R
Ryan S
I am trying to read an XML document generated by a web server using the
XMLTextReader class, but the document generated appears to have some blank
lines at the top that are causing problems.
If I connect directly to the URL, when I call the ".Read" method on the
XMLTextReader, I get the message:
"The XML declaration is unexpected. Line 8, Column 3"
If I open the URL in my browser and copy and paste the XML stuff (starting
with <?xml...) to a text file, save it locally and then access that file
using the XMLText Reader, all is well. It appears as if a bunch (7,
actually) of blank lines are prepended to the top of the file from the web
server so that they appear before the <?xml... declaration.
Is this an an example of a non-well-formed document?
Is there a way to have the XMLTextReader skip over these lines, or is there
a way for me to intercept the stream and only start parsing at the
appropriate point?
Thanks,
Ryan
BTW, I am specifically trying to call the APIs from BMC's Patrol Express
product which return an XML document.
XMLTextReader class, but the document generated appears to have some blank
lines at the top that are causing problems.
If I connect directly to the URL, when I call the ".Read" method on the
XMLTextReader, I get the message:
"The XML declaration is unexpected. Line 8, Column 3"
If I open the URL in my browser and copy and paste the XML stuff (starting
with <?xml...) to a text file, save it locally and then access that file
using the XMLText Reader, all is well. It appears as if a bunch (7,
actually) of blank lines are prepended to the top of the file from the web
server so that they appear before the <?xml... declaration.
Is this an an example of a non-well-formed document?
Is there a way to have the XMLTextReader skip over these lines, or is there
a way for me to intercept the stream and only start parsing at the
appropriate point?
Thanks,
Ryan
BTW, I am specifically trying to call the APIs from BMC's Patrol Express
product which return an XML document.