libxml-enno

 view release on metacpan or  search on metacpan

html/XML/DOM/Node.html  view on Meta::CPAN

<HTML><HEAD><TITLE>XML::DOM::Node - Super class of all nodes in XML::DOM</TITLE></HEAD><BODY><H1><A NAME="NAME">NAME

</A></H1><P>XML::DOM::Node - Super class of all nodes in XML::DOM

<P><HR><H1><A NAME="DESCRIPTION">DESCRIPTION

</A></H1><P>XML::DOM::Node is the super class of all nodes in an XML::DOM document.
This means that all nodes that subclass XML::DOM::Node also inherit all
the methods that XML::DOM::Node implements.

<H2><A NAME="GLOBAL_VARIABLES">GLOBAL VARIABLES

</A></H2><DL><DT><A NAME="_NodeNames_"><STRONG><P>@NodeNames

</STRONG></A><DD>The variable @XML::DOM::Node::NodeNames maps the node type constants to strings.
It is used by XML::DOM::Node::getNodeTypeName.

</DL><H2><A NAME="METHODS">METHODS

</A></H2><DL><DT><A NAME="getNodeType_"><STRONG><P>getNodeType

</STRONG></A><DD>Return an integer indicating the node type. See XML::DOM constants.

<DT><A NAME="getNodeName_"><STRONG><P>getNodeName

</STRONG></A><DD>Return a property or a hardcoded string, depending on the node type.
Here are the corresponding functions or values:

<PRE> Attr			getName
 AttDef			getName
 AttlistDecl		getName
 CDATASection		"#cdata-section"
 Comment		"#comment"
 Document		"#document"
 DocumentType		getNodeName
 DocumentFragment	"#document-fragment"
 Element		getTagName
 ElementDecl		getName
 EntityReference	getEntityName
 Entity			getNotationName
 Notation		getName
 ProcessingInstruction	getTarget
 Text			"#text"
 XMLDecl		"#xml-declaration"

</PRE><P><B>Not In DOM Spec</B>: AttDef, AttlistDecl, ElementDecl and XMLDecl were added for
completeness.

<DT><A NAME="getNodeValue_and_setNodeValue_value_"><STRONG><P>getNodeValue and setNodeValue (value)

</STRONG></A><DD>Returns a string or undef, depending on the node type. This method is provided 
for completeness. In other languages it saves the programmer an upcast.
The value is either available thru some other method defined in the subclass, or
else undef is returned. Here are the corresponding methods: 
Attr::getValue, Text::getData, CDATASection::getData, Comment::getData, 
ProcessingInstruction::getData.

<DT><A NAME="getParentNode_and_setParentNode_parentNode_"><STRONG><P>getParentNode and setParentNode (parentNode)

</STRONG></A><DD>The parent of this node. All nodes, except Document,
DocumentFragment, and Attr may have a parent. However, if a
node has just been created and not yet added to the tree, or
if it has been removed from the tree, this is undef.

<DT><A NAME="getChildNodes_"><STRONG><P>getChildNodes

</STRONG></A><DD>A NodeList that contains all children of this node. If there
are no children, this is a NodeList containing no nodes. The
content of the returned NodeList is "live" in the sense that,
for instance, changes to the children of the node object that
it was created from are immediately reflected in the nodes
returned by the NodeList accessors; it is not a static
snapshot of the content of the node. This is true for every
NodeList, including the ones returned by the
getElementsByTagName method.

<P>NOTE: this implementation does not return a "live" NodeList for
getElementsByTagName. See <A>CAVEATS</A>.

<P>When this method is called in a list context, it returns a regular perl list
containing the child nodes. Note that this list is not "live". E.g.

<PRE> @list = $node-&gt;getChildNodes;	      # returns a perl list
 $nodelist = $node-&gt;getChildNodes;    # returns a NodeList (object reference)
 for my $kid ($node-&gt;getChildNodes)   # iterate over the children of $node

</PRE><DT><A NAME="getFirstChild_"><STRONG><P>getFirstChild

</STRONG></A><DD>The first child of this node. If there is no such node, this returns undef.

<DT><A NAME="getLastChild_"><STRONG><P>getLastChild



( run in 1.243 second using v1.01-cache-2.11-cpan-5b529ec07f3 )