Re: xmltable and namespaces
Date: Sat, 5 Feb 2011 06:27:42 +0800
Message-ID: <iihugv$jb1$1_at_speranza.aioe.org>
"Gerard H. Pille" <ghpille_at_hotmail.com> wrote in message
news:cce8334b-aef8-4b51-aeb3-ff12dc978205_at_k22g2000yqh.googlegroups.com...
> declare
> soap_resp varchar(32767);
> resp sys.xmltype;
> begin
> soap_resp :=
> '<GetStaffDetailsResponse'
> || ' xmlns="https://www.axby.com/staffQuery/">'
> || '<GetStaffDetailsResult>'
> || '<StaffDetails>'
> || '<AuEduPersonPreferredGivenName>Bruce</
> AuEduPersonPreferredGivenName>'
> || '<AuEduPersonPreferredSurname>Coad</
> AuEduPersonPreferredSurname>'
> || '<EmployeeID>000715BC</EmployeeID>'
> || '</StaffDetails>'
> || '<StaffDetails>'
> || '<AuEduPersonPreferredGivenName>Lazy</
> AuEduPersonPreferredGivenName>'
> || '<AuEduPersonPreferredSurname>Richard</
> AuEduPersonPreferredSurname>'
> || '<EmployeeID>000999ZZ</EmployeeID>'
> || '</StaffDetails>'
> || '</GetStaffDetailsResult>'
> || '</GetStaffDetailsResponse>';
>
> resp := xmltype.createxml(soap_resp);
>
> for r in (
> select
> extractvalue(
> value(Y),
> '/StaffDetails/EmployeeID',
> 'xmlns="https://www.axby.com/staffQuery/"') X
> from
> table(
> xmlsequence(
> extract(
> resp,
> '/GetStaffDetailsResponse/GetStaffDetailsResult/
> StaffDetails',
> 'xmlns="https://www.axby.com/staffQuery/"'
> )
> )
> ) Y
> ) loop
> dbms_output.put_line('Hello:' || r.X);
> end loop;
> end;
> /
Now that looks good! I'll give it a go on Monday. Thanks Gerard.
Cheers Richard Maher Received on Fri Feb 04 2011 - 16:27:42 CST