Solved

XML Encoding Error

Posted on 2010-11-20
5
656 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

867 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

20 Experts available now in Live!

Get 1:1 Help Now