Bug 44831 - Add xInclude processing to XSLT task.
Summary: Add xInclude processing to XSLT task.
Status: RESOLVED DUPLICATE of bug 36653
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.0RC1
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-17 00:18 UTC by Dave Pawson
Modified: 2008-11-24 08:51 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Pawson 2008-04-17 00:18:49 UTC
Xinclude, http://www.w3.org/TR/xinclude/ is the modern way of partitioning an XML file.

Normally processed by the xml parser such that the expanded document is then
fed to the next stage of processing. Xerces parser includes such processing.

Please could this be added to the xslt task.
Saxon (http://saxon.sourceforge.net/) supports xinclude via command line options.
Many OS projects use docbook for their documentation. Docbook v5 now supports
xInclude.

-x and -y cmd line options relate to the parser. -r is for the catalog resolver, which
is another very useful feature for XSLT.


Java equivalent task is shown below.

TIA, DaveP


 <path id="xslt.processor.classpath">                                         
  <pathelement path="/myjava/saxon655.jar"/>  <!-- Saxon jar -->
  <pathelement path="/myjava/resolver.jar"/> <!-- resolver jar -->
  <pathelement path="${websiteHome}/extensions/saxon64.jar"/> 
  <pathelement path="/myjava/xercesImpl.jar"/>
  <pathelement path="/sgml"/> <!-- for catalogManager.properties -->

 <java classname="${xslt.processor.class}" 
	fork="yes" 
	dir="${in.dir}"
	failonerror="true">
    <classpath refid="xslt.processor.classpath" />
    <jvmarg line="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
    <jvmarg line="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    <jvmarg line="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>  
    <arg value="-l"/>
    <arg value="-o"/>
    <arg value="${out.dir}/${main.outfile}"/>
    <arg line="-x org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-y org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-r org.apache.xml.resolver.tools.CatalogResolver "/>
    <arg line="${in.dir}/${main.infile} ${main.stylesheet} ${param.args.post}" /> 
  </java>
Comment 1 Stefan Bodewig 2008-11-24 08:51:34 UTC
the -x to -r options would be very Saxon specific and should be dealt with in Saxon's own Ant task (I think there is one since Michael Kay talked about it on ant-dev).


*** This bug has been marked as a duplicate of bug 36653 ***