INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
Do a copy of the node to a given document.
def copyNode(self, node, extended): """Do a copy of the node to a given document. """ if node is None: node__o = None else: node__o = node._o ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended) if ret is None:raise treeError('xmlDocCopyNode() failed') __tmp = xmlN...
Do a recursive copy of the node list.
def copyNodeList(self, node): """Do a recursive copy of the node list. """ if node is None: node__o = None else: node__o = node._o ret = libxml2mod.xmlDocCopyNodeList(self._o, node__o) if ret is None:raise treeError('xmlDocCopyNodeList() failed') __tmp = xmlNode(_obj=ret)...
Create the internal subset of a document
def createIntSubset(self, name, ExternalID, SystemID): """Create the internal subset of a document """ ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID) if ret is None:raise treeError('xmlCreateIntSubset() failed') __tmp = xmlDtd(_obj=ret) return __tmp
Dump an XML document to an open FILE.
def dump(self, f): """Dump an XML document to an open FILE. """ ret = libxml2mod.xmlDocDump(f, self._o) return ret
Dump an XML/HTML node, recursive behaviour, children are printed too.
def elemDump(self, f, cur): """Dump an XML/HTML node, recursive behaviour, children are printed too. """ if cur is None: cur__o = None else: cur__o = cur._o libxml2mod.xmlElemDump(f, self._o, cur__o)
Dump an XML document to an open FILE.
def formatDump(self, f, format): """Dump an XML document to an open FILE. """ ret = libxml2mod.xmlDocFormatDump(f, self._o, format) return ret
Get the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).
def getRootElement(self): """Get the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). """ ret = libxml2mod.xmlDocGetRootElement(self._o) if ret is None:raise treeError('xmlDocGetRootElement() failed') __tmp = xmlNode(_obj=ret) ...
Get the internal subset of a document
def intSubset(self): """Get the internal subset of a document """ ret = libxml2mod.xmlGetIntSubset(self._o) if ret is None:raise treeError('xmlGetIntSubset() failed') __tmp = xmlDtd(_obj=ret) return __tmp
Creation of a new node containing a CDATA block.
def newCDataBlock(self, content, len): """Creation of a new node containing a CDATA block. """ ret = libxml2mod.xmlNewCDataBlock(self._o, content, len) if ret is None:raise treeError('xmlNewCDataBlock() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new character reference node.
def newCharRef(self, name): """Creation of a new character reference node. """ ret = libxml2mod.xmlNewCharRef(self._o, name) if ret is None:raise treeError('xmlNewCharRef() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new node containing a comment within a document.
def newDocComment(self, content): """Creation of a new node containing a comment within a document. """ ret = libxml2mod.xmlNewDocComment(self._o, content) if ret is None:raise treeError('xmlNewDocComment() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new Fragment node.
def newDocFragment(self): """Creation of a new Fragment node. """ ret = libxml2mod.xmlNewDocFragment(self._o) if ret is None:raise treeError('xmlNewDocFragment() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNo...
def newDocNode(self, ns, name, content): """Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using ...
Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNo...
def newDocNodeEatName(self, ns, name, content): """Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using...
Creation of a processing instruction element.
def newDocPI(self, name, content): """Creation of a processing instruction element. """ ret = libxml2mod.xmlNewDocPI(self._o, name, content) if ret is None:raise treeError('xmlNewDocPI() failed') __tmp = xmlNode(_obj=ret) return __tmp
Create a new property carried by a document.
def newDocProp(self, name, value): """Create a new property carried by a document. """ ret = libxml2mod.xmlNewDocProp(self._o, name, value) if ret is None:raise treeError('xmlNewDocProp() failed') __tmp = xmlAttr(_obj=ret) return __tmp
Creation of a new node element within a document. @ns and @content are optional (None).
def newDocRawNode(self, ns, name, content): """Creation of a new node element within a document. @ns and @content are optional (None). """ if ns is None: ns__o = None else: ns__o = ns._o ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content) if ret is None:ra...
Creation of a new text node within a document.
def newDocText(self, content): """Creation of a new text node within a document. """ ret = libxml2mod.xmlNewDocText(self._o, content) if ret is None:raise treeError('xmlNewDocText() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new text node with an extra content length parameter. The text node pertain to a given document.
def newDocTextLen(self, content, len): """Creation of a new text node with an extra content length parameter. The text node pertain to a given document. """ ret = libxml2mod.xmlNewDocTextLen(self._o, content, len) if ret is None:raise treeError('xmlNewDocTextLen() failed') __t...
Creation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset().
def newDtd(self, name, ExternalID, SystemID): """Creation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset(). """ ret = libxml2mod.xmlNewDtd(self._o, name, ExternalID, SystemID) if ret is None:raise treeError('xmlNewDtd() failed') __tm...
Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!
def newGlobalNs(self, href, prefix): """Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! """ ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix) if ret is None:raise treeError('xmlNewGlobalNs() failed') __tmp = xmlNs(_obj=ret) return ...
Creation of a new reference node.
def newReference(self, name): """Creation of a new reference node. """ ret = libxml2mod.xmlNewReference(self._o, name) if ret is None:raise treeError('xmlNewReference() failed') __tmp = xmlNode(_obj=ret) return __tmp
Dump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called
def nodeDumpOutput(self, buf, cur, level, format, encoding): """Dump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called """ if buf is None: buf__o = ...
Build the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs
def nodeListGetString(self, list, inLine): """Build the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs """ if list is None: list__o = None else: list__o = list._o ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine) re...
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, tree): """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 outs...
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 nodeListGetRawString(self, list, 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 list is None: list__o = N...
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 nodeGetBase(self, cur): """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 f...
Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.
def saveFileTo(self, buf, encoding): """Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. """ if buf is None: buf__o = None else: buf__o = buf._o ret = libxml2mod.xmlSaveFileTo(buf__o, sel...
Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used.
def saveFile(self, filename): """Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. """ ret = libxml2mod.xmlSaveFile(filename, self._o) return ret
Dump an XML document, converting it to the given encoding
def saveFileEnc(self, filename, encoding): """Dump an XML document, converting it to the given encoding """ ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding) return ret
Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. If @format is set then the document will be indented on output. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or ...
def saveFormatFile(self, filename, format): """Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. If @format is set then the document will be indented on output. Note that @format = 1 provide node ...
Dump an XML document to a file or an URL.
def saveFormatFileEnc(self, filename, encoding, format): """Dump an XML document to a file or an URL. """ ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format) return ret
Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.
def saveFormatFileTo(self, buf, encoding, format): """Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. """ if buf is None: buf__o = None else: buf__o = buf._o ret = libxml2mod.xmlSaveForm...
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, node, 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, node, href): """Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise. """ if node is None: node__o = None else: node__o = node._o ret = libxml2mod.xmlSearchNsByHref(self._o, no...
update all nodes in the list to point to the right document
def setListDoc(self, list): """update all nodes in the list to point to the right document """ if list is None: list__o = None else: list__o = list._o libxml2mod.xmlSetListDoc(list__o, self._o)
Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).
def setRootElement(self, root): """Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). """ if root is None: root__o = None else: root__o = root._o ret = libxml2mod.xmlDocSetRootElement(self._o, root__o) if ret is N...
update all nodes under the tree to point to the right document
def setTreeDoc(self, tree): """update all nodes under the tree to point to the right document """ if tree is None: tree__o = None else: tree__o = tree._o libxml2mod.xmlSetTreeDoc(tree__o, self._o)
Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs.
def stringGetNodeList(self, value): """Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. """ ret = libxml2mod.xmlStringGetNodeList(self._o, value) if ret is None:raise treeError('xmlStringGetNodeList() failed') ...
Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs.
def stringLenGetNodeList(self, value, len): """Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. """ ret = libxml2mod.xmlStringLenGetNodeList(self._o, value, len) if ret is None:raise treeError('xmlStringLenGetNodeLi...
Search the attribute declaring the given ID
def ID(self, ID): """Search the attribute declaring the given ID """ ret = libxml2mod.xmlGetID(self._o, ID) if ret is None:raise treeError('xmlGetID() failed') __tmp = xmlAttr(_obj=ret) return __tmp
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, elem, 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 elem is None...
Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs
def isMixedElement(self, name): """Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs """ ret = libxml2mod.xmlIsMixedElement(self._o, name) return ret
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, elem, 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 elem is None: elem__o = None else: elem__o = elem._o if attr is None: attr_...
Remove the given attribute from the ID table maintained internally.
def removeID(self, attr): """Remove the given attribute from the ID table maintained internally. """ if attr is None: attr__o = None else: attr__o = attr._o ret = libxml2mod.xmlRemoveID(self._o, attr__o) return ret
Remove the given attribute from the Ref table maintained internally.
def removeRef(self, attr): """Remove the given attribute from the Ref table maintained internally. """ if attr is None: attr__o = None else: attr__o = attr._o ret = libxml2mod.xmlRemoveRef(self._o, attr__o) return ret
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 validCtxtNormalizeAttributeValue(self, ctxt, elem, 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...
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, elem, 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 a...
Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.
def validateDocument(self, ctxt): """Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. """ if ctxt is None: ctxt__o = None ...
Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity
def validateDocumentFinal(self, ctxt): """Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for v...
Try to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present.
def validateDtd(self, ctxt, dtd): """Try to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present...
Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATIO...
def validateDtdFinal(self, ctxt): """Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one ...
Try to validate the subtree under an element
def validateElement(self, ctxt, elem): """Try to validate the subtree under an element """ 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.xmlValidateElement(ctxt__o, self._o, elem__o) ...
Validate that the given name match a notation declaration. - [ VC: Notation Declared ]
def validateNotationUse(self, ctxt, notationName): """Validate that the given name match a notation declaration. - [ VC: Notation Declared ] """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlValidateNotationUse(ctxt__o, self._o, notationName) ...
Try to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: En...
def validateOneAttribute(self, ctxt, elem, attr, value): """Try to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - ...
Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings ar...
def validateOneElement(self, ctxt, elem): """Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() f...
Try to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ...
def validateOneNamespace(self, ctxt, elem, prefix, ns, value): """Try to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC...
Pop the element end from the validation stack.
def validatePopElement(self, ctxt, elem, qname): """Pop the element end from the 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.xmlValidatePopElement(ctxt__o, self._o, ...
Push a new element start on the validation stack.
def validatePushElement(self, ctxt, elem, qname): """Push a new element start on the 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.xmlValidatePushElement(ctxt__o, self...
Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element
def validateRoot(self, ctxt): """Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element """ if ctxt is None: ctxt__o = No...
Implement the XInclude substitution on the XML document @doc
def xincludeProcessFlags(self, flags): """Implement the XInclude substitution on the XML document @doc """ ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags) return ret
Setup an xmltextReader to parse a preparsed XML document. This reuses the existing @reader xmlTextReader.
def NewWalker(self, reader): """Setup an xmltextReader to parse a preparsed XML document. This reuses the existing @reader xmlTextReader. """ if reader is None: reader__o = None else: reader__o = reader._o ret = libxml2mod.xmlReaderNewWalker(reader__o, self._o) return ...
Create an xmltextReader for a preparsed document.
def readerWalker(self): """Create an xmltextReader for a preparsed document. """ ret = libxml2mod.xmlReaderWalker(self._o) if ret is None:raise treeError('xmlReaderWalker() failed') __tmp = xmlTextReader(_obj=ret) return __tmp
Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.
def schemaNewDocParserCtxt(self): """Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process. """ ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o) if ret is None:raise parserError('xmlSchemaNewDocParserCtxt() failed') ...
Validate a document tree in memory.
def schemaValidateDoc(self, ctxt): """Validate a document tree in memory. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlSchemaValidateDoc(ctxt__o, self._o) return ret
Create a new xmlXPathContext
def xpathNewContext(self): """Create a new xmlXPathContext """ ret = libxml2mod.xmlXPathNewContext(self._o) if ret is None:raise xpathError('xmlXPathNewContext() failed') __tmp = xpathContext(_obj=ret) return __tmp
Create a new XPointer context
def xpointerNewContext(self, here, origin): """Create a new XPointer context """ if here is None: here__o = None else: here__o = here._o if origin is None: origin__o = None else: origin__o = origin._o ret = libxml2mod.xmlXPtrNewContext(self._o, here__o, origin__o) ...
Get the document tree from a parser context.
def doc(self): """Get the document tree from a parser context. """ ret = libxml2mod.xmlParserGetDoc(self._o) if ret is None:raise parserError('xmlParserGetDoc() failed') __tmp = xmlDoc(_obj=ret) return __tmp
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
def htmlCtxtReadDoc(self, cur, URL, encoding, options): """parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context """ ret = libxml2mod.htmlCtxtReadDoc(self._o, cur, URL, encoding, options) if ret is None:raise treeError('htmlCtxtReadDoc() faile...
parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context
def htmlCtxtReadFd(self, fd, URL, encoding, options): """parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context """ ret = libxml2mod.htmlCtxtReadFd(self._o, fd, URL, encoding, options) if ret is None:raise treeError('htmlCtxtReadFd() failed...
parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context
def htmlCtxtReadFile(self, filename, encoding, options): """parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context """ ret = libxml2mod.htmlCtxtReadFile(self._o, filename, encoding, options) if ret is None:raise treeError('htmlCtxtReadFile(...
Applies the options to the parser context
def htmlCtxtUseOptions(self, options): """Applies the options to the parser context """ ret = libxml2mod.htmlCtxtUseOptions(self._o, options) return ret
Parse a Chunk of memory
def htmlParseChunk(self, chunk, size, terminate): """Parse a Chunk of memory """ ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate) return ret
parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context
def ctxtReadFile(self, filename, encoding, options): """parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context """ ret = libxml2mod.xmlCtxtReadFile(self._o, filename, encoding, options) if ret is None:raise treeError('xmlCtxtReadFile() fail...
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
def ctxtReadMemory(self, buffer, size, URL, encoding, options): """parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context """ ret = libxml2mod.xmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options) if ret is None:raise treeError('xmlC...
Reset a push parser context
def ctxtResetPush(self, chunk, size, filename, encoding): """Reset a push parser context """ ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding) return ret
Applies the options to the parser context
def ctxtUseOptions(self, options): """Applies the options to the parser context """ ret = libxml2mod.xmlCtxtUseOptions(self._o, options) return ret
Parse a Chunk of memory
def parseChunk(self, chunk, size, terminate): """Parse a Chunk of memory """ ret = libxml2mod.xmlParseChunk(self._o, chunk, size, terminate) return ret
Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be
def setupParserForBuffer(self, buffer, filename): """Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be """ libxml2mod.xmlSetupParserForBuffer(self._o, ...
This function is deprecated, we now always process entities content through xmlStringDecodeEntities TODO: remove it in next major release. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'
def decodeEntities(self, len, what, end, end2, end3): """This function is deprecated, we now always process entities content through xmlStringDecodeEntities TODO: remove it in next major release. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' """ ...
Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point.
def handleEntity(self, entity): """Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point. """ if entity is None: entity__o = None else: entity__o = entity._o ...
parse ENTITY references declarations [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", the Name given in the ...
def parseEntityRef(self): """parse ENTITY references declarations [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "stand...
Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'
def stringDecodeEntities(self, str, what, end, end2, end3): """Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' """ ret = libxml2mod.xmlStringDecodeEntities(self._o, str, what, end,...
parse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *
def parseExternalSubset(self, ExternalID, SystemID): """parse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) * """ libxml2mod.xmlParseExternalSubset(self._o, ExternalID,...
Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'
def stringLenDecodeEntities(self, str, len, what, end, end2, end3): """Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';' """ ret = libxml2mod.xmlStringLenDecodeEntities(self._o, str,...
Dumps debug information for the attribute
def debugDumpAttr(self, output, depth): """Dumps debug information for the attribute """ libxml2mod.xmlDebugDumpAttr(output, self._o, depth)
Dumps debug information for the attribute list
def debugDumpAttrList(self, output, depth): """Dumps debug information for the attribute list """ libxml2mod.xmlDebugDumpAttrList(output, self._o, depth)
Do a copy of the attribute.
def copyProp(self, target): """Do a copy of the attribute. """ if target is None: target__o = None else: target__o = target._o ret = libxml2mod.xmlCopyProp(target__o, self._o) if ret is None:raise treeError('xmlCopyProp() failed') __tmp = xmlAttr(_obj=ret) return ...
Do a copy of an attribute list.
def copyPropList(self, target): """Do a copy of an attribute list. """ if target is None: target__o = None else: target__o = target._o ret = libxml2mod.xmlCopyPropList(target__o, self._o) if ret is None:raise treeError('xmlCopyPropList() failed') __tmp = xmlAttr(_obj=ret)...
Remove the given attribute from the ID table maintained internally.
def removeID(self, doc): """Remove the given attribute from the ID table maintained internally. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlRemoveID(doc__o, self._o) return ret
Remove the given attribute from the Ref table maintained internally.
def removeRef(self, doc): """Remove the given attribute from the Ref table maintained internally. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlRemoveRef(doc__o, self._o) return ret
Add an entry in the catalog, it may overwrite existing but different entries.
def add(self, type, orig, replace): """Add an entry in the catalog, it may overwrite existing but different entries. """ ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace) return ret
Remove an entry from the catalog
def remove(self, value): """Remove an entry from the catalog """ ret = libxml2mod.xmlACatalogRemove(self._o, value) return ret
Do a complete resolution lookup of an External Identifier
def resolve(self, pubID, sysID): """Do a complete resolution lookup of an External Identifier """ ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID) return ret
Try to lookup the catalog local reference associated to a public ID in that catalog
def resolvePublic(self, pubID): """Try to lookup the catalog local reference associated to a public ID in that catalog """ ret = libxml2mod.xmlACatalogResolvePublic(self._o, pubID) return ret
Try to lookup the catalog resource for a system ID
def resolveSystem(self, sysID): """Try to lookup the catalog resource for a system ID """ ret = libxml2mod.xmlACatalogResolveSystem(self._o, sysID) return ret
Do a complete resolution lookup of an URI
def resolveURI(self, URI): """Do a complete resolution lookup of an URI """ ret = libxml2mod.xmlACatalogResolveURI(self._o, URI) return ret
Do a copy of the dtd.
def copyDtd(self): """Do a copy of the dtd. """ ret = libxml2mod.xmlCopyDtd(self._o) if ret is None:raise treeError('xmlCopyDtd() failed') __tmp = xmlDtd(_obj=ret) return __tmp
Search the DTD for the description of this attribute on this element.
def dtdAttrDesc(self, elem, name): """Search the DTD for the description of this attribute on this element. """ ret = libxml2mod.xmlGetDtdAttrDesc(self._o, elem, name) if ret is None:raise treeError('xmlGetDtdAttrDesc() failed') __tmp = xmlAttribute(_obj=ret) return __...
Search the DTD for the description of this element
def dtdElementDesc(self, name): """Search the DTD for the description of this element """ ret = libxml2mod.xmlGetDtdElementDesc(self._o, name) if ret is None:raise treeError('xmlGetDtdElementDesc() failed') __tmp = xmlElement(_obj=ret) return __tmp