Transformation scenario: turn off XInclude expansion
Post here questions and problems related to oXygen frameworks/document types.
Transformation scenario: turn off XInclude expansion
Hi!
Is there a way to turn of the expansion of XIncludes for a single transformation scenario automatically?
There was a discussion, where it was suggested to turn of the expansion in Options > Preferences > XML > ...
other-issues/topic10319.html
But this turns on/off XInclude expansion for the parser everywhere. This is much too complicated for our users and might lead to data corruption, if not handled with care.
I'd like offer our users a scenario, where XIncludes aren't expanded, and they needn't care about switching on/off at all.
If it isn't possible to turn off the expansion in a normal XSLT transformation scenario (because it uses oXygen's core XML parser): Would it be possible with an ANT based scenario?
Kind regards,
Christian
Is there a way to turn of the expansion of XIncludes for a single transformation scenario automatically?
There was a discussion, where it was suggested to turn of the expansion in Options > Preferences > XML > ...
other-issues/topic10319.html
But this turns on/off XInclude expansion for the parser everywhere. This is much too complicated for our users and might lead to data corruption, if not handled with care.
I'd like offer our users a scenario, where XIncludes aren't expanded, and they needn't care about switching on/off at all.
If it isn't possible to turn off the expansion in a normal XSLT transformation scenario (because it uses oXygen's core XML parser): Would it be possible with an ANT based scenario?
Kind regards,
Christian
Re: Transformation scenario: turn off XInclude expansion
Hi Christian,
I'm afraid there is no such possibility with our XSLT based transformation scenarios.
With an ANT xslt task indeed you can control things better:
https://ant.apache.org/manual/Tasks/style.html
probably by forcing a non xi:Include aware parsing configuration:
but this may need to be tested.
We have a pre-configured "Ant (with Saxon-HE XSLT support)" transformation scenario which should be accessible when editing ANT build files.
Regards,
Radu
I'm afraid there is no such possibility with our XSLT based transformation scenarios.
With an ANT xslt task indeed you can control things better:
https://ant.apache.org/manual/Tasks/style.html
probably by forcing a non xi:Include aware parsing configuration:
Code: Select all
<xslt ...>
<sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration"
value="org.apache.xerces.parsers.XML11Configuration"/>
<xslt>
We have a pre-configured "Ant (with Saxon-HE XSLT support)" transformation scenario which should be accessible when editing ANT build files.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Transformation scenario: turn off XInclude expansion
Hi Radu!
That works great! If someone want's to do similar things, here's my ANT file:
Kind regards,
Christian
That works great! If someone want's to do similar things, here's my ANT file:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- ANT build script
USAGE (commandline):
ant -buildfile THISFILE \
-Dsaxon.jar=~/.m2/repository/net/sf/saxon/Saxon-HE/10.2/Saxon-HE-10.2.jar \
-DinputFile=SOURCE \
-DoutputFile=DEST \
-Dreading=lemma \
extract-reading
-->
<project basedir="." name="ALEA">
<!-- oxygenlib, defaults to ant lib -->
<property name="oxygenlib" value="..."/>
<!-- define the the saxon transformer or place it in the ant lib directory -->
<property name="saxon.jar" value="${oxygenlib}/saxon9he.jar"/>
<!-- Path to TEI XML file. -->
<property name="inputFile" value=""/>
<!-- Path where the output file will be saved. -->
<property name="outputFile" value=""/>
<!-- suffix of TEI documents -->
<property name="teiSuffix">.tei.xml</property>
<!-- author name -->
<property name="authorname" value="${user.name}"/>
<!-- directories -->
<dirname property="outputDir" file="${outputFile}"/>
<dirname property="inputDir" file="${inputFile}"/>
<!-- modfiy basedir, if necessary: -Dbasedir=... -->
<echo> basedir: ${basedir}</echo>
<echo> using Saxon: ${saxon.jar}</echo>
<!-- extract reading -->
<property name="reading" value="lemma"/>
<property name="recension" value=""/>
<target name="extract-reading">
<!-- Task for extracting a reading in order to start encoding an other recension based on it.
This is done from ANT in order to not expand XIncludes. -->
<xslt style="xsl/reading.xsl" in="${inputFile}" out="${outputFile}">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<classpath location="${saxon.jar}"/>
<sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration"
value="org.apache.xerces.parsers.XML11Configuration"/>
<param name="reading" expression="${reading}" type="STRING"/>
<param name="pdu" expression="${basedir}" type="STRING"/>
<param name="note-references" expression="true" type="BOOLEAN"/>
<param name="authorname" expression="${authorname}" type="STRING"/>
</xslt>
<echo>Extracted text stored in ${outputFile}</echo>
</target>
<!-- ... other tasks ... -->
</project>
Christian
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor
- ↳ Announcements
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML Services Market
- ↳ Offer a Service