Re: [xsl] SAX ParseException error: expected )

Subject: Re: [xsl] SAX ParseException error: expected )
From: Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Sep 2011 16:45:31 -0400
In the first <xsl:when>, you need a slash (/) between "." and
"DisplayPrice".  Because those two items together without a slash
between are not a valid XPath "sub-expression", which is what the
parser would expect to find between the parenthesis of a function
call, the parser assumes that the sub-expression must end after the
".", so it "expects" the closing ")".

-Brandon :)


On Thu, Sep 29, 2011 at 4:28 PM, aellath <aellath@xxxxxxxxxxxxx> wrote:
> i'm trying to get the product page to show certain text if the product
selected is on sale, based on code found in IAModules' knowledgebase, but i
keep getting
>
> <blockquote>
> XSL Transform Error:
> java.lang.Exception: org.xml.sax.SAXParseException: expected )
> Message:org.xml.sax.SAXParseException: expected )
> </blockquote>
>
> i've checked and rechecked, i had others check and recheck, and no-one can
find where the ) is missing. i know it's in the following block of code,
because when i remove the one block, the page works (as original, though, not
as what i want).
>
> <code>
> <xsl:choose>
>   <xsl:when test="(number(.DisplayPrice) &lt; number(./Price4))">
>      <p style="color:red; font-style:bold">On sale now! Regularly
$<xsl:value-of select="./Price5" /></p>
>      found sale<br /> <!-- just to reinforce, whilst testing -->
>   </xsl:when>
>   <xsl:otherwise>
>      not on sale <br /> <!-- again, just for my reference whilst testing
-->
>   </xsl:otherwise>
> </xsl:choose>
> </code>

Current Thread