XML Parse Problem

R

Rick Brandt

(simplified example)

I send this to a Java servlet where it is parsed and the data written to a
SQL Server database. Everything works fine.

<?xml version="1.0"?>
<Record>
<Notes><![CDATA[Some Text Characters]]></Notes>
</Record>

I send the same with one more character (note the "e") added and get...
org.xml.sax.SAXParseException: The root element is required in a
well-formed document.

<?xml version="1.0"?>
<Record>
<Notes><![CDATA[Some Text Characterse]]></Notes>
</Record>

The kicker is that it only does this when submitted to the Java servlet
running on our corporate web servers. When I run the servlet in my
JBuilder IDE locally (so I can step through it) the parse error is not
thrown so I have no idea how I can determine what is going on.

In a previous thread "Can't Process InputSource More Than Once?" I was
assisted in adding a method that writes my XML to a log file just before
doing the parse. What I don't understand is that the error is being raised
BEFORE I issue the parse command so the XML is only logged when the error
doesn't occur.

Just to make it really interesting I can substitute a different character
for the "e" and the error doesn't occur. If I put an "x" in that spot, no
error. If I use " e", no error. There just doesn't seem to be any rhyme
or reason to it.

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top