mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
this is the correct function (Davey too)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150683 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0f2fb190c1
commit
ba69aedf2e
1 changed files with 66 additions and 0 deletions
66
reference/simplexml/functions/simplexml-import-dom.xml
Normal file
66
reference/simplexml/functions/simplexml-import-dom.xml
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id='function.simplexml-import-dom'>
|
||||
<refnamediv>
|
||||
<refname>simplexml_import_dom</refname>
|
||||
<refpurpose>
|
||||
Get a <literal>simplexml_element</literal> object from a
|
||||
DOM node.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>object simplexml_element</type><methodname>simplexml_load_dom</methodname>
|
||||
<methodparam><type>domNode</type><parameter>node</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<!-- same with this link -->
|
||||
This function takes a node of a <link linkend="ref.domxml">DOM</link>
|
||||
document and makes it into a SimpleXML node. This new object can
|
||||
then be used as a native SimpleXML element. If any errors occur,
|
||||
it returns &false;.
|
||||
</para>
|
||||
<!-- php5 DOM isn't documented; this depends on it... :| -->
|
||||
<example>
|
||||
<title>Import DOM</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dom = new domDocument;
|
||||
$dom->loadXML('<books><book><title>blah</title></book></books>');
|
||||
if (!$dom) {
|
||||
echo 'Error while parsing the document';
|
||||
exit;
|
||||
}
|
||||
|
||||
$s = simplexml_import_dom($dom);
|
||||
|
||||
echo $s->book[0]->title; // blah
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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:"../../../../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
|
||||
-->
|
Loading…
Reference in a new issue