Home | Trees | Index | Help |
|
---|
Package twisted :: Package xish :: Module domish :: Class Element |
|
object
--+
|
Element
IQ
Object representing a container (a.k.a. tag or element) in an HTML or XML document.
An Element contains a series of attributes (name/value pairs), content (character data), and other child Element objects. When building a document with markup (such as HTML or XML), use this object as the starting point.Method Summary | |
---|---|
| |
__delitem__(self,
key)
| |
__getattr__(self,
key)
| |
__getitem__(self,
key)
| |
__setitem__(self,
key,
value)
| |
Retrieve the first CData (content) node | |
Dequalify an attribute key as needed | |
Add a child to this Element | |
Add some text data to this element | |
Add a new child Element to this Element; preferred method | |
Add a pre-serialized chunk o' XML as a child of this Element. | |
Add a unique (across a given Python session) id attribute to this Element | |
Safely compare the value of an attribute against a provided value; None-safe. | |
Iterate across all children of this Element that are Elements | |
firstChildElement(self)
| |
Retrieve the value of attribname, if it exists | |
Determine if the specified attribute exists | |
Swap the values of two attribute | |
Serialize this Element and all children to a string | |
Inherited from object | |
__delattr__(...)
| |
__getattribute__(...)
| |
__hash__(...)
| |
__reduce__(...)
| |
__repr__(...)
| |
__setattr__(...)
| |
Inherited from type | |
__new__(...)
|
Instance Variable Summary | |
---|---|
dict |
attributes : Dictionary of attributes associated with this Element. |
list |
children : List of child Elements and content |
str |
defaultUri : URI this Element exists within |
str |
name : Name of this Element |
Element |
parent : Reference to the parent Element, if any. |
str |
uri : URI of this Element's name |
Class Variable Summary | |
---|---|
int |
_idCounter = 0 |
Method Details |
---|
__init__(self,
qname,
defaultUri=None,
attribs=None)
|
__str__(self)
Retrieve the first CData (content) node
|
_dqa(self, attr)Dequalify an attribute key as needed |
addChild(self, node)Add a child to this Element |
addContent(self, text)Add some text data to this element |
addElement(self, name, defaultUri=None, content=None)Add a new child Element to this Element; preferred method |
addRawXml(self, rawxmlstring)Add a pre-serialized chunk o' XML as a child of this Element. |
addUniqueId(self)Add a unique (across a given Python session) id attribute to this Element |
compareAttribute(self, attrib, value)Safely compare the value of an attribute against a provided value; None-safe. |
elements(self)Iterate across all children of this Element that are Elements |
getAttribute(self, attribname, default=None)Retrieve the value of attribname, if it exists |
hasAttribute(self, attrib)Determine if the specified attribute exists |
swapAttributeValues(self, left, right)Swap the values of two attribute |
toXml(self, prefixes=None, closeElement=1)Serialize this Element and all children to a string |
Instance Variable Details |
---|
attributesDictionary of attributes associated with this Element.
|
childrenList of child Elements and content
|
defaultUriURI this Element exists within
|
nameName of this Element
|
parentReference to the parent Element, if any.
|
uriURI of this Element's name
|
Class Variable Details |
---|
_idCounter
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:12 2004 | http://epydoc.sf.net |