```{index} single: XML::LibXML ``` # XML::LibXML ```{pperl-module-badges} XML::LibXML ``` `XML::LibXML` - the DOM, XPath and SAX interface to libxml2. ```perl use XML::LibXML; my $doc = XML::LibXML->load_xml(string => ''); my $root = $doc->documentElement; print $root->namespaceURI, " ", $root->localname, "\n"; # DAV: multistatus my $resp = $doc->createElementNS('DAV:', 'd:response'); $root->appendChild($resp); print $doc->toString; ``` This is a native implementation of the CPAN distribution XML-LibXML 2.0213, over pperl's XML engine, libxml2 2.15 or newer; its Perl modules are used unchanged. The module fails to load with a message saying so when libxml2 is older or missing. The defaults are upstream's: entities are not expanded, no external DTD is loaded, and libxml2 2.15 has no network access of its own, so a document refers to no file or URL it is not given unless the `expand_entities`, `load_ext_dtd` or input callback options ask for it. ## Modules - [`XML::LibXML::Attr`](LibXML/Attr) - [`XML::LibXML::AttributeHash`](LibXML/AttributeHash.md) - tie an XML::LibXML::Element to a hash to access its attributes - [`XML::LibXML::Boolean`](LibXML/Boolean.md) - Boolean true/false values - [`XML::LibXML::Common`](LibXML/Common.md) - Constants and Character Encoding Routines - [`XML::LibXML::Devel`](LibXML/Devel.md) - makes functions from LibXML.xs available - [`XML::LibXML::ErrNo`](LibXML/ErrNo.md) - Structured Errors - [`XML::LibXML::Error`](LibXML/Error.md) - Structured Errors - [`XML::LibXML::LibError`](LibXML/LibError) - [`XML::LibXML::Literal`](LibXML/Literal.md) - Simple string values. - [`XML::LibXML::Namespace`](LibXML/Namespace) - [`XML::LibXML::NodeList`](LibXML/NodeList.md) - a list of XML document nodes - [`XML::LibXML::Number`](LibXML/Number.md) - Simple numeric values. - [`XML::LibXML::Reader`](LibXML/Reader.md) - XML::LibXML::Reader - interface to libxml2 pull parser - [`XML::LibXML::SAX`](LibXML/SAX.md) - XML::LibXML direct SAX parser - [`XML::LibXML::XPathContext`](LibXML/XPathContext.md) - XPath Evaluation - [`XML::LibXML::attr`](LibXML/attr) - LibXML.xs `MODULE = XML::LibXML PACKAGE = XML::LibXML::Attr`. - [`XML::LibXML::liberror`](LibXML/liberror) - LibXML.xs `MODULE = XML::LibXML PACKAGE = XML::LibXML::LibError`: the fields of the xmlError a structured error report hands over, which XML::LibXML::Error reads into an object of its own. - [`XML::LibXML::namespace`](LibXML/namespace) - LibXML.xs `MODULE = XML::LibXML PACKAGE = XML::LibXML::Namespace`: a namespace declaration of Perl's own, a copy bound to no document. ## Functions ### Other Functions #### `LIBXML_DOTTED_VERSION` `LIBXML_DOTTED_VERSION`: the version of the libxml2 an XS build is compiled against, which is the one it runs on. ```{toctree} :hidden: :maxdepth: 1 LibXML/Attr LibXML/AttributeHash LibXML/Boolean LibXML/Common LibXML/Devel LibXML/ErrNo LibXML/Error LibXML/LibError LibXML/Literal LibXML/Namespace LibXML/NodeList LibXML/Number LibXML/Reader LibXML/SAX LibXML/XPathContext LibXML/attr LibXML/liberror LibXML/namespace ```