Generate xml form retrieved query...

HI,
To start with am working to generate xml programatically for the first time ,I'd appreciate if anybody could help me out on the following...
I have some records in the database and am supposed to generate an xml file from the retrieved query and store the xml in a specific location.
iam using DOM parser to write the xml file.
Please let me know as of what is the classpath that i should set and what i need to compile my class
How can i generate the required xml file.
Thanks in advance...
Great day ahead....

hi thans for the code and after writing the folloing code am getting the erros as
I had set my classpath to Jdom.jar and compiled and got this error...can u let me know the classpath that i have to set????
i think it is the problem with only classpath( if am thinking right)......
location: class com.Fortune.adminusers.AdminUsers
Element root = new Element("top");
^
src\Admin\AdminUsers.java:48: cannot resolve symbol
symbol : class Element
location: class com.Fortune.adminusers.AdminUsers
Element root = new Element("top");
^
src\Admin\AdminUsers.java:53: cannot resolve symbol
symbol : class Element
location: class com.Fortune.adminusers.AdminUsers
Element next = new Element("next");
^
src\Admin\AdminUsers.java:53: cannot resolve symbol
symbol : class Element
location: class com.Fortune.adminusers.AdminUsers
Element next = new Element("next");
^
src\Admin\AdminUsers.java:56: cannot resolve symbol
symbol : variable Format
location: class com.Fortune.adminusers.AdminUsers
XMLOutputter writer = new XMLOutputter(Format.getPrettyFormat());
^
------------------------Code Sample-----------------------------------------------
import java.sql.*;
import <app packages>
import org.jdom.Document;
import org.jdom.JDOMException;
import org.jdom.input.DOMBuilder;
import org.jdom.output.XMLOutputter;
public class <XXXXXXX>
private DBC dbConnector = null;
public Users getUsers(String loginid)
          Users user = null;
          ResultSet rs_users=null;
          Statement get_users=null;
          Connection conn=null;
               try
                    String query_select_user = "";
                    query_select_user = <Database Query>
                    conn = dbConnector.getConnection();
                    get_users = conn.createStatement();
                    rs_users = get_users.executeQuery(query_select_user);
                    if((rs_users != null) && (rs_users.next()))
                         do
                              user = new Users();
                              user.setMainMod(rs_users.getString("MainModuleId"));
                              user.setModDesc(rs_users.getString("ModuleDesc"));
                              String top = user.getMainMod();
                              Element root = new Element("top");
                              root.setText(top);
                              String child = user.getModDesc();
                              System.out.println(top);
                              System.out.println(child);
                              Element next = new Element("next");
                              next.setText(child);
                              Document doc = new Document(root);
                              XMLOutputter writer = new XMLOutputter(Format.getPrettyFormat());
                              OutputStream out = new FileOutputStream("1.xml");
                              writer.output(doc, out);
                              writer.output(doc, System.out);
                         }while(rs_users.next());
               }catch (Exception e) {e.printStackTrace();}
                    finally
                         try
                              if ( rs_users != null)
                              rs_users.close();
                              if(get_users!=null)
                              get_users.close();
                              if(conn!=null)
                              conn.close();
                         }catch (SQLException se){}
     return user;
}

