mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
92 lines
2.3 KiB
XML
92 lines
2.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: c1f37a6c270aadbbb3da56a3973ffd62197adf2b Maintainer: leonardolara Status: ready --><!-- CREDITS: rafael, fabioluciano, fernandowobeto, leonardolara -->
|
|
<refentry xml:id="simplexmlelement.getname" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SimpleXMLElement::getName</refname>
|
|
<refpurpose>Obtém o nome de um elemento XML</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="SimpleXMLElement">
|
|
<modifier>public</modifier> <type>string</type><methodname>SimpleXMLElement::getName</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Obtém o nome do elemento XML.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
O método <literal>getName</literal> retorna uma <type>string</type> com o nome
|
|
da etiqueta XML referenciada pelo objeto SimpleXMLElement.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<note>
|
|
<para>
|
|
Os exemplos listados podem incluir o arquivo <literal>examples/simplexml-data.php</literal>,
|
|
que referem-se a uma string XML encontrada no primeiro exemplo
|
|
do guia de <link linkend="simplexml.examples-basic">uso básico</link>.
|
|
</para>
|
|
</note>
|
|
<example>
|
|
<title>Obtendo os nomes dos elementos XML</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
include 'examples/simplexml-data.php';
|
|
$sxe = new SimpleXMLElement($xmlstr);
|
|
|
|
echo $sxe->getName() . "\n";
|
|
|
|
foreach ($sxe->children() as $child)
|
|
{
|
|
echo $child->getName() . "\n";
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
filmes
|
|
filme
|
|
]]>
|
|
</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
|
|
-->
|