Re: [NOVICE] xpath query

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [NOVICE] xpath query
Дата
Msg-id CAKFQuwYGZuemzWhEUJPHXmUyCgyD-Wb4q9MTZkL8U7ZA0x_1Dg@mail.gmail.com
обсуждение исходный текст
Ответ на [NOVICE] xpath query  (Rita <rmorgan466@gmail.com>)
Список pgsql-novice
On Tue, Jan 24, 2017 at 7:02 PM, Rita <rmorgan466@gmail.com> wrote:

Using postgresql latest for a project.

I have a XML document which I would like to store in a table and query it using xpath function.

My document looks like this:

<ca>
<c>
<a n="color"><s>red</s></a>
<a n="year"><i>1995</i></a>
</c>
</ca>

How can I extract color. expected value is "red"

Also, is it better to dump the data into a table and then use some sort of trigger to parse it into a more normalized format for querying or is it better to to leave it as a XML dump and have the application handle the XML parsing?

It depends.

David J.

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

Предыдущее
От: Moreno Andreo
Дата:
Сообщение: Re: [NOVICE] Postgres authentication to multiple application servers
Следующее
От: padmini
Дата:
Сообщение: Re: [NOVICE] Postgres authentication to multiple application servers