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

xpath dynamic selection

Subject: xpath dynamic selection
From: Wim Lemkens <wim.lemkens@xxxxxxxxxx>
Date: Sun, 11 Jul 2004 00:36:29 +0200
xpath dynamic
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

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.