Skip to content

dom: Add stubs generated from php-src stubs #2813

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

Merged
merged 45 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
32ca2e8
dom: Add stubs generated from php-src stubs
Girgias Nov 7, 2023
df5dc75
Clarify string behaviour
nielsdos Nov 7, 2023
c0f51dc
Update DOMChildNode::after docs
nielsdos Nov 7, 2023
27076c7
Add docs for DOMElement::after
nielsdos Nov 7, 2023
4f14d07
Remove doc file for unimplemented, to-be-deprecated method
nielsdos Nov 7, 2023
158b157
Add docs for DOMCharacterData::after
nielsdos Nov 7, 2023
2e12f03
Error section for DOMChildNode::before
nielsdos Nov 7, 2023
757cbe0
Add docs for DOMCharacterData::before
nielsdos Nov 7, 2023
60809e9
ws fixes
nielsdos Nov 7, 2023
560d0a8
fixup: add description for DOMCharacterData::before
nielsdos Nov 7, 2023
74e9965
Add docs for DOMElement::before
nielsdos Nov 7, 2023
0ff00a1
ws fixes
nielsdos Nov 7, 2023
9672505
Fix description
nielsdos Nov 7, 2023
1da363c
Fix description
nielsdos Nov 7, 2023
51515bf
Update errors of DOMParentNode::append
nielsdos Nov 7, 2023
f4087ae
Add some stuff for examples I forgot
nielsdos Nov 7, 2023
7832249
Document DOMElement::append
nielsdos Nov 7, 2023
b03f08b
Add docs for DOMDocument::append
nielsdos Nov 7, 2023
0a2dadf
Fix description
nielsdos Nov 7, 2023
fe30378
DOMParentNode::prepend errors
nielsdos Nov 7, 2023
c6abae2
Add docs for DOMDocument::prepend
nielsdos Nov 7, 2023
8283b84
Document DOMDocumentFragment::prepend
nielsdos Nov 7, 2023
7b254c7
Better description for DOMDocument::{append,prepend} docs
nielsdos Nov 7, 2023
9b894c7
Add docs for DOMElement::prepend
nielsdos Nov 7, 2023
afcbb48
Add docs for DOMDocumentFragment::append
nielsdos Nov 7, 2023
0396cb4
Add docs for DOMCharacterData::remove
nielsdos Nov 7, 2023
6e8d286
Document DOMElement::remove
nielsdos Nov 7, 2023
8c0eeb2
Add docs for DOMDocument::adoptNode
nielsdos Nov 7, 2023
dd3b576
fix ws
nielsdos Nov 7, 2023
079aa77
Add errors for DOMChildNode::replaceWith
nielsdos Nov 8, 2023
1e409d1
Remove misleading statement
nielsdos Nov 8, 2023
9c2ecdc
Update reference/dom/domelement/before.xml
nielsdos Nov 9, 2023
794093a
Fix description of DOMDocumentFragment::append example
nielsdos Nov 9, 2023
b374f4e
Fix ws
nielsdos Nov 9, 2023
eddb1b4
Fix DOMElement::remove description
nielsdos Nov 10, 2023
e343dfb
Add replaceWith docs
nielsdos Nov 10, 2023
fe645c0
Add version data
nielsdos Nov 10, 2023
7f1a00f
Add docs for DOMElement::replaceChildren
nielsdos Nov 10, 2023
eb12597
Add DOMDocument::replaceChildren docs
nielsdos Nov 10, 2023
83d8560
Add errors for DOMParentNode::replaceChildren
nielsdos Nov 10, 2023
3efce36
Update references for DOMDocument::replaceChildren
nielsdos Nov 11, 2023
bfa4f42
Add docs for DOMDocumentFragment::replaceChildren
nielsdos Nov 11, 2023
1b8c289
Iterator docs
nielsdos Nov 11, 2023
92b8c13
Fix mistakes
nielsdos Nov 11, 2023
68a65dc
Review fixes
nielsdos Nov 11, 2023
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
32 changes: 32 additions & 0 deletions language-snippets.ent
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,38 @@ it is inserted with (e.g.) <function xmlns="http://docbook.org/ns/docbook">DOMNo
of the <link linkend="libxml.constants">libxml option constants</link>.
</para>'>

