Re: extracting xml tag name
- From: Stephane Faroult <sfaroult@xxxxxxxxxxxx>
- To: shayt@xxxxxxxxxxxx
- Date: Mon, 05 Dec 2005 11:26:23 +0100
I am not very familiar with the XML stuff, but some old-fashioned string
functions applied to your "xml" column can do it easily:
SQL> select substr(xml, 2, instr(xml, '>') - 2) tag
2 from (select '<blah>anyything here </blah>' xml
3* from dual)
SQL> /
TAG
----
blah
HTH
S Faroult
On Mon, 2005-12-05 at 12:07 +0200, Shay Toder wrote:
> hi,
>
> how can i get the NAME of the XML node,
> example -
> SELECT EXTRACT (VALUE (e), '/').getstringval () as xml
> , EXTRACTVALUE (VALUE (e), '/') as VALUE
> --, ??? as tag
> FROM TABLE (XMLSEQUENCE (EXTRACT (
> XMLTYPE ('<A>
> <B>2</B>
> <C>3</C>
> <D>4</D>
> </A>'
> ), '/A/*'))) e
>
> the result should be - (the first & second are ok, but how to get the
> third ?) -
>
> xml
> ---
> <B>2</B>
> <C>3</C>
> <D>4</D>
>
> value
> -----
> 2
> 3
> 4
>
> tag
> ---
> B
> C
> D
>
> Thanks,
> Shay
> --
> http://www.freelists.org/webpage/oracle-l
>
--
http://www.freelists.org/webpage/oracle-l
- References:
- extracting xml tag name
- From: Shay Toder
Other related posts:
- » extracting xml tag name
- » Re: extracting xml tag name
- » RE: extracting xml tag name
- » RE: extracting xml tag name
- extracting xml tag name
- From: Shay Toder