Re: Extract values from XML content

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: celati Laurent <laurent(dot)celati(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Extract values from XML content
Date: 2024-11-13 18:13:00
Message-ID: CAKFQuwaAmdC20AqHcYx_8+ha_kxQXxdbM01Wrk-K8fXxAscdiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, November 13, 2024, celati Laurent <laurent(dot)celati(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Catherine Frock 2024-11-13 18:50:00 Help with restoring database from old version of PostgreSQL
Previous Message walther 2024-11-13 18:01:58 Re: Fwd: A million users