Solved

Opening XML-file in Excel, parse-error

Posted on 2014-09-10
2
532 Views
Last Modified: 2014-09-10
Hi

I have a simple XML-file:
<?xml version="1.0" encoding="iso-8859-1" ?>
<rootelement>
  <data>xy & z</data>
</rootelement>

Open in new window

If I open this in Excel 2013 I get a parse-error (cause of the special-character &).
in "http://support.microsoft.com/kb/238833/en-us" I can read that using "Encoding="iso-8859-1" I can use the special characters without encoding. But Excel fires a parse-error. Has I to change an option in Excel or may it be an error in Excel? Other apps like Notepad++ reads the file error-free. Thanks, Peter
0
Comment
Question by:formi
2 Comments
 
LVL 33

Accepted Solution

by:
ste5an earned 500 total points
ID: 40314172
The encoding is not the problem.

It's the specification of XML. There are exactly two characters which must be always escaped, cause they are not allowed as literals in any encoding: & (ampersand) and < (left angle bracket). Use &amp; and &lt; instead of those characters.

See also XML - 2.4 Character Data and Markup.

So you have two options:

<?xml version="1.0" encoding="iso-8859-1" ?>
<rootelement>
  <data>xy &amp; z</data>
</rootelement>

Open in new window


or using the CDATA tag, which makes here normally no sense:

<?xml version="1.0" encoding="iso-8859-1" ?>
<rootelement>
  <data>xy <![CDATA[&]]> z</data>
</rootelement>

Open in new window

0
 

Author Closing Comment

by:formi
ID: 40314207
Thanks for your Information!
0

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

863 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

21 Experts available now in Live!

Get 1:1 Help Now