[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Get a comma delimited string of nodenames.

Subject: Re: Get a comma delimited string of nodenames.
From: Jarkko.Moilanen@xxxxxx
Date: Thu, 3 Apr 2003 08:02:34 +0300
xsl comma delimited
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.