Reputation: 279
I have a xml file that has
I am using linq to xml for parsing this xml. I have searched for validation of xml in linq to xml and most of the examples I get are validation against a xsd file.
Can please anyone tell me how to use linq to xml for validation against a DTD file.
Thanks.
Much obliged
Upvotes: 0
Views: 635
Reputation: 152624
From the documentation for XDocumentType:
LINQ to XML will not validate a document against a DTD, but you can use a validating XmlReader to perform DTD validation if necessary.
So it sounds like you'll need to validate the Xml using an XmlReader
before trying to read it using Linq to XML
Upvotes: 1