您應該使用@
指定的屬性。
使用XMLTABLE,
SELECT *
FROM xmltable(
xmlnamespaces(DEFAULT 'urn:/crmondemand/xml/AllotmentUsage/Data'),'ListOfAllotmentUsage'
passing xmltype('<ListOfAllotmentUsage xmlns="urn:/crmondemand/xml/AllotmentUsage/Data" recordcount="17680" lastpage="false"></ListOfAllotmentUsage>')
columns
rec_count NUMBER path '@recordcount'
);
使用extractValue一起,
SELECT extractvalue(
xmltype('<ListOfAllotmentUsage xmlns="urn:/crmondemand/xml/AllotmentUsage/Data" recordcount="17680" lastpage="false"></ListOfAllotmentUsage>'),
'ListOfAllotmentUsage/@recordcount',
'xmlns="urn:/crmondemand/xml/AllotmentUsage/Data"'
)
FROM dual;