Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> DOM XML Parsing in Oracle PL/SQL

DOM XML Parsing in Oracle PL/SQL

From: Joshua Perry <jperry_at_srdnet.com>
Date: Tue, 9 Apr 2002 09:43:20 -0700
Message-ID: <ub673qgjp8ni74@corp.supernews.com>


Hello,

    Please forgive me ignorance in the ways or Oracle...I am a MSSQL developer who has been recently challenged with the porting of our software to Oracle. We make heavy use of OPENXML and SQL based XML parsing and I need some assistance to perform those same tasks in Oracle 9i.

    Particularly, I wish to do simple parsing with the DOM in SQL/PL, such that I retrieve the values from child records of a given segment. For example:

<XML_Doc>

    <NAME_REC>

<FIRST>John</FIRST>
<MID>F</MID>
<LAST>Kennedy</LAST>

    </NAME_REC>
    <NAME_REC>

<FIRST>George</FIRST>
<MID>W</MID>
<LAST>Bush</LAST>

    </NAME_REC>
</XML_Doc>

I do know:

    xmlNameSegs := xmldom.getElementsByTagName(m_xmlDocument, 'NAME_REC');     NumOfSegs := xmldom.getLength(xmlNameSegs);

    --* loop through Each Name Segment and retrieve the Child Tags and Values

    for i in 0..NumOfSegs-1
    loop
      xmlSeg := xmldom.item(xmlNameSegs, i);

    end loop;

But what is the syntax for operations such as this???:

     xmlTag := selectSingleNode( '/FIRST');
     SomeCharVar :=  xmlTag.getNodeValue();

If someone would be willing to provide some examples of how to use sys.xmldom or information regarding the best texts to guild be in my ways, I would be grateful!

Thanks,
Josh Perry
jperry_at_srdnet.com
System Research & Development Received on Tue Apr 09 2002 - 11:43:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US