This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
how to extract chid node?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] how to extract chid node?
- From: "Sunil Dua" <sdua at solutionsny dot com>
- Date: Tue, 21 Aug 2001 14:36:48 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
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