 |
| XML General XML discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 17th, 2008, 02:53 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 17th, 2008, 03:57 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
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)
|
|

November 17th, 2008, 05:31 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 17th, 2008, 05:39 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
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)
|
|

November 17th, 2008, 06:02 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 17th, 2008, 06:33 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
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)
|
|

November 17th, 2008, 09:46 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
adding encoding="iso-8859-1" in the xml declaration header helps me out of problems.
thx a lot for your info!
kristof
|
|
 |