php-doc-en/reference/domxml/functions/DomElement-get-attribute-node.xml
2004-08-29 18:54:42 +00:00

71 lines
1.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/domxml.xml, last change in rev 1.27 -->
<refentry id='function.domelement-get-attribute-node'>
<refnamediv>
<refname>DomElement->get_attribute_node</refname>
<refpurpose>
Returns the node of the given attribute
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>object</type><methodname>DomElement->get_attribute_node</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
<para>
Returns the node of the attribute named <parameter>name</parameter>
in the current element. The <parameter>name</parameter> parameter is
case sensitive.
</para>
<para>
If no attribute with given name is found, &false; is returned.
</para>
<para>
<example>
<title>Getting an attribute node</title>
<programlisting role="php">
<![CDATA[
<?php
include("example.inc");
if (!$dom = domxml_open_mem($xmlstr)) {
echo "Error while parsing the document\n";
exit;
}
$root = $dom->document_element();
if ($attribute = $root->get_attribute_node('language')) {
echo 'Language is: ' . $attribute->value() . "\n";
}
?>
]]>
</programlisting>
</example>
</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:"../../../../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
-->