Ensure that all schemas within the collection import each other which has a blending effect. @return: self @rtype: L{SchemaCollection}
(self)
| 97 | return merged |
| 98 | |
| 99 | def autoblend(self): |
| 100 | """ |
| 101 | Ensure that all schemas within the collection |
| 102 | import each other which has a blending effect. |
| 103 | @return: self |
| 104 | @rtype: L{SchemaCollection} |
| 105 | """ |
| 106 | namespaces = self.namespaces.keys() |
| 107 | for s in self.children: |
| 108 | for ns in namespaces: |
| 109 | tns = s.root.get('targetNamespace') |
| 110 | if tns == ns: |
| 111 | continue |
| 112 | for imp in s.root.getChildren('import'): |
| 113 | if imp.get('namespace') == ns: |
| 114 | continue |
| 115 | imp = Element('import', ns=Namespace.xsdns) |
| 116 | imp.set('namespace', ns) |
| 117 | s.root.append(imp) |
| 118 | return self |
| 119 | |
| 120 | def locate(self, ns): |
| 121 | """ |