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

Re: finding an element at the lowest level

Subject: Re: finding an element at the lowest level
From: Mukul Gandhi <mukulgandhi2003@xxxxxxxxxxx>
Date: Wed, 7 Jan 2004 14:28:23 +0000 (GMT)
xsl finding closing element
Hi James,
  Please try the XSL Template ..

<xsl:template match="$catfile/root">
  <xsl:for-each select="//category">
    <xsl:if test="name = 'new man'">
      <p>
	<xsl:value-of select="desc"/>
      </p>
    </xsl:if>
  </xsl:for-each>
</xsl:template>

Regards,
Mukul

 --- james walker <jameswalkerandy@xxxxxxxxxxx> wrote:
> I am trying to find the get the value of the
> description tag under a 
> category with a name tag equal to "new man", the xsl
> i have at the moment i 
> incorrect but lok slike this, i think i am on th
> eright tracks but just can 
> tquite get it? ($catfile is the xml file shown at
> the bottom)
> 
> <xsl:for-each
>
select="$catfile/root/category/category/category/category">
> 		<xsl:if
>
test="contains(category/name,$subpageheader)=true()">
> 		<p><xsl:value-of select="category/description"
> /></p>
> 		</xsl:if>
> </xsl:for-each>
> would it be better to reference this using xpat
> staments like finding 
> children at the lowest level of teh hierar hierarchy
> and searching through 
> them?
> 
> 
> given this xml called $catfile,
> <root>
> 	<category><name></name><desc></desc>
> 		<category><name></name><desc></desc>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 		</category>
> 		<category><name></name><desc></desc>
> 			<category><name></name><desc></desc></category>
> 			<category><name>new
> man</name><desc></desc></category>*
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 		</category>
> 	</category>
> 	<category><name></name><desc></desc>
> 		<category><name></name><desc></desc>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 		</category>
> 		<category><name></name><desc></desc>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 			<category><name></name><desc></desc></category>
> 		</category>
> 	</category>
> </root>
> 
>
_________________________________________________________________
> Express yourself with cool emoticons - download MSN
> Messenger today! 
> http://www.msn.co.uk/messenger
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
>  

________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

 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.