This discussion is archived
1 Reply Latest reply: Jan 23, 2012 10:34 AM by Andrei Costache, Oracle RSS

XML accessing nodelist elements within nodes

909760 Newbie
Currently Being Moderated

I have an XML document structure (see example below) that contains an Nodelist element <SPs> of <SP> nodes
where each <SP> node itself contains a Nodelist element <SetDts> containing <SetDt>

<?xml version="1.0"?>

SP_nl dbms_xmldom.DOMNodeList;
SP_n dbms_xmldom.DOMNode;

SetDt_nl dbms_xmldom.DOMNodeList;
SetDt_n dbms_xmldom.DOMNode;

Assuming have parsed the XML into a document called l_doc, can now successfully can get a list of the SP nodes
as follows:

SP_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/Int86Data/SPs/SP');

and get a SP node (the first in this case) from the SP_nl nodelist

SP_n := dbms_xmldom.item(SP_nl, 0);

I now have the first SP node in SP_n. My question is What is the syntax for getting the SetDts NodeList
out of parent SP_n node.

I have tried the following but get error - ORA-01405: fetched column value is NULL

SetDt_nl := dbms_xslprocessor.selectNodes(SP_n,'/SetDts/SetDt')

Help Appreciated

Dave McDonald


  • Correct Answers - 10 points
  • Helpful Answers - 5 points