DBMS_XMLDOM Package Sample

Hello everyone
I need to generate XML output through PL/SQL. Though I had been successful in using DBMS_XMLGEN package, I need to us DBMS_XMLDOM, as I need create hierarchical xml document (ie., Department .....Department Attributes; Employee ....employee attributes....Employee and its attributes within Department node). I was searching for any samples but could not find any. Any help would be appreciated. Also, if I need to approach it in a different way, please let me know about it.
Thank you in advance
VV.

There are some examples of using DBMS_XMLDOM in the online documentation ...
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10790/xdb10pls.htm#sthref1069
Some other options would be to use XMLType Views, the XMLType functions or schema object types and the object based XMLType constructor ...
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10790/xdb14vie.htm#CJIDAFJI
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10790/xdb14vie.htm#i1025417
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/t_xml.htm#1009843
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10790/xdb13gen.htm#sthref1166

Similar Messages

  • Error when using DBMS_XMLDOM package

    Hello,
    I have created a set of triggers that use the DBMS_XMLDOM packages. These triggers were created on a Win 2k install of 9.2.0.2.1. A brand new user was created and a specific set of permissions granted. The permissions were:
    GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE, AQ_USER_ROLE
    GRANT EXECUTE ON DBMS_AQADM
    GRANT EXECUTE ON DBMS_AQ
    grant execute on dbms_aqin
    execute dbms_java.grant_permission('<USER>', 'java.net.SocketPermission', 'localhost:1024-', 'accept, listen, resolve');
    execute dbms_java.grant_permission( '<USER>', 'SYS:java.lang.RuntimePermission', ' getClassLoader', '' )
    execute dbms_java.grant_permission( '<USER>', 'SYS:java.lang.RuntimePermission' , 'setContextClassLoader', '' )
    I then went to install these triggers on our application database server. This is a Solaris installation that started out as 9.2.0.1.0 and was then upgraded to 9.2.0.2.0. I created the user and granted the exact same permissions on this database. However, everytime I attempt to execute the triggers, or anything else that uses DBMS_XMLDOM packages, I get the following error:
    doc dbms_xmldom.DOMDocument;
    ERROR at line 3:
    ORA-06550: line 3, column 11:
    PLS-00201: identifier 'DBMS_XMLDOM.DOMDOCUMENT' must be declared
    I did not create the application database instance on the Solaris machine, but from what I've talked with the DBA, it was created as a general database, which is how I created my test databases. I also verified that the users in both databases have Execute on SYS.XMLDOM granted.
    Any ideas on why I might be getting this error?
    Thanks,
    Andrew

    When I try the describe, it says object not found. If I go into OEM, I don't see that package either. Again, I didn't create that database, but I thought the XML DB stuff was installed by default with the database. Is there a way to add that package after the database is created?
    Thanks,
    Andrew

  • Differences between XMLDOM and DBMS_XMLDOM packages

    Hi all,
    Anybody could tell me if exists any differences between XMLDOM and DBMS_XMLDOM packages. Which are these?
    I have Oracle9i Enterprise Edition Release 9.2.0.3.0
    Thanks.

    hi,
    Can you check this
    Document TitleORA-1031 when setting Attribute via DBMS_SESSION SET_CONTEXT (Doc ID 100130.1)
    thanks,
    baskar.l

  • 10.2: loading DBMS_XMLDOM package

    I'm getting errors of the form identifier 'DBMS_XMLDOM.DOMNAMEDNODEMAP' must be declared when I run my stored procedure.
    What script needs to be run in Oracle 10g to create this package?

    I ran that, and that gives this error - do we need to create an xdb user? Is there a stock script for creating this user?
    SQL> start dbmsxmld.sql;
    CREATE OR REPLACE PACKAGE xdb.dbms_xmldom AUTHID CURRENT_USER IS
    ERROR at line 1:
    ORA-01435: user does not exist
    No errors.
    Synonym created.
    Synonym created.
    Synonym created.
    GRANT EXECUTE ON xdb.dbms_xmldom TO PUBLIC
    ERROR at line 1:
    ORA-04042: procedure, function, package, or package body does not exist
    GRANT EXECUTE ON sys.xmldom TO PUBLIC
    ERROR at line 1:
    ORA-04045: errors during recompilation/revalidation of SYS.XMLDOM
    ORA-00980: synonym translation is no longer valid
    ORA-00980: synonym translation is no longer valid
    No errors.
    SQL>

  • Dbms_xmldom package results in ORA-31020

    Hi,
    I have the following procedure which compiles correct:
    CREATE OR REPLACE procedure vbk_selproc_doc is
    queryctx dbms_xmlquery.ctxtype;
    result varchar2(30000);
    header varchar2(1000);
    footer varchar2(1000);
    body varchar2(20000);
    line VARCHAR2(2000);
    var XMLtype;
    doc dbms_xmldom.domdocument;
    docelem dbms_xmldom.domelement;
    node dbms_xmldom.domnode;
    childnode dbms_xmldom.domnode;
    nodelist dbms_xmldom.domnodelist;
    buf varchar2(30000);
    begin
    queryctx := dbms_xmlquery.newcontext('select * from jobs');
    dbms_xmlquery.setrowsettag(queryctx, 'opdracht-aanbieding');
    dbms_xmlquery.setrowtag(queryctx, 'opdracht');
    dbms_xmlquery.settagcase(queryctx, 1);
    dbms_xmlquery.setrowidattrName(queryctx, null);
    header := '<?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>';
    body := dbms_xmlquery.getxml(queryctx);
    var := XMLTYPE(body);
    doc := dbms_xmldom.newdomdocument(var);
    docelem := dbms_xmldom.getdocumentelement(doc);
    nodelist := dbms_xmldom.getelementsbytagname(docelem, 'NAME');
    node := dbms_xmldom.item(nodelist, 0);
    childnode := dbms_xmldom.getfirstchild(node);
    dbms_xmldom.writetobuffer(childnode, buf);
    dbms_output.put_line('First Child = ' || buf);
    footer := '</SOAP-ENV:Body>
    </SOAP-ENV:Envelope>' || chr(10);
    result := header || ' ' || body || ' ' || footer;
    loop
    exit when result is null;
    line := substr(result, 1, instr(result, chr(10))-1);
    dbms_output.put_line(line);
    result := substr(result, instr(result, chr(10)) +1 );
    end loop;
    dbms_xmlquery.closecontext(queryctx);
    end;
    When executing i get the following error:
    SQL> exec vbk_selproc_doc;
    BEGIN vbk_selproc_doc; END;
    FOUT in regel 1:
    .ORA-31020: The operation is not allowed, Reason: Invalid pl/sql DOM Node hdl
    ORA-06512: at "XDB.DBMS_XMLDOM", line 715
    ORA-06512: at "XDB.DBMS_XMLDOM", line 735
    ORA-06512: at "FWADMIN.VBK_SELPROC_DOC", line 48
    ORA-06512: at line 1
    What is wrong?
    Regards,
    Joshua

    I get the error on:
    dbms_xmldom.writetobuffer(childnode, buf);
    or when i use dbms_xmldom.removechild(nodelist, childnode)

  • How to share an array among members of a package

    I need to share the value of h among members of a package. The values for Byte h are generated by button events in the other program in the package [ sample below ]. That is transformed into ASCII code, h, which ideally should go through SerialWriter and out the serial port.
    private void menuButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
            Charset asciiCharset = Charset.forName("US-ASCII");
         CharsetDecoder decoder = asciiCharset.newDecoder();
         byte h[] = {33, 48, 48, 66, 77, 69, 78, 85, 13}; //brings menu up
         ByteBuffer asciiBytes = ByteBuffer.wrap(h);
         CharBuffer hChars = null;
         try {
              hChars = decoder.decode(asciiBytes);
         } catch (CharacterCodingException e) {
              System.err.println("Error decoding");
              System.exit(-1);
              System.out.println(hChars);
        }                                          Predictably, when trying to run the main member of the package -- listed below -- h is not transferred, hence not instantiated, and I get a Null Pointer Exception. How can I transfer the value of h so that is seen by the "connect" method below? thanks
    package desktopapplication1;
    import org.jdesktop.application.Application;
    import org.jdesktop.application.SingleFrameApplication;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.ByteBuffer.*;
    import java.nio.charset.*;
    import java.lang.String.*;
    import java.io.*;
    import java.util.*;
    import gnu.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.ByteBuffer.*;
    import java.nio.charset.*;
    import gnu.io.CommPort;
    import gnu.io.CommPortIdentifier;
    import gnu.io.SerialPort;
    * The main class of the application.
    public class DesktopApplication1 extends SingleFrameApplication {
            String defaultPort = "/dev/ttyS0";
         * At startup create and show the main frame of the application.
        @Override protected void startup() {
            show(new DesktopApplication1View(this));
         * This method is to initialize the specified window by injecting resources.
         * Windows shown in our application come fully initialized from the GUI
         * builder, so this additional configuration is not needed.
        @Override protected void configureWindow(java.awt.Window root) {
         * A convenient static getter for the application instance.
         * @return the instance of DesktopApplication1
        public static DesktopApplication1 getApplication() {
            return Application.getInstance(DesktopApplication1.class);
        public void connect ( String portName ) throws Exception {
         String defaultPort = "/dev/ttyS0";
            Byte h;
            CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);
            if ( portIdentifier.isCurrentlyOwned() )
                System.out.println("Error: Port is currently in use");
            else
                CommPort commPort = portIdentifier.open(this.getClass().getName(),200);
                if ( commPort instanceof SerialPort )
                    SerialPort serialPort = (SerialPort) commPort;
                    serialPort.setSerialPortParams(4800,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                    InputStream in = serialPort.getInputStream();
                    OutputStream out = serialPort.getOutputStream();
                    (new Thread(new SerialReader(in))).start();
                    (new Thread(new SerialWriter(out))).start();
              out.write(h);
              out.flush();
                else
                    System.out.println("Error: Only serial ports are addressable by this application.");
         public static class SerialReader implements Runnable
            InputStream in;
            public SerialReader ( InputStream in )
                this.in = in;
            public void run ()
                byte[] buffer = new byte[1024];
                int len = -1;
                try
                    while ( ( len = this.in.read(buffer)) > -1 )
                        System.out.print(new String(buffer,0,len));
                catch ( IOException e )
                    e.printStackTrace();
        public static class SerialWriter implements Runnable {
            OutputStream out;
            SerialPort     serialPort;
            public SerialWriter ( OutputStream out )
                this.out = out;
            public void run ()
                try
                    int c = 0;
                    while ( ( c = System.in.read()) > -1 )
                        this.out.write(c);
                catch ( IOException e )
                    e.printStackTrace();
             try {
                     Thread.sleep(2000);  // Be sure data is xferred before closing
                  } catch (Exception e) {}
                  serialPort.close();
                  System.exit(1);
         * Main method launching the application.
        public static void main(String[] args) {
            launch(DesktopApplication1.class, args);
          try
                (new DesktopApplication1()).connect("/dev/ttyS0");
            catch ( Exception e )
                e.printStackTrace();
    }

    Make h global, and make an getH method in that class. And then make an instance of the class containing the getH() method, and call it from the connect() method.
    private byte h[] = {33, 48, 48, 66, 77, 69, 78, 85, 13};
    public byte[] getH() {
         return h;
    private void menuButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
            Charset asciiCharset = Charset.forName("US-ASCII");
         CharsetDecoder decoder = asciiCharset.newDecoder();
          //brings menu up
         ByteBuffer asciiBytes = ByteBuffer.wrap(h);
         CharBuffer hChars = null;
         try {
              hChars = decoder.decode(asciiBytes);
         } catch (CharacterCodingException e) {
              System.err.println("Error decoding");
              System.exit(-1);
              System.out.println(hChars);
        }

  • Memory not released using dbms_xmldom. free_document()

    Hi:
    I'm using Oracle 10.2.0 under Windows 2003 server 32 bits (Oracle Dedicated Connection)
    I have a PL/SQL stored function that builds a Dom Document from the result of a SQL query and at the end store its content in a Clob variable which is returned to the caller. I’m using the DBMS_XMLDOM package to manipulate the Dom document and at the end I make a call the dbms_xmldom.free_document (domDoc) to free the resources associated to the Dom Doc.
    For some reason when I run several times the PL/SQL stored function I’ve notice that the PGA keeps growing and is never released even when I call "dbms_xmldom.free_document"
    Here is the pl/sql code:
    FUNCTION  sfLerColCenCarga (pId IN INTEGER, pTipoSerie IN VARCHAR2) RETURN CLOB AS
                CURSOR cCenCarga IS
                  SELECT CgCen.IdCgCen, CgCen.IdX, CgCen.Nom, CgCen.TpS, CgCen.EtI, CgCen.EtF,
                         CgCen.Fnt, CgCen.DtR, CgCen.DtA, CgCen.Arq, CgCen.Obs,
                         PeCad.IdX PeCadIdX
                    FROM CgCen, PeCad
                   WHERE PeCad.IdPeCad = CgCen.IdPeCad
                     AND CgCen.IdCgCen = DECODE(pId, NULL, CgCen.IdCgCen, pId)
                   ORDER BY CgCen.DtA DESC;
                regCenCarga cCenCarga%ROWTYPE;
                -- Atributos para manipular o XML
                domDoc                      DBMS_XMLDOM.DOMDocument;
                noRaiz                      DBMS_XMLDOM.DOMNode;
                noObjeto                    DBMS_XMLDOM.DOMNode;
                noColecaoObjeto             DBMS_XMLDOM.DOMNode;
                e                           DBMS_XMLDOM.DOMElement;
                xmlData                     CLOB;
            BEGIN
                dbms_session.free_unused_user_memory;
                domDoc := DBMS_XMLDOM.newDOMDocument;
                noRaiz := DBMS_XMLDOM.makeNode(domDoc);
                e := DBMS_XMLDOM.createElement(domDoc, 'ColecaoCenCarga');
                noColecaoObjeto := DBMS_XMLDOM.appendChild(noRaiz, DBMS_XMLDOM.makeNode(e));
                OPEN cCenCarga;
                LOOP
                    FETCH cCenCarga INTO regCenCarga;
                    EXIT WHEN cCenCarga%NOTFOUND;
                    e := DBMS_XMLDOM.createElement(domDoc, 'CenCarga');
                    -- Define valores dos atributos do elemento
                    DBMS_XMLDOM.setAttribute (e, 'Id', regCenCarga.IdCgCen);
                    DBMS_XMLDOM.setAttribute (e, 'IdX', TRIM(regCenCarga.IdX));
                    DBMS_XMLDOM.setAttribute (e, 'Nom', TRIM(regCenCarga.Nom));
                    DBMS_XMLDOM.setAttribute (e, 'Fnt', TRIM(regCenCarga.Fnt));
                    DBMS_XMLDOM.setAttribute (e, 'TpS', regCenCarga.TpS);
                    DBMS_XMLDOM.setAttribute (e, 'EtI', TRIM(regCenCarga.EtI));
                    DBMS_XMLDOM.setAttribute (e, 'EtF', TRIM(regCenCarga.EtF));
                    DBMS_XMLDOM.setAttribute (e, 'Aut', TRIM(regCenCarga.PeCadIdX));
                    DBMS_XMLDOM.setAttribute (e, 'Org', 'X');
                    DBMS_XMLDOM.setAttribute (e, 'OrgX', 'Externa');
                    DBMS_XMLDOM.setAttribute (e, 'DtR', TO_CHAR(regCenCarga.DtR,'dd/mm/yyyy HH24:MI'));
                    DBMS_XMLDOM.setAttribute (e, 'DtA', TO_CHAR(regCenCarga.DtA,'dd/mm/yyyy HH24:MI'));
                    DBMS_XMLDOM.setAttribute (e, 'Arq', TRIM(regCenCarga.Arq));
                    DBMS_XMLDOM.setAttribute (e, 'Obs', TRIM(regCenCarga.Obs));
                    noObjeto := DBMS_XMLDOM.appendChild(noColecaoObjeto, DBMS_XMLDOM.makeNode(e));
                END LOOP;
                CLOSE cCenCarga;
                dbms_lob.createTemporary(xmlData, TRUE, DBMS_LOB.CALL);
                DBMS_XMLDOM.writeToClob(domDoc, xmlData);
                DBMS_XMLDOM.freeDocument(domDoc);
                RETURN xmlData;
            END;Could somebody please tell me if I should call some other method to release my memory or is it a leak in the DBMS_XMLDOM package?
    Thanks in advance,
    André Granville

    You left off the final number in your version, but I'm going to assume it is .1 - .3. You are running into a bug in Oracle.
    http://anononxml.blogspot.com/2010/09/memory-leaks.html
    I would suggest upgrading to .4 or .5 (should be out for all versions) as the first step to fix your problem.

  • Sample code for offline PDF forms submit to workflow

    Hi,
    I have a XDP form which needs to be submitted offline by the user. So i have saved the XDP as dynamic PDF. On submit of this PDF the code flows to the servlet. I am getting the following error:
    "com.adobe.formServer.interfaces.ProcessFormSubmissionException: RequestBuffer not specified at com.adobe.formServer.client.EJBClient.processFormSubmission(EJBClient.java:454) at samples.triggerworkflow.servlet.ProcessFormServlet.doPost(ProcessFormServlet.java:54) at samples.triggerworkflow.servlet.ProcessFormServlet.doGet(ProcessFormServlet.java:28) at javax.servlet.http.HttpServlet.service(HttpServlet.java:697) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at.... "
    Finally i need to trigger the workflow from the servlet.
    Please help me fix this error. Pleas eprovide a sample code if you have.
    My servelt code is:
    package samples.triggerworkflow.servlet;
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.adobe.formServer.client.*;
    import com.adobe.formServer.interfaces.*;
    import com.adobe.idp.*;
    import com.adobe.workflow.client.*;
    import com.adobe.workflow.manager.*;
    import samples.util.*;
    * @version 1.0
    * @author
    public class ProcessFormServlet extends HttpServlet implements Servlet {
    private static String failedHTML = "Process Invocation Failed. See Log";
    * @see javax.servlet.http.HttpServlet#void (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
    doPost(req, resp);
    * @see javax.servlet.http.HttpServlet#void (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    public void doPost(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
    EJBClient formServer = new EJBClient(Util.getInitContext(getServletContext()));
    IOutputContext form = null;
    try {
    IOutputContext outputContext =formServer.processFormSubmission(req,"OutputType=0");
    // Determine the content type -- make sure it is text/xml
    String ct = outputContext.getContentType();
    if ((ct.equals("text/xml"))||(ct.equals("application/vnd.adobe.xdp+xml")))
    // Get the length of the output stream
    int outLength = outputContext.getOutputContent().length;
    // Create a byte array and allocate outLength bytes
    byte[] formOutput = new byte[outLength];
    // Populate the byte array by invoking getOutputContext
    formOutput = outputContext.getOutputContent();
    System.out.println("coming in post 5555***********");
    } catch (ProcessFormSubmissionException e1) {
    System.out.println("coming in exception 123***********");
    e1.printStackTrace(resp.getWriter());
    return;
    String returnHtml = triggerWorkflow(form);
    resp.setContentType("text/html");
    resp.setContentLength(returnHtml.length());
    resp.getWriter().print(returnHtml);
    private String triggerWorkflow(IOutputContext form) {
    System.out.println("coming in triggerWorkflow 1111***********");
    QLCSession session = null;
    String html = null;
    try {
    System.out.println("coming in try of triggerWorkflow 2222***********");
    session = QLCSessionFactory.createSession("Localhost");
    Context wkfContext = session.login("administrator", "password");
    session.setContext(wkfContext);
    System.out.println("coming in try of triggerWorkflow 3333***********");
    ProcessManager manager = session.getProcessManager();
    System.out.println("coming in try of triggerWorkflow 4444***********");
    manager.setContext

    Figured out how to set an event parameter in the function:
        CALL METHOD event_container->set
          EXPORTING
            name                          = 'Item'
            value                         = wa_eban-bnfpo

  • Dbms_xmldom and xmldom

    what is the difference between xmldom and dbms_xmldom packages?
    Has anyone worked with dbms_xmldom? if so does it still uses JVM inside the database?

    dbms_xmldom implemented in C, which doesn't need JVM.
    xmldom is implemented in Java. You should use dbms_xmldom in Oracle9i.

  • Dbms_xmldom not loaded?

    Hello!
    I use i migrated 9.2. database (previous:8.1.7). it seems, that the "dbms_xmldom" package is not available.
    my question:
    how can i test, if it is correct installed?
    if not, how can i manuell add the pl/sql-xml-packages?
    regards
    Harald.

    Please see the following thread...
    Error when using DBMS_XMLDOM package

  • Package problems in JAAS!

    I have problems with packages i have start with the JAAS sample that sun has and put in some classes to have a login promt insted of the commando window.
    I put all the java files in the package sample and try to complie it, and get errors. I have all java files in the same directory ...MyProjects Please can anyone tell me how to do.
    eg. when a try to compile the file SampleLoginModule.java a get this errors, it looks that the file SamplePrincipal dont exist in the directory ..MyProjects
    Compiling C:\SitePadPro\MyProjects\SampleLoginModule.java
    Command line: "C:\jdk1.4\bin\javac.exe" -deprecation -g -classpath "C:\SitePadPro\MyProjects" "C:\SitePadPro\MyProjects\SampleLoginModule.java"
    The current directory is: C:\SitePadPro\MyProjects
    C:\SitePadPro\MyProjects\SampleLoginModule.java:63: cannot resolve symbol
    symbol : class SamplePrincipal
    location: class sample.SampleLoginModule
    ^
    C:\SitePadPro\MyProjects\SampleLoginModule.java:304: cannot resolve symbol
    symbol : class SamplePrincipal
    location: class sample.SampleLoginModule
                   // overall authentication succeeded and commit succeeded,
    ^
    2 errors
    Finished

    Hi,
    This is what you'll have to do:
    1) rename "MyProjects" into "sample" (since these classes belong to the package "sample")
    2) open a command prompt
    3) type:
    cd SitePadPro
    C:\jdk1.4\bin\javac.exe -deprecation -g -classpath %CLASSPATH%;. -d . sample\SampleLoginModule.java
    Hope this helps,
    Kurt.

  • Problem with XMLDOM package (Oracle 10.2.0.1.0)

    Hi,
    I am using the dbms_xmldom package to generate xml files (specific structure).
    Below is the code but It produces nothing (dbms_output does not return) :
    DECLARE
    doc xmldom.DOMDocument;
    main_node xmldom.DOMNode;
    root_node xmldom.DOMNode;
    root_elmt xmldom.DOMElement;
    transmissionHeaderNode xmldom.DOMNode;
    transmissionHeaderElement xmldom.DOMElement;
    item_node xmldom.DOMNode;
    item_elmt xmldom.DOMElement;
    item_text xmldom.DOMText;
    buffer_problem CLOB;
    BEGIN
    doc := xmldom.newDOMDocument;
    main_node := xmldom.makeNode(doc);
    xmldom.setversion(doc,'1.0');
    root_elmt := xmldom.createElement(doc, 'InvoiceTransmission');
    root_node := xmldom.appendChild( main_node, xmldom.makeNode(root_elmt));
    transmissionHeaderElement := xmldom.createElement(doc, 'TransmissionHeader');
    transmissionHeaderNode := xmldom.appendChild(root_node, xmldom.makeNode(transmissionHeaderElement));
    item_elmt := xmldom.createElement(doc, 'TransmissionDateTime');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc, TO_CHAR(SYSDATE,'DD-MM-YYYY'));
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    item_elmt := xmldom.createElement(doc, 'IssuingOrganiszationID');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc,'0258');
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    item_elmt := xmldom.createElement(doc, 'Version');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    xmldom.writetobuffer(doc, buffer_problem);
    dbms_output.put_line(buffer_problem);
    xmldom.freeDocument(doc);
    END;
    That's strange because when remove a code part like :
    item_elmt := xmldom.createElement(doc, 'Version');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    I can get the ouput xml :
    <?xml version="1.0"?>
    <InvoiceTransmission>
    <TransmissionHeader>
    <TransmissionDateTime>26-10-2010</TransmissionDateTime>
    <IssuingOrganiszationID>0258</IssuingOrganiszationID>
    </TransmissionHeader>
    </InvoiceTransmission>
    I don't if it's a problem with xmldom or with dbms_output package...
    Please someone can help me ?

    Works fine for me
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    SQL> set serveroutput on;
    SQL>
    SQL> DECLARE
      2     doc xmldom.DOMDocument;
      3     main_node xmldom.DOMNode;
      4     root_node xmldom.DOMNode;
      5     root_elmt xmldom.DOMElement;
      6 
      7     transmissionHeaderNode xmldom.DOMNode;
      8     transmissionHeaderElement xmldom.DOMElement;
      9     item_node xmldom.DOMNode;
    10     item_elmt xmldom.DOMElement;
    11     item_text xmldom.DOMText;
    12 
    13     buffer_problem CLOB;
    14 
    15  BEGIN
    16 
    17     doc := xmldom.newDOMDocument;
    18     main_node := xmldom.makeNode(doc);
    19     xmldom.setversion(doc,'1.0');
    20     root_elmt := xmldom.createElement(doc, 'InvoiceTransmission');
    21     root_node := xmldom.appendChild( main_node, xmldom.makeNode(root_elmt));
    22 
    23     transmissionHeaderElement := xmldom.createElement(doc, 'TransmissionHeader');
    24     transmissionHeaderNode := xmldom.appendChild(root_node, xmldom.makeNode(transmissionHeaderElement));
    25 
    26     item_elmt := xmldom.createElement(doc, 'TransmissionDateTime');
    27     item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    28     item_text := xmldom.createTextNode(doc, TO_CHAR(SYSDATE,'DD-MM-YYYY'));
    29     item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    30 
    31     item_elmt := xmldom.createElement(doc, 'IssuingOrganiszationID');
    32     item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    33     item_text := xmldom.createTextNode(doc,'0258');
    34     item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    35 
    36     item_elmt := xmldom.createElement(doc, 'Version');
    37     item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    38     item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
    39     item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    40 
    41     --buffer_problem := 'a';  -- added to initialize clob
    42     xmldom.writetobuffer(doc, buffer_problem);  -- change to writetoclob
    43     dbms_output.put_line(buffer_problem);
    44     xmldom.freeDocument(doc);
    45 
    46  END;
    47  /
    <?xml version="1.0"?>
    <InvoiceTransmission>
      <TransmissionHeader>
        <TransmissionDateTime>26-10-2010</TransmissionDateTime>
        <IssuingOrganiszationID>0258</IssuingOrganiszationID>
        <Version>IATA:ISXMLInvoiceV3.0</Version>
      </TransmissionHeader>
    </InvoiceTransmission>Suggestions:
    - Use dbms_xmldom instead of just xmldom. Oracle changed the name in the 9i days and xmldom is a synonym to dbms_xmldom.
    - Use .writeToClob intead of .writeToBuffer
    - I would suggest trying to upgrade to .4 as you pick up a lot of improvements and bug fixes. Whether what you are encountering is a bug I cannot say but would seem so.
    - See the FAQ under your sign-in name to learn how to use the tag to format the code like I did above.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Fetch all vars in a package

    Hi,
    SSIS 2012
    Script Task c# 
    Is there a way to reference ALL variables in the Dts.Variables collection without the need to lock and explicitly provide the var's scope::name.
    Thanks,
    Shaul

    Hi,
    I’m afraid the suggested solution is not going to work.  When running ‘code-behind’ for a Script-Task, the code actually reference
    Dts .Variables   as oppose to arbitrary  pkg.Variables.
    The following code is NOT applicable in this scenario:
    Application app =
    new Application();
    Package pkg = app.LoadPackage(@"C:\Program
    Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx",
    null);
    Variables pkgVars = pkg.Variables;
    Please see the following
    thread  (which I found after submitting my question..) 
    Thanks,
    Shaul

  • Need Adventureworks 2014 DW SSIS Packages

    Hi All, 
    I want Analyse the design of  Adventure works 2014 Data Warehouse from Adventure works 2014 DB(OLTP).
    If any have or any one have link to download SSIS Packages/Project, Could you please share it or Can you guys please suggest me to  build SSIS Packages from Adventure works 2014 DB to Adventure works 2014 Data Warehouse.
    Thanks in Advance,
    Kareem

    You can download packages while installing SQL Server
    C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\
    I don't think AdeventureWorkDW2014 packages are available for download but you can design your own. Consider reading below books:
    Kimball- Micosoft Data Warehouse DW toolkit
    Professional
    Micorosft SQL Server 2014 Integration Services
    You can always refer older version SSIS packages for best practices and practice because the basic table structure and views are same.

  • Packaged Application installation error??

    Hi guys,
    I have downloaded sample packaged application from APEX product home page, and trying to download these application but continiously facing error, i have tried both to install (using application express and through sqlplus with FLOWS_020200 user) but unable to install it,
    Can anyone tell me how to install these sample applications supplied by Oracle corporation ???
    Your prompt reply will be appriciated .
    thanks & regards
    qamar

    Qamar,
    Can you give us more information? As in, what error do you get and when does it appear?
    The steps to install the packaged samples are:
    - Unzip the packaged application to a .sql file
    - In APEX, go to Home > Application Builder > Import and select the .sql file, then follow the steps in the wizard.
    Marco

Maybe you are looking for

  • How to do packing for a delivery? (which transaction?)

    How to do packing for a outbound delivery? Which transaction is used for this purpose? I am trying to do post goods issue for a outbound delivery but it gives me the error 'Delivery item is not or only partially packed'. How to solve this? Thank you!

  • How to transfer music from an old computer to a new one without losing CD's that were loaded?

    When I previously loaded my CD collection to my 1st laptop, I loaded it directly to iTunes. Now I have upgraded my laptop, and would like to transfer all of that music to my iTunes account on the new one. However, when I load iTunes, I only have the

  • How can I turn a pse file into a jpeg

    Today I created a pse file by the photo collage device. This is the only p file I have, and I would like to know if it is possible to convert this into a jpeg, and if so how? Thank you, Ian Julian www.natureandpictures.com

  • Add and remove fields from web service desk

    I want to customize the screen for the web service desk. I would like to remove the fields for processor as well as the field for category. I would like to replace those fields with Geographical Location and Telephone number. How can i do this?

  • How to move the file in the same system

    Hi ,          i have a small dought in moving the file along the system from DEV 20 to DEV 30 . And how to have check boxes to each record in a alv list . and how to have values to the combobox as alist . Please let clear me  some of the doughts i ha