xsl-list
[Top] [All Lists]

Re: [xsl] XSL for CSV to XML

2019-02-14 00:47:43
On Thu, 2019-02-14 at 05:54 +0000, Rahul Singh
rahulsinghindia15(_at_)gmail(_dot_)com wrote:
Hi,

I wrote XSL for CSV to XML conversion but i am not getting proper
output
for #Id 3. and Also I need output as per given expected output. 

You are using <elem> to make elements, rather than, for example,
<xsl:element name="$headings[$n]">...</xsl:element>
You'd have to arrange for $headings to be e.g.
   <xsl:variable name="headings" as="xs:string*"
      select="tokenize($headerrow, '[|]')" />
where $headerrow is the line containing the names.

Liam


-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Web slave for vintage clipart http://www.fromoldbooks.org/
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>