Package Peach :: Package Engine :: Module dom :: Class Element
[hide private]

Class Element

source code

Element in our template tree.

Instance Methods [hide private]
 
__init__(self, name=None, parent=None) source code
 
genElementsByType(self, type)
Will generate (yield) all values of a specific type in the tree starting with us.
source code
 
getFullDataName(self)
Return fully qualified name inside of data map
source code
 
getRoot(self)
Get the root of this DOM tree
source code
 
printDomMap(self, level=0)
Print out a map of the dom.
source code
 
toXmlDom(self, parent, dict)
Convert to an XML DOM object tree for use in xpath queries.
source code
 
_setXmlAttribute(self, node, key, value)
Set an XML attribute with handling for UnicodeDecodeError.
source code
 
_getXmlAttribute(self, node, key)
Get an XML attribute with handling for UnicdeDecodeError.
source code
 
updateFromXmlDom(self, node, dict)
Update our object based on an XML DOM object.
source code
 
copy(self, parent) source code
 
_FixParents(self, start=None, parent=None)
Walk down from start and fix parent settings on children
source code
 
getFullname(self) source code
 
nextSibling(self)
Get the next sibling or return None
source code
 
previousSibling(self)
Get the prior sibling or return None
source code
 
hasChildNode(self, name)
Checks to see if origional parsed XML has a child node with the specified name.
source code
 
_setAttribute(self, node, name, value, default=None)
Set an attribute on an XML Element.
source code
 
_xmlHadChild(self, child)
Verify that we should serialize child node.
source code
Static Methods [hide private]
 
getUniqueName() source code
Class Variables [hide private]
  __CurNameNum = 0
For generating unknown element names
  GuidRegex = re.compile('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[...
Instance Variables [hide private]
  name
Name of Element, cannot include "."s
  parent
Parent of Element
  hasChildren
If element has children
  elementType
Type of this element
  node
Our XML node
  ref
The reference that made us, or None
Method Details [hide private]

updateFromXmlDom(self, node, dict)

source code 

Update our object based on an XML DOM object. All we are taking for now is defaultValue.

_setAttribute(self, node, name, value, default=None)

source code 

Set an attribute on an XML Element. We only set the attribute in the following cases:

  1. We have no attached xml node or self.ref == None
  2. We have a node, and the node has that attribute
  3. The value is not None

_xmlHadChild(self, child)

source code 

Verify that we should serialize child node. Checks to see if we have an attached xml node and that xml node has the child. If we don't have an attached xml node then say we should add child.


Class Variable Details [hide private]

GuidRegex

Value:
re.compile('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{\
12}$')