pydoc > libxml2mod

๐Ÿ“ฆ NAME

libxml2mod โ€” Python bindings for the libxml2 C library, providing XML/HTML parsing, validation, XPath, and tree manipulation.

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ“– Parse XML filexmlParseFile(filename)Parse an XML file into a document tree
๐Ÿ“„ Parse XML stringxmlParseDoc(xml_string)Parse an XML string into a document tree
๐ŸŒ Parse HTML filehtmlParseFile(filename)Parse an HTML file into a document tree
๐Ÿ“ Parse HTML stringhtmlParseDoc(html_string)Parse an HTML string into a document tree
๐Ÿ” XPath queryxmlXPathEval(expr, ctxt)Evaluate an XPath expression against a context
๐Ÿ†• Create documentxmlNewDoc(version)Create a new empty XML document
๐Ÿงฉ Create nodexmlNewNode(ns, name)Create a new element node
โž• Add childxmlAddChild(parent, child)Append a child node to a parent
๐Ÿท๏ธ Get attributexmlGetProp(node, name)Get an attribute value from a node
โœ๏ธ Set attributexmlSetProp(node, name, value)Set an attribute on a node
๐Ÿ“ค Save to filexmlSaveFile(filename, doc)Save a document tree to a file
๐Ÿงน Free documentxmlFreeDoc(doc)Free a document and all its nodes
๐Ÿ”— Navigate childrenchildren(node)Get the first child of a node
โžก๏ธ Next siblingnext(node)Get the next sibling node
โฌ†๏ธ Parent nodeparent(node)Get the parent of a node
๐Ÿ“› Node namename(node)Get the name of a node
๐Ÿ“‹ Node contentxmlNodeGetContent(node)Get the text content of a node
โœ… Validate DTDxmlValidateDocument(ctxt, doc)Validate a document against its DTD
๐Ÿ“ Schema validatexmlSchemaValidateDoc(ctxt, doc)Validate a document against an XML Schema
๐Ÿ“– Text readerxmlNewTextReaderFilename(filename)Create a streaming text reader for large files
๐Ÿ”ค Escape URIxmlURIEscape(str)Escape a string for use in a URI
๐Ÿ“š Load catalogxmlLoadCatalog(filename)Load an XML catalog for entity resolution
๐Ÿ” Copy nodexmlCopyNode(node, extended)Deep copy a node
๐Ÿ—‘๏ธ Remove nodexmlUnlinkNode(node)Unlink a node from its tree

๐Ÿ“‹ FUNCTIONS

All functions in the libxml2mod module. Each wraps a corresponding libxml2 C function.

๐Ÿ“ FILE

/usr/lib/python3/dist-packages/libxml2mod.cpython-310-x86_64-linux-gnu.so

๐Ÿ“Œ This is a compiled C extension module for CPython 3.10 on x86_64 Linux systems. It provides direct bindings from Python to the libxml2 C library.

libxml2mod
๐Ÿ“ฆ NAME ๐Ÿš€ Quick Reference ๐Ÿ“‹ FUNCTIONS ๐Ÿ“ FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-19 17:58 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^