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!

Namespaces and path how to?

jlp_laurastarNov 26 2014 — edited Dec 1 2014

I have a problem with the notion of Namespaces and path.

i try this code

variable   xml_response varchar2(4000);

BEGIN

:xml_response :=

'<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <GenerateLabelResponse xmlns="https://www.mypostbusiness.ch/wsbc/barcode/v2_2/types">
         <Envelope>
            <LabelDefinition>
               <ImageFileType>PDF</ImageFileType>
            </LabelDefinition>
            <Data>
               <Provider>
                  <Sending>
                     <Item>
                        <ItemID>12346</ItemID>
                        <IdentCode>993314781300000277</IdentCode>
                        <Image>Base64 encoded data</Image>
                     </Item>
                  </Sending>
               </Provider>
            </Data>
         </Envelope>
      </GenerateLabelResponse>
   </S:Body>
</S:Envelope>';

END;
/

SELECT x1.*
FROM XMLTable(
       XMLNamespaces(default 'https://www.mypostbusiness.ch/wsbc/barcode/v2_2/types')
     , '/GenerateLabelResponse/Envelope/Data/Provider/Sending/Item'
       passing xmltype(:xml_response)
       columns
         ItemID varchar2(30) path '/ItemID',
         IdentCode varchar2(30) path '/IdentCode'
     ) x1
;

and have a return of no rows.

i have think that the namespaces determine the root of the path and i have only to follow the path since i have the right column.

what is wrong?

This post has been answered by odie_63 on Nov 27 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2014
Added on Nov 26 2014
2 comments
955 views