You have an older version of the DOM classes in your classpath or your
lib/ext directory. Check for .jar files that hold other parsers and
remove them.
Gary
Andy Thompson wrote:
>
> Hello Team-
>
> I am new to Xalan, but keen to help if I can (e.g. testing etc). I have been
> trying to get the code below to work (it is called from a JSP and is a
> simple stream transformation)
>
> But I get an exception:
>
> Un-expected Transform Error rendering XML: CAUSE:
> javax.xml.transform.TransformerConfigurationException: Namespace not
> supported by SAXParser
>
> Sounds like I have done something stupid (like not configured something
> correctly..) but I have not been able to see what the cause is from the
> docs. Anyone got any ideas? Many thanks..
>
> Regards, Andy.
>
> ============== Code fragment below ==================
>
> public String RenderXML(String XML, String XSL) {
>
> String html;
>
>
> try {
> TransformerFactory tFactory = TransformerFactory.newInstance();
>
> // Get the XML input document and the stylesheet.
> Source xmlSource = new StreamSource(new StringReader(XML));
> Source xslSource = new StreamSource(new URL( XSL ).openStream());
>
> CharArrayWriter out = new CharArrayWriter();
>
> //Generate the transformer.
> Transformer transformer = tFactory.newTransformer(xslSource);
> transformer.transform(xmlSource, new StreamResult(out));
>
> html = out.toString();
>
> }
> catch (TransformerException Ex) {
> html = "Un-expected Transform Error rendering XML: " + "CAUSE: " +
> Ex.getCause() + " LOCATION: " + Ex.getLocator() + " XML=" + XML;
> }
> catch (Exception Ex) {
> html = "Un-expected Error rendering XML: " + Ex.getMessage() + "
> XML=" + XML;
> }
>
>
> return html;
> }