DOCTYPE and DOMResult 2003-03-02 - By Robert Leftwich
I am having a problem getting a DOCTYPE specified using <xsl:output doctype-system="file.dtd"/> actually into a DOMResult. If I use a StreamResult (to System.out) the DOCTYPE is there but if I use a DOMResult and then check with getDocType() it is not. The code is as follows:
TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource("file.xsl")); DOMResult domResult = new DOMResult(); transformer.transform(new StreamSource("file.xml"), domResult);
DocumentType docType = ((Document)domResult.getNode()).getDoctype(); if (null == docType) { System.out.println("NO DOCTYPE"); }
What am I missing?
Robert
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|