XML Parse Problem

From: Rick Brandt (rickbrandt2_at_hotmail.com)
Date: 06/24/04


Date: Thu, 24 Jun 2004 11:11:54 -0500


(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

-- 
I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com


Relevant Pages

  • XML Parse Problem
    ... SQL Server database. ... The kicker is that it only does this when submitted to the Java servlet ... JBuilder IDE locally the parse error is not ... BEFORE I issue the parse command so the XML is only logged when the error ...
    (comp.lang.java.programmer)
  • Re: Post XML to a Java servlet using HttpWebRequest
    ... > I am trying to POST an XML string to a Java servlet, ... > relevant code (some of the names have been changed to protect the ...
    (microsoft.public.dotnet.languages.csharp)