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();

xmldocLoad(filePath);

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
1


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.

link

answered 06 Oct '15, 17:30

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×49
×36
×4
×2

Asked: 02 Oct '15, 02:51

Seen: 850 times

Last updated: 06 Oct '15, 17:30

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