Subject: [xsl] I would like to know how I can do this From: ycao5@xxxxxxxxxxxxxxx Date: Thu, 24 Feb 2011 14:47:31 -0500 |
My xslt stylesheet is going to convert a CSV file into XML format. The format of the CSV file is the following:
temperature1 temperature2
<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 stylesheet?
<xsl:variable name="lines" as="xs:string*" select="tokenize($input-text, '\r?\n')"/>
<xsl:variable name="parsed-lines"> <root> <xsl:for-each select="$lines"> <xsl:variable name="tokenizedSample" select="tokenize(., ',')"/> <xsl:if test="count($tokenizedSample) >= 1"> <temperature> <xsl:value-of select="$tokenizedSample[1]"/> </temperature> </xsl:if> </xsl:for-each> </root> </xsl:variable>
<xsl:template name="main"> <xsl:element name="file_header"> <xsl:copy-of select="$parsed-lines" /> </xsl:element> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Where (how) to use XML/XS, Brandon Ibach | Thread | Re: [xsl] I would like to know how , Brandon Ibach |
Re: [xsl] pulling object at their c, Brandon Ibach | Date | Re: [xsl] I would like to know how , Brandon Ibach |
Month |