Generate XML document

Hi,
My problem is about generating XML document. I'd like to be able to generate automaticaly (like what we can get at this kind of URL http://xdbserver:8080/oradb/USER/table_name) XML documents for any relational tables, I want the document being schema based and I want to store them in XDB in the repository.
I do not really matter at the time the way the xml is generated (I just do not want that it takes hours). Is there a way to do that with PL/SQL package or with a java classes?
Thanks in advance.
Vlad

1)I'm using this PL/SQL proc to create XML :
(table_name in VARCHAR2)as --generation d'un fichier xml basé sur un schéma pour la table dont le nom est passé en paramètre
qryCtx DBMS_XMLGEN.ctxHandle;
result XMLType;
begin
qryCtx := dbms_xmlgen.newContext('SELECT * from VLAD.' || table_name);
-- set the row header to be EMPLOYEE
DBMS_XMLGEN.setRowTag(qryCtx, table_name);
-- now get the result
result := DBMS_XMLGEN.getXMLType(qryCtx,2); --2 for XMLSchema (1 for a DTD)
--insertion de result dans la table tempo
insert into tempo values(result);
--close context
DBMS_XMLGEN.closeContext(qryCtx);
exception
when others then
dbms_output.put_line(TO_CHAR(sqlerrm));
end;
I saw in the doc that DBMS_XMLGEN.getXMLType(qryCtx,2) with the "2" was for schema but what does it do exactly, does it generate a schema against the table_name?
2)I'd like to put the result which is XMLType in a XML file in the server, is there a way to do it with UTL FILE?
Vlad

