|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Variables in XPath expressions
Hi.
I just want to be sure of something.
I want to select an element wrt its position: el1/*[position()=3], but
the position is extracted from the source document.
So what I thought I would do was put the value of the wanted position in
a xsl:variable
<xsl:variable name="i">
<xsl:value-of select="el1/aPosition"/>
</xsl:variable>
and then use the value of this variable later in my xpath selector, like
this:
<xsl:value-of select="el1/*[position()={$i}]"/>
But the engine tells me that $ is not allowed. (I'm using XP+XT)
I've figured out another way of doing what I want just using number(),
but I'd like to be sure that variables aren't allowed in an XPath
expression (I think I read somewhere that variables could be used in
xpath expressions in some cases, depending on the xsl instruction used)
Thanks.
Emmanuel.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








