Generate XML with additional Nodes. [message #417556] |
Mon, 10 August 2009 04:32 |
minority
Messages: 2 Registered: August 2009
|
Junior Member |
|
|
Hi,
I am trying to generate xml which get some of its information from a database table.
The format I am looking for is
<?xml version="1.0" encoding="utf-8" ?>
<result>
</status code= "0" msg="" />
<users>
<user stdId="" password="" type="" firstname="" surname="" email="" />
</users
</result>
The user node is the row from the table and users is the row set.
I needed to add an additional section called status which simply has a code (0 for successful, negative for unsuccessful) and a message if something went wrong.
Now I could do this just output htp.p and changing the header but I was wondering if there is a better way of doing this with the build in xml generators but I am not sure how to add the status node as it is not generated by the select and is rather by the outcome of the select.
Can anyone help with this one I have no idea of how to do this the cleanest way?
|
|
|
|
|