The schema is an objectification of a (xsd) definition. It provides inspection, lookup and type resolution. @ivar root: The root node. @type root: L{sax.element.Element} @ivar baseurl: The I{base} URL for this schema. @type baseurl: str @ivar container: A schem
| 159 | |
| 160 | |
| 161 | class Schema: |
| 162 | """ |
| 163 | The schema is an objectification of a <schema/> (xsd) definition. |
| 164 | It provides inspection, lookup and type resolution. |
| 165 | @ivar root: The root node. |
| 166 | @type root: L{sax.element.Element} |
| 167 | @ivar baseurl: The I{base} URL for this schema. |
| 168 | @type baseurl: str |
| 169 | @ivar container: A schema collection containing this schema. |
| 170 | @type container: L{SchemaCollection} |
| 171 | @ivar children: A list of direct top level children. |
| 172 | @type children: [L{SchemaObject},...] |
| 173 | @ivar all: A list of all (includes imported) top level children. |
| 174 | @type all: [L{SchemaObject},...] |
| 175 | @ivar types: A schema types cache. |
| 176 | @type types: {name:L{SchemaObject}} |
| 177 | @ivar imports: A list of import objects. |
| 178 | @type imports: [L{SchemaObject},...] |
| 179 | @ivar elements: A list of <element/> objects. |
| 180 | @type elements: [L{SchemaObject},...] |
| 181 | @ivar attributes: A list of <attribute/> objects. |
| 182 | @type attributes: [L{SchemaObject},...] |
| 183 | @ivar groups: A list of group objects. |
| 184 | @type groups: [L{SchemaObject},...] |
| 185 | @ivar agrps: A list of attribute group objects. |
| 186 | @type agrps: [L{SchemaObject},...] |
| 187 | @ivar form_qualified: The flag indicating: |
| 188 | (@elementFormDefault). |
| 189 | @type form_qualified: bool |
| 190 | """ |
| 191 | |
| 192 | Tag = 'schema' |
| 193 | |
| 194 | def __init__(self, root, baseurl, options, container=None): |
| 195 | """ |
| 196 | @param root: The xml root. |
| 197 | @type root: L{sax.element.Element} |
| 198 | @param baseurl: The base url used for importing. |
| 199 | @type baseurl: basestring |
| 200 | @param options: An options dictionary. |
| 201 | @type options: L{options.Options} |
| 202 | @param container: An optional container. |
| 203 | @type container: L{SchemaCollection} |
| 204 | """ |
| 205 | self.root = root |
| 206 | self.id = objid(self) |
| 207 | self.tns = self.mktns() |
| 208 | self.baseurl = baseurl |
| 209 | self.container = container |
| 210 | self.children = [] |
| 211 | self.all = [] |
| 212 | self.types = {} |
| 213 | self.imports = [] |
| 214 | self.elements = {} |
| 215 | self.attributes = {} |
| 216 | self.groups = {} |
| 217 | self.agrps = {} |
| 218 | if options.doctor is not None: |
no outgoing calls
no test coverage detected