rfc: changing documentation about xpath - Mailing list pgsql-hackers

From Denis I. Polukarov
Subject rfc: changing documentation about xpath
Date
Msg-id 201006031534.35863.d.polukarov@gpt.ru
Whole thread Raw
Responses Re: rfc: changing documentation about xpath
List pgsql-hackers
Hi!

I'm to face a problem, and not at once resolve it. When I do:

-- // --

test=# SELECT xpath('//domain:name/text()',
$$<?xml version='1.0' encoding='UTF-8'?>
                                                                                                                    
<epp xmlns='urn:ietf:params:xml:ns:epp-1.0'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='urn:ietf:params:xml:ns:epp-1.0
epp-1.0.xsd'><response> <result code='1301'>  <msg lang='en-US'>Command completed successfully; ack to dequeue</msg>
</result><msgQ count='3' id='114004'>  <qDate>2010-06-02T12:35:33.0Z</qDate>  <msg lang='en-US'>Transfer
Requested.</msg></msgQ> <resData>  <domain:trnData  
xmlns:domain='urn:ietf:params:xml:ns:domain-1.0'
xsi:schemaLocation='urn:ietf:params:xml:ns:domain-1.0
domain-1.0.xsd'>   <domain:name>xxx.xx</domain:name>   <domain:trStatus>pending</domain:trStatus>
<domain:reID>admin</domain:reID>  <domain:reDate>2010-06-02T12:35:33.0Z</domain:reDate>
<domain:acID>xxx-xx</domain:acID>  <domain:acDate>2010-06-07T12:35:33.0Z</domain:acDate>
<domain:exDate>2014-05-11T12:52:07.0Z</domain:exDate> </domain:trnData> </resData> <trID>  <svTRID>xx-xxx</svTRID>
</trID></response>
</epp>$$,
array[array['domain','urn:ietf:params:xml:ns:domain-1.0']]);   xpath
-------------{xxx.xx}
(1 row)

test=#

-- // --

worked... and:

-- // --

test=# SELECT xpath('//qDate/text()',
                                                                                                           
$$<?xml version='1.0' encoding='UTF-8'?>
                                                                                                                    
<epp xmlns='urn:ietf:params:xml:ns:epp-1.0'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='urn:ietf:params:xml:ns:epp-1.0
epp-1.0.xsd'><response> <result code='1301'>  <msg lang='en-US'>Command completed successfully; ack to
dequeue</msg></result><msgQ count='3' id='114004'>  <qDate>2010-06-02T12:35:33.0Z</qDate>  <msg lang='en-US'>Transfer
Requested.</msg></msgQ> <resData>  <domain:trnData  
xmlns:domain='urn:ietf:params:xml:ns:domain-1.0'
xsi:schemaLocation='urn:ietf:params:xml:ns:domain-1.0
domain-1.0.xsd'>   <domain:name>xxx.xx</domain:name>   <domain:trStatus>pending</domain:trStatus>
<domain:reID>admin</domain:reID>  <domain:reDate>2010-06-02T12:35:33.0Z</domain:reDate>
<domain:acID>xxx-xx</domain:acID>  <domain:acDate>2010-06-07T12:35:33.0Z</domain:acDate>
<domain:exDate>2014-05-11T12:52:07.0Z</domain:exDate> </domain:trnData> </resData> <trID>  <svTRID>xx-xxx</svTRID>
</trID></response>
</epp>$$);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()',
                                                                                                           
$$<?xml version='1.0' encoding='UTF-8'?>
                                                                                                                    
<epp xmlns='urn:ietf:params:xml:ns:epp-1.0'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='urn:ietf:params:xml:ns:epp-1.0
epp-1.0.xsd'><response> <result code='1301'>  <msg lang='en-US'>Command completed successfully; ack to
dequeue</msg></result><msgQ count='3' id='114004'>  <qDate>2010-06-02T12:35:33.0Z</qDate>  <msg lang='en-US'>Transfer
Requested.</msg></msgQ> <resData>  <domain:trnData  
xmlns:domain='urn:ietf:params:xml:ns:domain-1.0'
xsi:schemaLocation='urn:ietf:params:xml:ns:domain-1.0
domain-1.0.xsd'>   <domain:name>xxx.xx</domain:name>   <domain:trStatus>pending</domain:trStatus>
<domain:reID>admin</domain:reID>  <domain:reDate>2010-06-02T12:35:33.0Z</domain:reDate>
<domain:acID>xxx-xx</domain:acID>  <domain:acDate>2010-06-07T12:35:33.0Z</domain:acDate>
<domain:exDate>2014-05-11T12:52:07.0Z</domain:exDate> </domain:trnData> </resData> <trID>  <svTRID>xx-xxx</svTRID>
</trID></response>
</epp>$$, 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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Keepalive for max_standby_delay
Next
From: Andrew Dunstan
Date:
Subject: Re: rfc: changing documentation about xpath