Re: Extract values from XML content - Mailing list pgsql-general

From David G. Johnston
Subject Re: Extract values from XML content
Date
Msg-id CAKFQuwaAmdC20AqHcYx_8+ha_kxQXxdbM01Wrk-K8fXxAscdiQ@mail.gmail.com
Whole thread Raw
In response to Extract values from XML content  (celati Laurent <laurent.celati@gmail.com>)
List pgsql-general
On Wednesday, November 13, 2024, celati Laurent <laurent.celati@gmail.com> wrote:

SELECT id, xpath('/contact/CI_ResponsibleParty/organisationName/CharacterString/text()',
            CAST(data AS XML)) AS organisation_name <mri:pointOfContact>
    <cit:CI_Responsibility>      <cit:role>        <cit:CI_RoleCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_RoleCode" codeListValue="originator" />      </cit:role>      <cit:party>        <cit:CI_Organisation>          <cit:name>            <gco:CharacterString>Office français de la biodiversité</gco:CharacterString>          </cit:name>

I’d look into how to specify namespaces since your XML elements all have them but you don’t have any in your xpath.

David J.
 

pgsql-general by date:

Previous
From: walther@technowledgy.de
Date:
Subject: Re: Fwd: A million users
Next
From: Catherine Frock
Date:
Subject: Help with restoring database from old version of PostgreSQL