Solved

XML Encoding Error

Posted on 2010-11-20
5
649 Views
Last Modified: 2012-05-10
I have an XML file that will not load into Windows Explorer or into the intended destination application. The destination application gives very little information as to why the file fails. Internet Explorer stops (I think) at an error in the file with an ‘invalid character was found in text content’ message’.
The next character – the one that Explorer indicates is causing the problem – looks like a space. When I paste the text from the XML file into a website that converts text to SSCII it returns the space as a NULL.
When I try to load the file into an XML editor (Oxygen)  I get a ‘character coding exception’ error.
The XML file does not start with a XML Version element, with accompanying encoding attribute , and I cannot change the format, so I assume I must be stuck with the default encoding – whatever that is.
This file is an example of several that will not load. They are created using  the FileSystemObject WriteLine method within a VBA routine in Access 2010. How can I ensure that this produces text with the correct encoding?
0
Comment
Question by:LinksGu2
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Den_HBR
ID: 34179589
Can you please upload the file?
0
 
LVL 39

Expert Comment

by:als315
ID: 34179744
XML is text file. Open it with any text editor and check encoding and structure.
0
 

Author Comment

by:LinksGu2
ID: 34180285
The file in question is a large one.here's a snippet.
Snippet-2.xml
0
 
LVL 39

Accepted Solution

by:
als315 earned 250 total points
ID: 34182266
It seems problem is in 2 codes before ":" in this part:
CDATA[3E8S090K  : SILVER EARRING]
After K there are 2 hex A0 (Non-breaking space - &nbsp) symbols. If you replace them with hex 20 (space) all will be OK.
0
 
LVL 8

Expert Comment

by:Den_HBR
ID: 34182709
als315 is right.
You have to replace the Hex A0 with Hex 20  (= replace Dec 160 by Dec 32)

But to open it in internet explorer you will also have to add a parent element:
Something like <ProductList> on the very first line
and
something like </ProductList> on the very last line
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now