Package pyxb :: Package xmlschema :: Module structures :: Class _ImportElementInformationItem |
[hide private]
[frames] | no frames]

# type _ImportElementInformationItem

source code

      object --+
               |
         cscRoot --+
                   |
    _Annotated_mixin --+
                       |
                      _ImportElementInformationItem

Data associated with an import statement within a schema.

Instance Methods | [hide private]
id(self) The value of the `id` attribute from the import statement. | source code
namespace(self) The pyxb.namespace.Namespace instance corresponding to the value of the `namespace` attribute from the import statement. | source code
schemaLocation(self) The value of the `schemaLocation` attribute from the import statement, normalized relative to the location of the importing schema. | source code
prefix(self) The prefix from a namespace declaration for namespace that was active in the context of the import element, or `None` if there was no relevant namespace declaration in scope at that point. | source code
schema(self) The Schema instance corresponding to the imported schema, if available. | source code
__init__(self, importing_schema, node, **kw) Gather the information relative to an `import` statement. | source code
Inherited from `_Annotated_mixin`: `annotation` Inherited from `_Annotated_mixin` (private): `_annotationFromDOM`, `_updateFromOther_csc`

Class Variables | [hide private]
| __id = `None`
| __namespace = `None`
| __schemaLocation = `None`
| __prefix = `None`
| __schema = `None`
| _ImportElementInformationItem__id = `None`
| _ImportElementInformationItem__namespace = `None`
| _ImportElementInformationItem__prefix = `None`
| _ImportElementInformationItem__schema = `None`
| _ImportElementInformationItem__schemaLocation = `None`
Inherited from `_Annotated_mixin` (private): `_Annotated_mixin__annotation`

Method Details | [hide private]

### prefix(self) | source code
The prefix from a namespace declaration for namespace that was active in the context of the import element, or `None` if there was no relevant namespace declaration in scope at that point. This is propagated to be used as the default prefix for the corresponding namespace if no prefix had been assigned.

### schema(self) | source code
The Schema instance corresponding to the imported schema, if available. Normally `import` statements will be fulfilled by loading components from a namespace archive in which the corresponding namespace is marked as public. Where there are cycles in the namespace dependency graph, or the schema for a namespace are associated with a restricted profile of another namespace, there may be no such archive and instead the components are obtained using this schema.

### __init__(self, importing_schema, node, **kw) (Constructor) | source code
Gather the information relative to an `import` statement. If the imported namespace can be loaded from an archive, the `schemaLocation` attribute is ignored. Otherwise, it attempts to retrieve and parse the corresponding schema (if this has not already been done). Parameters: `importing_schema` - The Schema instance in which the import was found. `node` - The `xml.dom.DOM` node incorporating the schema information. Raises: `Exception` - Any exception raised when attempting to retrieve and parse data from the schema location. Overrides: cscRoot.__init__