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

Filtering nodes based on name and value

Subject: Filtering nodes based on name and value
From: Fabien Tillier <ftillier@xxxxxxxx>
Date: Mon, 2 Apr 2012 09:51:18 +0000
 Filtering nodes based on name and value
Hi List

I would like to be able to filter a node by its value, but this node itself is
unknown at the time of writing the xsl.

<xml>
	<row>
      	<N100>5</N100>
            <N101>2</N101>
	      <N102>3</N102>
	</row>
      <row>
      	<N100>4</N100>
           	<N101>5</N101>
	      <N102>6</N102>
      </row>
	<row>
		<N100>7</N100>
		<N101>8</N101>
		<N102>5</N102>
      </row>
</xml>

I would like to be able to select row nodes based on "name of the node is
N101" (for example) and value is 5, but the name N101 is given as a parameter
to a template.
Thus  it should be something like <xsl:value-of select="row[$param = 5]"/>,
which doesn't work, though <xsl:value-of select="row[N101 = 5]"/> does.
($param being equal to 'N101').

And I would like to have
<row>
      <N100>4</N100>
      <N101>5</N101>
      <N102>6</N102>
</row>               
(not using value-of of course, only for the sake of the example ;)
Any help would be much appreciated.

Best regards,
Fabien

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.