XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Invalid character in XML file

> 
> I have been supplied xml data that will not validate because 
> it contains an invalid character.

It's best to start such a conversation by referring to this as non-XML data.
This sets the right context: it means for example that you can discuss with
your suppliers the benefits that would accrue if you switched to exchanging
data in XML rather than in a non-XML format. And it makes it clear in your
mind that the only tools you can use for converting the data to XML are
tools that can handle non-XML input.
> 
> I need to write a script to replace this character, but I am 
> unable to see what the character is.

I'd encourage you to identify the root cause of the bad data first. Once you
know the root cause, you can decide whether patching the bad data is an
appropriate tactic. Your priority should be to make sure it doesn't happen
again.
> 
> Anybody know a way to find out what this character is, or a 
> way of removing invalid characters from an xml document?

Use a utility that gives you a hex dump of the file. Many text editors have
this feature.

Try different XML parsers - some have more helpful error messages than
others.

Michael Kay
http://www.saxonica.com/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS