This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: how to extract chid node?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] how to extract chid node?
- From: Xiaocun Xu <xiaocunxu at yahoo dot com>
- Date: Tue, 21 Aug 2001 15:55:28 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi, Sunil:
If you just need to extract langstring element,
instead of <xsl:value-of select="."/>, just replace it
with <xsl:value-of select="langstring"/>.
Hope this helps,
Xiaocun
--- Sunil Dua <sdua@solutionsny.com> wrote:
> Hello there,
>
>
> I have a xml code like the following which is well
> formatted and valid..
>
> <cc:classification
>
xmlns:cc="http://www.cecity.com/xml/cecity_classification">
> <cc:keywords>
> <cc:keyword>
> <type>profession</type>
> <ID>1071</ID>
> <langstring lang="en_US">Physician</langstring>
> </cc:keyword>
> <cc:keyword>
> <type>topic</type>
> <ID>2247</ID>
> <langstring
> lang="en_US">Psychiatry</langstring>
> </cc:keyword>
> <cc:keyword>
> <type>product_category</type>
> <ID>1118</ID>
> <langstring
> lang="en_US">ANXIOLYTICS</langstring>
> </cc:keyword>
> <cc:keyword>
> <type>disease</type>
> <ID>620</ID>
> <langstring
> lang="en_US">DEPRESSION</langstring>
> </cc:keyword>
> </cc:keywords>
> </cc:classification>
>
> I have to extract a child node langstring, which is
> under cc:keyword.. my
> xslt code extract me entire block under cc:keyword
> but not the only
> langstring. XSLT code, I am using is as follows:
>
> <xsl:template match="cc:keywords">
> <TD>
> <xsl:for-each
> select="./cc:keyword[type='topic']">
> <xsl:value-of select="."/>
> <xsl:text>, </xsl:text>
> </xsl:for-each>
> </TD>
> </xsl:template>
>
> Could anybody help me?
>
> thanks a lot
> Sunil Dua
>
>
>
> XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
>
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list