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

# type AttributeUse

source code

                           object --+
                                    |
                              cscRoot --+
                                        |
     utils.utility.PrivateTransient_mixin --+
                                            |
                               object --+   |
                                        |   |
                                  cscRoot --+
                                            |
         namespace._ComponentDependency_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
    namespace.archive._ArchivableObject_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
         utils.utility.PrivateTransient_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                utils.utility.Locatable_mixin --+
                                                |
                           _SchemaComponent_mixin --+
                                                    |
                                   object --+       |
                                            |       |
                                      cscRoot --+   |
                                                |   |
           namespace.resolution._Resolvable_mixin --+
                                                    |
                                   object --+       |
                                            |       |
                                      cscRoot --+   |
                                                |   |
                           _ValueConstraint_mixin --+
                                                    |
                                                   AttributeUse

An XMLSchema Attribute Use component.

Instance Methods | [hide private]
required(self) | source code
prohibited(self) | source code
restrictionOf(self) | source code
_setRestrictionOf(self, au) | source code
attributeDeclaration(self) The attribute declaration for this use. | source code
__init__(self, **kw) Initialize portions of a component. | source code
matchingQNameMembers(self, au_set) Return the subset of au_set for which the use names match this use. | source code
isResolved(self) Determine whether this named component is resolved. | source code
_resolve(self) Perform whatever steps are required to resolve this component. | source code
`frozenset` |
_bindingRequires_vx(self, include_lax) Attribute uses require their declarations, but only if lax. | source code
_adaptForScope(self, ctd) Adapt this instance for the given complex type. | source code
__str__(self) | source code
Inherited from `_SchemaComponent_mixin`: `bestNCName`, `facStateSortKey`, `hasBinding`, `isTypeDefinition`, `isUrTypeDefinition`, `nameInBinding`, `owner`, `schemaOrderSortKey`, `setNameInBinding` Inherited from `_SchemaComponent_mixin` (private): `_clearNamespaceContext`, `_clone`, `_cloneSource`, `_clones`, `_dissociateFromNamespace`, `_namespaceContext`, `_resetClone_csc`, `_scope`, `_scopeIsGlobal`, `_scopeIsIndeterminate`, `_setFacStateSortKey`, `_setOwner`, `_setScope`, `_updateFromOther_csc` Inherited from `namespace._ComponentDependency_mixin`: `bindingRequires` Inherited from `namespace.archive._ArchivableObject_mixin` (private): `_allowUpdateFromOther`, `_objectOrigin`, `_prepareForArchive`, `_setObjectOrigin`, `_updateFromOther` Inherited from `utils.utility.PrivateTransient_mixin`: `__getstate__` Inherited from `utils.utility.Locatable_mixin` (private): `_location`, `_setLocation` Inherited from `namespace.resolution._Resolvable_mixin` (private): `_queueForResolution` Inherited from `_ValueConstraint_mixin`: `default`, `fixed`, `valueConstraint` Inherited from `_ValueConstraint_mixin` (private): `_valueConstraintFromDOM`

Class Methods | [hide private]
CreateBaseInstance(cls, schema, attribute_declaration, use=2) | source code
CreateFromDOM(cls, node, **kw) Create an Attribute Use from the given DOM node. | source code

Class Variables | [hide private]
| __use = `None`
| USE_required = `1`
| USE_optional = `2`
| USE_prohibited = `4`
| __refExpandedName = `None`
| __restrictionOf = `None`
| __attributeDeclaration = `None`
Inherited from `_SchemaComponent_mixin` (private): `_SchemaComponent_mixin__PrivateTransient`, `_SchemaComponent_mixin__cloneSource`, `_SchemaComponent_mixin__clones`, `_SchemaComponent_mixin__facStateSortKey`, `_SchemaComponent_mixin__nameInBinding`, `_SchemaComponent_mixin__namespaceContext`, `_SchemaComponent_mixin__ownedComponents`, `_SchemaComponent_mixin__owner`, `_SchemaComponent_mixin__schemaOrderSortKey`, `_SchemaComponent_mixin__scope` Inherited from `namespace._ComponentDependency_mixin` (private): `_ComponentDependency_mixin__PrivateTransient`, `_ComponentDependency_mixin__bindingRequires` Inherited from `namespace.archive._ArchivableObject_mixin` (private): `_ArchivableObject_mixin__objectOrigin` Inherited from `namespace.resolution._Resolvable_mixin` (private): `_TraceResolution` Inherited from `_ValueConstraint_mixin`: `VC_default`, `VC_fixed`, `VC_na` Inherited from `_ValueConstraint_mixin` (private): `_ValueConstraint_mixin__valueConstraint`

Method Details | [hide private]

### attributeDeclaration(self) | source code
The attribute declaration for this use. When the use scope is assigned, the declaration is cloned (if necessary) so that each declaration corresponds to only one use. We rely on this in code generation, because the template map for the use is stored in its declaration.

### __init__(self, **kw) (Constructor) | source code
Initialize portions of a component. Parameters: `scope` - The scope in which the component is defined `namespace_context` - The NamespaceContext to use within this component `node` - If no `namespace_context` is provided, a DOM node must be provided from which a namespace context can be identified. `owner` - Reference to the component that owns this one (the immediately enclosing component). Is `None` in the case of top-level components. `schema` - Reference to the Schema component to which the component belongs. Required for every component except Schema, Annotation, and Wildcard. Overrides: cscRoot.__init__

### CreateFromDOM(cls, node, **kw) Class Method | source code
Create an Attribute Use from the given DOM node. wxs is a Schema instance within which the attribute use is being defined. node is a DOM element. The name must be 'attribute', and the node must be in the XMLSchema namespace. scope is the _ScopeDeclaration_mixin context into which any required anonymous attribute declaration is put. This must be a complex type definition, or None if this use is in an attribute group.

### isResolved(self) | source code
Determine whether this named component is resolved. Override this in the child class. Overrides: namespace.resolution._Resolvable_mixin.isResolved (inherited documentation)

### _resolve(self) | source code
Perform whatever steps are required to resolve this component. Resolution is performed in the context of the namespace to which the component belongs. Invoking this method may fail to complete the resolution process if the component itself depends on unresolved components. The sole caller of this should be _NamespaceResolution_mixin.resolveDefinitions. This method is permitted (nay, encouraged) to raise an exception if resolution requires interpreting a QName and the named component cannot be found. Override this in the child class. In the prefix, if isResolved is true, return right away. If something prevents you from completing resolution, invoke self._queueForResolution() (so it is retried later) and immediately return self. Prior to leaving after successful resolution discard any cached dom node by setting `self.__domNode=None`. Returns: `self`, whether or not resolution succeeds. Raises: `pyxb.SchemaValidationError` - if resolution requlres a reference to an unknown component Overrides: namespace.resolution._Resolvable_mixin._resolve (inherited documentation)

### _bindingRequires_vx(self, include_lax) | source code
Attribute uses require their declarations, but only if lax. Returns: `frozenset` The component instances on which this component depends Raises: `LogicError` - A subclass failed to implement this method Overrides: namespace._ComponentDependency_mixin._bindingRequires_vx

### _adaptForScope(self, ctd) | source code
Adapt this instance for the given complex type. If the attribute declaration for this use is not associated with a complex type definition, then associate a clone of it with this CTD, and clone a new attribute use that uses the associated declaration. This attribute use is then inherited by extensions and restrictions, while retaining its original scope.

### __str__(self) (Informal representation operator) | source code
Overrides: object.__str__ (inherited documentation)