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

RE: test conditions (xsl:when) involving constants using sa

Subject: RE: test conditions (xsl:when) involving constants using saxon
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 10 Jun 1999 12:38:30 +0100
xsl when test
SAXON 4.1 is a while ago and I'm having trouble remembering it (4.3, which
supports the latest XSLT syntax, is in the final stages of validation and
documentation).

But I think what's wrong is mainly the curly brackets: for
>    <xsl:when test="[{constant(partyid)} = '0']">
try
>    <xsl:when test=".[constant(partyid) = '0']">

Curly brackets are used only in an attribute value template, i.e. to
substitute an expression into a string, and not in an attribute where am
expression is expected. (This is also true of the current XSLT draft).

The leading "." is necessary because (if I remember version 4.1 correctly)
it's technically a match-pattern, testing whether the current node matches
some condition.

Mike


> -----Original Message-----
> From: Smith BC (Brian) at MSXSSC [mailto:BS185791@xxxxxxxxxxxxxxxx]
> Sent: 09 June 1999 18:55
> To: 'xsl-list@xxxxxxxxxxxxxxxx'
> Subject: test conditions (xsl:when) involving constants using saxon
> 
> 
> 
> I am using saxon 4.1 and I 
> am trying to use constants with 
> a test condtion as follows:
> 
> <xsl:choose>
>    <xsl:when test="[{constant(partyid)} = '0']">
> 	 .... do stuff....       
>    </xsl:when>
>    <xsl:otherwise>
>  	.... do other stuff....                 
>    </xsl:otherwise>
> </xsl:choose>
> 
> I get the following error: 
>     Failed while processing  input document: org.xml.sax.SAXException:
> Error in pattern [{constant{partyid)} = '0']:  Unexpected 
> token [ boeyond
> end of pattern.
> 
> 
> This is using the saxon notation of a constant.
> I am not sure that constant evaluations are supported
> inside of test conditions.  Has anyone else tried
> something like this?  Is there a work around that I
> am not seeing?  
> 
> I am using Saxon to as it enables me to define my
> own tags, which I am using until more parsers 
> support extension functions.  So switching parsers
> is not an option right now (I got XT extension functions
> working, but had to find and fix a bug first, so I am waiting
> for it to stablize).
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.