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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to