hot to parse xml using xpath in pl/sql

Posted on 2007-08-01
Last Modified: 2013-12-18
so far i had been using dbms_lob.instr/ extract node value from the xml stored as clob in my oracle.
                     start_position := dbms_lob.instr(r1.xml_data,'<Exception>',1,1) + 11;
                     end_position  := dbms_lob.instr(r1.xml_data, '</Exception>', start_position, 1);
                     xmldata := dbms_lob.substr(r1.xml_data, end_position - start_position, start_position);
now i want to use xpath; because i have a specific case which can be resolved using xpath. i ve this xpath which returns 4 lines to me in the xml file(using its xpath feature)

can someone help me share how i can use this xpath in oracle pl/sql?
thanks a lot
Question by:samir25
    LVL 76

    Accepted Solution

    As I've pointed out in previous questions, you can use EXTRACTVALUE or EXTRACT.  As you already know, the data has to be XMLTYPE and not CLOB.

    I assume this is the same data from your previous questions and still can't cast it as XMLTYPE?

    If you can provide some sample data and expected results I'll provide a working example.
    LVL 1

    Author Comment

    you can delete the other one this ques is more elaborate and the other one is generic. and if you had read carefully...the ques is diff from the past one.i want some xpath things to be done. dont know how.
    here is what want to do
    can you help on this?
    LVL 76

    Expert Comment

    by:slightwv (䄆 Netminder)
    I've deleted the other one as you requested.

    Since you've accepted an answer I assume you no longer need assistance with this question.

    If you still need assistance please provide the data I requested above and I'll unaccept the answer and continue helping you.

    The data I requested above::
    "If you can provide some sample data and expected results I'll provide a working example."
    LVL 1

    Author Comment

    yes i resolved this tough i am stuck at a dif place for which i will float sep ques

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
    This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now