Subject: Re: [xsl] Get a comma delimited string of nodenames. From: Jarkko.Moilanen@xxxxxx Date: Thu, 3 Apr 2003 08:02:34 +0300 |
Lainaus S K <shishirpradnya@xxxxxxxxxxx>: | Hi I have an xml like this: | | <?xml version="1.0" ?> | <root> | <data_field1>value1</data_field1> | <data_field2>value1</data_field2> | <data_field3>value1</data_field3> | <data_field4>value1</data_field4> | </root> | | I am trying to get back a string in the form: | | "data_field1,data_field2,data_field3,data_field4" | | Any help will be appreciated... | | -Shishir | | | _________________________________________________________________ | Protect your PC - get McAfee.com VirusScan Online | http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 | | | XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list | | <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output method = "text" /> <xsl:template match = "root" > <xsl:for-each select="*"> <xsl:value-of select = "local-name()" /> <xsl:if test = "not(position()=last())" > <xsl:text >, </xsl:text> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet> will output: data_field1, data_field2, data_field3, data_field4 Modify it to confront your exact needs. Cheers, Jarkko *************************************************** * Jarkko Moilanen * * Project Researcher, ITCM (www.itcm.org) * * Profound XML technology Expert * * University of Tampere * * Hypermedia Laboratory * *************************************************** XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Get a comma delimited string , S K | Thread | RE: [xsl] Get a comma delimited str, Allan Jones |
[xsl] Get a comma delimited string , S K | Date | Re: [xsl] many to one OR one to man, Fabien Triolet |
Month |