Hi all,
I want to sum the contents of an element in an XML-document using xpath. Currently i get the error message 'ORA-31012 Given XPATH expression not supported'. This is clear: in 9iR2 i can't use the complete xpath syntax.
Is there an alternative way without having to use all those very low-level dbms_xmldom-functions?
I can't (and don't want to) use XSLT inside my PL/SQL procedures.
thanks for all your help,
Bart
example:
declare
l_xml xmltype := xmltype('<a><b><amount>100.01</amount></b><b><amount>0.99</amount></b></a>');
begin
for r in (select extract(l_xml, 'sum(//amount/text())').getNumberVal() as total
from dual)
loop
-- n.b. loop returns only one (1) row !
dbms_output.put_line('total = '||r.total);
end loop;
end;
Message was edited by:
ow008057
Message was edited by:
ow008057