note 54977 added to ref.simplexml
| From: | scottprive at tgeemail dot com | Date: | Thu, 21 Jul 2005 11:45:22 +0000 |
| Subject: | note 54977 added to ref.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92250@lists.php.net to get a copy of this message | ||
Is it me, or do most of the XML tutorials for PHP assume you are <em>parsing</em> XML?
What about generating XML from scratch?
It seems like this should be common in PHP, especially since current MySQL does not return native
XML query results (unless you shell out, and that's not an option).
It seems the focus of SimpleXML documentation (and web tutorials) deal with PHP as a consumer of
XML... not a producer.
The context here is I am transitioning to PHP from Perl, and wish to generate well formed XML from
MySQL tables. I'm capable of iterating over the MySQL data myself and generate the XML, but
this seems like reinventing the wheel. I am stubborn and I want to do this without hand-building a
template using plain text.
Now, I have found few PHP5 tutorials for <em>adding nodes</em> to an existing XML file
(or string), but again that's 'cheating' (shortcut) since the root node was not
constructed with SimpleXML function(s).
----
Manual Page -- http://www.php.net/manual/en/ref.simplexml.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54977
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54977&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54977&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54977&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54977&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54977&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54977&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54977&report=yes
Search -- http://master.php.net/manage/user-notes.php