From 80fb006a123666a56b672f59c0ae71a1d3584694 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Sun, 15 Oct 2017 13:29:48 +0000 Subject: [PATCH] Fix bug #75343: Missing code examples for XMLWriter Basically, we use the examples given in php-src. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343246 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/xmlwriter/book.xml | 1 + reference/xmlwriter/examples.xml | 178 +++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 reference/xmlwriter/examples.xml diff --git a/reference/xmlwriter/book.xml b/reference/xmlwriter/book.xml index e2112c742e..7225722969 100644 --- a/reference/xmlwriter/book.xml +++ b/reference/xmlwriter/book.xml @@ -24,6 +24,7 @@ &reference.xmlwriter.setup; &reference.xmlwriter.constants; + &reference.xmlwriter.examples; &reference.xmlwriter.reference; diff --git a/reference/xmlwriter/examples.xml b/reference/xmlwriter/examples.xml new file mode 100644 index 0000000000..593f6c72b1 --- /dev/null +++ b/reference/xmlwriter/examples.xml @@ -0,0 +1,178 @@ + + + + &reftitle.examples; +
+ Creating a simple XML document + + This example shows how to use XMLWriter to create a XML document in memory. + + + + Creating a simple XML document + + + + &example.outputs; + + + + + This is a sample text, ä + + + + +]]> + + + +
+ +
+ Working with XML namespaces + + This example shows how to create namespaced XML elements. + + + + Working with XML namespaces + + + + &example.outputs; + + +book1 +]]> + + + +
+ +
+ Working with the OO API + + This example shows how to work with XMLWriter's object oriented API. + + + + Working with the OO API + +openMemory(); +$xw->startDocument("1.0"); +$xw->startElement("book"); +$xw->text("example"); +$xw->endElement(); +$xw->endDocument(); +echo $xw->outputMemory(); +]]> + + &example.outputs; + + +example +]]> + + + +
+
+ + +