Re: Input '&' symbol causing SystemID Unknown error

Michael Ludwig <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <20090914222758.GE3820@wladimir>
Oscar Usifer schrieb am 14.09.2009 um 17:14:33 (-0500):
> 
> My input XML <entry></entry> values are containing '&' input symbols,
> e.g. "...<entry>Texas A&M</entry>"

That's a syntax error in XML. The ampersand is special. It is used for
entity references, built-in and user-defined, like &lt; or &nbsp;, and
also for numeric character references, like &#100;. The correct version
would use &amp; to represent the ampersand:

  <entry>Texas A&amp;M</entry>

> which results in errors as follows. I am reading the XML input from a
> SQL database, and thus appear as input CLOBs, so no specification is
> being set on the input charset.

The charset should be UTF-8, UTF-16 with a BOM, or contained in the XML
declaration.

> Any ideas how to resolve?

Well, the data is broken. Garbage in, garbage out. Fix the process that
writes garbage into the database.

-- 
Michael Ludwig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.