Esempio n. 1
0
 def build_schema(self):
     """ Process L{Types} objects and create the schema collection """
     container = SchemaCollection(self)
     for t in [t for t in self.types if t.local()]:
         for root in t.contents():
             schema = Schema(root, self.url, self.options, container)
             container.add(schema)
     if not len(container): # empty
         root = Element.buildPath(self.root, 'types/schema')
         schema = Schema(root, self.url, self.options, container)
         container.add(schema)
     self.schema = container.load(self.options)
     for s in [t.schema() for t in self.types if t.imported()]:
         self.schema.merge(s)
     return self.schema
Esempio n. 2
0
 def build_schema(self):
     """ Process L{Types} objects and create the schema collection """
     container = SchemaCollection(self)
     for t in [t for t in self.types if t.local()]:
         for root in t.contents():
             schema = Schema(root, self.url, self.options, container)
             container.add(schema)
     if not len(container):  # empty
         root = Element.buildPath(self.root, 'types/schema')
         schema = Schema(root, self.url, self.options, container)
         container.add(schema)
     self.schema = container.load(self.options)
     for s in [t.schema() for t in self.types if t.imported()]:
         self.schema.merge(s)
     return self.schema