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

RE: matching on multiple attributes contained in a nod

Subject: RE: matching on multiple attributes contained in a node-set
From: Jarno.Elovirta@xxxxxxxxx
Date: Fri, 28 Mar 2003 07:11:00 +0200
select distinct multiple attributes
Hi,

> The desired output would list all the students, but only 
> once.  That is, larry 
> is listed as being on the list, all others are not.
> 
> The variable $list can be variable in length.. that is, I may 
> add or remove 
> items from this list (in fact, in the real-deal, this is a 
> passed-in parameter 
> to the Transformer.)

<xsl:template match="dftml">
  <xsl:for-each select="student">
    <xsl:variable name="s" select="." />
    <xsl:for-each select="xalan:nodeset($list)/item[$s/grade/@value = @grade and $s/type/@value = @type]">
      <xsl:value-of select="$s/name/@value" />
      <xsl:text> is in the list.&#xA;</xsl:text>
    </xsl:for-each>
  </xsl:for-each>
</xsl:template>

You should consider switching from xalan:nodeset to exslt:node-set. Also, if the $list is passed as a parameter, you shouldn't need to use node-set extensions. Hope this helps,

Cheers,

Jarno - Linnunradan käsikirja liftareille: Osa 4

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.