xpath differences between postgres 11.4 and 10.3

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Felipe de Jesús Molina Bravo <fjmolinabravo(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: xpath differences between postgres 11.4 and 10.3
Date: 2019-07-06 07:29:34
Message-ID: CAKFQuwZLVT0Y5X=4Z0BcqyNXpELaSGRK7JDoy8XHrSeK_=dt6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, July 5, 2019, Felipe de Jesús Molina Bravo <
fjmolinabravo(at)gmail(dot)com> wrote:

> <p idc="4776" rc="Cuadro" idrg="5"/>'
>
> *Per the SQL standard, relative paths start from the document node of the
> XML input document, not the root node as these functions previously did.*
>

The absolute path to the 4776 in the document is:

/p::attribute[id]

In v10 relative pathing looks like (root element node):

/p<you-are-here>::attribute[id]

In v11 relative pathing looks like (document root node):

/<you-are-here>p::attribute[id]

You either need to specify your root element name in your xpath expression
or, less precisely, use // to look for the attribute anywhere

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Felipe de Jesús Molina Bravo 2019-07-06 22:09:17 Re: xpath differences between postgres 11.4 and 10.3
Previous Message Adrian Klaver 2019-07-05 23:03:00 Re: Converting to identity columns with domains on PK columns