XML-LibXML

 view release on metacpan or  search on metacpan

lib/XML/LibXML/Node.pod  view on Meta::CPAN

  $childnode = $node->lastChild;
  $documentnode = $node->ownerDocument;
  $node = $node->getOwner;
  $node->setOwnerDocument( $doc );
  $node->insertBefore( $newNode, $refNode );
  $node->insertAfter( $newNode, $refNode );
  @nodes = $node->findnodes( $xpath_expression );
  $result = $node->find( $xpath );
  print $node->findvalue( $xpath );
  $bool = $node->exists( $xpath_expression );
  @childnodes = $node->childNodes();
  @childnodes = $node->nonBlankChildNodes();
  $xmlstring = $node->toString($format,$docencoding);
  $c14nstring = $node->toStringC14N();
  $c14nstring = $node->toStringC14N($with_comments, $xpath_expression , $xpath_context);
  $c14nstring = $node->toStringC14N_v1_1();
  $c14nstring = $node->toStringC14N_v1_1($with_comments, $xpath_expression , $xpath_context);
  $ec14nstring = $node->toStringEC14N();
  $ec14nstring = $node->toStringEC14N($with_comments, $xpath_expression, $inclusive_prefix_list);
  $ec14nstring = $node->toStringEC14N($with_comments, $xpath_expression, $xpath_context, $inclusive_prefix_list);
  $str = $doc->serialize($format);
  $localname = $node->localname;
  $nameprefix = $node->prefix;
  $uri = $node->namespaceURI();
  $boolean = $node->hasAttributes();
  @attributelist = $node->attributes();
  $URI = $node->lookupNamespaceURI( $prefix );
  $prefix = $node->lookupNamespacePrefix( $URI );
  $node->normalize;
  @nslist = $node->getNamespaces;
  $node->removeChildNodes();
  $strURI = $node->baseURI();
  $node->setBaseURI($strURI);
  $node->nodePath();
  $lineno = $node->line_number();

=head1 DESCRIPTION

XML::LibXML::Node defines functions that are common to all Node Types. An
XML::LibXML::Node should never be created standalone, but as an instance of a
high level class such as XML::LibXML::Element or XML::LibXML::Text. The class
itself should provide only common functionality. In XML::LibXML each node is
part either of a document or a document-fragment. Because of this there is no
node without a parent. This may causes confusion with "unbound" nodes.


=head1 METHODS

Many functions listed here are extensively documented in the DOM Level 3 specification (L<<<<<< http://www.w3.org/TR/DOM-Level-3-Core/ >>>>>>). Please refer to the specification for extensive documentation.

=over 4

=item nodeName

  $name = $node->nodeName;

Returns the node's name. This function is aware of namespaces and returns the
full name of the current node (C<<<<<< prefix:localname >>>>>>).

Since 1.62 this function also returns the correct DOM names for node types with
constant names, namely: #text, #cdata-section, #comment, #document,
#document-fragment.


=item setNodeName

  $node->setNodeName( $newName );

In very limited situations, it is useful to change a nodes name. In the DOM
specification this should throw an error. This Function is aware of namespaces.


=item isSameNode

  $bool = $node->isSameNode( $other_node );

returns TRUE (1) if the given nodes refer to the same node structure, otherwise
FALSE (0) is returned.


=item isEqual

  $bool = $node->isEqual( $other_node );

deprecated version of isSameNode().

I<<<<<< NOTE >>>>>> isEqual will change behaviour to follow the DOM specification


=item unique_key

  $num = $node->unique_key;

This function is not specified for any DOM level. It returns a key guaranteed
to be unique for this node, and to always be the same value for this node. In
other words, two node objects return the same key if and only if isSameNode
indicates that they are the same node.

The returned key value is useful as a key in hashes.


=item nodeValue

  $content = $node->nodeValue;

If the node has any content (such as stored in a C<<<<<< text node >>>>>>) it can get requested through this function.

I<<<<<< NOTE: >>>>>> Element Nodes have no content per definition. To get the text value of an
Element use textContent() instead!


=item textContent

  $content = $node->textContent;

this function returns the content of all text nodes in the descendants of the
given node as specified in DOM.


=item nodeType



( run in 0.998 second using v1.01-cache-2.11-cpan-39bf76dae61 )