XML.NET unexpected EOF error on Processing Instructions

M

Mark

I get the following error (see stacktrace) while loading
an XMLDocument. The document is huge and it has PI's
created from Arbortext's editor. Works fine when I use
MSXML2 to load the Document. Fails only on .NET
XMLDocument.Load().

Document loads on IE, XML Spy etc. without a problem.

The PI's look like these in the document

<?Pub _bookmark
Command="Alternate"?><?Pub _bookmark Command="Alternate"?
<?Pub _bookmark
Command="Alternate"?><?Pub _bookmark Command="Alternate"?
<?Pub _bookmark
Command="Alternate"?><?Pub _bookmark Command="Alternate"?>


Stack Trace:
============
An unexpected end of file parsing PI has occurred. Line
6089, position 33.
at System.Xml.XmlScanner.ScanPI()
at System.Xml.XmlTextReader.ParseTag()
at
System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities()
at System.Xml.XmlTextReader.Read()
at
System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
at System.Xml.XmlValidatingReader.Read()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument
parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc,
XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Test.Form1..ctor()
 
J

Jay B. Harlow [MVP - Outlook]

Mark,
Which version of .NET? VS.NET 2002 (.NET 1.0) or VS.NET 2003 (.NET 1.1)?

Do you have a small (10 or 15 node) sample you can include that demonstrates
the problem? (Not just the processing instructions, but a handful of the
other nodes also, a complete document that is under 25 nodes.

Hope this helps
Jay
 

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

Top