-
Notifications
You must be signed in to change notification settings - Fork 7.6k
XML helper
Derek Jones edited this page Jul 5, 2012
·
6 revisions
Category:Helper::Community | Category:Helper::XML
Four methods to easily generate XML Download and documentation
Example
$this->load->helper('xml');
$dom = xml_dom();
$book = xml_add_child($dom, 'book');
xml_add_child($book, 'title', 'Hyperion');
$author = xml_add_child($book, 'author', 'Dan Simmons');
xml_add_attribute($author, 'birthdate', '1948-04-04');
xml_print($dom);
generates
<?xml version="1.0"?>
<book>
<title>Hyperion</title>
<author birthdate="1948-04-04">Dan Simmons</author>
</book>
Jérôme Jaglale