Urgent!! Urgent!! Slow in XML extraction.

Hi,
I am using 8.1.7 dB. I have prob in performance, while extractging. I have XML doc like the following.
- <rowOfCells>
- <cellValueList>
<cellValue>Class I Senior Notes</cellValue>
<cellValue>0</cellValue>
<cellValue>0.0054</cellValue>
<cellValue>48164975</cellValue>
<cellValue>4.18</cellValue>
<cellValue>304557600</cellValue>
<cellValue>181835025</cellValue>
</cellValueList>
</rowOfCells>
- <rowOfCells>
- <cellValueList>
<cellValue>Class I Senior Notes</cellValue>
<cellValue>0</cellValue>
<cellValue>0.0054</cellValue>
<cellValue>49105975</cellValue>
<cellValue>4.33</cellValue>
<cellValue>307906256</cellValue>
<cellValue>180894025</cellValue>
</cellValueList>
</rowOfCells>
Please noet that the number of "cellValue" tags may vary. I am using the code like the following to extract and make it as a record.
l_row_node_list := xslProcessor.selectNodes (p_node,'/rowOfCells/cellValueList' );
FOR i IN 0 .. XMLDOM.getLength (l_row_node_list) - 1
LOOP
l_row_node := XMLDOM.item (l_row_node_list, i);
l_col_node_list := xslProcessor.selectNodes (l_row_node,'cellValue' );
     FOR j IN 0 .. XMLDOM.getLength (l_col_node_list) - 1
LOOP
     l_grandChildArray(j+1) := SUBSTR(XMLDOM.getNodeValue( XMLDOM.getFirstChild(XMLDOM.item (l_col_node_list, j) ) ),1,100);
     END LOOP;
-- Make as record structure.
l_generic_rec.col1 := l_grandChildArray(1);
     l_generic_rec.col2 := l_grandChildArray(2);
     l_generic_rec.col3 := l_grandChildArray(3);
     l_generic_rec.col4 := l_grandChildArray(4);
l_generic_rec.col5 := l_grandChildArray(5);
     l_generic_rec.col6 := l_grandChildArray(6);
     l_generic_rec.col7 := l_grandChildArray(7);
     l_generic_rec.col8 := l_grandChildArray(8);
END LOOP;
This works fine for me, but it takes 5 minutes to extract for 1200 cellValueList. I want to speed up this process.Is there any way i can modify this code or use some other way to speed up the process of extraction?
Advanced Thanks
Ramesh

Your code using the DOM APIs looks fine. You can change 'cellValue' to '/cellValue' and see if there will be any improvement:
l_col_node_list := xslProcessor.selectNodes (l_row_node,'/cellValue' );
Or you can use the SAX streaming method to get the data. Would you like to send the sample data?

