You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Katrin Yngve <ka...@inventa.se> on 2000/11/06 14:58:41 UTC

Turn off validation of stylesheets with Xalan/Xerces

I'm currently using Xalan 1.2 and Xerces to perform XSLT transformations and
have run into a small problem. I need to use the id() function in XSL, so I
need to set validation to true in the XercesLiaison. When I do this it
attempts to validate the XSL stylesheet as well, which is stupid since it
lowers performance and generates a lot of errors because the stylesheet
isn't valid.

Is there some way to set the validation to true for the XML source document
only? I have seen similar questions before in this list but not any
satisfying answers. Has anyone got a good workaround? I really don't want to
validate the stylesheet because of performance reasons, but I do want to use
the id() function.

Some source code:
...
xmlFile = new FileInputStream(args[0]);
xslFile = new FileInputStream(args[1]);
...
processor = XSLTProcessorFactory.getProcessor(new XercesLiaison());
...
processor.getXMLProcessorLiaison().setUseValidation(true);
processor.process(new XSLTInputSource(xmlFile), new
XSLTInputSource(xslFile), target);

Thanks in advance..
/Katrin