Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate Dom\import_simplexml #1939

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
-->