[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Modification to The CSV to XML transform XSLT v2 from Andrew Welch


Subject: Re: [xsl] Modification to The CSV to XML transform XSLT v2 from Andrew Welch
From: "Manfred Staudinger" <manfred.staudinger@xxxxxxxxx>
Date: Thu, 27 Mar 2008 11:12:32 +0100

On 27/03/2008, Marney Cotterill <marney@xxxxxxxxxxxxxxxxxxxx> wrote:
>  And the output XML I get from my test CSV using the above stylesheet is:
>
>  <?xml version="1.0" encoding="US-ASCII"?>
>  <root>
>     <row>
>         <elem name="classDay">Monday</elem>
>         <elem naem="classTime">11am</elem>
>     </row>
>     <row>
>         <elem name="classDay">Tuesday</elem>
>         <elem naem="classTime">12pm</elem>
>     </row>
>  </root>
>
>  So hence, what I would like is for the output to be:
>  ....
>     <row>
>         <classDay>Monday</classDay>
>         <classTime>11am</classTime>.......etc
>
>  Can we just modify this portion of the stylesheet:
>
>                 <elem name="{.}">
>                 <xsl:value-of select="$lineItems[$pos]" />
>                 </elem>
Yes, try
                 <xsl:element name="{.}">
                 <xsl:value-of select="$lineItems[$pos]" />
                 </xsl:element>

Manfred


Current Thread
Keywords
xml