<!ENTITY dom.errors.hierarchy.parent '<varlistentry xmlns="http://docbook.org/ns/docbook">
<term><constant>DOM_HIERARCHY_REQUEST_ERR</constant></term>
<listitem>
<para>
Raised if the parent is of a type that does not allow children of the
type of one of the passed <parameter>nodes</parameter>, or if the node to
put in is one of this node&#39;s ancestors or this node itself.
</para>
</listitem>
</varlistentry>'>

<!ENTITY dom.errors.hierarchy.self '<varlistentry xmlns="http://docbook.org/ns/docbook">
<term><constant>DOM_HIERARCHY_REQUEST_ERR</constant></term>
<listitem>
<para>
Raised if this node is of a type that does not allow children of the
type of one of the passed <parameter>nodes</parameter>, or if the node to
put in is one of this node&#39;s ancestors or this node itself.
</para>
</listitem>
</varlistentry>'>

<!ENTITY dom.errors.wrong_document '<varlistentry xmlns="http://docbook.org/ns/docbook">
<term><constant>DOM_WRONG_DOCUMENT_ERR</constant></term>
<listitem>
<para>
Raised if one of the passed <parameter>nodes</parameter> was created from a different
document than the one that created this node.
</para>
</listitem>
</varlistentry>'>

<!-- FileSystem entities -->
<!ENTITY fs.emits.warning.on.failure '<para xmlns="http://docbook.org/ns/docbook">
Upon failure, an <constant>E_WARNING</constant> is emitted.
Expand Down
81 changes: 81 additions & 0 deletions reference/dom/domcharacterdata/after.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="domcharacterdata.after" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>DOMCharacterData::after</refname>
<refpurpose>Adds nodes after the character data</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMCharacterData">
<modifier>public</modifier> <type>void</type><methodname>DOMCharacterData::after</methodname>
<methodparam rep="repeat"><type class="union"><type>DOMNode</type><type>string</type></type><parameter>nodes</parameter></methodparam>
</methodsynopsis>
<para>
Adds the passed <parameter>nodes</parameter> after the element.
</para>
</refsect1>

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.after')/db:refsect1[@role='parameters'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.after')/db:refsect1[@role='returnvalues'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.after')/db:refsect1[@role='errors'])" />

<refsect1 role="examples">
&reftitle.examples;
<example xml:id="domcharacterdata.after.example.basic">
<title><methodname>DOMCharacterData::after</methodname> example</title>
<para>
Adds nodes after the character data.
</para>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><![CDATA[hello]]]]><![CDATA[></container>");
$cdata = $doc->documentElement->firstChild;

$cdata->after("beautiful", $doc->createElement("world"));

echo $doc->saveXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
<container><![CDATA[hello]]]]><![CDATA[>beautiful<world/></container>
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>DOMChildNode::after</methodname></member>
<member><methodname>DOMCharacterData::before</methodname></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
-->
81 changes: 81 additions & 0 deletions reference/dom/domcharacterdata/before.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="domcharacterdata.before" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>DOMCharacterData::before</refname>
<refpurpose>Adds nodes before the node</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMCharacterData">
<modifier>public</modifier> <type>void</type><methodname>DOMCharacterData::before</methodname>
<methodparam rep="repeat"><type class="union"><type>DOMNode</type><type>string</type></type><parameter>nodes</parameter></methodparam>
</methodsynopsis>
<para>
Adds the passed <parameter>nodes</parameter> before the node.
</para>
</refsect1>

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.before')/db:refsect1[@role='parameters'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.before')/db:refsect1[@role='returnvalues'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.before')/db:refsect1[@role='errors'])" />

<refsect1 role="examples">
&reftitle.examples;
<example xml:id="domcharacterdata.before.example.basic">
<title><methodname>DOMCharacterData::before</methodname> example</title>
<para>
Adds nodes before the character data.
</para>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><![CDATA[world]]]]><![CDATA[></container>");
$cdata = $doc->documentElement->firstChild;

$cdata->before("hello", $doc->createElement("beautiful"));

echo $doc->saveXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
<container>hello<beautiful/><![CDATA[world]]]]><![CDATA[></container>
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>DOMChildNode::before</methodname></member>
<member><methodname>DOMCharacterData::after</methodname></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
-->
83 changes: 83 additions & 0 deletions reference/dom/domcharacterdata/remove.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="domcharacterdata.remove" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>DOMCharacterData::remove</refname>
<refpurpose>Removes the character data</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMCharacterData">
<modifier>public</modifier> <type>void</type><methodname>DOMCharacterData::remove</methodname>
<void/>
</methodsynopsis>
<para>
Removes the character data.
</para>
</refsect1>

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.remove')/db:refsect1[@role='parameters'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.remove')/db:refsect1[@role='returnvalues'])" />

