Batch XSLT 2.0 transformations fail when using build file
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Fri Nov 08, 2013 9:57 am
Batch XSLT 2.0 transformations fail when using build file
Hi there,
I'm new to Oxygen and ANT build files and a friend of mine referred me to ANT build files to process batches of xml files with XSLT. When I run using only XSLT 1.0 functions, it is fine. When I add an XSLT 2.0 function (base-uri() - I need to grab the file name information for something), it then dies spectacularly when running it through the build file. When the XSL is run alone, it runs and generates what is wanted.
This is the message I receive when it fails to run:
Executing:
"c:\program files\oxygen xml developer 15\jre/bin/java" -Xmx256m -classpath "C:\Program Files\Oxygen XML Developer 15/tools/ant/lib/ant-launcher.jar" "-Dant.home=C:\Program Files\Oxygen XML Developer 15/tools/ant" org.apache.tools.ant.launch.Launcher -f "build.xml"
Buildfile: J:\AA_Test\SessionsCourts\test\build.xml
dist:
[xslt] Transforming into J:\AA_Test\SessionsCourts\test\output
[xslt] Processing J:\AA_Test\SessionsCourts\test\content\001FH004.xml to J:\AA_Test\SessionsCourts\test\output\001FH004.xml
[xslt] Loading stylesheet J:\AA_Test\SessionsCourts\test\sessions.xsl
[xslt] : Error! Error checking type of the expression 'funcall(base-uri, [])'.
[xslt] : Fatal Error! Could not compile stylesheet
[xslt] Failed to process null
BUILD FAILED
J:\AA_Test\SessionsCourts\test\build.xml:4: Fatal error during transformation
Total time: 21 seconds
The process finished with exit code: 1
This is the contents of my build file:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="dist" name="ANTProject">
<target name="dist">
<xslt basedir="content/" destdir="output/" extension=".xml" excludes=".dtd" style="sessions.xsl"/>
</target>
</project>
To double check that the build file worked with only XSLT 1.0 functions, I commented out all references to the XSLT 2.0 items and it worked with no problems! As soon as I added them back in, failure!
Any suggestions would be more than welcome.
I'm new to Oxygen and ANT build files and a friend of mine referred me to ANT build files to process batches of xml files with XSLT. When I run using only XSLT 1.0 functions, it is fine. When I add an XSLT 2.0 function (base-uri() - I need to grab the file name information for something), it then dies spectacularly when running it through the build file. When the XSL is run alone, it runs and generates what is wanted.
This is the message I receive when it fails to run:
Executing:
"c:\program files\oxygen xml developer 15\jre/bin/java" -Xmx256m -classpath "C:\Program Files\Oxygen XML Developer 15/tools/ant/lib/ant-launcher.jar" "-Dant.home=C:\Program Files\Oxygen XML Developer 15/tools/ant" org.apache.tools.ant.launch.Launcher -f "build.xml"
Buildfile: J:\AA_Test\SessionsCourts\test\build.xml
dist:
[xslt] Transforming into J:\AA_Test\SessionsCourts\test\output
[xslt] Processing J:\AA_Test\SessionsCourts\test\content\001FH004.xml to J:\AA_Test\SessionsCourts\test\output\001FH004.xml
[xslt] Loading stylesheet J:\AA_Test\SessionsCourts\test\sessions.xsl
[xslt] : Error! Error checking type of the expression 'funcall(base-uri, [])'.
[xslt] : Fatal Error! Could not compile stylesheet
[xslt] Failed to process null
BUILD FAILED
J:\AA_Test\SessionsCourts\test\build.xml:4: Fatal error during transformation
Total time: 21 seconds
The process finished with exit code: 1
This is the contents of my build file:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="dist" name="ANTProject">
<target name="dist">
<xslt basedir="content/" destdir="output/" extension=".xml" excludes=".dtd" style="sessions.xsl"/>
</target>
</project>
To double check that the build file worked with only XSLT 1.0 functions, I commented out all references to the XSLT 2.0 items and it worked with no problems! As soon as I added them back in, failure!
Any suggestions would be more than welcome.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Batch XSLT 2.0 transformations fail when using build fil
Hi,
You're using the default XSLT processor from the Java runtime which has some issues and does not support XSLT 2.0. Note the ANT documentation:
http://ant.apache.org/manual/Tasks/style.html
http://stackoverflow.com/questions/9196 ... 0-with-ant
Press the Libraries button from the the ANT transformation scenario configuration dialog in Oxygen and add the required XSLT processor libraries (e.g. Saxon 9).
Regards,
Adrian
You're using the default XSLT processor from the Java runtime which has some issues and does not support XSLT 2.0. Note the ANT documentation:
http://ant.apache.org/manual/Tasks/style.html
You can find various instructions on the web on how to run XSLT 2.0 with ANT.If you are using JDK 1.4 or higher, this task does not require external libraries not supplied in the Apache Ant distribution. However, often the built in XSL engine is not as up to date as a fresh download, so an update is still highly recommended in particular since the built-in XSLT processors of Java 5 (and to a certain extent Java 6) are known to have serious issues.
http://stackoverflow.com/questions/9196 ... 0-with-ant
Press the Libraries button from the the ANT transformation scenario configuration dialog in Oxygen and add the required XSLT processor libraries (e.g. Saxon 9).
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ 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
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service