BUG #6395: Invalid XPath expression

Started by Franco Ricciover 14 years ago3 messagesbugs
Jump to latest
#1Franco Ricci
franco.ricci@phys.uniroma1.it

The following bug has been logged on the website:

Bug reference: 6395
Logged by: Franco Ricci
Email address: franco.ricci@phys.uniroma1.it
PostgreSQL version: 9.1.2
Operating system: FreeBSD 9
Description:

Query at bottom returns:
"ERROR: invalid XPath expression
DETAIL: Invalid expression

********** Error **********

ERROR: invalid XPath expression
SQL state: XX000
Detail: Invalid expression"

The same query on PostgreSQL 9.x works fine!

------
SELECT
xpath('/llrp:RO_ACCESS_REPORT/llrp:TagReportData/llrp:*[contains(name(),\"EPC\")]/llrp:EPC/text()',

'<llrp:RO_ACCESS_REPORT
xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0&quot;
Version="1" MessageID="8">
<llrp:TagReportData>
<llrp:EPC_96>
<llrp:EPC>04954524D0004980B0DF0001</llrp:EPC>
</llrp:EPC_96>
<llrp:ROSpecID>
<llrp:ROSpecID>100</llrp:ROSpecID>
</llrp:ROSpecID>
</llrp:TagReportData>
</llrp:RO_ACCESS_REPORT>'::xml

, ARRAY[ARRAY['llrp',
'http://www.llrp.org/ltk/schema/core/encoding/xml/1.0&#39;]])
----------

#2Florian Weimer
fweimer@bfk.de
In reply to: Franco Ricci (#1)
Re: BUG #6395: Invalid XPath expression

* franco ricci:

The same query on PostgreSQL 9.x works fine!

I think you mean 9.0.

xpath('/llrp:RO_ACCESS_REPORT/llrp:TagReportData/llrp:*[contains(name(),\"EPC\")]/llrp:EPC/text()',

Does it work if you drop the '\'?

PostgreSQL 9.1 defaults to standard_conforming_strings=on. See the
release notes for details.

--
Florian Weimer <fweimer@bfk.de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

#3Franco Ricci
franco.ricci@phys.uniroma1.it
In reply to: Florian Weimer (#2)
Re: BUG #6395: Invalid XPath expression

On 12-1-2012 4:58 PM, Florian Weimer wrote:

* franco ricci:

The same query on PostgreSQL 9.x works fine!

I think you mean 9.0.

Yes, I mean 9.0.5

xpath('/llrp:RO_ACCESS_REPORT/llrp:TagReportData/llrp:*[contains(name(),\"EPC\")]/llrp:EPC/text()',

Does it work if you drop the '\'?

Thanks a lot.
Without '\' it works!!

PostgreSQL 9.1 defaults to standard_conforming_strings=on. See the
release notes for details.

Regards
Franco Ricci

--
Franco Ricci
LabIT
Sviluppo Servizi Informatici

Dipartimento di Fisica
Universit� di Roma "La Sapienza"
Piazzale Aldo Moro, 5
00185
Roma
Italy

tel +390649913449
fax +39064463158