Similar Messages

  • How to generate XML from SQL query

    possible ways to generate XML from SQL qury.
    i want to generate XML of following query. "Select * from emp,dep wher emp.deptno=dept.deptno"

    Hello.
    Can you try:
    SQL> set pages 0
    SQL> set linesize 150
    SQL> set long 9999999
    SQL> set head off
    SQL> select dbms_xmlgen.getxml('Select * from emp,dep wher emp.deptno=dept.deptno') from dual;
    It works fine for me.
    Octavio

  • Use of Java Code within the generated XML Forms Stylesheets

    Hello,
    is the use of Java-Code possible with the XSL-Files generated by XML-Forms, as possible in standard XSLs? I know that this would mean a modification.
    kind regards,
    Marco

    Hi Marco,
    I "executed" some java code within XSLs file. I have quoted the word executed because I didn't really run java code, but I used a simply trick that I describe you below.
    Into your XSLs put an iframe which is hided (it has an height of 0 pixel). As src of the iframe put the address of a portal component which execute your code (in my case calculate some PCD URL of some pages into a defined role). As result of component execution, I use the response.write method in order to execute some jscript code, which is able to interact with the HTML generated by XSLs files, for example in my case response.write put the PCD URL into a drop down list placed into the "edit" form.
    This works fine. I don't know if is suitable also for your case, anyway could be a hint, but pay attention to Roland's recommendations.
    Ciao
    Roberto

  • XML forms and querying Active Directory?

    Hi All
    I am new to xml forms development and I am looking to have a connection to AD, so that when an form it being created you are able to select the active directory groups it relates to.
    Unfortunately I have NO IDEA how this is done? Any ideas?

    Michael,
    Oracle Forms does support Single Sign-On (SSO). Take a look at Oracle Containers for J2EE Security Guide: OC4J Java Single Sing-On. Also take a look at the Oracle Forms 10g Sample Code and scroll to the SSO demo under the Forms Services Demo section. There are also, numerous other documents available via Google. ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Generating XML from form fmb forms

    I am new to XML. I have some questions about generating XML forms from fmb forms. if possible I need some hints

    If you download the latest XSQL Servlet (release 0.9.8.6) it features several things that would help make this easy:
    (1) If you just want to insert the
    posted HTML form parameters into
    a table or view, you can use
    a new tag called <xsql:insert-request>
    This materializes a "request" document
    from the HTML Form parameters and
    allows you to specify an XSLT
    transformation to transform the request
    document into a format suitable for
    automatic insert into the table you
    provide. (See the release notes for
    details).
    (2) You can write your own custom
    action handler in Java that can
    get access to the materialized
    XML document representing the
    HTML form parameters by calling:
    getPageRequest().getPostedDocument()
    in your custom action handler.

  • Generating xml from oracle table

    Hi,
    I want to generate xml form an oracle table and using sql developer, oracle express 10g, xdk forler is also unzipped under oracle express folder, still getting following error: code used
    var g_clob clob;
    declare
         l_ctx  dbms_xmlquery.ctxHandle;
         l_clob clob;
        begin
          l_ctx := dbms_xmlquery.newContext('select * from scott.emp');
          dbms_lob.createtemporary(:g_clob,true,dbms_lob.session);
          :g_clob := dbms_xmlquery.getXml(l_ctx);
        end;
        /ORA-06550: line 2, column 14:
    PLS-00201: identifier 'DBMS_XMLQUERY.CTXHANDLE' must be declared
    Thanks in advance

    Hi,
    DBMS_XMLQUERY is a wrapper for methods from the Java class "oracle.xml.sql.query.OracleXMLStaticQuery".
    The problem is that Oracle 10g XE doesn't have a JVM, so you can't use this package.
    Use DBMS_XMLGEN instead, it provides similar functionalities and is more efficient (C-based) :
    SQL> var g_clob clob
    SQL> DECLARE
      2    l_ctx    dbms_xmlgen.ctxHandle;
      3  BEGIN
      4    l_ctx := dbms_xmlgen.newContext('select * from scott.emp');
      5    :g_clob := dbms_xmlgen.getXML(l_ctx);
      6    dbms_xmlgen.closeContext(l_ctx);
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    SQL> set long 5000
    SQL> set pages 1000
    SQL> print g_clob
    G_CLOB
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7902</MGR>
      <HIREDATE>17/12/80</HIREDATE>
      <SAL>800</SAL>
      <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>20/02/81</HIREDATE>
      <SAL>1600</SAL>
      <COMM>300</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>22/02/81</HIREDATE>
      <SAL>1250</SAL>
      <COMM>500</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7566</EMPNO>
      <ENAME>JONES</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>02/04/81</HIREDATE>
      <SAL>2975</SAL>
      <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7654</EMPNO>
      <ENAME>MARTIN</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>28/09/81</HIREDATE>
      <SAL>1250</SAL>
      <COMM>1400</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7698</EMPNO>
      <ENAME>BLAKE</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>01/05/81</HIREDATE>
      <SAL>2850</SAL>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09/06/81</HIREDATE>
      <SAL>2450</SAL>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17/11/81</HIREDATE>
      <SAL>5000</SAL>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7844</EMPNO>
      <ENAME>TURNER</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>08/09/81</HIREDATE>
      <SAL>1500</SAL>
      <COMM>0</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7900</EMPNO>
      <ENAME>JAMES</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7698</MGR>
      <HIREDATE>03/12/81</HIREDATE>
      <SAL>950</SAL>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7902</EMPNO>
      <ENAME>FORD</ENAME>
      <JOB>ANALYST</JOB>
      <MGR>7566</MGR>
      <HIREDATE>03/12/81</HIREDATE>
      <SAL>3000</SAL>
      <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7934</EMPNO>
      <ENAME>MILLER</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7782</MGR>
      <HIREDATE>23/01/82</HIREDATE>
      <SAL>1300</SAL>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>Or, using SQL/XML functions :
    SELECT XMLElement("ROWSET",
             XMLAgg(
               XMLElement("ROW",
                 XMLForest(empno, ename, job, mgr, hiredate, sal, comm, deptno)
           ).getClobVal()
    FROM scott.emp
    ;

  • "Feedback" problem in XML Forms

    Hi Forum,
                    I have created an xml form (for creating and showing articles similar to News) using form builder. In the "show" form i placed a button and assigned the action "Details" to it (So when it is clicked takes to Details Screen). Created a KM Navigational iview that uses my custom layout "myNewsExplorer" in which i have removed some of the command groups like properties, permissions etc.. as i dont want the end users to see these options in the details screen. But to my surprise the feed back button's action is not using myNewsExplorer layout and it is directly pointing to AdminExplorer and giving me all the unwanted command groups and commands. How can i make the feed back option to point to my custom layout set.
                     I dont want to use "give feedback", "feedback" commands at the resource renderer level, since they dont provide facility to open the given feed backs and read (They only allow to give feed back and just list the given feedbacks).
                     Now i am trying to use two feed back buttons in the show form, the first one with action - Details (for admin). I want to get this button to only specified admin user and not to end users. How can i capture the current logged in user from the xml form and put a condition that this button should only appear to admin user ?
                     Please share some ideas. I need to deliver this functionality immediately (working at client place).         (Points Assured)
    Thanks
    Ramesh Kotagiri

    Hi,
    Your requirement is to Browse from different km folders based on some dropdown selection in xml form.  is n't?
    We also face similar kind of problem, in which we have to enable/disable one fields depends on value of another fields.
    As i know it is not possible in XML Form. We acheived our requirement by adding some javascript in generated xml form.  Since it is not a recommended solution i am not suggesting to do so.
    Please ask suggestion from others also.
    Regards
    Baby

  • How to generate a report from data entered by users in XML forms

    hi,
      i have a requirement to generate report from xml forms which are created using XML forms Builder and stored in Km folders. management want to see in a single report all the activities of all the users in the xml form in such a way that one row in the report presents data blongs to each user.  i have no idea regarding this.
    can any one help me in detail.
    Thanking you in adavance
    sajeer

    Hi Sajeer,
    You have given quite few information what data should be collected / showed in detail. Anyhow, it sounds as if you want to provide data which isn't provided within the standard portal so far (see http://help.sap.com/saphelp_nw2004s/helpdata/en/07/dad131443b314988eeece94506f861/frameset.htm for a list of existing reports).
    For your needs you probably have to develop a repository service which reacts on content / property changes and then you would have to log these changes somewhere, for example in a DB. On the other side, you then could implement a report iView which accesses this data and displays it as whished.
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • Generate or import xml form content into portal

    Hi, we have a content repository type "fsdb" in wich we have created a xml form to publish content.
    Now we need to develope a program or process that read information from a database and generate the xml content in the repository,
    How can we generate the xml form content?
    I have tried coping and existing element of the repository from the file system and changing the data but something more is needed, I think that is necesary to update the database.
    Any suggestion is welcomed.
    Thanks in advanced.
    Regards.

    Hi,
    I differred my theme, cause I also had to use and transport the xml-forms into another portal. For this reason I have to use xml-forms. I've found out how to modify the the content/text of an subscription-mail.
    Is there any way to define different layouts for subscription-mails? (Maybe depending on the folder.)
    Is there any way to send an e-Mail to a specified address (including the content) when saving the xml-form?
    Greets
    Janko

  • Query with bind var created under apex to generate xml data

    Hi all;
    BiP: 10.1.3.4
    Apex: 4
    DB 10G
    Goal: want to generate a report by running a query with bind variables under apex.
    problem: when attempted to create a query under shared components in apex, at the downloading xml data stage, I always get "no data found" eror. Thus I can't save xml data for further report work. This only occurs when bind var involved. I have tticked "incl. session variables" and added the item but to no avail.
    Does anyone know how to do this and get the xml data to recive the bind variable ?
    Thanks.
    lulu

    To get the xml data, sql query has to return something. Why the sql is not returning anything can be better investigated outside the BI Publisher with special tool like SQL Developer or TOAD. There you have to run your query and make it working. One of the steps would be to try the sql without the parameter, see what data it brings back and go from there. One of possibilities why the parameter kills the output may be the NULL values involved, but you need to try the sql outside the BIP first.

  • Generating XML for query resultset

    hi,
    how to generate xml file for a query,,in sql server we use:
    select * from emp
    for auto xml do;
    it generates xml file for the result set of this query,,how to do it in oracle??
    regards
    umar

    Use dbms_xmlgen.getxml.
    Tom kyte has some good stuff at his site.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:4444542233908715904::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:16020931845088,

  • Query on XML Form Builder

    Hi,
    I have an news application to be developed in XML Form Builder. I am creating News Author part of it. It has an Date field where i have to do an validation like the user cannot enter date less than the current date. I can perform simple data type validation through  the form builder. Can I perform the above said validation in XML form builder or is there an work around in getting this done.
    Thanks in advance
    Regards,
    Ganesh

    hi,
    I opened the schema of  this particular application in the KM. I edited the tag for the particular application and included my restriction, so that the validation could occur. I did the same for string field in restricting the no of characters and found to be sucessful. But the same doesnt work for date field...
    The tag goes like this
    <element name="ExpiryDate" default="" minOccurs="1" maxOccurs="1" type="date" ns="default"><simpleType><restriction base="date"><minInclusive value="01/01/2009"/></restriction></simpleType></element>
    Usually you dont have this restriction.....I have added the tag in bold.....But still validation doesnt occur.....What is the format in which date is stored????
    The same worked for string field as shown below. I can restrict the entry to just 5 characters depending upon the restriction, I make in the schema.....
    element name="Courtesy" default="" minOccurs="1" maxOccurs="1" type="string" ns="default"><simpleType><restriction base="string"><maxLength value="5"/></restriction></simpleType></element>
    How can i apply the same to date field???
    Any inputs from Consultants worked in Form Builder??
    Thanks & Regards,
    Ganesh N

  • Error while generating XML file from rdf report.

    Hi All,
    we are having a rdf report that displays images retrieved from data base. I need to convert this report to xml report(using rtf template).
    when i tried to run the report after changing the output of the concurrent program to "XML", i am getting the below error.
    REP-1295: Data format of column 'PK1_VALUE' is unsupported.
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-1295: Data format of column 'PK1_VALUE' is unsupported.
    images are stored in BLOB type columns.
    Can anyone help me on this..
    thanks
    gtungala

    Hi Hussein,
    Thank you for the reply.. i was sure that i will get correct response with in a day..
    you people made this as one of the best technical forums..no doubt in that..
    need some more help from you...!
    The metalink docs say that it is not possible to generate xml file as the image is BLOB.
    Can you please tell me any solution for developing xml template(rtf) which can display images that are stored in data base BLOB columns. Even PL/SQL script will do.. I have tried with changing the BLOB to CLOB in rdf query(by calling a function that converts BLOB to CLOB). it didnt help.
    thanks in advance..
    gtungala

  • HELP in Generating XML(PLz help its urgent)

    Hi,I need to generate XML FIle.Since i m new to XML.
    I had toregister the valid schema in my DB now i want to generate the XML file and with the refernce to this schema that xml file should be validated one against that schema.
    things i hav done till now
    ->i hav registered the scehma
    and the sample XML file provided by client
    <?xml version="1.0"?>
    <MEDMLDATA xmlns="PhaseForward-MedML-Inform4">
    <!-- Insert Trial/Study Information -->
    <STUDYVERSION UUID="id"
    STUDYNAME="name"
    VERSIONDESCRIPTION="text" />
    <!-- Insert Site Personnel Information -->
    <USER USERNAME="mmeyer"
    USERTYPE = "SITE"
    ACTIVESTATE = "TRUE"
    DELETESTATE = "FALSE"
    FIRSTNAME = "Marianne"
    LASTNAME = "Meyer"
    DISPLAYNAME = "Marianne Meyer"
    TITLE = ""
    HOMESCREENURL = "./Custom/HomeDefault.html"
    PHONE = "(555) 555-1212"
    FAX = "(555) 555-1212"
    ALTPHONE = ""
    EMAIL = "[email protected]"
    ADDRESS = ""
    ADDRESS2 = ""
    CITY = ""
    STATE = ""
    ZIPCODE = ""
    COUNTRY = ""
    BEEPER = ""
    USERMUSTRESETPASSWORD = "FALSE"
    DESCRIPTION = ""
    PASSWORD="changeme"/>
    <USER USERNAME="john"
    USERTYPE = "SITE"
    ACTIVESTATE = "TRUE"
    DELETESTATE = "FALSE"
    FIRSTNAME = "John"
    LASTNAME = "Meyer"
    DISPLAYNAME = "John Meyer"
    TITLE = ""
    HOMESCREENURL = "./Custom/HomeDefault.html"
    PHONE = "(555) 555-1212"
    FAX = "(555) 555-1212"
    ALTPHONE = ""
    EMAIL = "[email protected]"
    ADDRESS = ""
    ADDRESS2 = ""
    CITY = ""
    STATE = ""
    ZIPCODE = ""
    COUNTRY = ""
    BEEPER = ""
    USERMUSTRESETPASSWORD = "FALSE"
    DESCRIPTION = ""
    PASSWORD="changeme"/>
    <!-- Insert Site Information -->
    <SITE NAME=     "(01) Massachusetts General Hospital" MNEMONIC="01"
    ADDRESS = "1 Main Street"
    ADDRESS2 = ""
    CITY = "Boston"
    STATE = "MA"
    ZIPCODE = ""
    COUNTRY = "USA"
    PHONE = "(555) 555-1212"
    ALTPHONE = ""
    FAX = ""
    EMAIL = ""
    TIMEZONE="(GMT-05:00) Eastern Time (US & Canada)"
    SITEDATEFORMAT = "MONTH_DAY_YEAR"
    STARTDATE = "April 1, 2005">
    </SITE>
    <SITE NAME=     "(02) Boston General Hospital" MNEMONIC="01"
    ADDRESS = "1 Main Street"
    ADDRESS2 = ""
    CITY = "Boston"
    STATE = "MA"
    ZIPCODE = ""
    COUNTRY = "USA"
    PHONE = "(555) 555-1212"
    ALTPHONE = ""
    FAX = ""
    EMAIL = ""
    TIMEZONE="(GMT-05:00) Eastern Time (US & Canada)"
    SITEDATEFORMAT = "MONTH_DAY_YEAR"
    STARTDATE = "April 1, 2005">
    </SITE>
    <!-- Insert SITE and User Mapping Information -->
    <SITEGROUP SITENAME="(01) Massachusetts General Hospital">
    <USERREF USERNAME="mmeyer"/>
    </SITEGROUP>
    <SITEGROUP SITENAME="(02) Boston General Hospital">
    <USERREF USERNAME="John"/>
    </SITEGROUP>
    <!-- Insert User ROle Information -->
    <RIGHTSGROUP GROUPNAME="CRA">
    <!-- Insert Rights -->
    <RIGHTREF RIGHT="Print"/>
    <RIGHTREF RIGHT="Monitor"/>
    <RIGHTREF RIGHT="Canned Reports"/>
    <RIGHTREF RIGHT="View CRF"/>
    <RIGHTREF RIGHT="View Signature History for CRF"/>
    <RIGHTREF RIGHT="View Signature History for CRB"/>
    <RIGHTREF RIGHT="Data Export Listings"/>
    <RIGHTREF RIGHT="Freeze a CRF"/>
    <RIGHTREF RIGHT="Unfreeze a CRF"/>
    <RIGHTREF RIGHT="Mark and Unmark a CRF as SVed"/>
    <RIGHTREF RIGHT="Freeze a CRB"/>
    <RIGHTREF RIGHT="Unfreeze a CRB"/>
    <RIGHTREF RIGHT="Change Query State from Candidate to Open"/>
    <RIGHTREF RIGHT="Change Query State from Candidate to Deleted"/>
    <RIGHTREF RIGHT="Change Query State from Answered to Closed"/>
    <RIGHTREF RIGHT="Change Query State from Open to Closed"/>
    <RIGHTREF RIGHT="Change Query State from Reissued Candidate to Closed"/>
    <RIGHTREF RIGHT="Enter Query in Candidate State"/>
    <RIGHTREF RIGHT="Enter Query in Open State"/>
    <RIGHTREF RIGHT="Re-issue Query in Candidate State"/>
    <RIGHTREF RIGHT="Re-issue Query in Open State"/>
    <RIGHTREF RIGHT="Navigate by Visit"/>
    <RIGHTREF RIGHT="Navigate by Form"/>
    <RIGHTREF RIGHT="Reordering of Patients"/>
    <!-- Insert Users for role -->
    <USERREF USERNAME="mmeyer"/>
    <USERREF USERNAME="john"/>
    </RIGHTSGROUP>
    </MEDMLDATA>
    now i need to generate XML based on the above SAMple XML file,can anybody tell me how to generate XML file based on this..and after generating it should be validated against the registerd schema.

    Maybe I am wrong, but my understanding is that you have to generate the xml from your data source (usually tables) and then you validate it against your schema. I don't know if the schema has a magic that can generate the xml for you. Is that correct? Anyone please? At the beginning, I asked a .Net guy if his tool could "generate" an xml simply using the schema (I thought so). But he said they had to use many style sheets to create the xml.
    Ben

  • Generating XML through PL/SQL

    Hi everyone,
    I got a new task at work, and my task is to generate XML through PL/SQL.
    I am using Oracle 11g database, and SQL Developer 3.0.
    The purpose of this procedure is to upload xml file to a queue, so my BPEL process can access the queue and do what it does.
    This is my first time writing a procedure that generates xml so bear with me.
    Below is a sample of the xml file I received. I need to generate xml file below through PL/SQL. All the information in xml file will need to be retrieved from the database.
    I need your help to start working on this procedure. Your help is very much appreciated.
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body xmlns:ns1="http://www.ussc.gov/soa/casefile/event/types">
          <caseFileUploadEvent xmlns:xsi="http://www.w3XX.org/2001/XMLSchema-instance"
                               xsi:schemaLocation="http://www.XXXX.gov/soa/casefile/event/types ../xsd/Case_META.xsd"
                               xmlns="http://www.XXXX.gov/soa/casefile/event/types">
             <taskEvent>SUBMIT</taskEvent>
             <defendentDetails>
                <sentensingDate>2008-11-10-05:00</sentensingDate>
                <personDetails>
                   <personNameDetails>
                      <firstName>FIRSTNAME</firstName>
                      <middleName>B</middleName>
                      <lastName>LASTNAME</lastName>
                   </personNameDetails>
                   <dateOfBirth>1969-09-23-04:00</dateOfBirth>
                </personDetails>
             </defendentDetails>
             <documentStatusDetails>
                <otherStatus>
                   <intCode>61</intCode>
                   <description>Other documents included</description>
                </otherStatus>
             </documentStatusDetails>
             <uploadOtherDetails>
                <submissionId>427000447</submissionId>               // NOTE: SUBMISSIONID WILL BE PASSED IN THROUGH THE PROCEDURE TO QUERY ALL THE INFORMATION NEEDED FOR THE XML FILE
                <submissionSessionId>401622</submissionSessionId>
                <submissionMethod>
                   <intCode>1</intCode>
                   <description>WebApplication</description>
                </submissionMethod>
                <submissionReason>
                   <intCode>1</intCode>
                   <description>InitialSubmission</description>
                </submissionReason>
                <district>
                   <intCode>99</intCode>
                   <description>Test District</description>
                </district>
                <caseFileType>
                   <intCode>10</intCode>
                   <description>Individual - Original</description>
                </caseFileType>
                <primaryDocketInfo>
                   <yearYY>5</yearYY>
                   <id>55555</id>
                   <defendentNumber>555</defendentNumber>
                </primaryDocketInfo>
                <PACTSId>55555555</PACTSId>
                <AOJudgeId>
                   <intCode>2512</intCode>
                   <description>FABER, DAVID, A.</description>
                </AOJudgeId>
                <missingCasefile>false</missingCasefile>
                <creator>
                   <firstName>will</firstName>
                   <lastName>smith</lastName>
                   <email>[email protected]</email>
                   <actionDate>2005-09-07T09:48:09.811-04:00</actionDate>
                </creator>
                <lastModifier>
                   <firstName>john</firstName>
                   <lastName>doe</lastName>
                   <email>[email protected]</email>
                   <actionDate>2006-10-03T08:51:21.5-04:00</actionDate>
                </lastModifier>
             </uploadOtherDetails>
          </caseFileUploadEvent>
       </soap:Body>
    </soap:Envelope>procedure below
    procedure upload_process(submission_id number) as
    begin
         -- retrieve information from database based on submission_id (passed in)
         -- generate XML
         -- send xml to queue
    end upload_process;Thanks

    Rooney,
    First of all, I would use Oracle package UTL_DBWS to handle web service calls.
    But if you choose to do all the work yourself to call web service, this is one of the options:
    Since the size of your xml soap request is about 4k, you can just use pl/sql varchar2 variable to construct your xml.
    Example:
    cSoapRequest VARCHAR2(5000);
    BEGIN
    cSoapRequest := '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                             <soap:Body xmlns:ns1="http://www.ussc.gov/soa/casefile/event/types">
                             <caseFileUploadEvent xmlns:xsi="http://www.w3XX.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://www.XXXX.gov/soa/casefile/event/types ../xsd/Case_META.xsd"
                             xmlns="http://www.XXXX.gov/soa/casefile/event/types">';
    FOR recRow IN <your cursor> LOOP
        cSoapRequest := cSoapRequest || '<dateOfBirth>'|| TO_CHAR(recRow.DOB,'YYYY-MM-DD HH:MI' )|| '</dateOfBirth>';
    END LOOP;
    ...Then use package utl_http to send the request and recieve response.
    Google pl/sql webservice,
    Here is one:
    Calling Web Service from PL/SQL (ORA-31011: XML parsing failed)
    Hope this will give you an idea.
    Thomas

Maybe you are looking for

  • Looping photo slide show in media manager

    I want to use the media manager to loop a presentation of photos from my PC. they only run through one time and then I need to hit ok on the remote to restart. Is there a repeat or continuous loop option? I want to run them throughout the day at a pa

  • Podcast - works on iTunes page but not when subscribed

    Hi, I produced my podcast, submitted the feed through iTunes store and was validated. However, it happens so that people can listen to the podcast on iTunes page but not when they subscribe to it and try to download. error points to URL issues appare

  • CRMu00B4s Sales Organization structure

    Hi everybody I´d like to know how Sales Org. (Sales area, distr. channel) is upload from R3 to CRM, or wheater it has to be customized in CRM ? May you give a clue how to set up them?? Thank a lot

  • My neighbour is using my address to get an EE contract without my permission.

    Hello,Please help. My neighbour is using my address to get contracts from EE & T-moblie. They had a contract with T-mobile and have now changed to EE. I've asked them why their mail is coming to my address on a number of occasions and they said it wa

  • 4 Domains using 2 Clustered C350

    Hi, Anyone here had this kind of setup already? 2 x c350 - version 6.1.0-307 1.) I have 4 domains which are configured to be trusted (domain1...domain4) All domains have their own incoming and outgoing content filters... I configured my LDAP to use p