Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: extracting xml tag name

RE: extracting xml tag name

From: <oracle-l-bounce_at_freelists.org>
Date: Mon, 5 Dec 2005 18:57:57 +0100
Message-ID: <F2C9CCA71510B442AF71446CAE8AEBAF205403@MSXVS04.trivadis.com>


Shay

>how can i get the NAME of the XML node,

In XPath the fuction name() should be used for that. Unfortunately you cannot use it with extract()...

Here a workaround:

SQL> SELECT XMLType(extract(value(e),'/').getstringval()).getRootElement() AS xml   2 FROM TABLE (XMLSEQUENCE (EXTRACT (

  3       XMLTYPE ('<A>
  4                    <B>2</B>
  5                    <C>3</C>
  6                    <D>4</D>
  7                </A>'
  8            ), '/A/*'))) e;

XML



B
C
D

HTH
Chris

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Dec 05 2005 - 13:39:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US