Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
This below returns the above error.
This comes back true to being schema based.
DECLARE
xmlresp CLOB;
pvxml XMLTYPE;
l_xml XMLTYPE;
BEGIN
xmlresp := '<?xml version="1.0" encoding="UTF-8"?>
<HTNG_HotelRoomStatusSearchRS
xmlns="http://htng.org/2014B"
xmlns:ota="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://htng.org/2014B HTNG_HotelRoomStatusSearchRS"
TransactionIdentifier="10">
<Errors><ota:Error Type="0" ShortText="None"></ota:Error></Errors>
<Success></Success>
<RoomInformationList>
<RoomInformation>
<TPA_Extensions>
<UNITI UNIT_NUM="0"/>
</TPA_Extensions>
</RoomInformation>
</RoomInformationList>
</HTNG_HotelRoomStatusSearchRS>';
l_xml := xmltype (xmlresp);
l_xml := l_xml.createschemabasedxml ('HTNG_HotelRoomStatusSearchRS.xsd');
IF l_xml.isschemabased () = 0
THEN
DBMS_OUTPUT.put_line ('Not Good');
ELSE
DBMS_OUTPUT.put_line ('Good Schema ');
END IF;
DBMS_OUTPUT.put_line (l_xml.getstringval ());
-- declare default element namespace "DEFAULT http://htng.org/2014B ,http://www.opentravel.org/OTA/2003/05 AS "ota"
SELECT XMLQUERY ('copy $d := .modify ( replace value of node $d/HTNG_HotelRoomStatusSearchRS/Errors/Error/@ShortText with $txt
,replace value of node $d/HTNG_HotelRoomStatusSearchRS/Errors/Error/@Type with $typ)
return $d' PASSING l_xml, 'Error Text' AS "txt", '99' AS "typ" RETURNING CONTENT)
INTO l_xml
FROM DUAL;
END;