Skip to Main Content

Select XML statement problem

Frank LehmannSep 22 2021

Hi,
i have this xml file, which i want to query.
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15">
<rsm:SpecifiedExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:ferd:CrossIndustryDocument:invoice:1p0:extended</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:SpecifiedExchangedDocumentContext>
<rsm:HeaderExchangedDocument>
<ram:ID>
6062680346</ram:ID>
<ram:Name>
RECHNUNG</ram:Name>
<ram:TypeCode>
380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20210921</udt:DateTimeString>
</ram:IssueDateTime>
</rsm:HeaderExchangedDocument>
<rsm:SpecifiedSupplyChainTradeTransaction>
<ram:ApplicableSupplyChainTradeAgreement>
<ram:SellerTradeParty>
<ram:GlobalID schemeID="0088">4011231000000</ram:GlobalID>
<ram:Name>Max Mustermann</ram:Name>

How could i query the rsm and ram tags ?
Which namespace i have to set ?
select * from xmltable(xmlnamespaces(Default '<what to set here>', '<what to set here>' as "ram" ), '<what to set here>' passing xml
columns
ID number(12) path '<what to set here'>

This post has been answered by BluShadow on Sep 22 2021
Jump to Answer
Comments
Post Details
Added on Sep 22 2021
5 comments
42 views