Back to index

php5  5.3.10
xmlwriter_mem_ns.php
Go to the documentation of this file.
00001 <?php
00002 dl('xmlwriter.so');
00003 
00004 $xw = xmlwriter_open_memory();
00005 xmlwriter_set_indent($xw, 1);
00006 $res = xmlwriter_set_indent_string($xw, ' ');
00007 
00008 xmlwriter_start_document($xw, '1.0', 'UTF-8');
00009 // A first element
00010 xmlwriter_start_element_ns($xw,'prefix', 'books', 'uri');
00011 xmlwriter_start_attribute($xw, 'isbn');
00012 
00013 /* Uncomment this line if you have libxml 2.6.17 or CVS version
00014  after 2005/02/22
00015  earlier versions segfault
00016 */
00017 /*
00018 xmlwriter_start_attribute_ns($xw, 'prefix', 'isbn', 'uri');
00019 xmlwriter_end_attribute($xw);
00020 */
00021 xmlwriter_end_attribute($xw);
00022 
00023 xmlwriter_text($xw, 'book1');
00024 xmlwriter_end_element($xw);
00025 
00026 xmlwriter_end_document($xw);
00027 $out = xmlwriter_output_memory($xw, 0);
00028 
00029 echo $out;
00030