By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,910 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,910 IT Pros & Developers. It's quick & easy.

XML.NET unexpected EOF error on Processing Instructions

P: n/a
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.ParseBeginTagExpandCharEn tities()
at System.Xml.XmlTextReader.Read()
at
System.Xml.XmlValidatingReader.ReadWithCollectText Token()
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()
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Mark" <an*******@discussions.microsoft.com> wrote in message
news:6b****************************@phx.gbl...
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.ParseBeginTagExpandCharEn tities()
at System.Xml.XmlTextReader.Read()
at
System.Xml.XmlValidatingReader.ReadWithCollectText Token()
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()

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.