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

Class _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 object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __id = None
hash(x)
  __namespace = None
hash(x)
  __schemaLocation = None
hash(x)
  __prefix = None
hash(x)
  __schema = None
hash(x)
  _ImportElementInformationItem__id = None
hash(x)
  _ImportElementInformationItem__namespace = None
hash(x)
  _ImportElementInformationItem__prefix = None
hash(x)
  _ImportElementInformationItem__schema = None
hash(x)
  _ImportElementInformationItem__schemaLocation = None
hash(x)
Properties [hide private]

Inherited from object: __class__

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: object.__init__