3

I have to use NSXMLParser to parse a XML file, but I need to validate it against a DTD. What is the best practice? Thank you.

user500
  • 4,519
  • 6
  • 43
  • 56

1 Answers1

0

Convert your DTD to an XML Schema then generate code which enforces the validation. See this and then this question.

Edit: Added DTD-to-XSD link.

Community
  • 1
  • 1
ThomasRS
  • 8,215
  • 5
  • 33
  • 48
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – rolve Nov 14 '12 at 08:03
  • It's not exactly a duplicate since the linked question is about XML Schema and not DTD. So without further explanations, your link-only answer is not very helpful. And if it *was* a duplicate, I think the link should be posted as a comment an not as an answer. – rolve Nov 14 '12 at 15:11
  • Happy now? I think this answer is very helpful. – ThomasRS Nov 15 '12 at 08:55