Security Advisories (3)
CVE-2015-3451 (2015-04-23)

The _clone function does not properly set the expand_entities option, which allows remote attackers to conduct XML external entity (XXE) attacks via crafted XML data to the (1) new or (2) load_xml function.

CVE-2017-10672 (2015-04-23)

Use-after-free in the XML-LibXML module through 2.0129 for Perl allows remote attackers to execute arbitrary code by controlling the arguments to a replaceChild call.

CVE-2026-8177 (2026-05-10)

XML::LibXML versions through 2.0210 for Perl read out-of-bounds heap memory when parsing XML node names containing truncated UTF-8 byte sequences. A node name ending in the middle of a multi byte UTF-8 sequence causes the parser to read past the end of the input string into adjacent heap memory. Any Perl process that passes attacker controlled strings to XML::LibXML's DOM node-name methods can reach this path on the default API. The likely consequence is a crash, causing denial of service.

NAME

XML::LibXML::Namespace - A Namespace Class to hold namespace nodes

synopsis

use XML::LibXML

print $ns->getName()
print $ns->name()
print $ns->prefix()
$localname = $ns->getLocalName()
print $ns->getData()
print $ns->getValue()
print $ns->value()
print $ns->uri()
$known_uri = $ns->getNamespaceURI()
$known_prefix = $ns->getPredix()

DESCRIPTION

Namespace nodes are returned by both $element->findnodes('namespace::foo') or by $node->getNamespaces().

The namespace node API is not part of any current DOM API, and so it is quite minimal. It should be noted that namespace nodes are not a sub class of XML::LibXML::Node, however Namespace nodes act a lot like attribute nodes, and similarly named methods will return what you would expect if you treated the namespace node as an attribute.

Methods

getName

Returns "xmlns:prefix", where prefix is the prefix for this namespace.

name

Alias for getName()

prefix

Returns the prefix bound to this namespace declaration.

getLocalName

Alias for prefix()

getData

Returns the URI of the namespace.

getValue

Alias for getData()

value

Alias for getData()

uri

Alias for getData()

getNamespaceURI

Returns the string "http://www.w3.org/2000/xmlns/"

getPrefix

Returns the string "xmlns"

AUTHOR

Matt Sergeant, Christian Glahn

VERSION

1.50