XML::LibXML's DOM implementation tries to follow the
various DOM specs although not all interfaces are
implemented yet. Also there some efford is taken to
- also to follow the XPath DOM extensions.
+ also to follow the XPath DOM extensions. There are
+ many functions that are specified for DOM and already
+ present in XML::LibXML's DOM API, but still not
+ Although XML::LibXML provides the more important interfaces
+ to node structures, there are not all node types implemented
+ (yet). The more common functions are provided by
+ XML::LibXML::Node, so it should be possible to access most
+ parts of the document. Since XML::LibXML wraps only the
+ document structure provided by libxml2, XML::LibXML::Node
+ will not work properly with nodes found in a DTD, since they
+ are not nodes in context of libxml2.
+ Besides that XML::LibXML's DOM Api should provide
+ a more perlish interface to the DOM structure libxml2
(e.g. with $CLASS->new()), the <em>toString</em>
function may not return the expected result.
+ <p><st>NOTE:</st> XML::LibXML magic encoding may not work
+ on all plattforms. Some platforms are known to have a broken
+ iconv(), which is partly used by libxml2.
This seems like a limitation as long UTF8 encoding is
assured. If iso encoded strings come into play it is
not be copied, but removed from the original
+ <st>NOTE:</st> Don't try to use importNode() to import
+ subtrees that contain an entity reference - even if
+ the entity reference is the root node of the subtree.
+ This will cause serious problems to your program. This is
+ a limitation of libxml2 and not of XML::LibXML itself.
+ <method name="isSameNode"
+ synopsis="$bool = $node->isSameNode( $other_node );">
+ returns TRUE (1) if the given nodes refer to the same
+ nodestructure, otherwise FALSE (0) is returned.
synopsis="$bool = $node->isEqual( $other_node );">
- returns TRUE (1) if documents refer to the same
- nodestructure, otherwise FALSE (0) is returned.
+ depraced version of isSameNode().
+ <p><st>NOTE</st> isEqual will change behaviour to
+ follow the DOM specification</p>
<method name="getData" synopsis="$content = $node->getData()">
+ <method name="replaceNode" synopsis="$node->replaceNode($newNode);">
+ This function is very similar to replaceChild(), but it
+ replaces the node itself rather than a childnode. This is
+ useful if a node found by any XPath function, should be
synopsis="$childnode = $node->appendChild( $childnode )">
+ <method name="addSibling" synopsis="$node->addSibling($newNode);">
+ addSibling() allows to add an additional node to the end of
+ a nodelist, defined by the given node.
synopsis="$newnode =$node->cloneNode( $deep )">
$deep is 0 only the current node will be copied.
+ <method name="attributes" synopsis="@attrs =$node->attributes;">
+ This function returns all attributes assigned to the
+ given node. if this function is called in scalar context,
+ it will return a XML::LibXML::NodeList.
synopsis="$parentnode = $node->getParentNode();">
- <method name="getAttributes"
- synopsis="@attributelist = $node->getAttributes;">
- returns all attribute nodes of the current node.
- <method name="attributes"
- synopsis="@attributelist = $node->attributes;">
- Alias for <st>getAttributes()</st>
synopsis="@attributelist = $node->attributesNS( $URI );">
returns all attributes for the given namespace.