Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generating XML through PL/SQL

Amer Ramamni-OracleJan 24 2012 — edited Jan 24 2012
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>wsmith@xxx.gov</email>
               <actionDate>2005-09-07T09:48:09.811-04:00</actionDate>
            </creator>
            <lastModifier>
               <firstName>john</firstName>
               <lastName>doe</lastName>
               <email>jdoe@xxx.gov</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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 21 2012
Added on Jan 24 2012
4 comments
193 views