more parsing. This needs a *TON* more work.
authorFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 14 Jan 2009 04:05:21 +0000 (04:05 +0000)
committerFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 14 Jan 2009 04:05:21 +0000 (04:05 +0000)
rspec/rspecvalidate.py

index dcf07ed..ec594bd 100644 (file)
@@ -30,6 +30,18 @@ def traverseComplexType(cmpTypeNode):
                for n in cmpTypeNode.getElementsByTagName("xsd:attribute"):
                        _elements[n.getAttribute("name")] = {'type': n.getAttribute("type")}
 
+
+# Element.  {name, value, default}
+def Element(elementDom):
+       node = {} #parsed dict
+       for attr in elementDom.attributes.keys():
+               node[attr] = elementDom.attributes.get(attr).value
+       return node
+
+# Sequence is a list of dicts.  Each dict is an element type with Type fields
+def Sequence(sequenceNode):
+       pass
+
 def buildDict(document):
        if document.hasChildNodes():
                for i in document.childNodes: buildDict(i)