Re: BUG #4294: XML support: name() xpath function not working

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: BUG #4294: XML support: name() xpath function not working
Дата
Msg-id 200808230322.m7N3M9w06962@momjian.us
обсуждение исходный текст
Ответ на Re: BUG #4294: XML support: name() xpath function not working  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #4294: XML support: name() xpath function not working  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Is there any TODO here?

---------------------------------------------------------------------------

Tom Lane wrote:
> "Enrico Sirola" <enrico.sirola@gmail.com> writes:
> > -- bad
> > select xpath('name(/my:a/*[last()])', test, ARRAY[ARRAY['my',
> > 'http://myns.com/ns']]) from test;
>
> You could barely swat a fly with what I know about XPath ... but I'm
> thinking that the culprit here is the crock at lines 3254-3288 of
> xml.c, which explains itself thus:
>
>     /*
>      * To handle both documents and fragments, regardless of the fact whether
>      * the XML datum has a single root (XML well-formedness), we wrap the XML
>      * datum in a dummy element (<x>...</x>) and extend the XPath expression
>      * accordingly.  To do it, throw away the XML prolog, if any.
>      */
>
> This code prefixes the given path expression with "/x", which of course
> is going to break any expression that starts with a function name.  It
> would have to stick the /x inside the function argument to have any
> chance of working.  In general, I think this has zero chance of working
> without implementing a pretty complete XPath parser.  We need to find
> another way.
>
>             regards, tom lane
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4281: some types of errors do not log statements
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4294: XML support: name() xpath function not working