[oXygen-user] Failure to identify missing xsl:choose element

McGibbney, Lewis John Lewis.McGibbney at gcu.ac.uk
Wed Apr 18 04:21:20 CDT 2012


Hi Betty & Jesse,

Thanks for the suggestions, and yes I will be using <xsl:if> instead of <xsl:choose> as at this stage in the xslt I don't think I need more than one option.. maybe later on :0)
However I'll pass it on the George anyway as I think the debugger should have picked it up... we'll soon see.

Thanks again.
Lewis
________________________________________
From: Betty Harvey [harvey at eccnet.com]
Sent: 17 April 2012 20:21
To: McGibbney, Lewis John
Cc: oxygen-user at oxygenxml.com
Subject: Re: [oXygen-user] Failure to identify missing xsl:choose element

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)

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


More information about the oXygen-user mailing list