Re: xpath and xml namespaces

Поиск
Список
Период
Сортировка
От Nikolay Samokhvalov
Тема Re: xpath and xml namespaces
Дата
Msg-id e431ff4c0703040827t44224a26xe206634fcdca16af@mail.gmail.com
обсуждение исходный текст
Ответ на xpath and xml namespaces  ("Peter Schonefeld" <peter.schonefeld@gmail.com>)
Список pgsql-general
On 3/4/07, Peter Schonefeld <peter.schonefeld@gmail.com> wrote:
> Hi, i'm having trouble getting xpath in Postgres 8.2 to recognise xml
> namespaces...could someone please point me to a good reference for the xml2
> lib?

This is FAQ-like question.
The thing is that XPath spec doesn't define any default mappings for
namespaces. It's considered as entirely user's problem -- he should
manually define namespaces mappings to use namespace prefixes in XPath
expressions.

If you use contrib/xml2 I'm afraid there is no way to use namespaces
in XPath w/o changing contib's code itself... To enable namespaces
using libxml2 one should use xmlXPathRegisterNs():
http://xmlsoft.org/html/libxml-xpathInternals.html#xmlXPathRegisterNs

I hope 8.3 will have XPath function with namespaces support in core.

--
Best regards,
Nikolay

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: date format
Следующее
От: "Sandeep Kumar Jakkaraju"
Дата:
Сообщение: how to pass an array to the plpgsql function from Java Code