rfc: changing documentation about xpath
rfc: changing documentation about xpath
От:
"Denis I. Polukarov" <d.polukarov@gpt.ru>
Дата:
Hi!
I'm to face a problem, and not at once resolve it. When I do:
-- // --
test=# SELECT xpath('//domain:name/text()',
$$
Command completed successfully; ack to dequeue 2010-06-02T12:35:33.0Z Transfer Requested. xxx.xx pending admin 2010-06-02T12:35:33.0Z xxx-xx 2010-06-07T12:35:33.0Z 2014-05-11T12:52:07.0Z xx-xxx
$$,
array[array['domain','urn:ietf:params:xml:ns:domain-1.0']]); xpath
-------------{xxx.xx}
(1 row)
test=#
-- // --
worked... and:
-- // --
test=# SELECT xpath('//qDate/text()',
$$
Command completed successfully; ack to dequeue 2010-06-02T12:35:33.0Z Transfer Requested. xxx.xx pending admin 2010-06-02T12:35:33.0Z xxx-xx 2010-06-07T12:35:33.0Z 2014-05-11T12:52:07.0Z xx-xxx
$$);xpath
-------{}
(1 row)
test=#
-- // --
not worked.
I think that the nuance about default namespaces should add to xpath's doc.
This select:
-- // --
SELECT xpath('//global:qDate/text()',
$$
Command completed successfully; ack to dequeue 2010-06-02T12:35:33.0Z Transfer Requested. xxx.xx pending admin 2010-06-02T12:35:33.0Z xxx-xx 2010-06-07T12:35:33.0Z 2014-05-11T12:52:07.0Z xx-xxx
$$, array[array['global', 'urn:ietf:params:xml:ns:epp-1.0']]); xpath
--------------------------{2010-06-02T12:35:33.0Z}
(1 row)
-- // --
work. Thanks to Ёж on www.sql.ru and pgsql-ru-general ... :)
--
Best regards,
Denis I. Polukarov
developer
"Garant-Park-Telekom"
http://www.gpt.ru
Re: rfc: changing documentation about xpath
От:
Andrew Dunstan <andrew@dunslane.net>
Дата:
Denis I. Polukarov wrote: > Hi! > > I'm to face a problem, and not at once resolve it. > > [default namespace mapped in xml "xmlns=" attribute requires corresponding mapping in third param of xpath()] It's a tolerably subtle point, and I'm not sure it's really PostgreSQL-specific. But if you think the docs need improvement, then please suggest a patch with the extra wording you think would make things clearer. cheers andrew
Re: rfc: changing documentation about xpath
От:
Nikolay Samokhvalov <samokhvalov@gmail.com>
Дата:
On Thu, Jun 3, 2010 at 16:02, Andrew Dunstan <andrew@dunslane.net> wrote:
[default namespace mapped in xml "xmlns=" attribute requires corresponding mapping in third param of xpath()]
Denis I. Polukarov wrote:Hi!
I'm to face a problem, and not at once resolve it.
It's a tolerably subtle point, and I'm not sure it's really PostgreSQL-specific. But if you think the docs need improvement, then please suggest a patch with the extra wording you think would make things clearer.
You are absolutely right, it's not really Postgres-specific, it's XML specific, but every novice using xpath encounters with this unclear point. So, small docs patch is sent to -docs.