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

I would like to know how I can do this

Subject: I would like to know how I can do this
From: ycao5@xxxxxxxxxxxxxxx
Date: Thu, 24 Feb 2011 14:47:31 -0500
 I would like to know how I can do this

My xslt stylesheet is going to convert a CSV file into XML format. The
format of the CSV
file is the following:


The output xml file will be the format of the following:

<Toronto> temperature1 </Toronto>
<London> temperature2 </London>

I am trying to use a static array to hold the city name: Toronto and
London. Would you
like to give me some suggestions on how I can do this by modifying the
following xslt

<xsl:variable name="lines" as="xs:string*" select="tokenize($input-text, '\r?\n')"/>

<xsl:variable name="parsed-lines">
<xsl:for-each select="$lines">
<xsl:variable name="tokenizedSample" select="tokenize(., ',')"/>
<xsl:if test="count($tokenizedSample) >= 1">
<xsl:value-of select="$tokenizedSample[1]"/>

<xsl:template name="main">
<xsl:element name="file_header">
<xsl:copy-of select="$parsed-lines" />

thanks for any assistance,


Current Thread


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.
First Name
Last Name
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.