[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Get a comma delimited string of nodenames.
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|