INSTRUCTION stringlengths 1 46.3k | RESPONSE stringlengths 75 80.2k |
|---|---|
Add a list of node at the end of the child list of the
parent merging adjacent TEXT nodes (@cur may be freed) | def addChildList(self, cur):
"""Add a list of node at the end of the child list of the
parent merging adjacent TEXT nodes (@cur may be freed) """
if cur is None: cur__o = None
else: cur__o = cur._o
ret = libxml2mod.xmlAddChildList(self._o, cur__o)
if ret is None:raise ... |
Append the extra substring to the node content. NOTE: In
contrast to xmlNodeSetContentLen(), @content is supposed to
be raw text, so unescaped XML special chars are allowed,
entity references are not supported. | def addContentLen(self, content, len):
"""Append the extra substring to the node content. NOTE: In
contrast to xmlNodeSetContentLen(), @content is supposed to
be raw text, so unescaped XML special chars are allowed,
entity references are not supported. """
libxml2mod.xmlNo... |
Add a new node @elem as the next sibling of @cur If the new
node was already inserted in a document it is first
unlinked from its existing context. As a result of text
merging @elem may be freed. If the new node is ATTRIBUTE,
it is added into properties instead of children. If th... | def addNextSibling(self, elem):
"""Add a new node @elem as the next sibling of @cur If the new
node was already inserted in a document it is first
unlinked from its existing context. As a result of text
merging @elem may be freed. If the new node is ATTRIBUTE,
it is added... |
Add a new node @elem as the previous sibling of @cur
merging adjacent TEXT nodes (@elem may be freed) If the new
node was already inserted in a document it is first
unlinked from its existing context. If the new node is
ATTRIBUTE, it is added into properties instead of children.
... | def addPrevSibling(self, elem):
"""Add a new node @elem as the previous sibling of @cur
merging adjacent TEXT nodes (@elem may be freed) If the new
node was already inserted in a document it is first
unlinked from its existing context. If the new node is
ATTRIBUTE, it is ... |
Add a new element @elem to the list of siblings of @cur
merging adjacent TEXT nodes (@elem may be freed) If the new
element was already inserted in a document it is first
unlinked from its existing context. | def addSibling(self, elem):
"""Add a new element @elem to the list of siblings of @cur
merging adjacent TEXT nodes (@elem may be freed) If the new
element was already inserted in a document it is first
unlinked from its existing context. """
if elem is None: elem__o = None... |
Do a copy of the node. | def copyNode(self, extended):
"""Do a copy of the node. """
ret = libxml2mod.xmlCopyNode(self._o, extended)
if ret is None:raise treeError('xmlCopyNode() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
Do a recursive copy of the node list. Use
xmlDocCopyNodeList() if possible to ensure string interning. | def copyNodeList(self):
"""Do a recursive copy of the node list. Use
xmlDocCopyNodeList() if possible to ensure string interning. """
ret = libxml2mod.xmlCopyNodeList(self._o)
if ret is None:raise treeError('xmlCopyNodeList() failed')
__tmp = xmlNode(_obj=ret)
return __... |
Do a copy of the attribute. | def copyProp(self, cur):
"""Do a copy of the attribute. """
if cur is None: cur__o = None
else: cur__o = cur._o
ret = libxml2mod.xmlCopyProp(self._o, cur__o)
if ret is None:raise treeError('xmlCopyProp() failed')
__tmp = xmlAttr(_obj=ret)
return __tmp |
Do a copy of an attribute list. | def copyPropList(self, cur):
"""Do a copy of an attribute list. """
if cur is None: cur__o = None
else: cur__o = cur._o
ret = libxml2mod.xmlCopyPropList(self._o, cur__o)
if ret is None:raise treeError('xmlCopyPropList() failed')
__tmp = xmlAttr(_obj=ret)
return __... |
Do a copy of the node to a given document. | def docCopyNode(self, doc, extended):
"""Do a copy of the node to a given document. """
if doc is None: doc__o = None
else: doc__o = doc._o
ret = libxml2mod.xmlDocCopyNode(self._o, doc__o, extended)
if ret is None:raise treeError('xmlDocCopyNode() failed')
__tmp = xmlNode... |
Do a recursive copy of the node list. | def docCopyNodeList(self, doc):
"""Do a recursive copy of the node list. """
if doc is None: doc__o = None
else: doc__o = doc._o
ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o)
if ret is None:raise treeError('xmlDocCopyNodeList() failed')
__tmp = xmlNode(_obj=ret)
... |
Set the root element of the document (doc->children is a
list containing possibly comments, PIs, etc ...). | def docSetRootElement(self, doc):
"""Set the root element of the document (doc->children is a
list containing possibly comments, PIs, etc ...). """
if doc is None: doc__o = None
else: doc__o = doc._o
ret = libxml2mod.xmlDocSetRootElement(doc__o, self._o)
if ret is None... |
Finds the first child node of that element which is a
Element node Note the handling of entities references is
different than in the W3C DOM element traversal spec since
we don't have back reference from entities content to
entities references. | def firstElementChild(self):
"""Finds the first child node of that element which is a
Element node Note the handling of entities references is
different than in the W3C DOM element traversal spec since
we don't have back reference from entities content to
entities refere... |
Searches for the BASE URL. The code should work on both XML
and HTML document even if base mechanisms are completely
different. It returns the base as defined in RFC 2396
sections 5.1.1. Base URI within Document Content and 5.1.2.
Base URI from the Encapsulating Entity However it... | def getBase(self, doc):
"""Searches for the BASE URL. The code should work on both XML
and HTML document even if base mechanisms are completely
different. It returns the base as defined in RFC 2396
sections 5.1.1. Base URI within Document Content and 5.1.2.
Base URI from ... |
Search for an attribute associated to a node This attribute
has to be anchored in the namespace specified. This does
the entity substitution. This function looks in DTD
attribute declaration for #FIXED or default declaration
values unless DTD use has been turned off. Note that a
... | def hasNsProp(self, name, nameSpace):
"""Search for an attribute associated to a node This attribute
has to be anchored in the namespace specified. This does
the entity substitution. This function looks in DTD
attribute declaration for #FIXED or default declaration
values... |
Search an attribute associated to a node This function also
looks in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off. | def hasProp(self, name):
"""Search an attribute associated to a node This function also
looks in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off. """
ret = libxml2mod.xmlHasProp(self._o, name)
if ret is None:return None
... |
Finds the last child node of that element which is a
Element node Note the handling of entities references is
different than in the W3C DOM element traversal spec since
we don't have back reference from entities content to
entities references. | def lastElementChild(self):
"""Finds the last child node of that element which is a
Element node Note the handling of entities references is
different than in the W3C DOM element traversal spec since
we don't have back reference from entities content to
entities referenc... |
Builds the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs, contrary to
xmlNodeListGetString() this function doesn't do any
character encoding handling. | def listGetRawString(self, doc, inLine):
"""Builds the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs, contrary to
xmlNodeListGetString() this function doesn't do any
character encoding handling. """
if doc is None: doc__o = None
... |
Build the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs | def listGetString(self, doc, inLine):
"""Build the string equivalent to the text contained in the
Node list made of TEXTs and ENTITY_REFs """
if doc is None: doc__o = None
else: doc__o = doc._o
ret = libxml2mod.xmlNodeListGetString(doc__o, self._o, inLine)
return ret |
Creation of a new child element, added at the end of
@parent children list. @ns and @content parameters are
optional (None). If @ns is None, the newly created element
inherits the namespace of @parent. If @content is non None,
a child list containing the TEXTs and ENTITY_REFs nod... | def newChild(self, ns, name, content):
"""Creation of a new child element, added at the end of
@parent children list. @ns and @content parameters are
optional (None). If @ns is None, the newly created element
inherits the namespace of @parent. If @content is non None,
a c... |
Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. We use href==None in the case of
an element creation where the namespace was not defined. | def newNs(self, href, prefix):
"""Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. We use href==None in the case of
an element creation where the namespace was not defined. """
ret... |
Create a new property tagged with a namespace and carried
by a node. | def newNsProp(self, ns, name, value):
"""Create a new property tagged with a namespace and carried
by a node. """
if ns is None: ns__o = None
else: ns__o = ns._o
ret = libxml2mod.xmlNewNsProp(self._o, ns__o, name, value)
if ret is None:raise treeError('xmlNewNsProp() f... |
Create a new property tagged with a namespace and carried
by a node. | def newNsPropEatName(self, ns, name, value):
"""Create a new property tagged with a namespace and carried
by a node. """
if ns is None: ns__o = None
else: ns__o = ns._o
ret = libxml2mod.xmlNewNsPropEatName(self._o, ns__o, name, value)
if ret is None:raise treeError('xm... |
Create a new property carried by a node. | def newProp(self, name, value):
"""Create a new property carried by a node. """
ret = libxml2mod.xmlNewProp(self._o, name, value)
if ret is None:raise treeError('xmlNewProp() failed')
__tmp = xmlAttr(_obj=ret)
return __tmp |
Creation of a new child element, added at the end of
@parent children list. @ns and @content parameters are
optional (None). If @ns is None, the newly created element
inherits the namespace of @parent. If @content is non None,
a child TEXT node will be created containing the stri... | def newTextChild(self, ns, name, content):
"""Creation of a new child element, added at the end of
@parent children list. @ns and @content parameters are
optional (None). If @ns is None, the newly created element
inherits the namespace of @parent. If @content is non None,
... |
Finds the first closest next sibling of the node which is
an element node. Note the handling of entities references
is different than in the W3C DOM element traversal spec
since we don't have back reference from entities content to
entities references. | def nextElementSibling(self):
"""Finds the first closest next sibling of the node which is
an element node. Note the handling of entities references
is different than in the W3C DOM element traversal spec
since we don't have back reference from entities content to
entiti... |
Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off. This
function is similar to xmlGetProp except it will acc... | def noNsProp(self, name):
"""Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off. This
function is sim... |
Search and get the value of an attribute associated to a
node This attribute has to be anchored in the namespace
specified. This does the entity substitution. This function
looks in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned... | def nsProp(self, name, nameSpace):
"""Search and get the value of an attribute associated to a
node This attribute has to be anchored in the namespace
specified. This does the entity substitution. This function
looks in DTD attribute declaration for #FIXED or default
dec... |
Finds the first closest previous sibling of the node which
is an element node. Note the handling of entities
references is different than in the W3C DOM element
traversal spec since we don't have back reference from
entities content to entities references. | def previousElementSibling(self):
"""Finds the first closest previous sibling of the node which
is an element node. Note the handling of entities
references is different than in the W3C DOM element
traversal spec since we don't have back reference from
entities content t... |
Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off.
NOTE: this function acts independently of namespaces
... | def prop(self, name):
"""Search and get the value of an attribute associated to a
node This does the entity substitution. This function looks
in DTD attribute declaration for #FIXED or default
declaration values unless DTD use has been turned off.
NOTE: this function acts... |
This function checks that all the namespaces declared
within the given tree are properly declared. This is needed
for example after Copy or Cut and then paste operations.
The subtree may still hold pointers to namespace
declarations outside the subtree or invalid/masked. As much
... | def reconciliateNs(self, doc):
"""This function checks that all the namespaces declared
within the given tree are properly declared. This is needed
for example after Copy or Cut and then paste operations.
The subtree may still hold pointers to namespace
declarations outsi... |
Unlink the old node from its current context, prune the new
one at the same place. If @cur was already inserted in a
document it is first unlinked from its existing context. | def replaceNode(self, cur):
"""Unlink the old node from its current context, prune the new
one at the same place. If @cur was already inserted in a
document it is first unlinked from its existing context. """
if cur is None: cur__o = None
else: cur__o = cur._o
ret = ... |
Search a Ns registered under a given name space for a
document. recurse on the parents until it finds the defined
namespace or return None otherwise. @nameSpace can be None,
this is a search for the default namespace. We don't allow
to cross entities boundaries. If you don't decl... | def searchNs(self, doc, nameSpace):
"""Search a Ns registered under a given name space for a
document. recurse on the parents until it finds the defined
namespace or return None otherwise. @nameSpace can be None,
this is a search for the default namespace. We don't allow
... |
Search a Ns aliasing a given URI. Recurse on the parents
until it finds the defined namespace or return None
otherwise. | def searchNsByHref(self, doc, href):
"""Search a Ns aliasing a given URI. Recurse on the parents
until it finds the defined namespace or return None
otherwise. """
if doc is None: doc__o = None
else: doc__o = doc._o
ret = libxml2mod.xmlSearchNsByHref(doc__o, self._o,... |
Replace the content of a node. NOTE: @content is supposed
to be a piece of XML CDATA, so it allows entity references,
but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). | def setContentLen(self, content, len):
"""Replace the content of a node. NOTE: @content is supposed
to be a piece of XML CDATA, so it allows entity references,
but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
... |
update all nodes in the list to point to the right document | def setListDoc(self, doc):
"""update all nodes in the list to point to the right document """
if doc is None: doc__o = None
else: doc__o = doc._o
libxml2mod.xmlSetListDoc(self._o, doc__o) |
Associate a namespace to a node, a posteriori. | def setNs(self, ns):
"""Associate a namespace to a node, a posteriori. """
if ns is None: ns__o = None
else: ns__o = ns._o
libxml2mod.xmlSetNs(self._o, ns__o) |
Set (or reset) an attribute carried by a node. The ns
structure must be in scope, this is not checked | def setNsProp(self, ns, name, value):
"""Set (or reset) an attribute carried by a node. The ns
structure must be in scope, this is not checked """
if ns is None: ns__o = None
else: ns__o = ns._o
ret = libxml2mod.xmlSetNsProp(self._o, ns__o, name, value)
if ret is None:... |
Set (or reset) an attribute carried by a node. If @name has
a prefix, then the corresponding namespace-binding will be
used, if in scope; it is an error it there's no such
ns-binding for the prefix in scope. | def setProp(self, name, value):
"""Set (or reset) an attribute carried by a node. If @name has
a prefix, then the corresponding namespace-binding will be
used, if in scope; it is an error it there's no such
ns-binding for the prefix in scope. """
ret = libxml2mod.xmlSetPro... |
update all nodes under the tree to point to the right
document | def setTreeDoc(self, doc):
"""update all nodes under the tree to point to the right
document """
if doc is None: doc__o = None
else: doc__o = doc._o
libxml2mod.xmlSetTreeDoc(self._o, doc__o) |
Concat the given string at the end of the existing node
content | def textConcat(self, content, len):
"""Concat the given string at the end of the existing node
content """
ret = libxml2mod.xmlTextConcat(self._o, content, len)
return ret |
Merge two text nodes into one | def textMerge(self, second):
"""Merge two text nodes into one """
if second is None: second__o = None
else: second__o = second._o
ret = libxml2mod.xmlTextMerge(self._o, second__o)
if ret is None:raise treeError('xmlTextMerge() failed')
__tmp = xmlNode(_obj=ret)
re... |
Remove an attribute carried by a node. | def unsetNsProp(self, ns, name):
"""Remove an attribute carried by a node. """
if ns is None: ns__o = None
else: ns__o = ns._o
ret = libxml2mod.xmlUnsetNsProp(self._o, ns__o, name)
return ret |
Remove an attribute carried by a node. This handles only
attributes in no namespace. | def unsetProp(self, name):
"""Remove an attribute carried by a node. This handles only
attributes in no namespace. """
ret = libxml2mod.xmlUnsetProp(self._o, name)
return ret |
Determine whether an attribute is of type ID. In case we
have DTD(s) then this is done if DTD loading has been
requested. In the case of HTML documents parsed with the
HTML parser, then ID detection is done systematically. | def isID(self, doc, attr):
"""Determine whether an attribute is of type ID. In case we
have DTD(s) then this is done if DTD loading has been
requested. In the case of HTML documents parsed with the
HTML parser, then ID detection is done systematically. """
if doc is None: ... |
Determine whether an attribute is of type Ref. In case we
have DTD(s) then this is simple, otherwise we use an
heuristic: name Ref (upper or lowercase). | def isRef(self, doc, attr):
"""Determine whether an attribute is of type Ref. In case we
have DTD(s) then this is simple, otherwise we use an
heuristic: name Ref (upper or lowercase). """
if doc is None: doc__o = None
else: doc__o = doc._o
if attr is None: attr__o = ... |
Does the validation related extra step of the normalization
of attribute values: If the declared value is not CDATA,
then the XML processor must further process the normalized
attribute value by discarding any leading and trailing
space (#x20) characters, and by replacing sequen... | def validNormalizeAttributeValue(self, doc, name, value):
"""Does the validation related extra step of the normalization
of attribute values: If the declared value is not CDATA,
then the XML processor must further process the normalized
attribute value by discarding any leading an... |
Implement the XInclude substitution for the given subtree | def xincludeProcessTreeFlags(self, flags):
"""Implement the XInclude substitution for the given subtree """
ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags)
return ret |
Validate a branch of a tree, starting with the given @elem. | def schemaValidateOneElement(self, ctxt):
"""Validate a branch of a tree, starting with the given @elem. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)
return ret |
Compare two nodes w.r.t document order | def xpathCmpNodes(self, node2):
"""Compare two nodes w.r.t document order """
if node2 is None: node2__o = None
else: node2__o = node2._o
ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o)
return ret |
Evaluate the XPath Location Path in the given context. The
node 'node' is set as the context node. The context node is
not restored. | def xpathNodeEval(self, str, ctx):
"""Evaluate the XPath Location Path in the given context. The
node 'node' is set as the context node. The context node is
not restored. """
if ctx is None: ctx__o = None
else: ctx__o = ctx._o
ret = libxml2mod.xmlXPathNodeEval(self._... |
Create a new xmlXPathObjectPtr of type NodeSet and
initialize it with the single Node @val | def xpathNewNodeSet(self):
"""Create a new xmlXPathObjectPtr of type NodeSet and
initialize it with the single Node @val """
ret = libxml2mod.xmlXPathNewNodeSet(self._o)
if ret is None:raise xpathError('xmlXPathNewNodeSet() failed')
return xpathObjectRet(ret) |
Create a new xmlXPathObjectPtr of type Value Tree (XSLT)
and initialize it with the tree root @val | def xpathNewValueTree(self):
"""Create a new xmlXPathObjectPtr of type Value Tree (XSLT)
and initialize it with the tree root @val """
ret = libxml2mod.xmlXPathNewValueTree(self._o)
if ret is None:raise xpathError('xmlXPathNewValueTree() failed')
return xpathObjectRet(ret) |
Traversal function for the "ancestor" direction the
ancestor axis contains the ancestors of the context node;
the ancestors of the context node consist of the parent of
context node and the parent's parent and so on; the nodes
are ordered in reverse document order; thus the paren... | def xpathNextAncestor(self, ctxt):
"""Traversal function for the "ancestor" direction the
ancestor axis contains the ancestors of the context node;
the ancestors of the context node consist of the parent of
context node and the parent's parent and so on; the nodes
are ord... |
Traversal function for the "ancestor-or-self" direction he
ancestor-or-self axis contains the context node and
ancestors of the context node in reverse document order;
thus the context node is the first node on the axis, and
the context node's parent the second; parent here is
... | def xpathNextAncestorOrSelf(self, ctxt):
"""Traversal function for the "ancestor-or-self" direction he
ancestor-or-self axis contains the context node and
ancestors of the context node in reverse document order;
thus the context node is the first node on the axis, and
the... |
Traversal function for the "attribute" direction TODO:
support DTD inherited default attributes | def xpathNextAttribute(self, ctxt):
"""Traversal function for the "attribute" direction TODO:
support DTD inherited default attributes """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlXPathNextAttribute(ctxt__o, self._o)
if ret is None:ra... |
Traversal function for the "child" direction The child axis
contains the children of the context node in document order. | def xpathNextChild(self, ctxt):
"""Traversal function for the "child" direction The child axis
contains the children of the context node in document order. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlXPathNextChild(ctxt__o, self._o)
i... |
Traversal function for the "descendant" direction the
descendant axis contains the descendants of the context
node in document order; a descendant is a child or a child
of a child and so on. | def xpathNextDescendant(self, ctxt):
"""Traversal function for the "descendant" direction the
descendant axis contains the descendants of the context
node in document order; a descendant is a child or a child
of a child and so on. """
if ctxt is None: ctxt__o = None
... |
Traversal function for the "descendant-or-self" direction
the descendant-or-self axis contains the context node and
the descendants of the context node in document order; thus
the context node is the first node on the axis, and the
first child of the context node is the second no... | def xpathNextDescendantOrSelf(self, ctxt):
"""Traversal function for the "descendant-or-self" direction
the descendant-or-self axis contains the context node and
the descendants of the context node in document order; thus
the context node is the first node on the axis, and the
... |
Traversal function for the "following" direction The
following axis contains all nodes in the same document as
the context node that are after the context node in
document order, excluding any descendants and excluding
attribute nodes and namespace nodes; the nodes are ordered
... | def xpathNextFollowing(self, ctxt):
"""Traversal function for the "following" direction The
following axis contains all nodes in the same document as
the context node that are after the context node in
document order, excluding any descendants and excluding
attribute node... |
Traversal function for the "following-sibling" direction
The following-sibling axis contains the following siblings
of the context node in document order. | def xpathNextFollowingSibling(self, ctxt):
"""Traversal function for the "following-sibling" direction
The following-sibling axis contains the following siblings
of the context node in document order. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = ... |
Traversal function for the "namespace" direction the
namespace axis contains the namespace nodes of the context
node; the order of nodes on this axis is
implementation-defined; the axis will be empty unless the
context node is an element We keep the XML namespace node
... | def xpathNextNamespace(self, ctxt):
"""Traversal function for the "namespace" direction the
namespace axis contains the namespace nodes of the context
node; the order of nodes on this axis is
implementation-defined; the axis will be empty unless the
context node is an ele... |
Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
one. | def xpathNextParent(self, ctxt):
"""Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
one. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlXPathNextParent(ctxt__o, self._... |
Traversal function for the "preceding" direction the
preceding axis contains all nodes in the same document as
the context node that are before the context node in
document order, excluding any ancestors and excluding
attribute nodes and namespace nodes; the nodes are ordered
... | def xpathNextPreceding(self, ctxt):
"""Traversal function for the "preceding" direction the
preceding axis contains all nodes in the same document as
the context node that are before the context node in
document order, excluding any ancestors and excluding
attribute nodes... |
Traversal function for the "preceding-sibling" direction
The preceding-sibling axis contains the preceding siblings
of the context node in reverse document order; the first
preceding sibling is first on the axis; the sibling
preceding that node is the second on the axis and so o... | def xpathNextPrecedingSibling(self, ctxt):
"""Traversal function for the "preceding-sibling" direction
The preceding-sibling axis contains the preceding siblings
of the context node in reverse document order; the first
preceding sibling is first on the axis; the sibling
... |
Traversal function for the "self" direction The self axis
contains just the context node itself | def xpathNextSelf(self, ctxt):
"""Traversal function for the "self" direction The self axis
contains just the context node itself """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlXPathNextSelf(ctxt__o, self._o)
if ret is None:raise xpathE... |
Create a new xmlXPathObjectPtr of type range using a single
nodes | def xpointerNewCollapsedRange(self):
"""Create a new xmlXPathObjectPtr of type range using a single
nodes """
ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o)
if ret is None:raise treeError('xmlXPtrNewCollapsedRange() failed')
return xpathObjectRet(ret) |
Create a new XPointer context | def xpointerNewContext(self, doc, origin):
"""Create a new XPointer context """
if doc is None: doc__o = None
else: doc__o = doc._o
if origin is None: origin__o = None
else: origin__o = origin._o
ret = libxml2mod.xmlXPtrNewContext(doc__o, self._o, origin__o)
if re... |
Create a new xmlXPathObjectPtr of type LocationSet and
initialize it with the single range made of the two nodes
@start and @end | def xpointerNewLocationSetNodes(self, end):
"""Create a new xmlXPathObjectPtr of type LocationSet and
initialize it with the single range made of the two nodes
@start and @end """
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewLocation... |
Create a new xmlXPathObjectPtr of type range | def xpointerNewRange(self, startindex, end, endindex):
"""Create a new xmlXPathObjectPtr of type range """
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex)
if ret is None:raise treeError('xmlXPtrNewRange()... |
Create a new xmlXPathObjectPtr of type range using 2 nodes | def xpointerNewRangeNodes(self, end):
"""Create a new xmlXPathObjectPtr of type range using 2 nodes """
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
if ret is None:raise treeError('xmlXPtrNewRangeNodes() failed')
... |
The HTML DTD allows a tag to implicitly close other tags.
The list is kept in htmlStartClose array. This function
checks if the element or one of it's children would
autoclose the given tag. | def htmlAutoCloseTag(self, name, elem):
"""The HTML DTD allows a tag to implicitly close other tags.
The list is kept in htmlStartClose array. This function
checks if the element or one of it's children would
autoclose the given tag. """
ret = libxml2mod.htmlAutoCloseTag(s... |
The HTML DTD allows a tag to implicitly close other tags.
The list is kept in htmlStartClose array. This function
checks if a tag is autoclosed by one of it's child | def htmlIsAutoClosed(self, elem):
"""The HTML DTD allows a tag to implicitly close other tags.
The list is kept in htmlStartClose array. This function
checks if a tag is autoclosed by one of it's child """
ret = libxml2mod.htmlIsAutoClosed(self._o, elem)
return ret |
Dump an HTML document. | def htmlDocContentDumpFormatOutput(self, buf, encoding, format):
"""Dump an HTML document. """
if buf is None: buf__o = None
else: buf__o = buf._o
libxml2mod.htmlDocContentDumpFormatOutput(buf__o, self._o, encoding, format) |
Dump an HTML document. Formating return/spaces are added. | def htmlDocContentDumpOutput(self, buf, encoding):
"""Dump an HTML document. Formating return/spaces are added. """
if buf is None: buf__o = None
else: buf__o = buf._o
libxml2mod.htmlDocContentDumpOutput(buf__o, self._o, encoding) |
Dump an HTML document to an open FILE. | def htmlDocDump(self, f):
"""Dump an HTML document to an open FILE. """
ret = libxml2mod.htmlDocDump(f, self._o)
return ret |
Dump an HTML node, recursive behaviour,children are printed
too, and formatting returns are added. | def htmlNodeDumpFile(self, out, cur):
"""Dump an HTML node, recursive behaviour,children are printed
too, and formatting returns are added. """
if cur is None: cur__o = None
else: cur__o = cur._o
libxml2mod.htmlNodeDumpFile(out, self._o, cur__o) |
Dump an HTML node, recursive behaviour,children are printed
too. TODO: if encoding == None try to save in the doc
encoding | def htmlNodeDumpFileFormat(self, out, cur, encoding, format):
"""Dump an HTML node, recursive behaviour,children are printed
too. TODO: if encoding == None try to save in the doc
encoding """
if cur is None: cur__o = None
else: cur__o = cur._o
ret = libxml2mod.htmlN... |
Dump an HTML node, recursive behaviour,children are printed
too. | def htmlNodeDumpFormatOutput(self, buf, cur, encoding, format):
"""Dump an HTML node, recursive behaviour,children are printed
too. """
if buf is None: buf__o = None
else: buf__o = buf._o
if cur is None: cur__o = None
else: cur__o = cur._o
libxml2mod.htmlNodeDu... |
Dump an HTML node, recursive behaviour,children are printed
too, and formatting returns/spaces are added. | def htmlNodeDumpOutput(self, buf, cur, encoding):
"""Dump an HTML node, recursive behaviour,children are printed
too, and formatting returns/spaces are added. """
if buf is None: buf__o = None
else: buf__o = buf._o
if cur is None: cur__o = None
else: cur__o = cur._o
... |
Dump an HTML document to a file. If @filename is "-" the
stdout file is used. | def htmlSaveFile(self, filename):
"""Dump an HTML document to a file. If @filename is "-" the
stdout file is used. """
ret = libxml2mod.htmlSaveFile(filename, self._o)
return ret |
Dump an HTML document to a file using a given encoding and
formatting returns/spaces are added. | def htmlSaveFileEnc(self, filename, encoding):
"""Dump an HTML document to a file using a given encoding and
formatting returns/spaces are added. """
ret = libxml2mod.htmlSaveFileEnc(filename, self._o, encoding)
return ret |
Dump an HTML document to a file using a given encoding. | def htmlSaveFileFormat(self, filename, encoding, format):
"""Dump an HTML document to a file using a given encoding. """
ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format)
return ret |
Sets the current encoding in the Meta tags NOTE: this will
not change the document content encoding, just the META
flag associated. | def htmlSetMetaEncoding(self, encoding):
"""Sets the current encoding in the Meta tags NOTE: this will
not change the document content encoding, just the META
flag associated. """
ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
return ret |
Check the document for potential content problems, and
output the errors to @output | def debugCheckDocument(self, output):
"""Check the document for potential content problems, and
output the errors to @output """
ret = libxml2mod.xmlDebugCheckDocument(output, self._o)
return ret |
Register a new entity for this document. | def addDocEntity(self, name, type, ExternalID, SystemID, content):
"""Register a new entity for this document. """
ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
if ret is None:raise treeError('xmlAddDocEntity() failed')
__tmp = xmlEntity(_obj=ret)
... |
Register a new entity for this document DTD external subset. | def addDtdEntity(self, name, type, ExternalID, SystemID, content):
"""Register a new entity for this document DTD external subset. """
ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)
if ret is None:raise treeError('xmlAddDtdEntity() failed')
__tmp = x... |
Do an entity lookup in the document entity hash table and | def docEntity(self, name):
"""Do an entity lookup in the document entity hash table and """
ret = libxml2mod.xmlGetDocEntity(self._o, name)
if ret is None:raise treeError('xmlGetDocEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
Do an entity lookup in the DTD entity hash table and | def dtdEntity(self, name):
"""Do an entity lookup in the DTD entity hash table and """
ret = libxml2mod.xmlGetDtdEntity(self._o, name)
if ret is None:raise treeError('xmlGetDtdEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
TODO: remove xmlEncodeEntities, once we are not afraid of
breaking binary compatibility People must migrate their
code to xmlEncodeEntitiesReentrant ! This routine will
issue a warning when encountered. | def encodeEntities(self, input):
"""TODO: remove xmlEncodeEntities, once we are not afraid of
breaking binary compatibility People must migrate their
code to xmlEncodeEntitiesReentrant ! This routine will
issue a warning when encountered. """
ret = libxml2mod.xmlEncodeEnt... |
Do a global encoding of a string, replacing the predefined
entities and non ASCII values with their entities and
CharRef counterparts. Contrary to xmlEncodeEntities, this
routine is reentrant, and result must be deallocated. | def encodeEntitiesReentrant(self, input):
"""Do a global encoding of a string, replacing the predefined
entities and non ASCII values with their entities and
CharRef counterparts. Contrary to xmlEncodeEntities, this
routine is reentrant, and result must be deallocated. """
... |
Do a global encoding of a string, replacing the predefined
entities this routine is reentrant, and result must be
deallocated. | def encodeSpecialChars(self, input):
"""Do a global encoding of a string, replacing the predefined
entities this routine is reentrant, and result must be
deallocated. """
ret = libxml2mod.xmlEncodeSpecialChars(self._o, input)
return ret |
Create a new entity, this differs from xmlAddDocEntity()
that if the document is None or has no internal subset
defined, then an unlinked entity structure will be
returned, it is then the responsability of the caller to
link it to the document later or free it when not needed
... | def newEntity(self, name, type, ExternalID, SystemID, content):
"""Create a new entity, this differs from xmlAddDocEntity()
that if the document is None or has no internal subset
defined, then an unlinked entity structure will be
returned, it is then the responsability of the calle... |
Do an entity lookup in the internal and external subsets and | def parameterEntity(self, name):
"""Do an entity lookup in the internal and external subsets and """
ret = libxml2mod.xmlGetParameterEntity(self._o, name)
if ret is None:raise treeError('xmlGetParameterEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
Create an XML RelaxNGs parser context for that document.
Note: since the process of compiling a RelaxNG schemas
modifies the document, the @doc parameter is duplicated
internally. | def relaxNGNewDocParserCtxt(self):
"""Create an XML RelaxNGs parser context for that document.
Note: since the process of compiling a RelaxNG schemas
modifies the document, the @doc parameter is duplicated
internally. """
ret = libxml2mod.xmlRelaxNGNewDocParserCtxt(self._o... |
Validate a document tree in memory. | def relaxNGValidateDoc(self, ctxt):
"""Validate a document tree in memory. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlRelaxNGValidateDoc(ctxt__o, self._o)
return ret |
Validate a full subtree when
xmlRelaxNGValidatePushElement() returned 0 and the content
of the node has been expanded. | def relaxNGValidateFullElement(self, ctxt, elem):
"""Validate a full subtree when
xmlRelaxNGValidatePushElement() returned 0 and the content
of the node has been expanded. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
if elem is None: elem__o = None
... |
Pop the element end from the RelaxNG validation stack. | def relaxNGValidatePopElement(self, ctxt, elem):
"""Pop the element end from the RelaxNG validation stack. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
if elem is None: elem__o = None
else: elem__o = elem._o
ret = libxml2mod.xmlRelaxNGValidatePopElement(ctx... |
Push a new element start on the RelaxNG validation stack. | def relaxNGValidatePushElement(self, ctxt, elem):
"""Push a new element start on the RelaxNG validation stack. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
if elem is None: elem__o = None
else: elem__o = elem._o
ret = libxml2mod.xmlRelaxNGValidatePushElemen... |
Do a copy of the document info. If recursive, the content
tree will be copied too as well as DTD, namespaces and
entities. | def copyDoc(self, recursive):
"""Do a copy of the document info. If recursive, the content
tree will be copied too as well as DTD, namespaces and
entities. """
ret = libxml2mod.xmlCopyDoc(self._o, recursive)
if ret is None:raise treeError('xmlCopyDoc() failed')
__tmp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.