How to use BeautifulSoup to validate that an XML is compatible with a given DTD?



Suppose I have a bunch of .xmls which use a tag scheme defined in my own custom .DTD file.


How could I use BeautifulSoup4 to validate that a given .xml conforms to a given custom .DTD file (i.e. it doesn't have tags not defined in that .DTD)? In particular I am using a BeautifulSoup class object, which takes a file as an argument and then parses the XML accordingly.


I have looked at these resources but they don't address how to directly solve this problem:


(1)http://ift.tt/1viiRpa


(2)http://ift.tt/1vZsxW8


(3)http://ift.tt/1tSS3xs


No comments:

Post a Comment