[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: comparisons between strings have changed since XPa

Subject: RE: comparisons between strings have changed since XPath 1.0 warning
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Wed, 5 Oct 2005 09:32:18 +0300
xochitlan
Hi,

> I receive the below error message when I try to compile the
> below XML. I
> am using saxon7 and can trace my error to
>         <xsl:when test="$webs &gt; '3'">
> but I am not sure how to fix this. I found some info on the
> oasis list
> site, but nothing in the mulberry archives.
>
> Any help would be appreciated. Thanks in advance-troy
>
>
> ***********************Error********************************
>   Less-than and greater-than comparisons between strings have changed
> since XPath 1.0
>
>
> ***********************XSL********************************
>
> <xsl:if test="string-length(WebExtra) &gt; 1">
>         <xsl:variable name="webs">
>                 <xsl:number value="count(WebExtra)"/>
>         </xsl:variable>
>         <xsl:choose>
>                 <xsl:when test="$webs &gt; '3'">

Change the above to

  <xsl:variable name="webs" select="count(WebExtra)"/>
  <xsl:choose>
    <xsl:when test="$webs &gt; 3">

I.e. instead of trying to compare a document node to a string, compare a
number to a number. (In XPath 1.0 the variable was bound to a Result Tree
Fragment and for comparison it was first converted to a string and then to a
number.)
Cheers,

Jarno

--
Alek Szahala: Xochitlan

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.