Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Como selecionar valores específicos do XML usando o Oracle Xquery


Encontrei uma resposta:
select t.*
        from xmltable(xmlnamespaces(default 'http://www.opengis.net/wfs'
                                   ,'http://www.opengis.net/gml' as "gml"
                                    ,'http://www.opengis.net/wfs' as "wfs"
                                    ,'http://www.opengis.net/ows' as "ows"
                                    ,'http://www.w3.org/1999/xlink' as "xlink"
                                    ,'http://www.w3.org/2001/XMLSchema-instance' as "xsi"
                                    ,'http://www.opengis.net/ogc' as "ogc")
                      ,'for $d in //ows:Operation/ows:Parameter/ows:Value
                        where $d/../../@name = "GetFeature"
                        and $d/../@name="outputFormat"
                        return $d' passing p_xml columns value varchar2(100) path '/') as t;

usando a expressão .. xpath para acessar os nós pais.