Subject:Please Help! Converting CSV to XML with HTML in CDATA is getting escaped Author:Tony Lavinio Date:20 Oct 2006 02:18 AM
The adapter won't help with this, since CSV files have no notion
of CDATA.
You could try running the output from the adapter through a XSLT
program and using disable-output-escaping, although it's kind of
a yucky (meaning non-elegant, not necessarily wrong) solution.
Subject:Please Help! Converting CSV to XML with HTML in CDATA is getting escaped Author:Roman Hammes Date:21 Oct 2006 12:47 AM
I'm not sure what you are asking - I downloaded Stylus Studio Enterprise 2007, ran the File >> New >> Convert to XML, accepted defaults and ran the conversion.
It did a great job of conversion, except for the escaping everything contained in CDATA.
Anything in CDATA should not be touched... Is there a setting which would allow me to turn off escaping based on CSV field?
Subject:Please Help! Converting CSV to XML with HTML in CDATA is getting escaped Author:Tony Lavinio Date:23 Oct 2006 10:19 AM
The point is that CDATA is not a part of CSV - it's an XML thing.
A parser for CDATA wouldn't know what CDATA is - since it really
doesn't know what anything is.
However, your problem is intriguing to us, and we'd like to know
more so that we can find a way to help you and others.
We could change things so that we pass through a field unaltered,
but that would still put a CDATA section in your output, and what's
in it would be character content and not elements.
Understanding who (that is, what program) is generating this odd
content and how you need it is key to our understanding this
issue and potentially implementing a solution.
Subject:Please Help! Converting CSV to XML with HTML in CDATA is getting escaped Author:Roman Hammes Date:23 Oct 2006 03:31 PM Originally Posted: 23 Oct 2006 03:24 PM
I am converting data from one source to another.
Coming in, I have an Excel spreadsheet. I massage this data with various functions (one of which wraps some cells in CDATA tags) and then "save as" CSV.
There is nothing magic to the input file - I just want Sylus to honor the CDATA tag when it finds it or provide a means to override output escaping by field.
So, it is nice that Stylus CSV to XML will correctly escape troubleshome characters as a default, but it would be an extremely strong selling point if:
a) it could either pick up a valid CDATA section and leave it alone
b) you could check / uncheck "disable-output-escaping" per field
c) or if it had some kind of extensibility that allowed the option of editing what gets sent out to the xml file (say if it was VBA, it would look something like onConvertField(DataIn) as string, where the user could intercept the automatic conversion and massage DataIn and then send it out to get the change captured.
Oh - just to make this clear - the CDATA fields in the input CSV is not escaped (viewing in Notepad shows < verses <)