Need help in XML data processing

Hi All,
I have to process a stored procedure's input parameter which comes as a string in the XML format.
Ex:
<Search>
<Row1>
<Table1>Tab1</Table1>
<Column1>col1</Column1>
<Operator1>op1</Operator1>
<Value1>val1</Value1>
</Row1>
<Row2>
<Table2>Tab2</Table2>
<Column2>col2</Column2>
<Operator2>op2</Operator2>
<Value2>val2</Value2>
</Row2>
</search>
I should process the above parameter and build a select query from each row.
Ex: select * from Tab1 where col1 op1 val1;
How can i achieve this?
i am using oracle 11g version.
Thanks in advance to all.

Your xml is not "well-formed" as every tag has a separate name (the numbering part in Row1, Row2 etc.), i would expect it as
<Search>
  <Row>
    <Table>Tab1</Table>
    <Column>col1</Column>
    <Operator>op1</Operator>
    <Value>val1</Value>
  </Row>
  <Row>
    <Table>Tab2</Table>
    <Column>col2</Column>
    <Operator>op2</Operator>
    <Value>val2</Value>
  </Row>
</Search>Anyway, this would do what you want:
WITH DATA AS (SELECT XMLTYPE('<Search>
                              <Row1>
                              <Table1>Tab1</Table1>
                              <Column1>col1</Column1>
                              <Operator1>op1</Operator1>
                              <Value1>val1</Value1>
                              </Row1>
                              <Row2>
                              <Table2>Tab2</Table2>
                              <Column2>col2</Column2>
                              <Operator2>op2</Operator2>
                              <Value2>val2</Value2>
                              </Row2>
                              </Search>') xml
                FROM DUAL
SELECT 'SELECT * FROM ' || TAB || ' WHERE ' ||COL || ' ' || OPER || ' ' || VALUE
  FROM (SELECT EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Table' || LEVEL) TAB,
               EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Column' || LEVEL) COL,
               EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Operator' || LEVEL) OPER,
               EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Value' || LEVEL) VALUE
          FROM DATA
          CONNECT BY LEVEL<100
WHERE TAB IS NOT NULL

Similar Messages

  • Need help in optimizing the process

    I need help in optimizing my process. Here is what am I doing:
    I have two tables table A and table B. table A has list of names and table B has name and ID. Right now I am loading name into cursor from table A and for each name from the cursor I try to match with name in table B to get the ID. This process takes very long to complete. I need help to replace PL/SQL with SQL if possible. I am using oracle utl_match to match the best possible record in table B. table B sometimes returns multiple matching records. I take the top nearest match name and ID for my use (there is not always one to one match)
    Any idea or help will be appreciated. Thanks

    always provide create table and sample data instert statements when asking a question. also, provide your database version.
    because you're using utl_match, you can't really use an index, there must be a cartesian join on the two tables so it may always be slow.
    however, here's a sample SQL that you may be able to make use of:
    with n as (select 'KATHERINE' person_name from dual
                 union all
                 select 'STEVE' from dual
                 union all
                 select 'BRUCE' from dual)
        ,nid as (select 'CATHERINE' person_name, 1 NID FROM DUAL
                 union all
                 select 'STEFAN', 2 from dual
                 UNION ALL
                 select 'STEVEN', 2 from dual
                 union all
                 select 'CATHY',3 from dual)
    select n_name, nid
      from (
            select n.person_name N_NAME
                  ,nid.person_name
                  ,nid.nid
                  ,ROW_NUMBER() OVER (partition by n.person_name ORDER BY utl_match.jaro_winkler_similarity(n.person_name,nid.person_name) DESC) jws_ORDER
              from n
              join nid on (utl_match.jaro_winkler_similarity(n.person_name,nid.person_name) > 70)
      where jws_order = 1;    

  • Need help in converting date format

    Hi,
    Need help in converting date format from 'DD-MON-YYYY' to 'YYYY-MM-DD' in an .rtf template as I believe xml publisher supports the date format as 'YYYY-MM-DD' only.
    Thanks,
    Raj.

    I got the same problem, anyone know how to solve this problem? I allready found some date functions on http://blogs.oracle.com/xmlpublisher/2008/09/date_functions.html . I also tried <?xdoxslt:month_name(xdoxslt:get_month(xdofx:substr(NEED_BY_DATE, 4,3)), $_XDOLOCALE), 0, 'nl-NL')?>, but then it returns a namespace error (Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.). Anyone know how to fix this?
    Edited by: user11165753 on 7-dec-2009 23:50

  • Need help in transfering data to my new iphone4 from my old iphone3

    Hello, just received my new iphone 4, need help in transfering data from my old iphone 3 photos, emails etc. apps, thank you

    http://support.apple.com/kb/ht2109

  • Need help in oracle data recovery

    Friends ,i need help in oracle data recovery.
    I had an oracle 8i database running on windows.
    For some reason Windows operating system crashed.
    It is not booting up.
    I dont have current backups.But my database physical files are in the disk.
    Controlfile,datafiles and redo log files are there.
    Is there any way I can recover my database?
    Please help in this issue.
    regards
    Ajith

    HI citrus,
    thanks for the reply.
    I have installed database 9i on the same PC after O/S reinstallation.
    You are saying that ,I need to keep oracle root folder same as that of my old installation ,and copy control files,redo log and data files in exactly same folders as that of old database,and then start the database?
    thank you for your patience and support.
    regards.,
    Ajith

  • I need help proving the date tag on a photo stored in my iPhoto is from the date it was sent to my iphone/date it was imported into iphoto - and that it is NOT the date the photo was actually taken.  Please help!

    I need help proving the date tag on a photo stored in my iPhoto is from the date it was sent to my iphone/date it was imported into iphoto - and that it is NOT the date the photo was actually taken.   I recieved a photo via text on my iphone and then I synced my iphone to my macbook and now it is in iphoto.  I already know that the date on the photo per the tag that shows up on it in iphoto is NOT the date the photo was actually taken.  I need article or literature or something confirming the tag is from when it was sent to the iphone and/or when it was imported.  I greatly appreciate some assistance!

    All I am trying to do is find something on a forum board or article etc stating that the the date showing in iphoto could be the date it was imported or synced or sent to me and not the actual date taken.
    The date on the photo could be anything because you can edit the date with iPhoto or any of 100 apps, free and paid for. So, the date on the photo will prove nothing, I'm afraid.
    Regards
    TD

  • Need help for interface to process employee expenses

    need help for interface to process employee expenses
    i have used the interface tables as
    AP_INVOICES_INTERFACE
    AP_INVOICE_LINES_INTERFACE
    are they the right one
    is there a concurrent program or any API for doing interface

    hi,
    i think what ever table are using for interfacing expenses correct.
    but you have to enter invoice type as expense report.
    Regards,
    Srikanth

  • I need help with XML Gallery Fade in out transition. somebody please help me :(

    I need help with XML Gallery Fade in out transition. somebody please help me
    I have my post dont want to duplicate it

    The problem doesn't lie with your feed, although it does contain an error - you have given a non-existent sub-category. You need to stick to the categories and sub-categories listed here:
    http://www.apple.com/itunes/podcasts/specs.html#categories
    Subscribing to your feed from the iTunes Store page work as such, but the episodes throw up an error message. The problem lies with your episode media files: you are trying to stream them. Pasting the URL into a browser produces a download (where it should play the file) of a small file which does not play and in fact is a text file containing (in the case of ep.2) this:
    [Reference]
    Ref1=http://stream.riverratdoc.com/RiverratDoc/episode2.mp3?MSWMExt=.asf
    Ref2=http://70.33.177.247:80/RiverratDoc/episode2.mp3?MSWMExt=.asf
    You must provide a direct link to the actual mp3 file. Streaming won't work. The test is that if you paste the URL of the media file (as given in the feed) into the address bar of a browser it should play the file.

  • Help needed with sending XML data out of Dashboard design/ Xcelsius

    Hi All,
    I did this a year back and got it right, but now am not able to get it, probably Ive made a small mistake which I have been overlooking.
    I selcted Enable XML send in my XML data connection and dfined the connection name as "Range_1" and Range name also as "Range_1"
    Now I worte this servlet in Java:
    public class PostTestServlet extends HttpServlet{
         protected void doPost(HttpServletRequest request, HttpServletResponse response){
         String param1=request.getParameter("Range_1");
         System.out.println(param1);
         protected void doGet(HttpServletRequest request, HttpServletResponse response){
         System.out.println("Get Called");
         doPost(request,response);
         System.out.println("abcd");
    Deployed it to Apache Tomcat 6.
    Also selected the required usage options in Xcelsius for sending data every 10 seconds.
    Now the servlet gets called, I see it in the console.
    But the request.getParameter("Range_1") is returning null.
    Tried many things, not able to figure it out. Any help?
    Thanks
    Nikhil

    Hi,
    Xcelsius/Dashboards will convert the range of values that you want to send into XML.
    It then will POST the XML when it calls the web page.
    For example, if you had created three ranges to send to your web page:
    A (a single cell)
    B (a single cell)
    C (a row of three cells)
    The data in the POST input stream for the web page will look something like this:
    <data>
      <variable name="A">
        <row>
          <column>10</column>
        </row>
      </variable>
      <variable name="B">
        <row>
          <column>15</column>
        </row>
      </variable>
      <variable name="C">
        <row>
          <column>1</column>
          <column>2</column>
          <column>3</column>
        </row>
      </variable>
    </data>
    I don't have an example for ASP, but I do for a JSP (attached).
    Regards
    Matt

  • Need help in ViewObject Data Validation

    HI Everyone,
    I have few queries about ViewObject. I'm working on JDev11gU2 ADFRC.
    Actually i made an application to upload XLS file to af:table. Everything is working but now I stucked with some functionality. Like -
    1. After inserting all rows in table have opposite sequence as in XLS file, I mean i want to know that is there any way with method VO.readXML() i can
    Insert rows below the previous one. by default it is taking new row as first row in af:table.
    2. Second thing is, I need to show at least 100 lines in af:table by default after uploading data of minimum 3000 lines. So like we had paging functionality in JDev 10g, but in 11g we have scroll and fetch functionality, because of this after loading 100 lines in table my application gets very slow. So any solution to put some same paging functionality like 10g.
    3. Validate all Row attribute in Viewobject, like I have a button say Validate Data, after clicking it all Data of viewobject should validate and if there are any Invalid data. So that Row column should get highlighted. Validation just like before committing data.These are some critical requirement so is there anyone who can guide me properly.
    Thank you,
    Fizzz...

    ok Grant,
    these are all just for explanation only, my exact tables and entity is totally different,
    So just guess i have -
    EmpView(from Employee Entity) - set to show only new inserted rows(Fresh Uncommitted Rows only)
    Attr - EmployeeId (PK)
            EmpName
            DeptId (FK - Department Entity)
            JobId (FK - Job Entity)
            InstId (FK - Institute Entity)
    DeptView(from Departement Entity)
    Attr - DeptId (PK)
            DeptDesc
            InstId (FK - Institute Entity)
    InstView(from Institute Entity) -
    attr - InstId (PK)
            InstDesc
    JobView(from Job Entity) -
    attr - JobId (PK)
            JobDesc
    Now I have one table named *New Employee* on my page to Add more Employees using EmpView ViewObject, For that i have one XLS sheet with all new employee data,
    After Upload XLS File New Employee Table is Like(All Fields are already filled) -
    Line No. EmployeeId           DeptId          InstId       JobId
    1           70021             D10             I01       -->J80
    2           70022          -->D90             I01          J10
    3           70023             D20          -->I20          J20
    4           70024             D30             I03          J10
    5           70025          -->D70          -->I10       -->J50Now what i need is, Suppose
    Invalid Data is (Which Does not exist in their main Table)
    In Line 1 : JobId = J80 (Not exist in Job Entity)
    In Line 2 : DeptId = D90
    In Line 3 : InstId = I20
    In Line 4 : No Error
    In Line 5 : All Three fields have invalid values.
    So now I'm trying to Identify these errors and try to get exact column attribute like above to highlight them in table in red with showing proper formatted msg to user. Like :
    Msg for User :
    These Lines have INVALID DATA :
    Line 1 : JobId,
    Line 2 : DeptId,
    Line 3 : InstId,
    Line 5 : JobId, DeptId and InstId.
    If i do ViewObject Validation then at the time i Uploading process of data from XLS get very slow for large amount of rows like 250<, That's why i was trying to do it after uploading data.
    So after upload i got above table. Now i have a save button where I'm committing data, which calls doDML() method for that Employee entity, where
    suppose process gets error on Line 1 then whole process stops there and throws JboException, and i got Line no 1 for my Msg to show user, but what about other faulty rows,
    For that i catched that exception so after every faulty row process continues, but now the line 4 , which has no error it get committed in DB. I don't want this.
    Another solution i got is use postChange(), but here I'm not getting what I'm doing wrong, problem is it post all previous rows too, suppose i have new 5 lines as shown above but in postChange() method post rest of old lines too. It is making me completely crazy,
    It is very urgent so could not able to find more time to research on this so you please help me, or if you have some examples related to this then please send me the links.
    hope above scenario will help you to understand my problem.
    Thanks
    fizzz...
    Edited by: Fizzz on Jul 8, 2009 1:10 PM

  • Stax reading /writing need help from xml guru plz

    hi, i have been told that stax reading /writing should involve no overhead and that is why i use it and i am now able to write my large data to file, but using my reader i seem to run out of memory, using netbeans profiler i ahve found that char[] seems to be the problem,
    by backtracing i ahve found that javax.xml.parser.SAXParser.parse calls the xerces packages which eventually leads to the char[ ], now my code for my reader is attatched here...
    package utilities;
    import Categorise.Collection;
    import Categorise.Comparison;
    import Categorise.TestCollection;
    import java.io.IOException;
    import javax.xml.parsers.*;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.Attributes;
    import java.io.File;
    import java.util.ArrayList;
    import java.util.List;
    import measures.Protocol;
    * @author dthomas
    public class XMLParser extends DefaultHandler
        static Collection collection = new Collection();
        List<Short> cList;
        List<Comparison> comparisonList;
        File trainFileName;
        File testFileName;
        TestCollection tc;
        List<TestCollection> testCollectionList;
        List<File> testFileNameList = new ArrayList<File>();
        List<File> trainFileNameList = new ArrayList<File>();
        boolean allTrainsAdded = false;
        Protocol protocol;
        List<File> trainingDirList;
        File testingDir;
        int counter = 0;
        File[ ] trainingDirs;
        File[ ] trainingFileNames;
        File[ ] testFileNames;
        TestCollection[ ] testCollections;
        Comparison[ ] comparisons;
        Comparison c;
        short[ ] cCounts;
        String order;
        String value;
        File trainDir;
        /** Creates a new instance of XMLParser */
        public XMLParser() {
        public static Collection read( File aFile )
            long startTime = System.currentTimeMillis();
            System.out.println( "Reading XML..." );
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp;
            try {
                sp = spf.newSAXParser();
                sp.parse( aFile, new XMLParser() );
            } catch (IOException ex) {
                ex.printStackTrace();
            } catch (SAXException ex) {
                ex.printStackTrace();
            } catch (ParserConfigurationException ex) {
                ex.printStackTrace();
            long endTime = System.currentTimeMillis();
            long totalTime = ( endTime - startTime ) / 1000;
            System.out.println( "Done..."  + totalTime + " seconds" );
            return collection;
        public void startElement(String uri,String localName,String qName, Attributes attributes)
            if( qName.equals( "RE" ) )
                testCollectionList = new ArrayList<TestCollection>();
            else if( qName.equals( "p") )
                boolean isConcatenated = new Boolean( attributes.getValue( "c" ) );
                boolean isStatic = new Boolean( attributes.getValue( "s" ) );
                protocol = new Protocol( isConcatenated, isStatic );
            else if( qName.equals( "trdl" ) )
                trainingDirList = new ArrayList<File>();
            else if( qName.equals( "trd" ) )
                trainDir = new File( attributes.getValue( "fn" ) );
                trainingDirList.add( trainDir );
            else if( qName.equals( "td" ) )
                testingDir = new File( attributes.getValue( "fn" ) );
            else if( qName.equals( "TC" ) )
                counter++;
                System.out.println( counter );
                comparisonList = new ArrayList<Comparison>();
                testFileName = new File( attributes.getValue( "tfn" ) );
                testFileNameList.add( testFileName );
                tc = new TestCollection( );
                tc.setTestFileName( testFileName );
            else if ( qName.equals( "r" ) )
             order = attributes.getValue( "o" );
                value = attributes.getValue( "v" );
                cList.add( Short.parseShort( order ), new Short( value ) );
            else if( qName.equals( "c" ) )
                cList = new ArrayList<Short>();
                trainFileName = new File( attributes.getValue( "trfn" ) );
                if( !allTrainsAdded )
                    trainFileNameList.add( trainFileName );
        public void characters(char []ch,int start,int length)
            //String str=new String(ch,start,length);
            //System.out.print(str);
        public void endElement(String uri,String localName,String qName)
            if (qName.equals( "c") )
                allTrainsAdded = true;
                cCounts = new short[ cList.size() ];      
                for( int i = 0; i < cCounts.length; i++ )
                    cCounts[ i ] = cList.get( i );
                c = new Comparison( trainFileName, tc );
                c.setcCounts( cCounts );
                this.comparisonList.add( c );
            else if( qName.equals( "TC" ) )
                comparisons = new Comparison[ comparisonList.size() ];
                comparisonList.toArray( comparisons );           
                tc.setComparisons( comparisons );
                testCollectionList.add( tc );
            else if( qName.equals( "RE" ) )
                testCollections = new TestCollection[ testCollectionList.size() ];
                testCollectionList.toArray( testCollections );
                collection.setTestCollections( testCollections );
                testFileNames = new File[ testFileNameList.size() ];
                testFileNameList.toArray( testFileNames );
                collection.setTestingFiles( testFileNames );
                //String[ ] testCategories = new String[ testCategoryList.size() ];
                //testCategoryList.toArray( testCategories );
                //collection.setTestCategories( testCategories );
                trainingFileNames = new File[ trainFileNameList.size() ];
                trainFileNameList.toArray( trainingFileNames );
                collection.setTrainingFiles( trainingFileNames );
                //String[ ] trainingCategories = new String[ trainCategoryList.size() ];
                //trainCategoryList.toArray( trainingCategories );
                //collection.setTrainingCategories( trainingCategories );
                collection.setProtocol( protocol );
                trainingDirs = new File[ trainingDirList.size() ];
                trainingDirList.toArray( trainingDirs );           
                collection.setTrainingDirs( trainingDirs );
                collection.setTestingDir( testingDir );
         //else
             //System.out.println("End element:   {" + uri + "}" + localName);
    }i thought it may have been a recursive problme, hence having so many instance variables instead of local ones but that hasn't helped.
    all i need at the end of this is a Collection which holds an array of testCollections, which holds an array of cCounts and i was able to hold all of this in memory as all i am loading is what was in memory before it was written.
    can someone plz help
    ps when i use tail in unix to read the end of the xml file it doesnt work correctly as i cannot specify the number of lines to show, it shows all of the file as thought it is not split into lines or contains new line chars or anything, it is stored as one long stream, is this correct??
    here is a snippet of the xml file:
    <TC tfn="
    /homedir/dthomas/Desktop/4News2/output/split3/alt.atheism/53458"><c trfn="/homed
    ir/dthomas/Desktop/4News2/output/split0/alt.atheism/53586"><r o="0" v="0"></r><r
    o="1" v="724"></r><r o="2" v="640"></r><r o="3" v="413"></r><r o="4" v="245"></
    r><r o="5" v="148"></r><r o="6" v="82"></r><r o="7" v="52"></r><r o="8" v="40"><
    /r><r o="9" v="30"></r><r o="10" v="22"></r><r o="11" v="16"></r><r o="12" v="11
    "></r><r o="13" v="8"></r><r o="14" v="5"></r><r o="15" v="2"></r></c><c trfn="/
    homedir/dthomas/Desktop/4News2/output/split0/alt.atheism/53495"><r o="0" v="0"><
    /r><r o="1" v="720"></r><r o="2" v="589"></r><r o="3" v="349"></r><r o="
    please if anyone has any ideas from this code why a char[] would use 50% of the memory taken, and that the average age seems to show that the same one continues to grow..
    thanks in advance
    danny =)

    hi, i am still having lo luck with reading the xml data back into memory, as i have said before, the netbeans profiler is telling me it is a char[] that is using 50% of the memory but i cannot see how a char[] is created, my code doesn't so it must be the xml code...plz help

  • Help in XML data..(solved)

    Hi everyone,
    Could someone please help me to solve this..
    I have some XML data in the database in a clob column..like this..
    XMLDATA 1
    ==========
    <findPatientByNameResponse xmlns="http://service.sdt.tact.company.org">
      <out xmlns="http://service.sdt.tact.company.org">
        <ns1:patient xmlns:ns1="http://model.sdt.tact.company.org">
          <age xmlns="http://model.sdt.tact.company.org">66</age>
          <birthDate xmlns="http://model.sdt.tact.company.org">1949-11-23T00:00:00-07:00</birthDate>
          <empi xmlns="http://model.sdt.tact.company.org">544665</empi>
          <firstName xmlns="http://model.sdt.tact.company.org">A</firstName>
          <isValidPatient xmlns="http://model.sdt.tact.company.org">true</isValidPatient>
          <languageCode xmlns="http://model.sdt.tact.company.org">ENGLISH</languageCode>
          <lastName xmlns="http://model.sdt.tact.company.org">SMITH</lastName>
          <maritalStatusCode xmlns="http://model.sdt.tact.company.org">M</maritalStatusCode>
          <middleName xmlns="http://model.sdt.tact.company.org">MADELINE</middleName>
          <newEmpi xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <newPatient xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <sexCode xmlns="http://model.sdt.tact.company.org">F</sexCode>
        </ns1:patient>
        <ns1:patient xmlns:ns1="http://model.sdt.tact.company.org">
          <age xmlns="http://model.sdt.tact.company.org">47</age>
          <birthDate xmlns="http://model.sdt.tact.company.org">1969-04-15T00:00:00-07:00</birthDate>
          <empi xmlns="http://model.sdt.tact.company.org">540171</empi>
          <firstName xmlns="http://model.sdt.tact.company.org">A</firstName>
          <isValidPatient xmlns="http://model.sdt.tact.company.org">true</isValidPatient>
          <languageCode xmlns="http://model.sdt.tact.company.org">ENGLISH</languageCode>
          <lastName xmlns="http://model.sdt.tact.company.org">SMITH</lastName>
          <maritalStatusCode xmlns="http://model.sdt.tact.company.org">D</maritalStatusCode>
          <middleName xmlns="http://model.sdt.tact.company.org">KELLY</middleName>
          <newEmpi xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <newPatient xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <sexCode xmlns="http://model.sdt.tact.company.org">F</sexCode>
        </ns1:patient>
      </out>
    </findPatientByNameResponse>I have to parse the above XML...The above XML has 2 records..
    i used the following query to parse the above XML
    QUERY 1
    =======
    select extractValue(value(t),'/birthDate/text()') "birthDate"
         , extractValue(value(t),'/empi') "empi"
         , extractValue(value(t),'/firstName') "firstName"
         , extractValue(value(t),'/lastName') "lastName"
         , extractValue(value(t),'/middleName') "middleName"
         , extractValue(value(t),'/sexCode') "sexCode"
    from nw_test c,
          table(xmlsequence(extract(xmltype.createxml(c.clob_data),'//findPatientByNameResponse/out/patient'))) t
    where c.id = 1;     with the above query ...it is not returing any records....
    and just for a TEST i changed the above XML to some thing more clear
    XML DATA 2 (Just for test)
    ==========
    <findPatientByNameResponse>
      <out>
        <patient>
          <age>63</age>
          <birthDate>1949-11-23T00:00:00-07:00</birthDate>
          <empi>5446</empi>
          <firstName>A</firstName>
          <isValidPatient>true</isValidPatient>
          <languageCode>ENGLISH</languageCode>
          <lastName>SMITH</lastName>
          <maritalStatusCode>M</maritalStatusCode>
          <middleName>MADELINE</middleName>
          <newEmpi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <newPatient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <sexCode>F</sexCode>
        </patient>
        <patient>
          <age>47</age>
          <birthDate>1967-04-15T00:00:00-07:00</birthDate>
          <empi>540171</empi>
          <firstName>A</firstName>
          <isValidPatient>true</isValidPatient>
          <languageCode>ENGLISH</languageCode>
          <lastName>SMITH</lastName>
          <maritalStatusCode>D</maritalStatusCode>
          <middleName>KELLY</middleName>
          <newEmpi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <newPatient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <sexCode>F</sexCode>
        </patient>
      </out>
    </findPatientByNameResponse>
    QUERY 2
    =======
    select extractvalue(value(d),'/patient/age') as age,
        extractvalue(value(d),'/patient/birthDate') as birthddate,
        extractvalue(value(d),'/patient/empi') as empi,
        extractvalue(value(d),'/patient/firstName') as firstName,
        extractvalue(value(d),'/patient/languageCode') as languageCode,
        extractvalue(value(d),'/patient/isValidPatient') as isValidPatient,
        extractvalue(value(d),'/patient/lastName') as lastName,
        extractvalue(value(d),'/patient/middleName') as middleName
        from nw_test x,table(xmlsequence(extract(xmltype.createxml(x.clob_data), '/findPatientByNameResponse/out/patient'))) d where id = 2;with query 2 i am able to get the following output
    Age Birthdate empi firstname languagecode isvalidpatient lastname
    Got 2 records...
    Query 2 is working fine..If the change the original XML data..
    But actually i have to parse XML DATA 1
    Could someone please help me with QRERY 1 to parse XMLDATA1.
    Thanks in advance
    phani

    THose namespaces are really a pain. You should consider to have all "xmlns=" removed that are not really needed.
    SQL> r
      1  with x as (select xmltype('<findPatientByNameResponse xmlns="http://service.adt.tactical.intermountain.org"> '
      2                 ||' <out xmlns="http://service.adt.tactical.intermountain.org">'
      3          ||'    <ns1:patient xmlns:ns1="http://model.adt.tactical.intermountain.org">'
      4          ||'      <age xmlns="http://model.adt.tactical.intermountain.org">66</age>'
      5          ||'      <birthDate xmlns="http://model.adt.tactical.intermountain.org">1949-11-23T00:00:00-07:00</birthDate>'
      6          ||'      <empi xmlns="http://model.adt.tactical.intermountain.org">544665</empi>'
      7          ||'      <firstName xmlns="http://model.adt.tactical.intermountain.org">A</firstName>'
      8          ||'      <isValidPatient xmlns="http://model.adt.tactical.intermountain.org">true</isValidPatient>'
      9          ||'      <languageCode xmlns="http://model.adt.tactical.intermountain.org">ENGLISH</languageCode>'
    10          ||'      <lastName xmlns="http://model.adt.tactical.intermountain.org">SMITH</lastName>'
    11          ||'      <maritalStatusCode xmlns="http://model.adt.tactical.intermountain.org">M</maritalStatusCode>'
    12          ||'      <middleName xmlns="http://model.adt.tactical.intermountain.org">MADELINE</middleName>'
    13          ||'      <newEmpi xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
    14          ||'      <newPatient xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
    15          ||'      <sexCode xmlns="http://model.adt.tactical.intermountain.org">F</sexCode>'
    16          ||'    </ns1:patient>'
    17          ||'    <ns1:patient xmlns:ns1="http://model.adt.tactical.intermountain.org">'
    18          ||'      <age xmlns="http://model.adt.tactical.intermountain.org">47</age>'
    19          ||'      <birthDate xmlns="http://model.adt.tactical.intermountain.org">1969-04-15T00:00:00-07:00</birthDate>'
    20          ||'      <empi xmlns="http://model.adt.tactical.intermountain.org">540171</empi>'
    21          ||'      <firstName xmlns="http://model.adt.tactical.intermountain.org">A</firstName>'
    22          ||'      <isValidPatient xmlns="http://model.adt.tactical.intermountain.org">true</isValidPatient>'
    23          ||'      <languageCode xmlns="http://model.adt.tactical.intermountain.org">ENGLISH</languageCode>'
    24          ||'      <lastName xmlns="http://model.adt.tactical.intermountain.org">SMITH</lastName>'
    25          ||'      <maritalStatusCode xmlns="http://model.adt.tactical.intermountain.org">D</maritalStatusCode>'
    26          ||'      <middleName xmlns="http://model.adt.tactical.intermountain.org">KELLY</middleName>'
    27          ||'      <newEmpi xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
    28          ||'      <newPatient xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
    29          ||'      <sexCode xmlns="http://model.adt.tactical.intermountain.org">F</sexCode>'
    30          ||'    </ns1:patient>'
    31          ||'  </out></findPatientByNameResponse>') myXmlCol
    32          from dual)
    33  select --t.column_value.getClobval(),
    34      extractValue(t.column_value,'//birthDate','xmlns="http://model.adt.tactical.intermountain.org"') "birthDate"
    35  from x x1,
    36*   table(xmlsequence(extract(x1.myXmlcol,'/findPatientByNameResponse/out/ns1:patient','xmlns="http://service.adt.tactical.intermountain.org" xmlns:ns1="http://model.adt.tactical.intermountain.org"'))) t
    birthDate
    1949-11-23T00:00:00-07:00
    1969-04-15T00:00:00-07:00
    SQL> Message was edited by: copy&pasted removed some important code. Added this manually.
    Sven W.

  • Need help with XML delay   URGENT!!!

    Hi i need help making a flash movie to load everything from
    xml. It has to load text, images and flv, but, it has to load them
    and end them at the time said in the xml. So flash loads and
    unloade the text or image or video at the time specified in the
    XML! PLEASE HELP I NEED THIS DONE TODAY!!!!! VERY IMPORTANT!!!
    Contact me by msn [email protected] or send mail or
    reply here!!

    It was probably a little unclear initially (no offence
    intended ) whether your problem was with getting the data from XML
    or with the sequencing aspect. I assume that its the sequencing
    aspect based on your recent reply.
    So if it was me I would parse the loaded info into Date
    objects for the load and remove times and have this information
    handled by some sort of sequencing code.
    At its simplest, you could compare the xml-derived date/times
    for load/unload with the current system date/time and use a
    setInterval function to initiate the load after the calculated
    difference in milliseconds has passed. Similar for the removeclip
    timing.

  • Needing to use xml data source to populate richfaces tree nodes

    Hey I cant seem to figure this out. I know I probably need to write some java code but Im not sure how it should look. I have some xml and I need to use the data from within the elements to populate some nodes on a richfaces tree.
    I know how to use a .properties file as the data source for the nodes, and how to use some existign nodes to populate the nodes. Both are done with java code I can post here if needed.
    But I dont know how to go about writing the java code to take the data from xml elements, and then somehow parse it to use in a richfaces tree.
    Here is some info on what Im using with my project:
    eclipse
    simplexml
    httpclient
    jsf
    richfaces library

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    Flex 3 - Using item renderers with the AdvancedDataGrid
    control:
    Flex Data Visualization Developer's Guide / Advanced Data
    Grid Controls and .... that the item renderer is for column 2 of
    the control: <?xml version='1.0'?
    Link:
    http://livedocs.adobe.com/flex/3/html/advdatagrid_10.html
    DataGrid ItemRenderer - Flex India Community | Google Groups:
    Apr 28, 2008 ... My dataGrid itemRenderer displays a certain
    icon and sets fontStyle ... <mx:Label id='txt' fontWeight='bold'
    text='{data.subject}'/>
    Link:
    http://groups.google.com/group/flex_india/browse_thread/thread/bd30dd974da47d68
    Flex 3 - DataGrid control:
    <mx:Button label='Toggle Price Column'
    click='price.visible = !price.visible;' ... Flex lets you populate
    a DataGrid control from an ActionScript variable
    Link:
    http://livedocs.adobe.com/flex/3/html/dpcontrols_6.html
    Flex Fun - Advanced DataGrid Topics:
    You will notice that the datagrid doesn't have any header
    labels or vertical ..... After the opening tag we add a
    <mx:itemRenderer> telling Flex that we are
    Link:
    http://blog.paranoidferret.com/index.php/2007/08/29/flex-fun-advanced-datagrid-topics/
    Flex 3 - Instrumenting RandomWalk events:
    Flex Data Visualization Developer's Guide / Advanced Data
    Grid Controls and Automation Tools ... itemRenderer = child as
    Label; dispatchEvent(rEvent);
    Link:
    http://livedocs.adobe.com/flex/3/html/functest_components2_20.html
    Adobe Flex 2: Advanced DataGrid:
    Adobe Flex 2: Advanced DataGrid. Drop-in RadioButtonGroupBox;
    runtime computed .... Anatole authored number of books and articles
    on AJAX, XML, Internet and
    Link:
    http://flex.sys-con.com/node/311283
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • Need help on XML Publiser

    I have one query regarding Genrating report in XML Publisher.
    1)i have developed report without layout in In Oracle Report.
    2)Register it in Application and format as XML.
    3)Create layout in xml publisehr.
    4)Define Data Defination and Template.
    5)Attach layout at SRS Window.
    there are 3 user. user 1 has run the report he gets output based on some parameter.Now user 2 has run the reprot DO THE SAME PROCESS HAS TO DO BY USER 2 AS SAME ABOVE to gets the different output since the XML data is old? LIKE XML DATA MAPPING AND CREATING TEMPLATE.

    Hi Nabendu.
    BI publisher does have the option of showing a running total in PDF format usign a RTF template. If you look up the advanced rtf samples provided with the BI publisher plugin there is one example to show running totals, with the previous page total at the top.
    you can find this located on your PC where the Word Plugin is installed. C:\Program Files (x86)\Oracle\BI Publisher\BI Publisher Desktop\samples\RTF templates
    replace C:\ with the drive leeter of the drive where your desktop plugin is installed
    Hope this Helps,
    Domnic

Maybe you are looking for