Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-18126: XUDY0027 - Invalid target expression

user12296100May 4 2015 — edited May 5 2015

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;

This post has been answered by odie_63 on May 5 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2015
Added on May 4 2015
2 comments
1,947 views