Skip to main content
Origen Enlace

Error en XMLTYPE en xml con namespaces

La siguiente sentencia sql me está provocando un error LPX-00601: Invalid token in: '/soap:Envelope/soap:Body/GetRatesTreeResponse'. ¿Me podríais indicar si veis algún fallo?

WITH mydata AS
   (SELECT TO_CLOB('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                       <soap:Body>
                          <GetRatesTreeResponse xmlns="http://orca.orangetech.es/Tazzyv30/Tazzy/RateService">
                             <GetRatesTreeResult>
                                <RateNode>
                                   <Id>686</Id>
                                   <HotelCode>TEST</HotelCode>
                                   <HotelName>Loading Test</HotelName>
                                   <RateCode>BASE</RateCode>
                                   <RateName>BASE</RateName>
                                   <GroupRateCode>MEUSA</GroupRateCode>
                                   <GroupRateName>MERCADO ESTADOUNIDENSE</GroupRateName>
                                   <CalcType>PrecioNeto</CalcType>
                                   <CurrencyCode>US</CurrencyCode>
                                   <CurrencyName>USA</CurrencyName>
                                   <ParentRateId xsi:nil="true"/>
                                </RateNode>
                                <RateNode>
                                   <Id>687</Id>
                                   <HotelCode>TEST</HotelCode>
                                   <HotelName>Loading Test</HotelName>
                                   <RateCode>OTA</RateCode>
                                   <RateName>OTA</RateName>
                                   <GroupRateCode>MEUSA</GroupRateCode>
                                   <GroupRateName>MERCADO ESTADOUNIDENSE</GroupRateName>
                                   <CalcType>PrecioNeto</CalcType>
                                   <CurrencyCode>US</CurrencyCode>
                                   <CurrencyName>USA</CurrencyName>
                                   <ParentRateId>686</ParentRateId>
                                </RateNode>
                                <RateNode>
                                   <Id>688</Id>
                                   <HotelCode>TEST</HotelCode>
                                   <HotelName>Loading Test</HotelName>
                                   <RateCode>WEB</RateCode>
                                   <RateName>WEB</RateName>
                                   <GroupRateCode>MEUSA</GroupRateCode>
                                   <GroupRateName>MERCADO ESTADOUNIDENSE</GroupRateName>
                                   <CalcType>PrecioNeto</CalcType>
                                   <CurrencyCode>US</CurrencyCode>
                                   <CurrencyName>USA</CurrencyName>
                                   <ParentRateId>686</ParentRateId>
                                </RateNode>
                             </GetRatesTreeResult>
                          </GetRatesTreeResponse>
                       </soap:Body>
                    </soap:Envelope>') c
    FROM   DUAL) 
SELECT EXISTSNODE(xmltype(c), '/soap:Envelope/soap:Body/GetRatesTreeResponse') 
FROM mydata t;