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 +]]> + + + +
+
+ + +