Am Trying to convert an XML data into CSV with XSLT. The rows are separated with commas but some of the data have double quotes. i used the following codes for the conversion but it doesn't handle the data properly, especially the rows with quotes.
this is my sample data
<Add>
<Rowinfo>
<LocatorD>Dwelling </LocatorD>
<LName> shark </LName>
<L>1</L>
<AArea>Abesinia Passage</AArea>
</Rowinfo>
when the XSL is applied to the above data it produces
LocatorDesignator,LocatorName, Locator , Thoroughfare , AddressArea
Dwelling , shark , 1 , Abesinia Passage,
Shop 01-Feb,Shop , 1 , Casenapes Square , ,
But the intended result is to produce
LocatorDesignator,LocatorName,Locator, Thoroughfare , AddressArea
Dwelling , shark , 1 , Abesinia Passage ,
Shop 01-Feb , Shop , 1 , Casenapes Square ,
In other words when you open this as a CSV file
- Shop 01-Feb,Shop happend to be in a single column
instead of seperate columns such as:
LocatorDesignator| LocatorName
Shop 01-Feb,shop|
instead of
LocatorDesignator| LocatorName
Shop 01-Feb | Shop
This XSLT 1.0 style-sheet...
...will take this input document...
...and transform it into this csv output...
Caveats
I have assumed that: