XML Helper - generate XML quickly and easily |
[eluser]Jérôme Jaglale[/eluser]
Download and documentation New XML document Code: $dom = xml_dom(); Add "book" element Code: $book = xml_add_child($dom, 'book'); Add "title" to "book" Code: xml_add_child($book, 'title', 'Hyperion'); Add "author" to "book" Code: $author = xml_add_child($book, 'author', 'Dan Simmons'); Add "birthdate" attribute to "author" Code: xml_add_attribute($author, 'birthdate', '1948-04-04'); Display XML document Code: xml_print($dom); Output Code: <?xml version="1.0"?> PHP 5 required. Based on DOMDocument.
[eluser]rezzz[/eluser]
The only issue here is that instead of Code: <?xml version="1.0"?> it's really creating Code: <?xml version="1.0"?> Anyone else notice this? Or better yet have an idea for a fix? Thank you very much! |
Welcome Guest, Not a member yet? Register Sign In |