Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Generate XML with additional Nodes. (ORacle)
Generate XML with additional Nodes. [message #417556] Mon, 10 August 2009 04:32 Go to next message
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?
Re: Generate XML with additional Nodes. [message #417580 is a reply to message #417556] Mon, 10 August 2009 05:53 Go to previous messageGo to next message
minority
Messages: 2
Registered: August 2009
Junior Member
Not sure why this got moved since I am trying to output this via MOD PLSQL?
Re: Generate XML with additional Nodes. [message #419066 is a reply to message #417580] Wed, 19 August 2009 13:36 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
See XMLelement and XMLforest.

http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb13gen.htm#insertedID2

You may need to set the mime type to XML if the output is going to the browser else your javascript (or whatever you're doing with the XML) may not understand it...


owa_util.mime_header('application/xml', FALSE );
owa_util.http_header_close;



Previous Topic: how to test ? (cookie)
Next Topic: File Upload and download into ORacle DB Thro APEX
Goto Forum:
  


Current Time: Thu Mar 28 12:28:50 CDT 2024