Similar Messages

  • Create a large XML extract from relational tables - 10g

    The Oracle 10g documentation recommends using the various SQL functions such as XMLAGG,XMLELEMENT or DBMS_XMLGEN under chapter "16 Generating XML Data from the Database" for generating a XML extract file. The DBMS_XMLDOM seems like a useful structured package to create a XML formatted extract. Any idea why Oracle does not recommend the use of XMLDOM API ? Are there performance issues or likely de-support ?
    Whats the best way to produce a large XML extract?
    Thanks.

    mdrake wrote:
    No reason not to use it. It just tends to require a lot more coding than the other methods. Underneath the covers they all map into the same code-line. In general, to generate a given XML document you wlll write far fewer lines of code using the SQL/XML operators. Less Code written = less code to maintan = faster time to market.Less code to parse...?

  • Using XML extraction from Oracle and XSLT data transformation

    Hi
    How can transfer data ie: Using XML extraction from Oracle and XSLT data transformation with java application?
    usually i use to do querying sql, getting data from table assinging to model class then send it to UI. how can i go for XML extraction form oracle?
    thanks

    Sorry, I don't understand what exactly you want to do. And I'm under the impression that you might not know exactly what you want to do as well. Could you explain a bit more detailed what you want to achieve?

  • XML extract error

    Hello -
    This is my table:
    SQL> describe UCCNET_REGISTRY_CAT_ITEM;
    Name Null? Type
    UCCNET_REGISTRY_CAT_ITEM_KEY NOT NULL NUMBER
    XML XMLTYPE
    EAN_UCC_PROXY_KEY NUMBER
    DOCUMENT_NAME VARCHAR2(256)
    SQL>
    and this is my statement that is supposed to extract the XML data:
    select p.XML
    from UCCNET_REGISTRY_CAT_ITEM p
    where p.XML.extract('/item/text()').getStringVal = '123';
    I did it exactly as the Oracle Viewlet showed it to me but I got this error:
    where p.XML.extract('/item/text()').getStringVal = '123'
    ERROR at line 3:
    ORA-22806: not an object or REF
    Could you please tell me wher I went wrong?
    Thanks,
    Peter

    I just hit something else on top of my previous problem with XML namespaces. I am trying to pass my XML document to a stored procedure and I seem to be hitting a length limit for a parameter.
    Here's my SP:
    create or replace procedure TEST_UCCnet_Add_Envelope( p_key in number, p_XML in VARCHAR2) is
    lastIndex number;
    begin
    lastIndex := 0;
    insert into Envelope (
    ENVELOPE_KEY,
    XML )
    values (
    lastIndex,
    sys.XMLTYPE.createXML (p_XML));
    end;
    Here's How I call it:
    This parameter gets through(951 Bytes):
    execute TEST_UCCnet_Add_Envelope( -5, '<envelope communicationVersion="2.2"> <messageHeader> <messageIdentifier> <value>RCIR-MSGID-001</value> </messageIdentifier> <userId>steruser</userId> <representingParty> <gln>0034500000000</gln> </representingParty> </messageHeader> <registerCommandOperand> <registryCatalogueItem type="RegistryCatalogueItemType" creationDate="2001-08-02T12:00:00" documentStatus="ORIGINAL"> <registryCatalogueItemState state="REGISTERED"/> <catalogueItemClassification classificationCategoryCode="UDEX.02.0016.0093"/> <catalogueItemReference> <gtin>00061420464322</gtin> <dataSource>1701911838063</dataSource> </catalogueItemReference> <sourceDataPool>8507247615230</sourceDataPool> <informationProviderOfTradeItem> </informationProviderOfTradeItem> </registryCatalogueItem> <test_tag></test_tag> </registerCommandOperand> </envelope>');
    This one, does not (987 Bytes). All I added is the test_tag element:
    execute TEST_UCCnet_Add_Envelope( -6, '<envelope communicationVersion="2.2"> <messageHeader> <messageIdentifier> <value>RCIR-MSGID-001</value> </messageIdentifier> <userId>steruser</userId> <representingParty> <gln>0034500000000</gln> </representingParty> </messageHeader> <registerCommandOperand> <registryCatalogueItem type="RegistryCatalogueItemType" creationDate="2001-08-02T12:00:00" documentStatus="ORIGINAL"> <registryCatalogueItemState state="REGISTERED"/> <catalogueItemClassification classificationCategoryCode="UDEX.02.0016.0093"/> <catalogueItemReference> <gtin>00061420464322</gtin> <dataSource>1701911838063</dataSource> </catalogueItemReference> <sourceDataPool>8507247615230</sourceDataPool> <informationProviderOfTradeItem> <test_tag>kkkkkkkkkkkkkkk</test_tag> </informationProviderOfTradeItem> </registryCatalogueItem> <test_tag></test_tag> </registerCommandOperand> </envelope>');
    And here's the error message:
    ERROR:
    ORA-01756: quoted string not properly terminated
    SP2-0042: unknown command "pe>')" - rest of line ignored.
    This suggests strongly that the argument is simply too long for the SP to accept. Am I right?
    Thanks,
    Peter

  • Oracle Payments - Funds Capture - Create Settlement Batches - Customize Standard XML extract

    Hi,
    I am required to customize the output produced by 'Create Settlement Batches' program.
    There are two parts to it:
         1. Customizing Standard XML
              This is required to add custom XML Tags to the standard XML extract.
              I read in a meta-link note that this can be achieved through table iby_trxn_extensibility. Oracle suggests that we insert rows into this table via a trigger on iby_trxn_summaries_all, and           these rows will appear as additional XML Tags in the Standard XML extract.
              I need to figure out how to populate the column iby_trxn_extensibility.extend_name so that the new XML Tag appears at a specific path in the Standard XML extract.
              Kindly provide your valuable inputs on this?
         2. Customizing Standard RTF
              In case of Funds Disbursement, we have a standard Format called 'US NACHA Generic Format'. Do we have a similar seeded Format in case of Funds Capture?
    Best Regards,
    Uday Arora

    I am wondering whether u were able to achieve this. I am able to insert via autonomous transaction but it insert duplicate values, HOW to avoid duplicate.

  • Xml extract assign to varchar2

    How do i assign the xml Extract to a varchar2.. its throwing me error, is it possible or an alternative method to do this.
    ST_Name1 varchar2(120);
    ST_Name1:= xml_st.EXTRACT ('ST/Name1/text()').getstringval ();Thanks

    its throwing me errorit would also help to mention what kind of error you get!
    In general it would work:
    SQL> declare
       ST_Name1 varchar2 (120);
       xml_st   xmltype := xmltype ('<ST><Name1>SomeName</Name1></ST>');
    begin
       ST_Name1 := xml_st.extract ('ST/Name1/text()').getstringval ();
       dbms_output.put_line(ST_Name1);
    end;
    SomeName
    PL/SQL procedure successfully completed.

  • Need Xml Extraction help...not very urgent but only 6 Hrs left...

    Hi,
         I have an xml in a blob column and I need to extract the xml resultset into the (specified below) row/column format. So that i created a custom blob_to_clob function for this conversion and extracted below specified xml. Now I am executing the below specified queries for this xml to extract PanelSet, PanelId, Link values & attributes. but the problem is, I am not been able to relate the parent and child nodes or may be not able to identify, who belongs to who (parent--child). for e.g if I extract all link i.e status1, status2 etc of a particular Panel then i am not been able to access its (parent) Panel identification.please suggest me any solution.
    --query using
    --to extract PanelSet
    select
      extractValue(value(t),'/PanelSet/@name') panelset_name
      from
        (Select blob_to_clob(grp_menu) blobval
        from OUG
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/PanelSet'))) t
    --to extract PanelID
    select
      extractValue(value(t),'/PanelID/text()') panelid
      from
        (Select blob_to_clob(grp_menu) blobval
        from oug
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/PanelSet/PanelID'))) t
    --to extract Panel
    select
      extractValue(value(t),'/Panel/@id') Panel_id,
      extractValue(value(t),'/Panel/@name') Panelname
      from
        (Select blob_to_clob(grp_menu) blobval
        from oug
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/Panel'))) t
    --to extract link
    select
      extractValue(value(t),'/Link/@name') link_name,
      extractValue(value(t),'/Link/@type') link_type,
      extractValue(value(t),'/Link/text()') link_value 
      from
        (Select blob_to_clob(grp_menu) blobval
        from oug
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/Panel/Link'))) t
    --XML
    <Menus>
        <PanelSet name="0_Data center_A">
        <PanelID>1-1</PanelID>
        <PanelID>1-2</PanelID>
        <PanelID>1-3</PanelID>
        <PanelID>0-0</PanelID>
        <PanelID>1-6</PanelID>
        <PanelID>1-7</PanelID>
    </PanelSet>
       <PanelSet name="1_Data center_B">
          <PanelID>2-4</PanelID>
          <PanelID>2-5</PanelID>
          <PanelID>2-6</PanelID>
          <PanelID>0-0</PanelID>
          <PanelID>2-7</PanelID>
          <PanelID>2-8</PanelID>
    </PanelSet>
       <PanelSet name="2_Data center_C">
          <PanelID>3-2</PanelID>
          <PanelID>3-4</PanelID>
          <PanelID>0-0</PanelID>
          <PanelID>3-9</PanelID>
          <PanelID>3-10</PanelID>
          <PanelID>3-11</PanelID>
    </PanelSet>
          <Panel id="1-1" name="Sts">
            <Link name="status 1" type="Module">forbidden</Link>
            <Link name="status 2" type="Module">/forbidden</Link>
            <Link name="status 3" type="Module">/forbidden</Link>
            <Link name="status 4" type="Module">/forbidden</Link>
            <Link name="status 5" type="Module">/forbidden</Link>
          </Panel>
          <Panel id="1-2" name="Adm">
             <Link name="View 1" type="Module">forbidden</Link>
             <Link name="View 2" type="Module">forbidden</Link>
             <Link name="View 3" type="Module">forbidden</Link>
             <Link name="View 4" type="Module">forbidden</Link>
             <Link name="View 5" type="Module">forbidden</Link>
             <Link name="View 6" type="Module">forbidden</Link>
             <Link name="View 7" type="Module">forbidden</Link>
          </Panel>
          <Panel id="2-4" name="Position">
             <Link name="viewer 1" type="Module">forbidden</Link>
             <Link name="viewer 2" type="Module">forbidden</Link>
          </Panel>
          <Panel id="3-2" name="Administration">
             <Link name="inquiry 1" type="Module">forbidden</Link>
          </Panel>
          <Panel id="3-4" name="Reconciliation">
            <Link name="reconciliation 1" type="Module">forbidden</Link>
            <Link name="reconciliation 2" type="Module">forbidden</Link>
            <Link name="reconciliation 3" type="Module">forbidden</Link>
          </Panel> 
    </Menus>
    --Structure
                                       -----Link abc
                                      -     Link abd
                                  -      Link abe
                -----Panel ID 1-1-                
                  -     Panel ID 1-2--------link a--z (more than one)
    --------    -      Panel ID 1-3--------link N...
    |PanelSet 0|-
                  ------PanelID 2-1--------link N...
               -     PanelID 2-2--------link N...
    --------     -      PanelID 2-3--------link N...
    |PanelSet 1|-      
                  ------PanelID 3-1--------link N...
    --------     -      PanelID 3-2--------link N...
    |PanelSet 2|-       PanelID 3-1--------link N...
    --resultset required
    Panel_set         Panel_id          link
    0_Data center_A    1-1               Status1
    0_Data center_A    1-1               Status2
    0_Data center_A    1-1               Status3
    0_Data center_A    1-1               Status4
    0_Data center_A    1-1               Status5
    0_Data center_A    1-2               View 1
    0_Data center_A    1-2               View 2
    0_Data center_A    1-2               View 3
    0_Data center_A    1-2               View 4
    0_Data center_A    1-2               View 1
    1_Data center_B    2-4              viewer 1
    1_Data center_B    2-4              viewer 2Message was edited by:
    Sachin.Singh

    with t as
    (select xmltype(
    '... your xml here ...
    ') as xml from dual),
    panel_sets as ( select extractvalue(t2.column_value, '//*/@name') as panel_set,
                           extractvalue(t3.column_value, '//*'      ) as panel_id
                      from t, table(xmlsequence(extract(t.xml,           '//Menus/PanelSet'))) t2,
                              table(xmlsequence(extract(t2.column_value, '//*/PanelID'     ))) t3
        panels as ( select extractvalue(t2.column_value, '//*/@id'  ) as panel_id,
                           extractvalue(t3.column_value, '//*/@name') as link
                      from t, table(xmlsequence(extract(t.xml,           '//Menus/Panel'))) t2,
                              table(xmlsequence(extract(t2.column_value, '//*/Link'     ))) t3
    select s.panel_set, s.panel_id, p.link
      from panel_sets s, panels p
      where p.panel_id = s.panel_id
    PANEL_SET            PANEL_ID LINK
    0_Data center_A      1-1      status 1
    0_Data center_A      1-1      status 2
    0_Data center_A      1-1      status 3
    0_Data center_A      1-1      status 4
    0_Data center_A      1-1      status 5
    0_Data center_A      1-2      View 1
    0_Data center_A      1-2      View 2
    0_Data center_A      1-2      View 3
    0_Data center_A      1-2      View 4
    0_Data center_A      1-2      View 5
    0_Data center_A      1-2      View 6
    0_Data center_A      1-2      View 7
    1_Data center_B      2-4      viewer 1
    1_Data center_B      2-4      viewer 2
    2_Data center_C      3-2      inquiry 1
    2_Data center_C      3-4      reconciliation 1
    2_Data center_C      3-4      reconciliation 2
    2_Data center_C      3-4      reconciliation 3
    18 rows selected.

  • Urgent help needed for XML Tags using XMLForest()

    Folks
    I need some urgent help regarding getting use defined tag in your
    XML output.
    For this I am using XMLElement and XMLForest which seems to work fine
    when used at the SQL prompt but when used in a procedure throws and error
    SQL> Select SYS_XMLAGG(XMLElement("SDI",
                                       XMLForest(sdi_num)))
         From sdi
         where sdi_num = 22261;- WORKS FINE
    But when used in a procedure,doesnt seem to work
    Declare
        queryCtx  DBMS_XMLQuery.ctxType;
        v_xml     VARCHAR2(32767);
        v_xmlClob CLOB;
        BEGIN
        v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
                                             XMLFOREST(sdi_num)))
        From sdi
        where sdi_num = 22261';
        queryCtx :=DBMS_XMLQuery.newContext(v_xml);
        v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
        display_xml(v_xmlClob);
    End;
    CREATE OR REPLACE PROCEDURE  display_xml(result IN OUT NOCOPY CLOB)
    AS
         xmlstr varchar2(32767);
         line varchar2(2000);
    BEGIN
         xmlstr:=dbms_lob.SUBSTR(result,32767);
         LOOP
         EXIT WHEN xmlstr is null;
         line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
         dbms_output.put_line('.'||line);
         xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
         END LOOP;
    end;
    SQL> /
    .<?xml version = '1.0'?>
    .<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
    XML tag name.</ERROR>
    PL/SQL procedure successfully completed.
    SQL>HELP is appreciated as to where I am going wrong?

    Hi,
    if you want to transform something to something else, you should declare, what is your source.
    I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
    Kind regards,
    Hendrik

  • URGENT: Importing deployed-composites.xml File into MDS

    Gurus,
    I am running into a problem whereby soa-infra application crashes upon server restart.
    This doesn't allow soa_server (managed server) to come up properly.
    I see the following error during server start up:
    <Sep 20, 2011 3:02:18 AM PDT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'soa-infra'.
    weblogic.application.ModuleException: [HTTP:101216]Servlet: "FabricInit" failed to preload on startup in Web application: "/soa-infra".
    oracle.fabric.common.FabricException: Error in getting XML input stream: oramds:/deployed-composites/default/AttachmentSR_Sample_Composite_rev1.0/SCA-INF/lib/rt.jar: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/deployed-composites/default/AttachmentSR_Sample_Composite_rev1.0/SCA-INF/lib/rt.jar does not exist.
    at oracle.fabric.common.metadata.MetadataManagerImpl.getInputStreamFromAbsoluteURL(MetadataManagerImpl.java:276)
    at oracle.integration.platform.common.MDSMetadataManagerImpl.getInputStreamFromAbsoluteURL(MDSMetadataManagerImpl.java:545)
    at oracle.integration.platform.common.MDSMetadataManagerImpl.transferFile(MDSMetadataManagerImpl.java:820)
    at oracle.integration.platform.common.MDSMetadataManagerImpl.copyTree(MDSMetadataManagerImpl.java:801)
    at oracle.fabric.composite.model.CompositeModel.getClassLoaderFiles(CompositeModel.java:347)
    at oracle.fabric.composite.model.CompositeModel.getCompositeClassloader(CompositeModel.java:203)
    at oracle.integration.platform.kernel.WLSFabricKernelInitializer.deployComposite(WLSFabricKernelInitializer.java:506)
    What I am doing is this: I have added a SCA-INF/lib folder inside the project and added rt.jar file in it. Then I tried to deploy it, deployment did not happen successfully however, it made an entry in MDS as I could see entire composite in MDS along with rt.jar file. Now, when server restarts, it always tries to load the jar file from MDS and for some reason, it doesn't find the jar file despite it being very much in MDS at the correct path.
    Because of this, I ran into a deadlock situation.
    I cannot remove the composite from MDS (using removeSharedData ant task or WLST offline command) as my soa managed server is not up. So, request to http://serverhost:8001 throws 404 error when I use removeSharedData Ant task and WLST offliine sca_undeployCompoiste command. And, this composite entry in MDS doesn't allow the server to start up properly!!
    As another workaround, I've modified deployed-composites.xml file. But without soa-infra listed in EM Console, I cannot import the file.
    Does anyone know how I can import/upload deployed-composites.xml file from outside EM console (and without soa-infra being up!)?
    Thanks-
    Ashish

    If its urgent maybe you can delete the record from all the deployed composites from the Metadata database (you will have to redeploy all of them and you will leave some tush in the content tables).
    connect to the metadata database (XXXXX_MDS schema) configured for that soa_server, you will find a table named MDS_PATHS.
    there you will see all the paths of the files stored in the MDS.
    backup the table and then try
    1) THIS COMMAND DELETE ALL COMPOSITES PAHTS FROM METADATA but it leaves some blob content orphan:
    Execute:
    delete from mds_paths where path_fullname like '/deployed-composites%' and path_fullname <> '/deployed-composites' and path_fullname <> '/deployed-composites/default'; --if you have another partition you can filterit there
    restart the soa_server and the soa-infra will start with no composites. You will have to redeploy them all (but it will come up :).
    I use this method when the soa-infra wont come up because it doesnt found some file on /deployed-composites/.....................
    Anyway, if something goes wrong you can restore the table from your backup ;)
    글 수정: user7691407

  • Urgent help for processing XML stream read from a JAR file

    Hi, everyone,
         Urgently need your help!
         I am reading an XML config file from a jar file. It can print out the result well when I use the following code:
    ===============================================
    InputStream is = getClass().getResourceAsStream("conf/config.xml");
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    String line;
    while ((line = br.readLine()) != null) {
    System.out.println(line); // It works fine here, which means that the inputstream is correct
    // process the XML stream I read from above
    NodeIterator ni = processXPath("//grid/gridinfo", is);
    Below is the processXPath() function I have written:
    public static NodeIterator processXPath(String xpath, InputStream byteStream) throws Exception {
    // Set up a DOM tree to query.
    InputSource in = new InputSource(byteStream);
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    dfactory.setNamespaceAware(true);
    Document doc = dfactory.newDocumentBuilder().parse(in);
    // Use the simple XPath API to select a nodeIterator.
    System.out.println("Querying DOM using " + xpath);
    NodeIterator ni = XPathAPI.selectNodeIterator(doc, xpath);
    return ni;
    It gives me so much errors:
    org.xml.sax.SAXParseException: The root element is required in a well-formed doc
    ument.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213
    at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
    LDocumentScanner.java:570)
    at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.endO
    fInput(XMLDocumentScanner.java:790)
    at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XMLDocument
    Scanner.java:418)
    at org.apache.xerces.validators.common.XMLValidator.sendEndOfInputNotifi
    cations(XMLValidator.java:712)
    at org.apache.xerces.readers.DefaultEntityHandler.changeReaders(DefaultE
    ntityHandler.java:1031)
    at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEntityRead
    er.java:168)
    at org.apache.xerces.readers.UTF8Reader.changeReaders(UTF8Reader.java:18
    2)
    at org.apache.xerces.readers.UTF8Reader.lookingAtChar(UTF8Reader.java:19
    7)
    at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.disp
    atch(XMLDocumentScanner.java:686)
    at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
    canner.java:381)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.
    java:195)
    at processXPath(Unknown Source)
    Thank you very much!
    Sincerely Yours
    David

    org.xml.sax.SAXParseException: The root element is required in a well-formed document.This often means that the parser can't find the document. You think it should be able to find the document because your test code could. However if your test code was not in the same package as your real (failing) code, your test is no good because getResourceAsStream("conf/config.xml") is looking for that file name relative to the package of the class that contains that line of code.
    If your test code wasn't in any package, put a slash before the filename and see if that works.

  • URGENT !! Calling XML document in FORMS 6i

    Hello Friends,
    This is Anurag here . I have created an Application Help System in XML based on a WORD Document . Please can any one let me know how can I call this XML document in my application created in FORMS 6i.
    Its slightly urgent and any help from your side could come as a Blessing to me .
    Regards,
    Anurag Sharma

    You may post this question in the forum for Forms.

  • Urgent????extracting alphanumerics

    Hi Experts,
      Can any kindly explain how to extract Alphanumerics From R/3 to BW.
    I'm using generic extraction.
    from  CATSDB table i have to extract the data to BW. But for this table the  field RPROJ have Alphanumeric data.
    But this field having NUMC datatype in R/3. But the Alphanumeric data is getting to that field when we select ALV grid display.
    Plz its an Urgent. Today i should give answer to the client
    Thanks in advance,
    Deepa.c

    Hi,
    You have to be careful with your dimension order. It must be the same at all stages
    Let's assume that your Essbase model order is : Scenario, Account, Version, Year, Period, Entity, Project
    Then in your report you should have the exact order : Scenario, Account, Version, Year, Period, Entity, Project
    It will give you the following output file : Scenario, Account, Version, Year, Period, Entity, Project, "Data"
    Now in ODI, check that your datastore has also the same order : Scenario, Account, Version, Year, Period, Entity, Project, Data
    If not make a reverse in order to get back the same order as Essbase.
    Now try your interface but with no mapping. Do you still get data the same way as the report script ? If yes, then start implementing your mapping one member at the time.
    For my part, i've never do a mapping directly. I create a package with two interfaces. The first one creates a temporary file (or writes in a database) which is exactly that the output file of the report script. Then my second interface creates my final file with mappings.
    Regards

  • Urgent - Need an answer - XML Java API

    This is the 3rd time I've posted this question in last week - Oracle Support: How can I get an answer to this?
    This question is about how to free up the memory of XMLDocuments, Parsers, etc using the Java APIs - not the PLSQL wrappers.
    I'm writing an app using the DocumentSplitter class (from Steve M.'s book) that allows for the SAX parsing of large XML documents. But this question is really about the Oracle Java XML API.
    Is there a way to free the memory of each of the "temporary" XMLDocuments that get created? I know there's a XMLNodeCover.freeDocument(int id)
    method in the xmlplsql.jar- where do you get the id from? I'm trying XMLNodeCover.getDocumentId(curDoc) - but that doesn't seem to work.
    And can I use that same method for each Node and Element that gets created also?
    Also, would like to free the memory for the XSL processor, SAXParser, and XSLStylesheet - but this is even less obvious (although not as critical).
    I'm actually getting out-of-memory errors even sooner when using the SAX parser then when using the DOM parser, and I think its due to this issue.
    I know that there are PL/SQL wrappers for all these, but I'm trying to use the DocumentSplitter and associated custom classes
    in only Java stored procs, and then writing a single XSLT.transform wrapper. This way its largely invisible to the PLSQL layer.
    Thanks

    Hi - thanks for your response.
    Actually, yes, I did change the split method to return a CLOB. The big picture is I'm trying to use the DocumentSplitter
    class to assist in the transformation of large XML documents to html or tab-delimited output. Using the standard DOM parser,
    I eventually get an out-of-memory situation. So now I'm trying the DocumentSplitter to do a "mini" XSL transform on each <ROW>.
    The good news is it works for small to medium size reports. But its slower and runs out of memory quicker.
    Below is some of the relevant code. I also wrote associated classes to wrap the DocumentSplitter and to be the 'handler' that transfoms the XML when a <ROW> is found, and returns a string (see 'endElement' method below).
    I'm freeing the CLOBS in PLSQL after reading them - do I need to free them from JVM memory seprately? If so, how can I do that if I need to pass them to PLSQL?
    Thanks much,
    Eric
    // Split a large XML document into N subdocuments, each one identified
    // by the an opening 'splitElement' element. Invoke an XMLDocumentHandler
    // to process each subdocument encountered.
    public CLOB split(String splitElement, CLOB inputCLOB, CLOB outputCLOB)
    throws Exception, SAXParseException,SAXException,IOException, SQLException {
    this.inputCLOB = inputCLOB;
    this.outputCLOB = outputCLOB;
    this.splitOnElement = splitElement;
    // Create a new SAXParser
    SAXParser parser = new SAXParser();
    // Register the current instance of this class as the Document Handler
    parser.setDocumentHandler(this);
    // Create ascii stream from CLOB source
    InputStream inputStream = inputCLOB.getAsciiStream();
    // Start parsing the stream of XML
    parser.parse(inputStream);
    Writer out = this.outputCLOB.getCharacterOutputStream();
    // Set buffer to be the optimal size
    int chunk = outputCLOB.getChunkSize();
    char[] buffer = new char[chunk];
    // Create a reader from the output string
    StringReader reader = new StringReader(this.outputString);
    int length = -1;
    // Now write from output string to output CLOB
    while ((length = reader.read(buffer)) != -1) {
    out.write(buffer, 0, length);
    // Close streams
    reader.close();
    out.close();
    inputStream.close();
    return outputCLOB;
    portion of endElement method:
    // Handle the </Element> "end-element" parsing event
    public void endElement(String name) throws SAXException {
    // If we're NOT building a subdocument, we don't care. Just return.
    if (curDoc == null) return;
    // If this is the endElement event for the subdocument splitElement
    // then we're done with the subdocument and are ready to call the
    // handler to handle it.
    if (name.equals(splitOnElement)) {
    if (curDoc != null) {
    try {
    // Call the XMLDocumentHandler.handle() method for current subdoc
    //Append the output to the growing output string
    if (this.outputString == null) {
    this.outputString = handler.handleDocument(curDoc);
    } else {
    this.outputString = this.outputString + handler.handleDocument(curDoc);
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    }

  • Please help, Urgent ! creation of xml from servlet

    Hi,
    I have to write a servlet that takes user input from a html form and creates a xml file from those input parameters and transform that xml file into html form using xsl program. Whenever the user adds new values to the form this newly generated xml file should overwrite the previous xml file content.
    Can anybody please tell me how to create a xml file from user input in servlet so that I can pass it to a transformer object.
    Thanks in advance!

    why write out the XML, it seems to be only a temporary file?
    Doing as you suggest is extremely risky for when several requests come in at the same time you can never be sure that the file contains the data that you just wrote to it.
    Better to keep the XML all in memory.
    For the XML creation, look no further than DOM. Most XML parsers provide excellent DOM support, I'll be using Xerces 2 here as that's what I'm most familiar with.
    Document doc = new DocumentImpl();
    Element root = doc.createElement("mydoc");
    * fill in the XML
    Element elem = doc.createElement("focuscontrol");
    elem.appendChild(doc.createTextNode("alert('loaded')"));
    root.appendChild(elem);
    elem = doc.createElement("data");
    elem.appendChild(doc.createTextNode("Hello World!"));
    root.appendChild(elem);     
    doc.appendChild(root);     creates an XML Document object like this:
    <?xml version="1.0"?>
    <mydoc>
      <focuscontrol>alert('loaded')</focuscontrol>
      <data>Hello World!</data>
    </mydoc>This XML Document object can be easily passed to an XSLT processor to turn it into HTML.
    String path = getServletContext().getRealPath("/WEB-INF/xsl/");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xslSource = new StreamSource(new File(path, "myxslfile.xsl"));
    Source xmlSource = new DOMSource(doc);     
    t.transform(xmlSource, new StreamResult(out));where out is the PrintWriter for the servlet and your XSL file is stored in yourwebapp/WEB-INF/xsl (thus out of sight of prying eyes).
    I leave it up to you to find an encoding of your request parameters into the generated XML that you like.

  • Urgent help importing an XML file

    Hi all,
    I'm currently exporting my XML files from Magento, the webshop client. However I cannot use the XML task in ETL because I get the error about namedspaces. I can open the XML file itself no problem, it contains a few columns with data, some empty values.
    What I do to solve the error is create the script in ETL that converts the XML file so that I can make the SDX schema. The ETL script itself works 
    <?xml version="1.0" encoding="utf-8" ?> 
    <xsl:stylesheet version="1.0"         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
      <xsl:output method="xml" indent="no" /> 
      <xsl:template match="/|comment()|processing-instruction()"> 
        <xsl:copy> 
          <xsl:apply-templates /> 
        </xsl:copy> 
      </xsl:template> 
      <xsl:template match="*"> 
        <xsl:element name="{local-name()}"> 
          <xsl:apply-templates select="@*|node()" /> 
        </xsl:element> 
      </xsl:template> 
      <xsl:template match="@*"> 
        <xsl:attribute name="{local-name()}"> 
          <xsl:value-of select="." /> 
        </xsl:attribute> 
      </xsl:template> 
    </xsl:stylesheet> 
    But when I open the newly created file he looks really odd: See below for the initial file and the new file (based on how many times I open the file, i get another weird look...). Please help me out it's killing me :)

    Or you can apply a XSLT transform as per http://blogs.msdn.com/b/mattm/archive/2007/12/15/xml-source-making-things-easier-with-xslt.aspx
    Arthur My Blog

Maybe you are looking for