|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xpath dynamic selection
Hello,
When I look at all the examples every selection like
select="child::item[@value>3]" has a constant value to test against ("3" in
this case).
Can't this be done with a variable? eg:
select="child::item[@value>$basevalue]"
Because I'm trying to create a structure like this...
usecase
->item(s) (kind of ordered list)
->alt (with @number parameter)
->alternativecourse
->alternative (with @number parameter)
->item(s)
the "alternative"s should get the itemnumber from the matching "alt"s.
It try to do this by calling the alts in item with:
<xsl:apply-templates match="alt">
<xsl:with-param name="step" select="$step"/>
</xsl:apply-templates>
with the $step number of the item
and in alternative:
<xsl:param name="start">
<xsl:value-of select="ancestor::*/*/alt[@number=$anumber]"/>
</xsl:param>
with $anumber the number of the alternative.
But it returns nothing. If I remove the "[@number=$anumber]" part it always
returns 1, so I guess it returns the first match.
I also don't understand how I can get the @step value from the alt.
adding /attribute::step after the */*/alt doesn't seem to work.
If there are better ways to do this, please let me know, want I don't realy
understand the reasoning after the xsl structure.
Thanks,
Wim Lemkens
|
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








