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?