Subject: Re: [xsl] XSLT for CSV to XML Conversion From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sat, 16 Feb 2019 16:35:28 -0000 |
I wrote XSL code for CSV to XML conversion but i am not getting proper output as for #Id 3 in XML. and, Also I need output as per given expected output below.
Need yours help for given Input CSV, XSL Code, Current Output, Expected Output please:
*Input CSV:*
<root>ID|Value|Number|descr1|descr2|descr3|descr4 1|AAAAA|1|aaaaaaaaaaa|aaaaaaaaaaa|aaaaaaaaaaa|aaaaaaaaaaa 2|AAAAA|2|aaaaaaaaaaa|aaaaaaaaaa|aaaaaaaa|aaaaaaaaaaaa 3|AAAAA|3|aaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|aaaaaaaaaaa|aaaaaaaaaaa|aaaaaaaaaaa</root>
*Expected Output:*
<?xml version="1.0" encoding="UTF-8"?>
<root>
B B <row>
B B B <ID>1</ID>
B B B <Value>AAAAA</Value>
B B B <Number>1</Number>
B B B <descr1>aaaaaaaaaaa</descr1>
B B B <descr2>aaaaaaaaaaa</descr3>
B B B <descr3>aaaaaaaaaaa</descr3>
B B B <descr4>aaaaaaaaaaa</descr4>
B B </row>
B B <row>
B B B <ID>2</ID>
B B B <Value>AAAAA</Value>
B B B <Number>2</Number>
B B B <descr1>aaaaaaaaaaa</descr1>
B B B <descr2>aaaaaaaaaa</descr2>
B B B <descr3>aaaaaaaa</descr3>
B B B <descr4>aaaaaaaaaaaa</descr4>
B B </row>
B B <row>
B B B <Id>3</Id>
B B B <Value>AAAAA</Value>
B B B <Number>3</Number>
<descr1>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</descr1>
B B B <descr2>aaaaaaaaaaa</descr2>
B B B <descr3>aaaaaaaaaaa</descr3>
B B B <descr4>aaaaaaaaaaa</descr4>
B B </row>
</root>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" version="3.0">
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT for CSV to XML Conve, Mukul Gandhi gandhi. | Thread | [xsl] A use-case for xsl:merge?, John Dziurlaj john@x |
Re: [xsl] XSLT for CSV to XML Conve, Mukul Gandhi gandhi. | Date | [xsl] XSLT 3.0 try/catch doubts, Mukul Gandhi gandhi. |
Month |