mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 01:12:06 +01:00
190 lines
5.7 KiB
XML
190 lines
5.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 28f0dc949d62c97698ac4a0ca814c3780d8cf318 Maintainer: jpauli Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="simplexmlelement.construct" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SimpleXMLElement::__construct</refname>
|
|
<refpurpose>
|
|
Crée un nouvel objet SimpleXMLElement
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<constructorsynopsis role="SimpleXMLElement">
|
|
<modifier>public</modifier> <methodname>SimpleXMLElement::__construct</methodname>
|
|
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>dataIsURL</parameter><initializer>&false;</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>namespaceOrPrefix</parameter><initializer>""</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>isPrefix</parameter><initializer>&false;</initializer></methodparam>
|
|
</constructorsynopsis>
|
|
<para>
|
|
Crée un nouvel objet <classname>SimpleXMLElement</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Une chaîne de caractères XML bien formée ou le chemin d'accès ou un
|
|
URL pointant à un document XML si <parameter>dataIsURL</parameter>
|
|
vaut &true;.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Optionnellement utilisé pour spécifier des
|
|
<link linkend="libxml.constants">paramètres Libxml additionnels</link>,
|
|
qui affecte la lecture de documents XML. Les options affectant la sortie
|
|
des documents XML (par exemple <constant>LIBXML_NOEMPTYTAG</constant>)
|
|
sont ignorée silencieusement.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Il peut être nécessaire de passer <constant>LIBXML_PARSEHUGE</constant>
|
|
pour pouvoir traiter des nœuds de texte profondément imbriqués ou très volumineux.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>dataIsURL</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Par défaut, <parameter>dataIsURL</parameter> vaut &false;. Utilisez
|
|
&true; pour spécifier que le paramètre <parameter>data</parameter> est
|
|
un chemin d'accès ou un URL pointant à un document XML au lieu d'une
|
|
chaîne de caractères de données.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>namespaceOrPrefix</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Préfixe d'espace de noms ou URI.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>isPrefix</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
&true; si <parameter>namespaceOrPrefix</parameter> est un préfix, &false; sinon.
|
|
Valeur par défaut : &false;.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Produit un message d'erreur de type <constant>E_WARNING</constant>
|
|
pour chaque erreur trouvée dans les données XML et
|
|
lance également une <classname>exception</classname> si les données XML ne peuvent être
|
|
analysées.
|
|
</para>
|
|
<tip>
|
|
<para>
|
|
Utilisez la fonction <function>libxml_use_internal_errors</function>
|
|
pour supprimer toutes les erreurs XML et la fonction
|
|
<function>libxml_get_errors</function> pour les parcourir.
|
|
</para>
|
|
</tip>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<note>
|
|
<para>
|
|
Les exemples listés incluent parfois <literal>example.php</literal>,
|
|
ceci fait référence à la chaine XML du premier exemple de
|
|
<link linkend="simplexml.examples-basic">l'utilisation de base</link>.
|
|
</para>
|
|
</note>
|
|
<example>
|
|
<title>Crée un objet SimpleXMLElement</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
include 'example.php';
|
|
|
|
$sxe = new SimpleXMLElement($xmlstr);
|
|
echo $sxe->movie[0]->title;
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
PHP: Behind the Parser
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Crée un objet SimpleXMLElement à partir d'un URL</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$sxe = new SimpleXMLElement('http://example.org/document.xml', 0, true);
|
|
echo $sxe->asXML();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><xref linkend="simplexml.examples-basic"/></member>
|
|
<member><function>simplexml_load_string</function></member>
|
|
<member><function>simplexml_load_file</function></member>
|
|
<member><xref linkend="simplexml.examples-errors"/></member>
|
|
<member><function>libxml_use_internal_errors</function></member>
|
|
<member><function>libxml_set_streams_context</function></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
|
|
-->
|