This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

how to extract chid node?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]