|
|
XML::LibXML::Namespace - A Namespace Class to hold namespace nodes
use XML::LibXML
my $ns = XML::LibXML::Namespace->new($nsURI); 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()
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.
optionally you can pass the prefix to the namespace constructor. If this second parameter is ommited you will create a so called default namespace. Note, the newly created namespace is not bound to any docuement or node, therefore you should not expect it to be available in an existing document.
getName()
prefix()
getData()
getData()
getData()
Matt Sergeant, Christian Glahn
1.53