2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-11-08 12:10:21 +00:00
|
|
|
<!-- $Revision: 1.7 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 -->
|
2004-04-23 12:14:15 +00:00
|
|
|
<refentry id='function.domelement-has-attribute'>
|
2002-04-15 00:12:54 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>DomElement->has_attribute</refname>
|
|
|
|
<refpurpose>
|
2004-08-29 18:54:42 +00:00
|
|
|
Checks to see if an attribute exists in the current node
|
2002-04-15 00:12:54 +00:00
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
2004-11-01 16:40:58 +00:00
|
|
|
&reftitle.description;
|
2002-04-15 00:12:54 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>DomElement->has_attribute</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2004-08-29 18:54:42 +00:00
|
|
|
This functions checks to see if an attribute named
|
|
|
|
<parameter>name</parameter> exists in the current node.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Testing the existence of an attribute</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();
|
|
|
|
|
2004-11-08 12:10:21 +00:00
|
|
|
$buffer = '<html';
|
2004-08-29 18:54:42 +00:00
|
|
|
if ($root->has_attribute('language')) {
|
|
|
|
$buffer .= 'lang="' . $root->get_attribute('language') . '"';
|
|
|
|
}
|
|
|
|
$buffer .= '>';
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
2002-04-15 00:12:54 +00:00
|
|
|
</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
|
|
|
|
-->
|