Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply With Quote
  #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)
Reply With Quote
  #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
Reply With Quote
  #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)
Reply With Quote
  #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
Reply With Quote
  #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)
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



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


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