[xsd-users] Why this error?

Boris Kolpackov boris at codesynthesis.com
Fri Mar 9 01:41:44 EST 2007


Hi Al,

Al Niessner <Al.Niessner at jpl.nasa.gov> writes:

> This seems to be an error propagating up from xceres-c 2.7. It does not
> something about the line
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

This is the XML declaration as found in the XML file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

And this one is as found in the fullText buffer:

<?xmlversion="1.0"encoding="UTF-8"standalone="yes"?>

Do you see any difference (there are no spaces in the second
version)? The first is valid while the second is not. The
problem is with the way you read in the XML in this loop:

while (!fin.eof())
{
  fin >> buffer;
  fullText += buffer;
}

The fin >> buffer extracts words and ignores whitespaces. As
a result, you end up with the mangled XML declaration above.
I provided a modified version of this loop in my first reply
to this thread. It reads in an exact code copy of the XML file,
including whitespaces.


hth,
-boris



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070309/b3c202f6/attachment.pgp


More information about the xsd-users mailing list