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

Re: trouble forming xpath expression with compound con

Subject: Re: trouble forming xpath expression with compound conditions
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 04 Oct 2001 18:04:32 +0200
compound xpath statements
<xsl:value-of select="item[si/@id='3' and si='SI7']"/>

This statement will return the "sum" of all descendant text-nodes. But only from the first occurence of an <item> which fulfills your conditions.

More useful will be <xsl:apply-templates select=".."/>. With this the second condition 'select the <item> elements ...' will be fulfilled too.

Joerg

Steve Renshaw wrote:

With the xml given below, the context node it <items>.
I want to select the <item> elemesnt for which the attribute
@id='3' and <si> content is SI7 (this would be the second <item>
instance)? The desired
attribute value
would be stored in a variable $myid and the desired content
would be stored in a variable $mysi. Anyone know how to form
the xpath expression within <xsl-value-of select="xpath expression"/>?

<items>
  <item>
     <si id="1">SI1</si>
     <si id="2">SI2</si>
     <si id="3">SI3</si>
     <si id="4">SI4</si>
  </item>
  <item>
     <si id="1">SI5</si>
     <si id="2">SI6</si>
     <si id="3">SI7</si>
     <si id="4">SI8</si>
  </item>
<items>


--

System Development
VIRBUS AG
Fon +49(0)341-979-7435
Fax +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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.