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

Re: Multi-part search XPath expressions.

Subject: Re: Multi-part search XPath expressions.
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Fri, 10 Sep 2004 21:04:57 -0400
xpath multiple expressions
On Sep 10, 2004, at 8:36 PM, David Adams wrote:

I want to do searches, such as

select species where the Extinct="True" and Genus_Name="Alectura"

The best I've been able to come up with is an expression like the one below:

/Australian_Birds/Species[Extinct!="True"]/self:: Species[Genus_Name="Alectura"]

You're going to be surprised how easy it is.


Say you do a template match on Species. Your select or test xpath statement is then "Extinct='True' and Genus_Name='Alectura'".

So, put it all together and you might have:

<xsl:template match="/">
  <h1>Birds</h1>
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="Species">
  <xsl:choose>
    <xsl:when test="Extinct='False' and Genus_Name='Casuarius'">
      <p>species name is <xsl:value-of select="Species_Name"/></p>
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
  </xsl:choose>
</xsl:template>

Bruce

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.