Skip to content

Commit

Permalink
Translate Dom\import_simplexml (#1939)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan2Shrek authored Dec 11, 2024
1 parent a60b02f commit e4e1510
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions reference/dom/functions/dom-ns-import-simplexml.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 54935fc4b239f498040cc1fa3f7e6eef8f048671 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.dom-ns-import-simplexml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>Dom\import_simplexml</refname>
<refpurpose>
Renvoie un objet <classname>Dom\Attr</classname> ou <classname>Dom\Element</classname> à partir d'un
objet <classname>SimpleXMLElement</classname>
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>Dom\Attr</type><type>Dom\Element</type></type><methodname>Dom\import_simplexml</methodname>
<methodparam><type>object</type><parameter>node</parameter></methodparam>
</methodsynopsis>
<simpara>
Cette fonction prend l'attribut ou l'élément <parameter>node</parameter> donné (une instance de
<classname>SimpleXMLElement</classname>) et crée
un nœud <classname>Dom\Attr</classname> ou <classname>Dom\Element</classname>, respectivement.
Le nouveau <classname>Dom\Node</classname> fait référence au même nœud XML sous-jacent
que le <classname>SimpleXMLElement</classname>.
</simpara>
</refsect1>

<refsect1 role="parameters">
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('function.dom-import-simplexml')/db:refsect1[@role='parameters']/*)">
<xi:fallback/>
</xi:include>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Le <classname>Dom\Attr</classname> ou <classname>Dom\Element</classname>.
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Importe SimpleXML dans DOM et modifie SimpleXML via DOM</title>
<simpara>
La gestion des erreurs est omise pour la brièveté.
</simpara>
<programlisting role="php">
<![CDATA[
<?php
$sxe = simplexml_load_string('<books><book><title>blah</title></book></books>');
$elt = Dom\import_simplexml($sxe);
$elt->setAttribute("foo", "bar");
echo $sxe->asXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
<books foo="bar"><book><title>blah</title></book></books>
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>simplexml_import_dom</function></member>
</simplelist>
</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
-->

0 comments on commit e4e1510

Please sign in to comment.