I'm using C# to produce an XML file on the ABBYY server and then I read it using the following:

XmlDocument xmlDoc = new XmlDocument();


However this throws an XmlException stating "DTD must be defined before the document root element". This is referring to the HTML code that is at the end of the file...

asked 02 Oct '15, 02:51

Philip%20Johns's gravatar image

Philip Johns

Philip, please sorry for the delay with response.

Could you please specify why you speak about HTML and not about XML? Possibly you try to load something else? Your code snippet is OK and it allows to load the correct XML without any problems.

Also our developers recommend you to view the following link http://stackoverflow.com/a/1542101/. You can use XDocument instead of XmlDocument. Moreover you can see our code samples where XDocument is used.


answered 06 Oct '15, 17:30

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 02 Oct '15, 02:51

Seen: 915 times

Last updated: 06 Oct '15, 17:30

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal