XALAN-XERCES/ loading of external DTD

From: Michael Alers (michael.alers_at_web.de)
Date: 10/27/03


Date: Mon, 27 Oct 2003 14:08:23 GMT

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(xsltFileName);
 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