By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,557 Members | 1,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,557 IT Pros & Developers. It's quick & easy.

XALAN-XERCES/ loading of external DTD

P: n/a
Hi,

I have the problem switching off the "loading of external DTD" feature while
transforming xml/xslt with XALAN.
The used xml-parser is XERCES.
I know how to switch off this feature when only parsing XML (SAX-API)
(
saxParser.setFeature("http://apache.org/xml/features/nonvalidating/load-exte
rnal-dtd", false) )
and I would like to know how to switch off this when using XALAN/XERCES in
order to XSLT transform.

Here is my code snippet:
-----------
javax.xml.transform.Source xmlSource = new
javax.xml.transform.stream.StreamSource(new StringReader(xml));
javax.xml.transform.stream.StreamSource xsltSource = new
javax.xml.transform.stream.StreamSource(xsltFileNa me);
StringWriter resultText = new StringWriter();
javax.xml.transform.Result xmlResultStream = new
javax.xml.transform.stream.StreamResult(resultText );
javax.xml.transform.TransformerFactory transFact =
javax.xml.transform.TransformerFactory.newInstance ();
Transformer trans = transFact.newTransformer(xsltSource);
trans.transform(xmlSource, xmlResultStream);
-------------

Thanks for any hint.

Michael Alers


Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.