Subject: RE: [xsl] Converting CSV to XML without hardcoding schema details in xsl From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 21 Jun 2006 16:01:56 -0400 |
Cheers, Wendell
Can anybody suggest how to convert CSV data in the format
Field1,Field2 Value11,Value12
to xml like
<Field1>Value11</Field1> <Field2>Value12</Field2>
without hardcoding the fieldnames in the xsl?
I was thinking of something like
<xsl:for-each select="tokenize(., ',')"> <<xsl:value-of select="item-at($elementNames,index-of(?parent of current node?,.))"/>> <xsl:value-of select="."/> </<xsl:value-of select="item-at($elementNames,index-of(?parent of current node?,.))"/>> </xsl:for-each>
where elementNames is a tokenized list of the fieldnames - but I am unable to get it to work.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Converting CSV to XML wit, Pantvaidya, Vishwaji | Thread | RE: [xsl] Converting CSV to XML wit, Michael Kay |
RE: [xsl] Converting CSV to XML wit, Pantvaidya, Vishwaji | Date | [xsl] Counting and Rearranging Node, rostom aghanian |
Month |