Solved

XML Encoding Error

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

808 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