Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old November 17th, 2008, 02:53 AM
Authorized User
 
Join Date: Jun 2003
Location: Gent, , Belgium.
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default 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
  #2 (permalink)  
Old November 17th, 2008, 03:57 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)
  #3 (permalink)  
Old November 17th, 2008, 05:31 AM
Authorized User
 
Join Date: Jun 2003
Location: Gent, , Belgium.
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default

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
  #4 (permalink)  
Old November 17th, 2008, 05:39 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)
  #5 (permalink)  
Old November 17th, 2008, 06:02 AM
Authorized User
 
Join Date: Jun 2003
Location: Gent, , Belgium.
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default

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
  #6 (permalink)  
Old November 17th, 2008, 06:33 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)
  #7 (permalink)  
Old November 17th, 2008, 09:46 AM
Authorized User
 
Join Date: Jun 2003
Location: Gent, , Belgium.
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default

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

kristof


Similar Threads
Thread Thread Starter Forum Replies Last Post
csv > xml command line tool, encoding option Kabe XML 2 November 20th, 2008 09:06 AM
Converting Int -> ASCII silaros C++ Programming 1 June 5th, 2007 01:12 AM
Achitecture ? SQL -> XML -> ASP -> PDF or HTML Frm jstrong Classic ASP XML 0 July 9th, 2005 01:18 PM
Html > csv format goldspider Beginning PHP 2 March 27th, 2005 06:39 PM
asp(ado->xml) --->internet>--asp(xml->ado) moon XML 0 November 28th, 2003 09:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.