|
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 |
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| test conditions (xsl:when) involvi, Smith BC (Brian) at | Thread | Problem in displaying & in XML node, Hari Yerram |
| Re: Leventhal's response..., Tony Graham | Date | RE: Problem in displaying & in XML , Kay Michael |
| Month |