<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="domdocument.getelementsbytagname" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>DOMDocument::getElementsByTagName</refname>
  <refpurpose>Searches for all elements with given local tag name</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="DOMDocument">
   <modifier>public</modifier> <type>DOMNodeList</type><methodname>DOMDocument::getElementsByTagName</methodname>
   <methodparam><type>string</type><parameter>qualifiedName</parameter></methodparam>
  </methodsynopsis>
  <para>
   This function returns a new instance of class
   <classname>DOMNodeList</classname> containing all the elements with a given
   local tag name.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>qualifiedName</parameter></term>
     <listitem>
      <para>
       The local name (without namespace) of the tag to match on. The special value <literal>*</literal>
       matches all tags. 
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   A new <classname>DOMNodeList</classname> object containing all the matched 
   elements.
  </para>
 </refsect1>
 <refsect1 role="examples"><!-- {{{ -->
  &reftitle.examples;
  <para>
   <example xml:id="domdocument.getelementsbytagname.example.basic"><!-- {{{ -->
    <title>Basic Usage Example</title>
    <programlisting role="php">
<![CDATA[
<?php
$xml = <<< XML
<?xml version="1.0" encoding="utf-8"?>
<books>
 <book>Patterns of Enterprise Application Architecture</book>
 <book>Design Patterns: Elements of Reusable Software Design</book>
 <book>Clean Code</book>
</books>
XML;

$dom = new DOMDocument;
$dom->loadXML($xml);
$books = $dom->getElementsByTagName('book');
foreach ($books as $book) {
    echo $book->nodeValue, PHP_EOL;
}
?>
]]>
    </programlisting>
    &example.outputs;
    <screen>
<![CDATA[
Patterns of Enterprise Application Architecture
Design Patterns: Elements of Reusable Software Design
Clean Code
]]>
    </screen>
   </example><!-- }}} -->
  </para>
 </refsect1><!-- }}} -->
 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><methodname>DOMDocument::getElementsByTagNameNS</methodname></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