Similar Messages

  • How to validate generated XML-Document in Memory by XML-Schema?

    Hi all!
    I have the following problem:
    I am generating a Document using the DOM delivered with Xerces 2.6.2.
    Before I'll send the generated xml-document through network to another system I have to check with my xml-schema if the document is correct.
    In the DOM-FAQ I found an "example" trying to explain how it should work. But with this example the problems begin.
    I am creating my document with this method:
         public void createDocument() {
              myDOM = DOMImplementationImpl.getDOMImplementation();
              doc = myDOM.createDocument("", "documentData", null);
              root = doc.getDocumentElement();
              root.setAttribute(
                   "xmlns:xsi",
                   "http://www.w3.org/2001/XMLSchema-instance");
              //          root.setAttribute("xsi:noNamespaceSchemaLocation", "myScheme.xsd");
              domConfig = ((DocumentImpl) doc).getDomConfig();
              domConfig.setParameter(
                   "schema-location",
                   "file:///d:/workspace/XMLProject/WebContent/WEB-INF/myScheme.xsd");
              domConfig.setParameter("error-handler", new EHandler());
              domConfig.setParameter("validate", Boolean.TRUE);
         }In the line getting the domConfig, it is getting differeing to the example: The example is like this:
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMConfiguration;
    import org.w3c.dom.ls.LSParser;
    Document document = builder.parseURI("data/personal-schema.xml");
    DOMConfiguration config = document.getConfig();
    config.setParameter("error-handler",new MyErrorHandler());
    config.setParameter("validate", Boolean.TRUE);
    document.normalizeDocument();They get the DOM-Configuration from the document-Object, but my document-Object has no "getConfig()" and only after type-casting I get a getDomConfig()-Method to get the configuration.
    Then I fill my document and call                
    ((DocumentImpl) doc).normalizeDocument();When I run my Application I get the following error:
    org.w3c.dom.DOMException: FEATURE_NOT_SUPPORTED: The parameter schema-location is recognized but the requested value cannot be set.
         at org.apache.xerces.dom.DOMConfigurationImpl.setParameter(Unknown Source)
         at xmlProject.createDocument(Convert.java:63)
         at xmlProject.Convert.main(Convert.java:154)I tried several ways to get the validation without success.
    The next question is how I should refer to my xml-schema (which path) and where to place it relative to my jar I will generate, because I will have no webserver I could place it on.
    Has anyone any experience with validating a document created and not placed on disc?
    I have also another question to SAX: I read, that it is reading a document without saving it in the memory. I think this means that if I am validating it by SAX it will be read once and for parsing it will be read a second time. If I would transfer the document over an tcp-connection, I only have the document once in my inputstream and after validation it would be consumed I think. But what can I parse then? Or did I missed a detail with the function of the SAX?
    Thank you for your help!
    Yours
    Christian

    static final String schemaSource = argv[0];
    static final String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    factory.setAttribute(JAXP_SCHEMA_SOURCE,
    new File(schemaSource));

  • Question about generate xml document

    Hi, I'm new to xml can anyone introduce me some tools to generate xml documents? or some faster way to generate xml documents.

    a good site for the info www.xml.com or www.oasis.org
    xml-spy is a good tool

  • Generating XML Document by giving Object as input

    Hi all,
       I have to give some object as input for generating XML Document.Basing on the data in the object the XML file has to be generated.
    Please give me your guidance in this issue.
    Thanks&Regards
    Madhu

    Madhu,
    You may:
    1. Generate XML Document manually with DOM API
    2. Use some complex lib like implementation of <a href="http://java.sun.com/webservices/jaxb/">JAXB</a> with ad-hoc control over format.
    3. Use some simple library like <a href="http://xstream.codehaus.org/">XStream</a> with minimal format control.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Urgetnt:Generate XML Document from Oracle Tables.

    Environment is :9i Release 2
    Requirement : Generate XML document from the data which is vailable in Oracle tables at client location.
    Could some body help me on how to get ahead on this.
    Thanks in advance,
    Kumar.

    Implimentation in PowerBuilder7(Source is experimental.. need optimization):
    kml_store = create datastore
    selectblob kml into :kml_result from (select get_kml(:querry_type,:tmp_querry_value,1) as kml from dual) using sqlca;
    if sqlca.sqlcode=100 then
    MessageBox("INFO","No data found");
    return false;
    end if
    if sqlca.sqlcode = -1 then
         MessageBox("INFO","Error in generating KMl file");
         return false
    end if
    li_FileNum = FileOpen("test.kml",StreamMode!, Write!, LockWrite!, Replace!);
    b_len=Len(kml_result)
    b_len=64244;
    /*inserting in file :)*/
    DO WHILE b_pos<=b_len
         s_pipe=String(BlobMid(kml_result,b_pos,i_str_len))
         ret = FileWrite(li_FileNum,s_pipe);
         s_pipe="";
         b_pos=b_pos+i_str_len;
    LOOP
    FileClose(li_FileNum);
    Message was edited by:
    user601564

  • Content of generated XML document to variable - Oracle ...

    Hello everybody,
    here is sample code which generates XML document:
    * This is a sample application program which is built using the
    * classes generated by the XML DTD Class Generator. The External DTD
    * File "Widl.dtd" or the XML document which "Widl.xml" which is compliant
    * to Widl.dtd is used to generate the classes. The application
    * SampleMain.java is used to generate the classes which takes the DTD
    * or XML document as input parameters to generate classes.
    import oracle.xml.classgen.CGNode;
    import oracle.xml.classgen.CGDocument;
    import oracle.xml.classgen.DTDClassGenerator;
    import oracle.xml.classgen.InvalidContentException;
    import oracle.xml.parser.v2.DTD;
    public class TestWidl
    public static void main (String args[])
    try
    WIDL w1 = new WIDL();
    DTD dtd = w1.getDTDNode();
    w1.setNAME("WIDL1");
    w1.setVERSION(WIDL.VERSION_1_0);
    SERVICE s1 = new SERVICE("Service1", "Service_URL");
    s1.setINPUT("File");
    s1.setOUTPUT("File");
    BINDING b1 = new BINDING("Binding1");
    b1.setTYPE(BINDING.TYPE_INPUT);
    BINDING b2 = new BINDING("Binding2");
    b2.setTYPE(BINDING.TYPE_OUTPUT);
    VARIABLE v1 = new VARIABLE("Variable1", VARIABLE.NULLOK_FALSE);
    v1.setTYPE(VARIABLE.TYPE_STRING);
    v1.setUSAGE(VARIABLE.USAGE_INTERNAL);
    v1.setVALUE("value");
    VARIABLE v2 = new VARIABLE("Variable2", VARIABLE.NULLOK_TRUE);
    v2.setTYPE(VARIABLE.TYPE_STRING1);
    v2.setUSAGE(VARIABLE.USAGE_HEADER);
    VARIABLE v3 = new VARIABLE("Variable3", VARIABLE.NULLOK_FALSE);
    v3.setTYPE(VARIABLE.TYPE_STRING2);
    v3.setUSAGE(VARIABLE.USAGE_FUNCTION);
    v3.setMASK("mask");
    CONDITION c1 = new CONDITION("CRef1", "CMatch1");
    c1.setSERVICE("Service1");
    c1.setTYPE(CONDITION.TYPE_SUCCESS);
    CONDITION c2 = new CONDITION("CRef2", "CMatch2");
    c2.setTYPE(CONDITION.TYPE_RETRY);
    CONDITION c3 = new CONDITION("CRef3", "CMatch3");
    c3.setSERVICE("Service3");
    c3.setTYPE(CONDITION.TYPE_FAILURE);
    REGION r1 = new REGION("Region1", "Start", "End");
    b1.addNode(r1);
    b1.addNode(v1);
    b1.addNode(c1);
    b1.addNode(v2);
    b2.addNode(c2);
    b2.addNode(v3);
    w1.addNode(s1);
    w1.addNode(b1);
    w1.addNode(b2);
    w1.validateContent();
    w1.print(System.out);
    catch (Exception e)
    System.out.println(e.toString());
    e.printStackTrace();
    I see the method w1.print(System.out) which shows content of xml to console. But how can I store xml to some String variable? Thank you in advance.
    Jan :)

    If there is a version of the "print" method that can write to a Writer, then:StringWriter sw = new StringWriter();
    w1.print(sw);
    String result = sw.toString();But if you can only write to an OutputStream then:ByteArrayOutputStream baos = new ByteArrayOutputStream();
    w1.print(baos);
    String result = new String(baos.toByteArray(), encoding);where "encoding" is a string containing the name of the encoding used to write the XML. Possibly you can control that via "w1.setENCODING(something)" or some other way.

  • New to XML, need to generate XML document

    I have an existing application that uses an Oracle 9.2.0.3 database. An existing PL/SQL procedure generates a flat file interface using UTL_FILE. My task is to upgrade this procedure to generate an XML file and transform this XML file into different outputs (e.g. flat file interface, PDF file which I plan to use XSL Formatting Objects). My question is how should I generate the XML document from the PL/SQL procedure? Should I use the Oracle 9i SQL/XML capabilities? specifically xmlelement, etc? An if so should I also use UTL_FILE to generate the XML file? Your help will be appreciated.

    Williams,
    Do you want to generate an XML file from the data present in relational tables using PL/SQL ?
    In that case you can use XML SQL Utility(XSU).
    For more information on XSU click [url http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx23xsp.htm#1008317]here.
    Regards,
    Anupama
    [url http://otn.oracle.com/sample_code/]OTN Sample Code

  • Can not generate XML Document Template

    I have the below class
    public class MyHome implements Serializable {
    ArrayList rooms;
    //getter/setter methods here
    When I right click mouse and select "Generate XML Template Document", I got the error
    Some fields could not be generated to the XML template
    c:\e200\dv900\java\classes\java\util\ArrayList.class (The system cannot find the path specified)
    Do you have any idea?

    Not with the info given...
    Which jdev version?
    Where do I find this menu, as I don't see it?
    Timo

  • Inserting PI into generated XML document

    Can anyone tell me how to insert processing instructions into an XML document generated using the xmlcg generated classes? I understand that I can create a PI using the Document::createProcessingInstruction() method but how do I add it as a sibling to the root element? Any insight in this regard will be really appreciated.

    Your question is not very clear.
    Do you want to know How to insert an element into an XML document?
    Answer: I can see you already know how to do it. You have added the element using addContent()
    or do you want to know How to display the XML in a tidy format?
    Answer: to view the XML in a properly formatted style you can you the Format class. A very basic way of viewing the XML would be:
       * Prints the Document to the specified file.
       * @param doc
       * @param filename
       * @param formatting
      public static void printDocToFile(Document doc, String strFileName,
          boolean formatting)
        XMLOutputter xmlOut = null;
        if (!formatting)
          xmlOut = new XMLOutputter();
        } else
          Format prettyFormat = Format.getPrettyFormat();
          prettyFormat.setOmitEncoding(false);
          prettyFormat.setOmitDeclaration(false);
          xmlOut = new XMLOutputter(prettyFormat);
        try
          if (doc != null)
            FileWriter writer = new java.io.FileWriter(strFileName, true);
            xmlOut.output(doc, writer);
            writer.flush();
            writer.close();
          } else
            System.out.println("Document is null.");
        catch (Exception ex)
          System.out.println(ex);
      }

  • Generating XML document

    Hello, All!
    I have some questions about XML in Oracle 9.2
    For examle, I have a query such as:
    select to_clob(
    ((XMLElement("MSG" , XMLAttributes('EXPOPR' as "FORMAT",
         '1' as "SENDER",
                             '2' as "RECIPIENT",
                             to_char(SYSDATE, 'YYYY.MM.DD HH24:MI:SS') as "TIME"
         ))) msg
    from dual
    MSG
    <MSG FORMAT="EXPOPR" SENDER="1" RECIPIENT="2" TIME="2004.10.04 10:23:16"></MSG>
    1) How I can get a full XML document from this result (add <?xml version ...> tag)? I know about SYS_XMLGen, but this function will add a <ROW> tag into XML, but I don't need this...
    Also, I can use concatenation of strings, but it is not interestring for me...
    2) How I can get the string without enclose tag </MSG>:
    <MSG FORMAT="EXPOPR" SENDER="1" RECIPIENT="2"
    TIME="2004.10.04 10:23:16" />
    Thank for help.

    There is a new function XMLRoot that will be released as part of 10gR2 for this. In the mean time string concatenation is the only solution..
    The following works in 10gR1
    create or replace function XMLROOT (XML XMLType,
    target varchar2 default NULL,
    data varchar2 default NULL,
    CHARSET varchar2 default 'UTF-8')
    return XMLType deterministic
    is
    tempCLOB clob;
    tempXML XMLtype;
    PI VARCHAR2(256);
    begin
    PI := '<?' || target || ' ' || data || '?>';
    select xmlparse(DOCUMENT '<?xml version="1.0" encoding="UTF-8"?>' || PI || XML.getClobVal() WELLFORMED)
    into tempXML
    from dual;
    return tempXML;
    end;
    In 9.2 it would need to be something like this
    create or replace function XMLROOT (XML XMLType,
    target varchar2 default NULL,
    data varchar2 default NULL,
    CHARSET varchar2 default 'UTF-8')
    return XMLType deterministic
    is
    tempCLOB clob;
    tempXML XMLtype;
    PI VARCHAR2(256);
    begin
    PI := '<?' || target || ' ' || data || '?>';
    select xmltype('<?xml version="1.0" encoding="UTF-8"?>' || PI || XML.getClobVal(),0,1,1)
    into tempXML
    from dual;
    return tempXML;
    end;
    /

  • Generating an XML Document from an internal table in ABAP

    Good day to all of you;
    With ABAP, in the R/3 system, I'm trying to figure out a way to accomplish the following:
    1) SELECT a set of Purchase Order data into an internal table.
    2) Generate an XML document, containing the above data, using a specific schema.
    I've been playing around with function module SAP_CONVERT_TO_XML_FORMAT which has the following interface:
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
          EXPORTING
          I_FIELD_SEPERATOR    = ''
          I_LINE_HEADER        = ''
            I_FILENAME           = v_fname
          I_APPL_KEEP          = ''
          I_XML_DOC_NAME      = v_docname
          IMPORTING
            PE_BIN_FILESIZE      = v_byte
          TABLES
            I_TAB_SAP_DATA       = i_SapData
          CHANGING
            I_TAB_CONVERTED_DATA = i_XMLData
          EXCEPTIONS
            CONVERSION_FAILED    = 1
            OTHERS               = 2.
    I'm uncertain as to whether or not the Export parameter, I_XML_DOC_NAME refers to some schema or definition and therefore have been excluding it.  In doing so, the generated XML document seems to use the field name/type information from my itab for the tags.
    If this function module requires an XML Document Name, how do I create one and where do I store it in R/3?  If this is not the recommended solution, is anyone familiar with a way to load an XML schema, retrieve some data then have SAP generate an XML document using the schema?
    Many thanks for any help available.
    T

    Hai Phillips
    Try with the following Code
    This program exports an internal table to an XML file.
    Report ZPRUEBA_MML_13 *
    Export an internal table to XML document *
    NO BORRAR ESTE CODIGO *
    REPORT ZPRUEBA_MML_13.
    PANTALLA SELECCION *
        PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
    PANTALLA SELECCION *
    TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
        LU LIKE T552A-TPR01,
        MA LIKE T552A-TPR01,
        MI LIKE T552A-TPR01,
        JU LIKE T552A-TPR01,
        VI LIKE T552A-TPR01,
        SA LIKE T552A-TPR01,
        DO LIKE T552A-TPR01,
    END OF TURNOS.
    TYPE TURNOS *
    TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
        NUMERO LIKE PERNR-PERNR,
        REPOSICION LIKE PA0050-ZAUVE,
        NOMBRE LIKE PA0002-VORNA,
        TURNOS TYPE TURNOS,
    END OF SOCIO.
    TYPE SOCIO *
    ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
        SOCIO TYPE SOCIO,
    END OF ACCESOS.
    ESTRUCTURA ACCESOS *
    START OF SELECTION *
    START-OF-SELECTION.
        PERFORM LLENA_ACCESOS.
        PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    END OF SELECTION *
    FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
                  'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
                  'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    FORM LLENA_ACCESOS *
    FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
                  M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
                  G_IXML TYPE REF TO IF_IXML,
                  W_STRING TYPE XSTRING,
                  W_SIZE TYPE I,
                  W_RESULT TYPE I,
                  W_LINE TYPE STRING,
                  IT_XML TYPE DCXMLLINES,
                  S_XML LIKE LINE OF IT_XML,
                  W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
                  D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
                  NAME = 'ACCESOS'
                  DATAOBJECT = ACCESOS[]
    IMPORTING
                  DATA_AS_DOM = L_DOM
    CHANGING
                  DOCUMENT = M_DOCUMENT
    EXCEPTIONS
                  ILLEGAL_NAME = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
                  DOCUMENT = M_DOCUMENT
    IMPORTING
                  XML_AS_STRING = W_STRING
                  SIZE = W_SIZE
    TABLES
                  XML_AS_TABLE = IT_XML
    EXCEPTIONS
                  NO_DOCUMENT = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
                  APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                  BIN_FILESIZE = W_SIZE
                  FILENAME = GK_RUTA
                  FILETYPE = 'BIN'
    TABLES
                  DATA_TAB = XML_TAB
    EXCEPTIONS
                  OTHERS = 10.
    IF SY-SUBRC <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    FORM DESCARGA_XML *
    Thanks & regards
    Sreenivasulu P

  • How to generate XML from relational data : PL/SQL or Java

    I'm new to Oracle XML and would appreciate some advice. I've been asked to generate XML documents from data stored in relational tables. The XML documents must be validated against a DTD. We will probably want to store the XML in the database.
    I've seen a PL/SQL based approach as follows :
    1.Mimic the structure of the DTD using SQL object types 2.Assign the relational data to the object type using PL/SQL as required
    3.Use the SYS_XMLGEN package to render the required XML documents from the SQL objects
    However, creating the object types seems to be quite time consuming (step 1 above) for anything other than the simplest of XML documents.
    I've also seen that there is the Java based approach, namely :
    1. Use the XML generator to build Java classes based on a DTD.
    2. Use these classes to build the required XML
    On the face of it, the Java based approach seems simpler. However, I'm not that familiar with Java.
    Which is the best way to proceed ? Is the PL/SQL based approach worth pursuing or should I bite the bullet and brush up my Java ?
    Is it possible to use a combination of PL/SQL and Java to populate the dtd generated java classes (step 2 of the Java approach) to reduce my learning curve ?
    Thanks in advance

    To help answer your questions:
    1) Now, in 9iR2, you can use SQL/XML as another choice.
    2) You can also use XSU to generate the XML and use XSLT to transform it to a desired format instead of using object views if possible.
    3) XDK provide Class generator support to populate XML data to Java classes.

  • Error while printing generated XML doc using DBMS_OUTPUT

    while generating XML document using XDK for PL/SQL i am getting " ORU-10027: buffer overflow, limit of 1000000 bytes " error even though i had set DBMS_OUTPUT to 1000000.
    Is there any way to getrid of this problem .
    i am using this code ..
    CREATE OR REPLACE procedure SQLToXML1 is
    queryCtx DBMS_XMLquery.ctxType;
    result CLOB;
    begin
    DBMS_OUTPUT.ENABLE (1000000);
    queryCtx := DBMS_XMLQuery.newContext ('select * from depolib_library' )
    result := DBMS_XMLQuery.getXML(queryCtx);
    printClobOut(result);
    DBMS_XMLQuery.closeContext(queryCtx);
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end;
    urgent help is needed
    Thanks
    null

    No, It is a PO Print only. Only for changes to PO that do not affect the value of the PO,this error occurs. When i select the entry for the PO and click on Output message, the output message fails. On clicking Display Message, it shows the message - No schedules exist for the Scheduling Agreement XXXXXX(the PO number".
    So,it is not for Scheduling Agreements but for PO only. I know it is weird to see such an error on the PO output message in ME9F.
    Pls help.

  • Creating an XML document from a DTD in Java

    Hi All,
    I need help on the following requirement very badly. Pls help me.
    I have a requirement to implement with java and XML. I am quit new to XML.Can any of you pls help me.
    I have a DTD file. I need to generate XML document from it using java code. I have to use DTD as a template to generate my XML document.
    After going through WEB sites, I understtod that, we have to user Java API JAXB for my requirement. But I could not find JAXB.jar anywhere.
    I need to know the following inforamtion ....
    1. Is my understanding of using JAXB for my requirement is correct?
    2. Where can I get JAXB.jar?
    3. What are the steps to create XML document from a DTD in Java?
    If can give me a sample code for this would help me a lot.
    Pls pls reply me. Your help is greatly appreciated.
    Thanks in Advance.
    Regards,
    Gayathri.

    hi Gayathri,
    iam currently working in the same field.
    firs download jaxb from this link:
    http://java.sun.com/xml/downloads/jaxb.html
    first u need to marshall it.
    cheers
    shashi

  • Generation of xml document of rows in table.

    hi..
    i want to generate xml document for one table.....i want all records from that table to xml...
    thank u
    sam

    create table test(col1 varchar2(10));
    insert into test values('hello1');
    insert into test values('hello2');
    insert into test values('hello3');
    insert into test values('hello4');
    commit;
    set serveroutput on;
    declare
    v_sql varchar2(1000);
    v_output clob;
    begin
    v_sql := 'select * from test';
    v_output := dbms_xmlgen.getxml(v_sql);
    dbms_output.put_line(v_output);
    end;
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <COL1>hello1</COL1>
    </ROW>
    <ROW>
    <COL1>hello2</COL1>
    </ROW>
    <ROW>
    <COL1>hello3</COL1>
    </ROW>
    <ROW>
    <COL1>hello4</COL1>
    </ROW>
    </ROWSET>
    The dbms_xmlgen can do it for you like the above example.
    Lee
    null

Maybe you are looking for