[oXygen-user] Failure to identify missing xsl:choose element
Betty Harvey
harvey at eccnet.com
Tue Apr 17 14:21:53 CDT 2012
John:
The parser is giving you the correct error. An <xsl:when> must be inside
an <xsl:choose>. If you only have one choice then you will want to use
<xsl:if>.
You can use <xsl:choose> with the following structure:
<xsl:choose>
<xsl:when test="...">...</xsl:when>
<xsl:otherwise/>
</xsl:choose>
Good luck!
Betty
> Hi,
>
> I have the following xslt
>
> <Secondary>
> <Body DocumentURI="" IdURI="" NumberOfProvisions=""
> RestrictStartDate="">
> <xsl:for-each
> select="html:html/html:body/html:div/html:div[@class='page
> css-gen1']">
> <SectionPage>
> <xsl:value-of select="@id"/>
> </SectionPage>
> <Sectionheader>
> <xsl:value-of
> select="html:div[1]/html:div/html:span/html:span"/>
> </Sectionheader>
> <xsl:when
> test="html:div[2]/html:div/html:span[@class='css-gen3']
> and
> html:div[2]/html:div[2]/html:span[@class='css-gen5']">
> <xsl:call-template name="createStandardHead"/>
> </xsl:when>
> </xsl:for-each>
>
> Which seems to be fine when running it through the debugger, however when
> I attempt to run a transformation scenario with the xslt I get the
> following error:
>
> System ID: /media/PENDRIVE/xmlcalabash/xslt/transform_sections.xsl
> Scenario: STS_Transform
> XML file: /media/PENDRIVE/xmlcalabash/input/0.1.xhtml
> XSL file: /media/PENDRIVE/xmlcalabash/xslt/transform_sections.xsl
> Engine name: Saxon6.5.5
> Severity: error
> Description: xsl:when must be immediately within xsl:choose
> Start location: 129:0
>
> Is it known that the debugger fails to pick this up?
>
> Thanks
>
> Lewis
>
> lewis.mcgibbney at gcu.ac.uk
>
> Glasgow Caledonian University is a registered Scottish charity, number
> SC021474
>
> Winner: Times Higher Educationâs Widening Participation Initiative of
> the Year 2009 and Herald Societyâs Education Initiative of the Year
> 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
>
> Winner: Times Higher Educationâs Outstanding Support for Early Career
> Researchers of the Year 2010, GCU as a lead with Universities Scotland
> partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey at eccnet.com | Washington,DC XML Users Grp
URL: http://www.eccnet.com | http://www.eccnet.com/xmlug
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
Member of XML Guild (www.xmlguild.org)
More information about the oXygen-user
mailing list