| Home | Trees | Index | Help |
|
|---|
| Package pyxmpp :: Module error :: Class ErrorNode |
|
StanzaErrorNode,
StreamErrorNodeBase class for both XMPP stream and stanza errors
| Method Summary | |
|---|---|
Initialize an ErrorNode object. | |
__del__(self)
| |
Add custom condition element to the error. | |
Downgrade an XMPP error element to the legacy format. | |
Free the associated XML node. | |
Free the associated "borrowed" XML node. | |
Get the condition element of the error. | |
Get the description text from the error element. | |
Check if the error node is a legacy error element. | |
Serialize the element node. | |
Upgrade a legacy error element to the XMPP compliant one. | |
Evaluate XPath expression on the error element. | |
| Method Details |
|---|
__init__(self,
xmlnode_or_cond,
ns=None,
copy=True,
parent=None)
|
add_custom_condition(self, ns, cond, content=None)
Add custom condition element to the error.
:Parameters:
- `ns`: namespace URI.
- `cond`: condition name.
- `content`: content of the element.
:Types:
- `ns`: `unicode`
- `cond`: `unicode`
- `content`: `unicode`
:return: the new condition element.
:returntype: `libxml2.xmlNode`
|
downgrade(self)Downgrade an XMPP error element to the legacy format. Add a numeric code attribute according to the condition name. |
free(self)Free the associated XML node. |
free_borrowed(self)Free the associated "borrowed" XML node. |
get_condition(self, ns=None)
Get the condition element of the error.
:Parameters:
- `ns`: namespace URI of the condition element if it is not
the XMPP namespace of the error element.
:Types:
- `ns`: `unicode`
:return: the condition element or `None`.
:returntype: `libxml2.xmlNode`
|
get_text(self)Get the description text from the error element. :return: the text provided with the error or `None`. :returntype: `unicode` |
is_legacy(self)Check if the error node is a legacy error element. :return: `True` if it is a legacy error. :returntype: `bool` |
serialize(self)Serialize the element node. :return: serialized element in UTF-8 encoding. :returntype: `str` |
upgrade(self)Upgrade a legacy error element to the XMPP compliant one. Use the error code provided to select the condition and the <error/> CDATA for the error text. |
xpath_eval(self, expr, namespaces=None)
Evaluate XPath expression on the error element.
The expression will be evaluated in context where the common namespace
(the one used for stanza elements, mapped to 'jabber:client',
'jabber:server', etc.) is bound to prefix "ns" and other namespaces are
bound accordingly to the `namespaces` list.
:Parameters:
- `expr`: the XPath expression.
- `namespaces`: prefix to namespace mapping.
:Types:
- `expr`: `unicode`
- `namespaces`: `dict`
:return: the result of the expression evaluation.
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Wed May 31 22:36:59 2006 | http://epydoc.sf.net |