Upload xml using xpath when data in scattered in different tags

Hi,
My problem is "I have to upload a big XML File into a relational master child model of hierarcy=5,but the struture of the xml is not as per the Data Model".I am using the xpath approach in PL/SQL because there is no other way I can get this done.Can you tel me how can I do this effeciently using this approach.Secondly,How can I increase the performance in this scenarion ?
Thanks a Lot !!!

Hi Marco,
Thanks for your advice.
Please tel me how canI use Xmltype view to come out of this problem.As I already mention that the xml tree is not per the Data model and the nodes name is also differenr so how can I do this.I don't know java but can handle pl/sql.
Thanks !! Waiting for further advice.

Similar Messages

  • Count multiple nodes in XML using xPath

    Hi',
    How to count the CUSTSERIAL node in the below XML using xPath.
    <missingICCRec>
    <MissingField xmlns="http://www.Google.com/MissingFields/v1.0">
    <CUSTSERIAL xmlns="http://Google.com/InboundService">23809002RN</CUSTSERIAL>
    <CUSTSERIAL xmlns="http://Google.com/InboundService">23809003RN</CUSTSERIAL>
    <CUSTSERIAL xmlns="http://Google.com/InboundService">23809004RN</CUSTSERIAL>
    </MissingField>
    </missingICCRec>
    Thanks
    Yatan

    Yatan,
    I created a simple BPEL with assign to count the node. Using ora:countNodes() function is throwing exception but when i tried with count() it works.
    XSD seems to be valid. Only you need to have the function as below.
    count(bpws:getVariableData('inputVariable','payload','/client:process/client:missingICCRec/client:MissingField/client:CUSTSERIAL'))
    XSD Used:
    <?xml version="1.0" encoding="UTF-8"?>
    <schema attributeFormDefault="unqualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/PIMtoRPASAmendment/BPLENodeCount/BPLENodeCount"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="process">
    <complexType>
    <sequence>
    <element name="missingICCRec">
    <complexType>
    <sequence>
    <element name="MissingField">
    <complexType>
    <sequence>
    <element name="CUSTSERIAL" maxOccurs="unbounded" type="string"/>
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    <element name="processResponse">
    <complexType>
    <sequence>
    <element name="result" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    This works !!!
    Please let me know if this helps.
    Thanks,
    Vijay

  • Write XML using XPath

    Hi,
    I have a problem. I need to WRITE a XML using XPath.
    Supose that XPath String : "/clients/client/name"
    Equivalent XML :
    <clients>
    <client>
    <name></name>
    </client>
    <clients>
    Please, helpme ...
    The XPath Strings are dinamic, there are lot of combinations.
    Is there an API (free ?) that support this ?
    Thankz

    Normally XPath is used for searching existing XML documents, not for creating new ones. So it's unlikely that anything exists to do what you ask. But not impossible, people do the strangest things. Have you searched Google?
    Of course you realize you can't use arbitrary XPath expressions here, for example what would you do with a predicate?

  • Creating New XML using xPath

    Hi,
    I wanted to know if an XML Document created in the Database using xPaths. I mean, I don't want to creat any XML file on the OS in the first place. I want to create an XML using a table containing xPaths. Can this be done in XDB ?
    Thanks in Advance,
    Piyush

    Hi Piyush
    I don't see how you can create a XML document via xpath!?!? xpath it's only used to reference data in an XML document...
    Chris

  • Creating XML using XPath

    Hello,
    I want to creat XML document using Dom and XPath, as per my knowledge goes I can't create it using XPath {I may b wrong, if I am then pls tell me know :-) }.
    If there doesn't exists any thing like this I am thinkin of wrapping a class {say its XPathProcesserDom} which takes the XPath querry and internaly creates XML Document and returns on request. Is this a good idea :-)
    waiting for comments :-)....
    thanks and regards,
    MaheshPujari

    Hi Piyush
    I don't see how you can create a XML document via xpath!?!? xpath it's only used to reference data in an XML document...
    Chris

  • Read xml using xpath in java

    Hi ALL,
    I have a xml as follows:
    <AAA>
    <BBB>
    <CCC>xyz</CCC>
    <DDD>abc</DDD>
    </BBB>
    </AAA>
    Now using any of the java class, i just need read the value of "CCC" as follows:
    (i.e using xpath i need to read the value)
    String val = x.somemethod("/AAA/BBB/CCC");
    Thanks!

    In case you're curious - here's the dom4j equivalent of dvohra09's sample code.
    SAXReader saxReader = new SAXReader("org.apache.xerces.parsers.SAXParser");
    Document doc = saxReader.read(source); //Where source is your file, input source, input stream, reader, or url
    String value = doc.valueOf("//AAA/BBB/CCC"); //Result given the xml from OP = 'xyz'OK - not much difference with this simple example but if you haven't settled on an API, dom4j is worth looking at (IMHO).
    &#8734; brewman &#8734;

  • How to use Xpath to query elements loaded from different xml docs?

    I have a big DBLP XML doc (95mb), to load into the container, i splitted the doc into many small xml docs by the publication types, such as articles, books, inproceedings, etc.
    I tried to use xpath query such as
    query 'collection()/dblp[article/author]/book[title]'
    I got empty answers.
    but if i use XQuery such as
    query 'let $r:=collection()/dblp,$a :=$r/inproceedings/author
    for $l2 in $r/book
    where $a and $l2/title
    return <result> {$l2}{$a}</result>'
    i got answers. However, if i remove {$a} from the return clause, i still got empty answers.
    is there any problem with my Xpath query and flwor Xquery?
    regards,
    xiaoying

    Hi John,
    Following is the procedure i have used to load the xml docs (after the indexes have been created):
    private static void loadXmlFiles(File path2DbEnv,String theContainer, File file) throws Throwable {
         //Open a container in the db environment
              XmlManager theMgr = null;
              XmlContainer openedContainer = null;
              myDbEnv env;
              try {
              env = new myDbEnv(path2DbEnv);
         theMgr = new XmlManager(env.getEnvironment(), new XmlManagerConfig());
         //use node container
         theMgr.setDefaultContainerType(XmlContainer.NodeContainer);
                   try{
                   openedContainer = theMgr.createContainer(theContainer);
                   }catch (XmlException e){
                        //if the container alreay exist, then open it;     
                        openedContainer = theMgr.openContainer(theContainer);
              //Get an update context.
              XmlUpdateContext updateContext = theMgr.createUpdateContext();
                   String theFile = file.toString();
                   String docName=file.getName();
              //Get the input stream.
              XmlInputStream theStream = theMgr.createLocalFileInputStream(theFile);
              System.out.println("Adding " + theFile + " to container " +
                             theContainer);
         //     Do the actual put
              openedContainer.putDocument(docName, // The document's name
              theStream, // The actual document.
              updateContext, // The update context
         //     (required).
              null); // XmlDocumentConfig object
              System.out.println("done.");
              //XmlException extends DatabaseException, which in turn extends Exception.
              // Catching Exception catches them all.
              } catch (XmlException e){
                   System.err.println("Error loading files into container " + theContainer);
                   System.err.println(" Message: " + e.getMessage());
                   //In the event of an error, we abort the operation
                   // The database is left in the same state as it was in before
                   // we started this operation.
                   throw e;
              finally {
              cleanup(theMgr, openedContainer);
    Unfortunately, i waited for around 20 hours 148mb doc was not loaded; so i gave up.
    Could you please give me some suggestions on how to load the large doc efficiently ? thanks.
    regards,
    xiaoying

  • Displaying XML using XPath expressions

    Hi. I have a XML file which looks something like this:
    <?xml version="1.0"?>
    <SAQ>
    <question id="1">
    What does UML stand for?
    <answer id="1" correct="yes">
    Unified Modelling Language
    <explanation>
    Explanation
    </explanation>
    </answer>
    <answer id="2" correct="no">
    United Modelling Language
    <explanation>
    Wrong
    </explanation>
    </answer>
    </question>
    I want to just display the Question, not the child Answer and Explantion nodes under it, but when I use:
    <c:set var="temp" value="1" />
    <x:out select="$doc//SAQ//question[@id = $temp]" />
    it displays:
    What does UML stand for? Unified Modelling Language Explanation United Modelling Language Wrong
    How do I just display the parent question node and not its child answer and explanation nodes?
    Thanks!

    use the text() xpath function it should work:
    <x:out select="$doc//SAQ//question[@id = $temp]/text()" />

  • Adobe Designer 7.0 - XML parsing error when data connection to XML with UTF-16

    Hi all
    <br />
    <br />I need to change my data connection xml file to use UTF-16 instead of ISO-8859-1. When I connect the file with the UTF-16 encoding, I receive the following error
    <br />
    <br />Invalid XML: Xml parsing error: encoding specified in XML declaration is incorrect (error code 19) ..
    <br />
    <br />The XML declaration is:
    <br /><?xml version="1.0" encoding="utf-16"?>
    <br />
    <br />I am able to succesfully set the encoding to "UTF-8". UTF-16 should also be possible.
    <br />
    <br />Has anyone seen this error before ? How can I resolve this ?
    <br />
    <br />Thanks in advance
    <br />
    <br />Bilal Haniff

    Thank you, expert, for your quick reply.
    Described problem got solved: we noticed later that the extra text only appears for users using Adobe professional 7.0, 'normal' users with adobe 8.0 reader don't get the extra text, so that is ok for us.

  • How to remove elements/attributes from XML using Xpath in XSLT ??

    Hello ,
    Is there anyway or method of Xpath from which I can delete the elements and attributes from XML at runtime ??
    Like I have such XML and I have to remove per attribute highlighted below
    <person per="and">
    <e:emp a="ir" b="ad" >
    </e:emp>
    </person>
    And want a result like this
    <person>
    <e:emp a="ir" b="ad" >
    </e:emp>
    </person>
    Thanks

    To achieve this you can use the bpelx:remove function: http://download.oracle.com/docs/cd/E12483_01/integrate.1013/b28981/manipdoc.htm#CIHJBJFD
    your assign will look like:
    <bpel:assign>
    <bpelx:remove>
    <target variable="person" query="/person/@per" />
    </bpelx:remove>
    </bpel:assign>
    Regards,
    Melvin

  • Insert Node into XML using XPATH

    Hi,
    I'm having problems inserting a node into a XML. After getting some attributes from the CRC result i'd like to store them in a temp xml variable.
    After that the parent node of the attributes should be inserterd in a goal XML with a repeating node structure.
    Whats the right way to set a node to a certain position in the goal XML?
    Now the only thing i'm getting is erros about transaction:
    Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a307d1e:fd15:4d35c503:1351f50 status: ActionStatus.ABORT_ONLY >
        at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectio nManager.java:304)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnec tionManager2.java:396)
    Etc..
    Thx!

    You can always append new nodes which has a unique tag name (this won't get overwritten).
    Which means, each time when you add a node, it should have tag name which has not already present within the same parent node.
    Later you can replace the tag name with the actual name by using XSL transformations.
    I've tried this in one of my project and worked fine.
    Nith

  • Retrieve records based on condition from xml using XPATH

    Hi all,
    I have a table form_content where there are two columns - form_content_id (numeric) and xml_content (clob). The structure of xml_content is
    <RAF xmlns="http://www.abnamro.com/WCS/GCEG/KRT">
    <XBorderRAF>
    <ClientProfile isBranch="1" isBusinessAddressDifferent="1" isSubsidiary="0" regDate="2009-09-01">
    <RegisteredAddress city="test" country="GB" nameOfContactPerson="3454545" street1="test" telephoneNumber="34534545"/>
    </ClientProfile>
    </XBorderRAF>
    </RAF>
    I want to retrive all form_contant_id from form_content table where country is 'GB' inside RegisteredAddress tag.
    I am able to retrive all form_content_id with country value using below query,
    SELECT form_content_id,
    extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')
    as registerAddress
    from
    form_content
    but I am finding it difficult to reterive records based on any condition..
    SELECT form_content_id,
    extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')
    as registerAddress
    from
    form_content
    where
    (extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')='GB'
    Please help me to resolve this problem. ....
    Thanks

    Ok, thaks to all who looked this query, I found the answer
    select form_content_id
    from xmltest
    where existsnode(xmltype(xml_content), '/RAF/XBorderRAF/ClientProfile/RegisteredAddress[@country="GB"]','xmlns="http://www.abnamro.com/WCS/GCEG/KRT"') = 1;

  • Xml loading using xpath in pl/sql

    Hi,
    I am loading xml using xpath query bu i am stucked here.I am not able to pass the loop counter "I" into the query.Please help.
    The problem is in line " 13 FROM xml_table,table(XMLSequence(extract(OBJECT_VALUE, '/BIF/SBI/SBC/flag'))) li;
    " in the below block
    1 declare
    2 SBI_count pls_integer;
    3 begin
    4 select count(*)
    5 into SBI_count
    6 from xml_table,table(XMLSequence(extract(OBJECT_VALUE, '/BIF/SBI') ) );
    7 dbms_output.put_line( 'SBI_count '||SBI_count );
    8 for I in 1..SBI_count
    9 LOOP
    10 INSERT INTO Subclass_Date_Flags( Subclass_Id,
    11 subclass_date_flags_8 )
    12 SELECT 'SID',extractvalue(VALUE(li), '//flag')
    13 FROM xml_table,table(XMLSequence(extract(OBJECT_VALUE, '/BIF/SBI[I]/SBC/flag'))) li;
    14 dbms_output.put_line( 'Row '||SQL%ROWCOUNT );
    15 END LOOP;
    16 commit;
    17* end;
    SQL> /
    SBI_count 2
    Row 0
    Row 0
    PL/SQL procedure successfully completed.

    Try this code, just keep a reference to your root node so you can keep appending children to it:
    DECLARE
    xmlDoc xmldom.DOMDocument;
    xmlNode xmldom.DOMNode;
    xmlNode1 xmldom.DOMNode;
    xmlElem1 xmldom.DOMElement;
    xmlElem2 xmldom.DOMElement;
    xmlText xmldom.DOMText;
    CURSOR cur_emp IS
    SELECT *
    FROM emp;
    --WHERE empno = 7369;
    row_emp emp%ROWTYPE;
    BEGIN
    xmlDoc := xmldom.newDOMDocument;
    xmlNode := xmldom.makeNode(xmlDoc);
    xmlElem1 := xmldom.createElement(xmlDoc,'root');
    xmlNode := xmldom.appendChild(xmlNode,xmldom.makeNode(xmlElem1));
    OPEN cur_emp;
    LOOP
    FETCH cur_emp INTO row_emp;
    EXIT WHEN cur_emp%NOTFOUND;
    xmlElem2 := xmldom.createElement(xmlDoc,'name');
    xmldom.setAttribute(xmlElem2, 'empno',TO_CHAR(row_emp.empno));
    xmlNode1 := xmldom.appendChild(xmlNode,xmldom.makeNode(xmlElem2));
    xmlText := xmldom.createTextNode(xmlDoc,row_emp.ename);
    xmlNode1 := xmldom.appendChild(xmlNode1,xmldom.makeNode(xmlText));
    END LOOP;
    CLOSE cur_emp;
    xmldom.writeToFile(xmlDoc,'c:\xmltest1.txt');
    END;
    null

  • C++ sample code using XPATH

    Need to navigate an XML and extract xml nodes using XPATH expressions in C++ Application.
    Please send us a C++ code sample using Oracle 9.2.0.3 XPATH API functions to extract an XML using XPATH expression.
    Thanks
    Shiva

    Hi,
    Where i can find this path "$XDK_HOME\xdk\demo\c\xslt"
    thanks in advance
    shashi.

  • Forming XMLs using XML beans

    Hi ,
    I am forming XMLs using XMLBeans whose XSDs been provided.
    The tag values are coming from the database which I am querying.
    and then adding the various tags as per the XSD.
    In the End,I am using the ,doc.toString() where doc is the Document object as per the XSD.
    and then writing it to a file.
    I want to know ,what limitations can this method have or what might be a better way.
    Will there be a restriction on the size of the xml being formed??
    Thanks in Advance

    I modified the code :
    [code]
    Select P.PAT_MRN,
               XMLELEMENT("Patient",
                          (XMLELEMENT("pat_mrn", P.pat_mrn)),
                          (XMLForest(cm_results_o_t(CAST(MULTISET
                                                                    (SELECT O.COMP_NAME AS "ID"
                                                                       FROM oper O
                                                                      WHERE O.ENCOUNTER_ID =
                                                                            E.ENCOUNTER_ID) AS
                                                                    component_list_t)) AS
                                               "Results"))) AS Orderxml
         FROM PATIENT P
         JOIN ENCOUNT E
           ON P.PAT_MRN = E.PAT_MRN
          AND P.PAT_MRN = '63280'
          AND E.ENCOUNTER_ID = 42
    [/code]
    Need the Res_LIST tag to be removed which is coming from object type.

Maybe you are looking for

  • 500 internal server error while executing templates

    Hi All, We are receiving the 500 Internal server while excecuting few of our webtemplates. The error message is . Access to a shared objects area that has already been released. com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Access to

  • What router will work on my 2006 iMac?

    What router will work with my 2006 iMac 10.4.11?

  • IR posting without DCIn happening for PO

    Hi Gurus, I have a scenario, where the Invoice Receipt is happening without DCIn(Del. Cost Invoice) in Purchase Order, we were expecting a error for Exchange rate while posting the IDoc. Is there any setting or a way to determine the solution. Please

  • My life with my Time Capsule

    So I just thought I'd post my experience with my new 500GB TC. I opened it up, installed the latest APU software, plugged my modem, and power, to the TC, fired it up, and my mac found it wirelessly, at which point I set my preferences and Bang......

  • Pros and Cons

    Is there a handy list somewhere with the features which will work in leopard and ilife08 when installed on a iMacG5 powerPC 1.8GHz machine? I am trying to weigh up the benefits of upgrading from Panther and iLife06 or trading up to a new machine. I a