note 71264 deleted from ref.xmlwriter by danbrown

From: Date: Thu, 19 Feb 2009 13:56:44 +0000
Subject: note 71264 deleted from ref.xmlwriter by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-150855@lists.php.net to get a copy of this message
Note Submitter: robajz [a] robajz [.] info ---- Hi, There already is a class xmlWriter, although it is not documented. This is a rewrite of the example from [http://cz2.php.net/manual/en/ref.xmlwriter.php#64484 Carlos Averett] and works well on my php 5.1.6 <?php $xw = new xmlWriter(); $xw->openMemory(); $xw->startDocument('1.0','UTF-8'); $xw->startDtd('html','-//WAPFORUM//DTD XHTML Mobile 1.0//EN', 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'); $xw->endDtd(); $xw->startElement ('html'); // <html> $xw->writeAttribute( 'xmlns', 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'); $xw->writeAttribute( 'xm:lang', 'en'); $xw->startElement('head'); // <head> $xw->writeElement ('title', 'Test WAP Document'); $xw->endElement(); // </head> $xw->startElement('body'); // <body> $xw->startElement('ol'); // <ol> $xw->writeElement ('li', 'One Item &amp; <sss <ss />></ss>'); $xw->writeElement ('li', 'Another Item'); $xw->writeElement ('li', 'Another Item'); $xw->endElement(); // </ol> $xw->endElement(); // </body> $xw->endElement(); // </html> $xw->endDtd(); print $xw->outputMemory(true); ?>

« previous php.notes (#150855) next »