So as far as I understood what I should do is the following.<br>Go through my own XML keeping track of the full path of everything for example<br><br><SETUP><br><SETUP/COMMENT><br><SETUP/OTHER><br><br>and so on, then for every entry found in this iteration, check the schema to make sure that that particular construct is allowed<br>
on that level of the tree.<br><br>I have something like this for example that creates a dictionary from an element tree element...<br>Does it make sense or am I going in the wrong direction?<br><br><br>def etree_to_dict(xml_file):<br>
"""Takes the root node from the XML and generates a dictionary<br> """<br> dic = {}<br> etree = ElementTree.parse(open(xml_file))<br> root = list(etree.iter())[0]<br> queue = [root]<br>
<br> while queue:<br> el = queue.pop()<br> childs = el.getchildren()<br> queue += childs<br> dic[el] = childs<br><br> return dic<br><br><br>