Altova Mailing List Archives


Re: [xsl] SAX ParseException error: expected )

From: Michael Kay <mike@--------.--->
To: xsl-list@-----.------------.---
Date: 9/29/2011 8:48:00 PM
An XML name cannot begin with ".". So after

number(.

the only things that can legally come next are either ")", or an 
operator such as "+", "div", or "/".

It's not a good message. Sometimes when you get a poor error message, 
it's worth trying another XSLT processor to see if it gives you a better 
one. Saxon on this one gives you:

Error at xsl:when on line 24 column 67 of test.xsl:
   XPST0003 XPath syntax error at char 9 on line 24 in 
{(number(.DisplayPrice)}:
     expected ")", found name "DisplayPrice"

The "expected ')'" when there are many other symbols that could occur is 
symptomatic of a top-down parser, which typically only reports what it 
was expecting as a 'last resort'. A bottom-up parser that builds a 
finite-state machine would know all the possible symbols that could 
validly occur in this context.

Michael Kay
Saxonica

On 29/09/2011 21:28, aellath wrote:
> Hello! i wish i could tell you versions, etc., but i am modifying code  for a webstore my boss is opening, and everything goes through IAModules. i'm not even allowed to see the .jsp files they're using, much less tinker with *them*. all store inventory data is xml, and the jsps wrap html around various xsl files, pulling data from the xml files.
>
> 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>
>
> There's only one line with ( ) in it, and there are three complete pair there.
>
> Can anyone see where i'm missing a )? or would know why *else* that error would get thrown?
>
> i'd ask IAModules, but i'm afraid they'd see it as a chance to charge us for design-time.>P
>
> Thank you!
> aellath
> 		
>
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail:<mailto:xsl-list-unsubscribe@l...>
> --~--
>
>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.