v7.0 - Only xsl:when and xsl:otherwise are allowed here
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 35
- Joined: Fri Jun 03, 2005 11:00 am
v7.0 - Only xsl:when and xsl:otherwise are allowed here
Oxygen 7.0 keeps claiming that there is a problem with the following XSL fragment:
<test>
<xsl:choose>
<xsl:when test="//DocumentType = 'CSCNOTE' ">CSC Note</xsl:when>
<xsl:when test="//DocumentType = 'CSCREQUEST' ">CSC Request</xsl:when>
<xsl:otherwise><xsl:value-of select="//DocumentType"/> </xsl:otherwise>
</xsl:choose>
</test>
Apparently:
"Only xsl:when and xsl:otherwise are allowed here"
I can fix the problem by removing all the indentations, but, as far as I know, an indented xsl:choose is correct. I have checked the DTD, and tried to add the xml:space attribute, but that didn't help.
Am I doing something wrong, or should the XSD/DTD used by Oxygen be amended?
<test>
<xsl:choose>
<xsl:when test="//DocumentType = 'CSCNOTE' ">CSC Note</xsl:when>
<xsl:when test="//DocumentType = 'CSCREQUEST' ">CSC Request</xsl:when>
<xsl:otherwise><xsl:value-of select="//DocumentType"/> </xsl:otherwise>
</xsl:choose>
</test>
Apparently:
"Only xsl:when and xsl:otherwise are allowed here"
I can fix the problem by removing all the indentations, but, as far as I know, an indented xsl:choose is correct. I have checked the DTD, and tried to add the xml:space attribute, but that didn't help.
Am I doing something wrong, or should the XSD/DTD used by Oxygen be amended?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
-
- Posts: 35
- Joined: Fri Jun 03, 2005 11:00 am
xml:space="preserve"
Radu,
I am no longer sure this is an error:
the validation error only occurs when I have xml:space="preserve" on the template (or the node)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<test xml:space="preserve">
<xsl:choose>
<xsl:when test="true()">True</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</test>
</xsl:template>
</xsl:transform>
I am not sure if this actually an error, as with xml:space="preserve", the indentations are indeed text nodes, wich appear within the xsl:choose, and therefore are indeed invalid content.
I am no longer sure this is an error:
the validation error only occurs when I have xml:space="preserve" on the template (or the node)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<test xml:space="preserve">
<xsl:choose>
<xsl:when test="true()">True</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</test>
</xsl:template>
</xsl:transform>
I am not sure if this actually an error, as with xml:space="preserve", the indentations are indeed text nodes, wich appear within the xsl:choose, and therefore are indeed invalid content.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Hi Franck,
Version 1.0 stylesheets are in Oxygen validated by default with Saxon 6.
As far as we can see this processor considers that white spaces are prohibited in xsl:choose although it should silently ignore them because xsl:choose has element-only content. We will file a report to Michael Kay about the processor's problem.
In the meantime, you can try one of the following:
1) Choose Xalan as the stylesheet validator from Options-> Preferences->XML->XSLT/FO/XQuery->Engine used for XSLT validation and also choose Xalan as the transformer for your stylesheet's related scenarios.
2) Change the stylesheet's version to 2.0. This will automatically change the validator to Saxon 8 and also choose Saxon 8 as the transformer for your stylesheet's related scenarios.
Regards, Radu.
Version 1.0 stylesheets are in Oxygen validated by default with Saxon 6.
As far as we can see this processor considers that white spaces are prohibited in xsl:choose although it should silently ignore them because xsl:choose has element-only content. We will file a report to Michael Kay about the processor's problem.
In the meantime, you can try one of the following:
1) Choose Xalan as the stylesheet validator from Options-> Preferences->XML->XSLT/FO/XQuery->Engine used for XSLT validation and also choose Xalan as the transformer for your stylesheet's related scenarios.
2) Change the stylesheet's version to 2.0. This will automatically change the validator to Saxon 8 and also choose Saxon 8 as the transformer for your stylesheet's related scenarios.
Regards, Radu.
-
- Posts: 35
- Joined: Fri Jun 03, 2005 11:00 am
thanks
I'm a Xalan user, so I'll switch to Xalan (I thought I had already) for the validation.
One of the beauty (among many) of oxygen is that it allows me to run the exact same processing than my own application, without the burden of going through an entire request/Response round trip.
This has saved me so much time already that I probably owe you lot a round of beers.
Anyway, thanks for checking that for me.
Best regards
Franck
One of the beauty (among many) of oxygen is that it allows me to run the exact same processing than my own application, without the burden of going through an entire request/Response round trip.
This has saved me so much time already that I probably owe you lot a round of beers.
Anyway, thanks for checking that for me.
Best regards
Franck
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