mirror of
https://github.com/macintoshplus/doc-en.git
synced 2026-03-24 08:52:18 +01:00
92 lines
2.0 KiB
XML
92 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="simplexmlelement.getname" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SimpleXMLElement::getName</refname>
|
|
<refpurpose>Gets the name of the XML element</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="SimpleXMLElement">
|
|
<modifier>public</modifier> <type>string</type><methodname>SimpleXMLElement::getName</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Gets the name of the XML element.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
The <literal>getName</literal> method returns as a <type>string</type> the
|
|
name of the XML tag referenced by the SimpleXMLElement object.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<note>
|
|
<para>
|
|
Listed examples may include <literal>example.php</literal>,
|
|
which refers to the XML string found in the first example
|
|
of the <link linkend="simplexml.examples-basic">basic usage</link> guide.
|
|
</para>
|
|
</note>
|
|
<example>
|
|
<title>Get XML element names</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
include 'example.php';
|
|
$sxe = new SimpleXMLElement($xmlstr);
|
|
|
|
echo $sxe->getName() . "\n";
|
|
|
|
foreach ($sxe->children() as $child)
|
|
{
|
|
echo $child->getName() . "\n";
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
movies
|
|
movie
|
|
]]>
|
|
</screen>
|
|
</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:"~/.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
|
|
-->
|