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

type AttributeDeclaration

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 --+       |
                                        |       |
     utils.utility.PrivateTransient_mixin --+   |
                                            |   |
                               object --+   |   |
                                        |   |   |
                                  cscRoot --+   |
                                            |   |
                        _NamedComponent_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
       namespace.resolution._Resolvable_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                             _Annotated_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                       _ValueConstraint_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                     _ScopedDeclaration_mixin --+
                                                |
                                               AttributeDeclaration

An XMLSchema Attribute Declaration component.

Instance Methods [hide private]
 
typeDefinition(self)
The simple type definition to which an attribute value must conform.
source code
 
__init__(self, *args, **kw)
Initialize portions of a component.
source code
 
__str__(self) 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
 
_updateFromOther_csc(self, other)
Override fields in this instance with those from the other.
source code
frozenset
_bindingRequires_vx(self, include_lax)
Attribute declarations require their type.
source code

Inherited from _SchemaComponent_mixin: bestNCName, facStateSortKey, hasBinding, isTypeDefinition, isUrTypeDefinition, nameInBinding, owner, schemaOrderSortKey, setNameInBinding

Inherited from namespace._ComponentDependency_mixin: bindingRequires

Inherited from _NamedComponent_mixin: __getnewargs__, __getstate__, __setstate__, bindingNamespace, expandedName, isAnonymous, isDerivationConsistent, isNameEquivalent, isTypeEquivalent, name, targetNamespace

Inherited from _Annotated_mixin: annotation

Inherited from _Annotated_mixin (private): _annotationFromDOM

Inherited from _ValueConstraint_mixin: default, fixed, valueConstraint

Inherited from _ScopedDeclaration_mixin: baseDeclaration, scope

Class Methods [hide private]
 
CreateBaseInstance(cls, name, schema, std=None)
Create an attribute declaration component for a specified namespace.
source code
 
CreateFromDOM(cls, node, **kw)
Create an attribute declaration from the given DOM node.
source code

Inherited from _ScopedDeclaration_mixin: IsValidScope, ScopeIsGlobal, ScopeIsIndeterminate

Static Methods [hide private]

Inherited from _NamedComponent_mixin: __new__

Class Variables [hide private]
  __typeDefinition = None
  __typeExpandedName = None

Inherited from _ValueConstraint_mixin: VC_default, VC_fixed, VC_na

Inherited from _ScopedDeclaration_mixin: SCOPE_global, XSCOPE_indeterminate

Method Details [hide private]

__init__(self, *args, **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__

__str__(self)
(Informal representation operator)

source code 
Overrides: object.__str__
(inherited documentation)

CreateFromDOM(cls, node, **kw)
Class Method

source code 

Create an attribute declaration from the given DOM node.

wxs is a Schema instance within which the attribute is being declared.

node is a DOM element. The name must be one of ( 'all', 'choice', 'sequence' ), and the node must be in the XMLSchema namespace.

scope is the _ScopeDeclaration_mxin context into which the attribute declaration is placed. It can be SCOPE_global, a complex type definition, or XSCOPE_indeterminate if this is an anonymous declaration within an attribute group. It is a required parameter for this function.

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:
Overrides: namespace.resolution._Resolvable_mixin._resolve
(inherited documentation)

_updateFromOther_csc(self, other)

source code 

Override fields in this instance with those from the other.

This method is invoked only by Schema._addNamedComponent, and then only when a built-in type collides with a schema-defined type. Material like facets is not (currently) held in the built-in copy, so the DOM information is copied over to the built-in STD, which is subsequently re-resolved.

Returns self.

Overrides: _Annotated_mixin._updateFromOther_csc

_bindingRequires_vx(self, include_lax)

source code 

Attribute declarations require their type.

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