This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Peculiar variable assignment
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Peculiar variable assignment
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Wed, 24 May 2000 14:42:09 +0100
- Reply-To: xsl-list at mulberrytech dot com
> <xsl:variable name="bbString" select="BESTBEFORE" />
> <xsl:variable name="bbMonth"
> select="document('')//foo:month[@name =
> substring-before(substring-after($bbString, ' '), ' ')]/@num" />
>
> gives $bbMonth = "05" whereas:
>
> <xsl:variable name="bbMonth"
> select="document('')//foo:month[@name =
> substring-before(substring-after(BESTBEFORE, ' '), ' ')]/@num" />
>
> gives $bbMonth = "", as does:
In the second example BESTBEFORE is used in a predicate, so the system
expects it to be a child of the foo:month element you are examining. If you
don't want to use a variable you could write current()/BESTBEFORE
Mike K
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list