Returns a NodeList of all descendant elements with a given
tag name, in the order in which they would be encountered in
a preorder traversal of the Element tree.
<P>Parameters:
<EM>name</EM> The name of the tag to match on. The special value ``*'' matches all tags.
<EM>recurse</EM> Whether it should return only direct child nodes (0) or any descendant that matches the tag name (1). This argument is optional and defaults to 1. It is not part of the DOM spec.</P>
<P>Return Value: A list of matching Element nodes.</P>
<P>NOTE: this implementation does not return a ``live'' NodeList for
getElementsByTagName. See <EM>CAVEATS</EM>.</P>
<P>When this method is called in a list context, it returns a regular perl list
containing the result nodes. E.g.</P>
<PRE>
@list = $node->getElementsByTagName("tag"); # returns a perl list
$nodelist = $node->getElementsByTagName("tag"); # returns a NodeList (object ref.)
for my $elem ($node->getElementsByTagName("tag")) # iterate over the result nodes</PRE>
<P></P></DL>
<P>
<H2><A NAME="additional methods not in the dom spec">Additional methods not in the DOM Spec</A></H2>
Comments in the DOCTYPE section are not kept in the right place. They will become
child nodes of the Document.
<P></P></UL>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P>The Japanese version of this document by Takanori Kawai (Hippo2000)
at <A HREF="http://member.nifty.ne.jp/hippo2000/perltips/xml/dom.htm">http://member.nifty.ne.jp/hippo2000/perltips/xml/dom.htm</A></P>
<P>The DOM Level 1 specification at <A HREF="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</A></P>
<P>The XML spec (Extensible Markup Language 1.0) at <A HREF="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</A></P>
<P>The XML::Parser and XML::Parser::Expat manual pages.</P>
<P>
<HR>
<H1><A NAME="caveats">CAVEATS</A></H1>
<P>The method <A HREF="#item_getElementsByTagName"><CODE>getElementsByTagName()</CODE></A> does not return a ``live'' NodeList.
Whether this is an actual caveat is debatable, but a few people on the
www-dom mailing list seemed to think so. I haven't decided yet. It's a pain
to implement, it slows things down and the benefits seem marginal.
Let me know what you think.</P>
<P>(To subscribe to the www-dom mailing list send an email with the subject
``subscribe'' to <A HREF="mailto:www-dom-request@w3.org.">www-dom-request@w3.org.</A> I only look here occasionally, so don't
send bug reports or suggestions about XML::DOM to this list, send them
to <A HREF="mailto:enno@att.com">enno@att.com</A> instead.)</P>
<P>
<HR>
<H1><A NAME="authors">AUTHORS</A></H1>
<P>Enno Derksen <<EM><A HREF="mailto:enno@att.com">enno@att.com</A></EM>> and Clark Cooper <<EM><A HREF="mailto:coopercl@sch.ge.com">coopercl@sch.ge.com</A></EM>>.
Please send bugs, comments and suggestions to Enno.</P>