Package pyxb :: Package binding :: Module basis :: Class ElementContent
[hide private]
[frames] | no frames]

Class ElementContent

source code

object --+    
         |    
  _Content --+
             |
            ElementContent

Marking wrapper for element content.

The value should be translated into XML and made a child of its parent.

Instance Methods [hide private]
 
__getElementDeclaration(self)
The pyxb.binding.content.ElementDeclaration associated with the element content.
source code
 
__init__(self, value, element_declaration=None, instance=None, tag=None)
Create a wrapper associating a value with its element declaration.
source code

Inherited from _Content (private): _Content__getValue

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __elementDeclaration = None
hash(x)

Inherited from _Content (private): _Content__value

Properties [hide private]
  elementDeclaration
The pyxb.binding.content.ElementDeclaration associated with the element content.

Inherited from _Content: value

Inherited from object: __class__

Method Details [hide private]

__getElementDeclaration(self)

source code 

The pyxb.binding.content.ElementDeclaration associated with the element content. This may be None if the value is a wildcard.

__init__(self, value, element_declaration=None, instance=None, tag=None)
(Constructor)

source code 

Create a wrapper associating a value with its element declaration.

Normally the element declaration is determined by consulting the content model when creating a binding instance. When manipulating the preferred content list, this may be inconvenient to obtain; in that case provide the instance in which the content appears immediately, along with the tag that is used for the Python attribute that holds the element.

Parameters:
  • value - the value of the element. Should be an instance of _TypeBinding_mixin, but for simple types might be a Python native type.
  • element_declaration - The pyxb.binding.content.ElementDeclaration associated with the element value. Should be None if the element matches wildcard content.
  • instance - Alternative path to providing element_declaration
  • tag - Alternative path to providing element_declaration
Overrides: object.__init__

Property Details [hide private]

elementDeclaration

The pyxb.binding.content.ElementDeclaration associated with the element content. This may be None if the value is a wildcard.

Get Method:
__getElementDeclaration(self) - The pyxb.binding.content.ElementDeclaration associated with the element content.