Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] help

From: "Thomas B. Passin" <tpassin@------------>
To:
Date: 5/1/2002 12:28:00 PM
[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>

But if you only are interested in those services, you could include them in
the specification of the selected nodes:

select='dynamictree/category/service[@id="01"]'

If so, you could omit the xsl:if test for an "01" value.

If, on the other hand, you actually meant that you want to simply extract
the id and name of each service regardless of its id, you could use
something like this:

id: <xsl:value-of select='@id'/>, name:<xsl:value-of select='@name'/>

It all depends on what you really want to accomplish.

Cheers,

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
>


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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent