Re: help with xpath namespace - Mailing list pgsql-sql

From Brian Sherwood
Subject Re: help with xpath namespace
Date
Msg-id CAExyqyhHwdNoeuexzOya2Ku=pwwoBPDHZZ-qUf7DN9WC85rMGQ@mail.gmail.com
Whole thread Raw
In response to Re: help with xpath namespace  (Filip Rembiałkowski <plk.zuber@gmail.com>)
Responses Re: help with xpath namespace
List pgsql-sql
Yep, that did it.

Thanks!


2011/9/23 Filip Rembiałkowski <plk.zuber@gmail.com>:
>
>
> 2011/9/22 Brian Sherwood <bdsher@gmail.com>
>>
>> select (xpath('/chassis-inventory/chassis/serial-number/text()',
>>        data_xml,
>>        ARRAY[ARRAY['junos',
>> 'http://xml.juniper.net/junos/9.6R4/junos-chassis']]
>>       )) from xml_test;
>>
>> Can anyone suggest how I would go about getting the serial-number with
>> xpath?
>>
>
>
> http://www.postgresql.org/docs/9.1/static/functions-xml.html#FUNCTIONS-XML-PROCESSING
> - see "mydefns".
>
> This will work:
>
> select xpath(
>     '/junos:chassis-inventory/junos:chassis/junos:serial-number/text()',
>     data_xml,
>     ARRAY[ARRAY['junos',
> 'http://xml.juniper.net/junos/9.6R4/junos-chassis']]
> )
> from xml_test;
>
>
>
> cheers, Filip
>
>
>


pgsql-sql by date:

Previous
From: David Johnston
Date:
Subject: Re: Sorting of data from two tables
Next
From: Filip Rembiałkowski
Date:
Subject: Re: handling duplicate row exception