On 2/25/2010 6:24 AM, Steven Gerrard wrote:
Hi,
I'm using Xalan-C 1.10 and Xerces-C 2.7, and have just encountered what
seems to be a bug (or a misunderstanding on my part).
Upgrading Xalan or Xerces is currently not an option due to time
constraints.
I'm using XalanTransformer::transform and pass an istrstream as an input
XML.
As long as my XML is upto 1423 characters, everything works like magic.
Once I pass in an 1424 characters long XML, I get a -2 return code, and
an "invalid document structure" error message.
I looked around and saw a similar(?) bug that was first discovered in
Xalan 1.4, but the fix seems to reflect the current state of my code,
plus the bug itself was not reproducable in Xalan 1.3 so I imagine it
was introduced in 1.4.
It's unlikely this is a bug in Xalan-C, since Xerces-C is reading the stream and reporting the error. The usual reason for this are stray bytes at the end of the stream, or a corrupted stream.

If you can come up with an isolated test case, including the input data, I can take a look at what's going on.

Also, could you please post a reference to the the similar bug you found? It would help me to take a look at the original bug report to see if there might be a connection to your issue.

Anyone encountered this issue, or can think of something I'm doing
wrong? Even a way to workaround the issue would be greatly appreciated,
as I'm pretty stumped here...
I would suggest you also test with ifstream and a disk file since the parser will use the underlying istream interface to read the data.

Dave

Reply via email to