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

Re: <xsl:for-each> help

Subject: Re: <xsl:for-each> help
From: "Zoe Peng" <zoe@xxxxxxxxxxxx>
Date: Wed, 1 May 2002 17:17:32 -0400
Re:  <xsl:for-each> help
Hi Tom, 
many thanks. 
I won't be able to use <xsl:if test...> cuz the xml document is 
generate on the fly and the key is coming from parameter. But, I got 
what I need. It outputs "My News". 

This is what I want: 
<xsl:for-each select='dynamictree/category[@id="1"]'>
<xsl:for-each select='service[@id="01"]'>
  servicename: <xsl:value-of select="@name" />
</xsl:for-each>
</xsl:for-each>
--Zoe

> [Zoe]
> 
> > I want to display the specific service id="01"'s name.
> > how can I approach this? The result will be 'My News'.
> > does it have any condition that I can use? Thanks.
> >
> > <xsl:for-each select="dynamictree/category/service"....? >
> > <!-- serviceid =01, name="My News" -->
> > </xsl:for-each>
> >
> 
> If you literally mean what you ask, then you only want to see services
> having a id value of "01".  You can get them, using your selector in 
the
> xsl:for-each element, like this:
> 
> <xsl:if test='@id="01"><xsl:value-of  select='@name'/></xsl:if>
> 
> 
> Tom P
> 
> > XML file:
> > - <dynamictree version="1" statuscode="0" statusdesc="OK">
> > - <category id="1" name="Favorite">
> > - <service id="01" name="My News">
> >   <querykeyword id="7003" name="News USA" />
> >   <querykeyword id="7004" name="News Africa" />
> >   </service>
> > - <service id="02" name="My Stocks">
> >   <querykeyword id="7001" name="Stock Quotes" />
> >   </service>
> >   </category>
> >   </dynamictree>
>

 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.