p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XML (http://p2p.wrox.com/forumdisplay.php?f=91)
-   -   CSV > XML (converting problems) (http://p2p.wrox.com/showthread.php?t=71491)

Kabe November 17th, 2008 02:53 AM

CSV > XML (converting problems)
 
Hi

I'm converting a CSV (with A7Soft csv2xml) to XML. But from time to time there are wrong characters which XML can't handle.

Does anyone know another better CSV to XML converting tool where it is possible to catch those special characters in order to have a clean XML-file?

and what do to do with these, for xml, wrong characters?
in the CSV delivered, they want to put for example '12#858;' (#858; was the endless sign i putted here).

How to get these special character again in output, after xsl-rendering?

kristof

joefawcett November 17th, 2008 03:57 AM

XML/XSLT can't handle some 'binary' characters, such as x00, x01 etc. If the CSV contains those then you'll have to pre-process it first. If you are talking about other characters then can you show an example of what you mean as I don't really follow the 12#858 example?

--

Joe (Microsoft MVP - XML)

Kabe November 17th, 2008 05:31 AM

hi, here an example of a part of a CSV-file
http://www.itwebburo.com/download/degrees_character.gif

I can convert problemless to XML, with the degrees-sign, but when rendering the xml ... i got stuck of course.
This supplier is delivering me frequently this data with 'wrong' characters.

Can you help me to find a method (other convertion tool) to strip those special characters?

thx a lot,
kristof

joefawcett November 17th, 2008 05:39 AM

There's no reason why an XML can't cope with that character. When you say render, what do you mean? XML files are just text. Why not show the XML output you get and state what you'd actually like?

--

Joe (Microsoft MVP - XML)

Kabe November 17th, 2008 06:02 AM

i'm using msxml4.0 for accessing the xml in asp(vbscript), then i get the error

here's the data with the part i get an error with, converted to xml-format i'm using:
http://www.itwebburo.com/download/upd_web_bis.xml
i get the CSV like that:
http://www.itwebburo.com/download/UPD_WEB_bis.txt

when loading in IE, it gives too error on the degrees-symbol
when loading in asp with msxml4.0 object, i get an object error

kristof

joefawcett November 17th, 2008 06:33 AM

That probably means the encoding used in the document doesn't match that declared, or assumed, by the parser.
How are you creating the file? Take a look at this link: http://www.dpawson.co.uk/xsl/sect2/N3353.html

--

Joe (Microsoft MVP - XML)

Kabe November 17th, 2008 09:46 AM

adding encoding="iso-8859-1" in the xml declaration header helps me out of problems.
thx a lot for your info!

kristof


All times are GMT -4. The time now is 06:21 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.