<refsect1 role="examples">
&reftitle.examples;
<example xml:id="domcharacterdata.remove.example.basic">
<title><methodname>DOMCharacterData::remove</methodname> example</title>
<para>
Removes the character data.
</para>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><![CDATA[hello]]]]><![CDATA[><world/></container>");
$cdata = $doc->documentElement->firstChild;

$cdata->remove();

echo $doc->saveXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
<container><world/></container>
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>DOMChildNode::remove</methodname></member>
<member><methodname>DOMCharacterData::after</methodname></member>
<member><methodname>DOMCharacterData::before</methodname></member>
<member><methodname>DOMCharacterData::replaceWith</methodname></member>
<member><methodname>DOMNode::removeChild</methodname></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
-->
83 changes: 83 additions & 0 deletions reference/dom/domcharacterdata/replacewith.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="domcharacterdata.replacewith" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>DOMCharacterData::replaceWith</refname>
<refpurpose>Replaces the character data with new nodes</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMCharacterData">
<modifier>public</modifier> <type>void</type><methodname>DOMCharacterData::replaceWith</methodname>
<methodparam rep="repeat"><type class="union"><type>DOMNode</type><type>string</type></type><parameter>nodes</parameter></methodparam>
</methodsynopsis>
<para>
Replaces the character data with new <parameter>nodes</parameter>.
</para>
</refsect1>

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.replacewith')/db:refsect1[@role='parameters'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.replacewith')/db:refsect1[@role='returnvalues'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domchildnode.replacewith')/db:refsect1[@role='errors'])" />

<refsect1 role="examples">
&reftitle.examples;
<example xml:id="domcharacterdata.replacewith.example.basic">
<title><methodname>DOMCharacterData::replaceWith</methodname> example</title>
<para>
Replaces the character data with new nodes.
</para>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><![CDATA[hello]]]]><![CDATA[></container>");
$cdata = $doc->documentElement->firstChild;

$cdata->replaceWith("beautiful", $doc->createElement("world"));

echo $doc->saveXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
<container>beautiful<world/></container>
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>DOMChildNode::replaceWith</methodname></member>
<member><methodname>DOMCharacterData::after</methodname></member>
<member><methodname>DOMCharacterData::before</methodname></member>
<member><methodname>DOMCharacterData::remove</methodname></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
-->
9 changes: 9 additions & 0 deletions reference/dom/domchildnode/after.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<listitem>
<para>
Nodes to be added after the node.
Strings are automatically converted to text nodes.
</para>
</listitem>
</varlistentry>
Expand All @@ -39,6 +40,14 @@
</para>
</refsect1>

<refsect1 role="errors">
&reftitle.errors;
<variablelist>
&dom.errors.hierarchy.parent;
&dom.errors.wrong_document;
</variablelist>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
Expand Down
Loading