Search code examples
xmlxsltsaxonxincludexerces2-j

xslt document function doesn't resolve the xinclude tags in the referenced xml file


I'm looking for a solution to resolve xincludes at documents referenced by the document() function (XSLT).

On my evalutation I tried the xsltproc (doesn't work) and now I stuck on the saxon 6.5.5 in combination with the apache xerces 2.11.0.

This is my current commandline.

java.exe  -cp lib\xercesImpl-2.7.1.jar;\lib\saxon.jar 
 -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl  
 -Djavax.xml.parsers.SAXParserFactory= org.apache.xerces.jaxp.SAXParserFactoryImpl  
 -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration 
 com.icl.saxon.StyleSheet 
 -o OUTPUT.XML INPUT.XML COPY.XSLT  

Maybe I have to add some parameters or I have to use some additional libs. Thanks for your reply. BR

Markus


Solution

  • I just added a URI Resolver at the commandline.

    -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration 
     net.sf.saxon.Transform
     -x:org.apache.xml.resolver.tools.ResolvingXMLReader
     -y:org.apache.xml.resolver.tools.ResolvingXMLReader
     -r:org.apache.xml.resolver.tools.CatalogResolver   
    

    I want to thank Mickael Kay and Dave Pawson for the help.