XML path function
От | x asasaxax |
---|---|
Тема | XML path function |
Дата | |
Msg-id | 91495cb0801081221g41e91241v34537eec25b056e8@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: XML path function
Re: XML path function Re: XML path function |
Список | pgsql-general |
Hi everyone,
I´m trying to undestand how to do select with xml path.
I have this xml example:
create table temp(id integer, xml text, Primary Key(id));
<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>
<element1>
<element2>
<element3 id="1" name="2">
<name></name>
<element4>
<element5></element5>
<element5></element5>
<element5></element5>
</element4>
</element3>
</element2>
</element1>
Here go the questions:
1) How can i select all name elements from the xml?
2) How can i select all element3 id´s?
3) How can i select all element5 that have element3 with attribute name="x"?
Thanks very much. :)
I´m trying to undestand how to do select with xml path.
I have this xml example:
create table temp(id integer, xml text, Primary Key(id));
<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>
<element1>
<element2>
<element3 id="1" name="2">
<name></name>
<element4>
<element5></element5>
<element5></element5>
<element5></element5>
</element4>
</element3>
</element2>
</element1>
Here go the questions:
1) How can i select all name elements from the xml?
2) How can i select all element3 id´s?
3) How can i select all element5 that have element3 with attribute name="x"?
Thanks very much. :)
В списке pgsql-general по дате отправления: