Add a schema node to the collection. Schema(s) within the same target namespace are consolidated. @param schema: A schema object. @type schema: (L{Schema})
(self, schema)
| 58 | self.namespaces = {} |
| 59 | |
| 60 | def add(self, schema): |
| 61 | """ |
| 62 | Add a schema node to the collection. Schema(s) within the same target |
| 63 | namespace are consolidated. |
| 64 | @param schema: A schema object. |
| 65 | @type schema: (L{Schema}) |
| 66 | """ |
| 67 | key = schema.tns[1] |
| 68 | existing = self.namespaces.get(key) |
| 69 | if existing is None: |
| 70 | self.children.append(schema) |
| 71 | self.namespaces[key] = schema |
| 72 | else: |
| 73 | existing.root.children += schema.root.children |
| 74 | existing.root.nsprefixes.update(schema.root.nsprefixes) |
| 75 | |
| 76 | def load(self, options): |
| 77 | """ |
no test coverage detected