def parse(self, dir):
        objects = {}
        for file in os.listdir(dir):
            if file.lower().endswith('.xml'):
                filename = os.path.join(dir, file)
                # print filename
                dom = minidom.parse(filename)
                domObjects = dom.getElementsByTagName('object')
                for node in domObjects:
                    curObject = self.parseObject(node)
                    objects[curObject.getName()] = curObject

        # set the referenced objects here
        for obj in objects.itervalues():
            for prop in obj.properties:
                if prop.getReference():
                    try:
                        prop.setReferencedObject(objects[prop.getReference()])
                    except __HOLE__:
                        print 'error:', prop.getReference()
            for choice in obj.choices:
                for prop in choice.properties:
                    if prop.getReference():
                        try:
                            prop.setReferencedObject(
                                objects[prop.getReference()])
                        except KeyError:
                            print 'error:', prop.getReference()
                
        return objects.values()
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/db/bin/parser.py/AutoGenParser.parse