'@param schema: The containing schema.
@type schema: L{schema.Schema}
@param root: The xml root node.
@type root: L{Element}'

def __init__(self, schema, root):

    self.schema = schema
    self.root = root
    self.id = objid(self)
    self.name = root.get('name')
    self.qname = (self.name, schema.tns[1])
    self.min = root.get('minOccurs')
    self.max = root.get('maxOccurs')
    self.type = root.get('type')
    self.ref = root.get('ref')
    self.form_qualified = schema.form_qualified
    self.nillable = False
    self.default = root.get('default')
    self.rawchildren = []
    self.cache = {}
