How to use Xalan in Oxygen 7.1?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 37
- Joined: Sun Feb 12, 2006 10:34 pm
How to use Xalan in Oxygen 7.1?
When I configure a transformation scenario to use Oxygen 7.1's Xalan I get a java.lang.NullPointerException. I hesitate to include here my XML and XSLT because it's pretty voluminous.
The transformation works as expect with Saxon 6.5.5. Here are the aspects of the transformation that might be significant:
(1) The XML uses a DTD to set default values of some attributes and validates against a W3C XML Schema schema.
(2) The XSLT uses an extension function, nodeset.
(3) The XSLT uses a DTD to define entities used in the templates.
Can anybody spot gross oversights on my part. It must be something fairly obvious, because the transformation fails almost immediately.
Thanks,
Richard
The transformation works as expect with Saxon 6.5.5. Here are the aspects of the transformation that might be significant:
(1) The XML uses a DTD to set default values of some attributes and validates against a W3C XML Schema schema.
(2) The XSLT uses an extension function, nodeset.
(3) The XSLT uses a DTD to define entities used in the templates.
Can anybody spot gross oversights on my part. It must be something fairly obvious, because the transformation fails almost immediately.
Thanks,
Richard
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Richard,
The problem is probably caused by the use of the node-set extension, if you use the Saxon node-set like below for instance:
You should use the EXSLT node-set extension instead as it is implemented also by Xalan:
Let us know if that was indeed the case.
Best Regards,
George
The problem is probably caused by the use of the node-set extension, if you use the Saxon node-set like below for instance:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:saxon="http://icl.com/saxon">
<xsl:template match="/*">
<xsl:variable name="test">
<xsl:copy-of select="."/>
</xsl:variable>
<xsl:variable name="copy" select="saxon:node-set($test)"/>
<xsl:copy-of select="$copy"/>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:exslt="http://exslt.org/common">
<xsl:template match="/*">
<xsl:variable name="test">
<xsl:copy-of select="."/>
</xsl:variable>
<xsl:variable name="copy" select="exslt:node-set($test)"/>
<xsl:copy-of select="$copy"/>
</xsl:template>
</xsl:stylesheet>
Best Regards,
George
-
- Posts: 37
- Joined: Sun Feb 12, 2006 10:34 pm
George,
Thanks for your as ever prompt reply. Regarding node-set I have the following in my XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wbr="http://www.ubs.com/namespaces/wbml-render" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:xalan="http://xml.apache.org/xalan" xmlns:libxslt="http://xmlsoft.org/XSLT/namespace" xmlns:com="http://exslt.org/common" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="wbr msxml xalan libxslt com svg xlink">
...
<xsl:variable name="_xsltengine">
<xsl:choose>
<xsl:when test="function-available('xalan:nodeset')">xalan</xsl:when>
<xsl:when test="function-available('libxslt:node-set')">libxslt</xsl:when>
<xsl:when test="function-available('com:node-set')">com</xsl:when>
<xsl:when test="function-available('msxml:node-set')">msxml</xsl:when>
<xsl:otherwise>
No node-set or nodeset extension function while setting t.
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Whenever I use node-set (or nodeset) I do that in a xsl:choose that tests $_xsltengine. I even tried moving the third xsl:when, which checks for the exslt library, to the first position in the xsl:choose, but the null pointer exception was still raised. In fact, by examing the value of $_xsltengine I see that Saxon 6.5.5, which is the default XSLT transformer, is using the exslt library.
Regards,
Richard
Thanks for your as ever prompt reply. Regarding node-set I have the following in my XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wbr="http://www.ubs.com/namespaces/wbml-render" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:xalan="http://xml.apache.org/xalan" xmlns:libxslt="http://xmlsoft.org/XSLT/namespace" xmlns:com="http://exslt.org/common" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="wbr msxml xalan libxslt com svg xlink">
...
<xsl:variable name="_xsltengine">
<xsl:choose>
<xsl:when test="function-available('xalan:nodeset')">xalan</xsl:when>
<xsl:when test="function-available('libxslt:node-set')">libxslt</xsl:when>
<xsl:when test="function-available('com:node-set')">com</xsl:when>
<xsl:when test="function-available('msxml:node-set')">msxml</xsl:when>
<xsl:otherwise>
No node-set or nodeset extension function while setting t.
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Whenever I use node-set (or nodeset) I do that in a xsl:choose that tests $_xsltengine. I even tried moving the third xsl:when, which checks for the exslt library, to the first position in the xsl:choose, but the null pointer exception was still raised. In fact, by examing the value of $_xsltengine I see that Saxon 6.5.5, which is the default XSLT transformer, is using the exslt library.
Regards,
Richard
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
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