Transform:result-document error
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 4
- Joined: Thu Jan 19, 2017 1:20 am
Transform:result-document error
When I run a transform scenario, I always get this error:
C:\Users\tjeffery01\Desktop\iot-ssp-um_clone\build1.xml:43: javax.xml.transform.TransformerException: java.lang.RuntimeException: Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:result-document'
The odd thing is that my colleague's machine does NOT get this error, using the same scripts, same data. The Oxygen versions are the same (XML Developer, v17.1 build 2016032212) and the same Preferences are set (as far as I can tell). The Libraries, Frameworks, and System Properties seem to be the same, but I could only eyeball.
Background: The scripts were built by a colleague no longer with the company. They were being used by another colleague who just left. I am the novice who inherited her job.
I can keep using her machine, but it is inconvenient. Any ideas what would cause this error on one system but not another?
C:\Users\tjeffery01\Desktop\iot-ssp-um_clone\build1.xml:43: javax.xml.transform.TransformerException: java.lang.RuntimeException: Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:result-document'
The odd thing is that my colleague's machine does NOT get this error, using the same scripts, same data. The Oxygen versions are the same (XML Developer, v17.1 build 2016032212) and the same Preferences are set (as far as I can tell). The Libraries, Frameworks, and System Properties seem to be the same, but I could only eyeball.
Background: The scripts were built by a colleague no longer with the company. They were being used by another colleague who just left. I am the novice who inherited her job.
I can keep using her machine, but it is inconvenient. Any ideas what would cause this error on one system but not another?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Transform:result-document error
Hi,
This means that an XSLT 1.0 processor is being used to transform an XSLT 2.0 stylesheet. You need an XSLT 2.0 processor like Saxon 9. Usually it's enough for the processor .jar library to be in the classpath for this to work.
Check the Libraries from the transformation scenario configuration. One of saxon9ee.jar or saxon9he.jar is required.
Also check how the transformation is run in the ANT script. Is there a java command and a classpath involved?
Regards,
Adrian
Code: Select all
C:\Users\tjeffery01\Desktop\iot-ssp-um_clone\build1.xml:43: javax.xml.transform.TransformerException: java.lang.RuntimeException: Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:result-document'
Most likely there's a hard-coded path somewhere either in the scenario configuration or ANT build script that matches the location of some libraries on one system, but not on another.Any ideas what would cause this error on one system but not another?
Check the Libraries from the transformation scenario configuration. One of saxon9ee.jar or saxon9he.jar is required.
Also check how the transformation is run in the ANT script. Is there a java command and a classpath involved?
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
-
- Posts: 4
- Joined: Thu Jan 19, 2017 1:20 am
Re: Transform:result-document error
Thanks! I think you are correct. On closer inspection, I see that the next line of the error msg is:
So the system is using Xalan instead of Saxon? Searching my code, I can only find refs to Saxon. They look like this:
or
The saxon9ee.jar does exist, and is good as far as I know.
Is Xalan a fallback when Saxon isn't working? Could that what is causing this?
Code: Select all
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
Code: Select all
<scenario>
...
<field name="xslTransformer">
<String>Saxon-PE</String>
</field>
...
</scenario>
Code: Select all
<antScenario>
...
<field name="extensionURLs">
<String-array>
<String>file:/C:/Program%20Files/Oxygen%20XML%20Editor%2017/lib/saxon9ee.jar</String>
</String-array>
</field>
</antScenario>
Is Xalan a fallback when Saxon isn't working? Could that what is causing this?
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Transform:result-document error
Hi,
This may depend on how you are running the XSLT transformation from the ANT build file.
Could you give us a code snippet from the place in the build file where the XSLT transformation is started?
Regards,
Radu
This may depend on how you are running the XSLT transformation from the ANT build file.
Could you give us a code snippet from the place in the build file where the XSLT transformation is started?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Thu Jan 19, 2017 1:20 am
Re: Transform:result-document error
Thanks for the help given to a rank beginner! I'll try and extract the useful snippets.
The project file has this project tree:
We right-click build1.xml and Apply Transformation Scenario(s). In the project file, there is an ANT Scenario entry for build1.xml like this:
build1.xml itself sets up and clears some directories, successfully. The error occurs in this section of the build file, when it loads doxygen2dita_v2.11-innerclasslist.xsl:
The offending area of doxygen2dita_v2.11-innerclasslist.xls seems to be:
Hope this helps. If there is any other area that I should look at, any element or attribute, please let me know. Thanks.
The project file has this project tree:
Code: Select all
<projectTree name="doxygen2dita.xpr">
<file name="build1.xml"/>
<file name="ssp-doc-data.xml"/>
</projectTree>
Code: Select all
<antScenario>
<field name="additionalAntArgs">
<String></String>
</field>
<field name="buildTarget">
<String></String>
</field>
<field name="buildFilePath">
<String>${pd}/build1.xml</String>
</field>
<field name="ditaParams">
<list/>
</field>
<field name="jvmArgs">
<String>-Xmx256m</String>
</field>
<field name="useCustomJavaHome">
<Boolean>false</Boolean>
</field>
<field name="customJavaHomeDir">
<String></String>
</field>
<field name="useCustomANTHome">
<Boolean>false</Boolean>
</field>
<field name="customANTHomeDir">
<String></String>
</field>
<field name="workingDir">
<String>${pd}</String>
</field>
<field name="showConsoleAlways">
<Boolean>true</Boolean>
</field>
<field name="advancedOptionsMap">
<null/>
</field>
<field name="name">
<String>build1</String>
</field>
<field name="baseURL">
<null/>
</field>
<field name="footerURL">
<null/>
</field>
<field name="fOPMethod">
<null/>
</field>
<field name="fOProcessorName">
<null/>
</field>
<field name="headerURL">
<null/>
</field>
<field name="inputXSLURL">
<null/>
</field>
<field name="inputXMLURL">
<null/>
</field>
<field name="defaultScenario">
<Boolean>false</Boolean>
</field>
<field name="isFOPPerforming">
<Boolean>false</Boolean>
</field>
<field name="type">
<String>ANT</String>
</field>
<field name="saveAs">
<Boolean>true</Boolean>
</field>
<field name="openInBrowser">
<Boolean>true</Boolean>
</field>
<field name="outputFile">
<null/>
</field>
<field name="outputResource">
<null/>
</field>
<field name="openOtherLocationInBrowser">
<Boolean>true</Boolean>
</field>
<field name="locationToOpenInBrowserURL">
<String></String>
</field>
<field name="openInEditor">
<Boolean>false</Boolean>
</field>
<field name="showInHTMLPane">
<Boolean>false</Boolean>
</field>
<field name="showInXMLPane">
<Boolean>false</Boolean>
</field>
<field name="showInSVGPane">
<Boolean>false</Boolean>
</field>
<field name="showInResultSetPane">
<Boolean>false</Boolean>
</field>
<field name="useXSLTInput">
<Boolean>false</Boolean>
</field>
<field name="xsltParams">
<list/>
</field>
<field name="cascadingStylesheets">
<String-array/>
</field>
<field name="xslTransformer">
<String>ANT</String>
</field>
<field name="extensionURLs">
<String-array>
<String>file:/C:/Program%20Files/Oxygen%20XML%20Editor%2017/lib/saxon9ee.jar</String>
</String-array>
</field>
</antScenario>
Code: Select all
<target name="generate-innerclass-list"
description="Create the innerclasslist from index.xml."
depends="create-temp-dir-out">
<xslt
style="doxygen2dita_v2.11-innerclasslist.xsl"
in="${src.dir}/index.xml"
out="${out.dir}/out.txt"
>
</xslt>
</target>
Code: Select all
<xsl:template match="doxygenindex">
<xsl:result-document href="innerclass-list.xml">
<xsl:element name="list">
<xsl:for-each select="./compound[@kind='group' and contains(@refid, 'a_p_i') ]">
<!--<xsl:value-of select="$newline"></xsl:value-of>-->
<xsl:variable name="filename" select="concat($doxygendir, @refid, '.xml')"></xsl:variable>
<xsl:variable name="groupname" select="document($filename)/doxygen/compounddef/@id"></xsl:variable>
<xsl:variable name="innerclass-list">
<xsl:for-each select="document($filename)/doxygen/compounddef/innerclass">
<xsl:element name="item">
<xsl:element name="struct">
<xsl:value-of select="@refid"></xsl:value-of>
</xsl:element>
<xsl:element name="group">
<xsl:value-of select="$groupname"></xsl:value-of>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:variable>
<xsl:copy-of select="$innerclass-list"></xsl:copy-of>
</xsl:for-each>
</xsl:element>
</xsl:result-document>
</xsl:template>
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Transform:result-document error
Hi,
Thanks for the details.
From what the build file looks like, the xslt task should use the first Saxon library found in the scenario's classpath.
Could you edit the transformation scenario you are using, click the Libraries button, remove the reference to the saxon9ee.jar and add it again using the Add button?
If it still does not work, maybe you could zip your project, send it to support@oxygenxml.com and we can take a look at it.
Regards,
Radu
Thanks for the details.
From what the build file looks like, the xslt task should use the first Saxon library found in the scenario's classpath.
Could you edit the transformation scenario you are using, click the Libraries button, remove the reference to the saxon9ee.jar and add it again using the Add button?
If it still does not work, maybe you could zip your project, send it to support@oxygenxml.com and we can take a look at it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Transform:result-document error
Hi,
There is no compiled version of the XPR, we use it as it is, if you have a copy of the older XPR you can compare the versions using our Tools menu->Compare Files.
In my opinion initially the reference to the Saxon 9 JAR was somehow incorrect.
Regards,
Radu
There is no compiled version of the XPR, we use it as it is, if you have a copy of the older XPR you can compare the versions using our Tools menu->Compare Files.
In my opinion initially the reference to the Saxon 9 JAR was somehow incorrect.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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