From oracle-l-bounce@freelists.org Tue Dec 6 01:00:43 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id jB670frN022436 for ; Tue, 6 Dec 2005 01:00:41 -0600 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id jB670YAX022408 for ; Tue, 6 Dec 2005 01:00:35 -0600 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5AAC824A31C; Tue, 6 Dec 2005 02:00:27 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25578-04; Tue, 6 Dec 2005 02:00:27 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id DAEA824A057; Tue, 6 Dec 2005 02:00:26 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 06 Dec 2005 01:58:27 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2717E249942 for ; Tue, 6 Dec 2005 01:58:27 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25109-01 for ; Tue, 6 Dec 2005 01:58:26 -0500 (EST) Received: from ftsmail.fts-soft.com (mail.fts-soft.com [62.90.113.94]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5007D248676 for ; Tue, 6 Dec 2005 01:58:26 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by Ecartis Subject: RE: extracting xml tag name Date: Tue, 6 Dec 2005 08:57:00 +0200 Message-ID: <7FF923B77C9A3D46BD808F3BD91473ACF0CF44@ftsmail.fts-soft.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: extracting xml tag name Thread-Index: AcX2bzZoD6xtGDfmQNq7jiUpGHff4gDFGnPQABBoQWAAGyD0gA== From: "Shay Toder" To: "Christian Antognini" Cc: X-archive-position: 28938 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: shayt@fts-soft.com Precedence: normal Reply-To: shayt@fts-soft.com X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-mailscan-MailScanner-Information: Please contact the ISP for more information X-mailscan-MailScanner: Found to be clean X-MailScanner-From: oracle-l-bounce@freelists.org X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on air891.startdedicated.com X-Spam-Level: X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, UPPERCASE_25_50 autolearn=no version=2.63 Thank you very much, It works like a charm. Another option is to use this line (if you exactly in the place, if not, your line is better) - VALUE (e).getrootelement() AS tag2 Like in this example - SELECT EXTRACT (VALUE (e), '/').getstringval () AS xml , EXTRACTVALUE (VALUE (e), '/') AS VALUE , XMLTYPE (EXTRACT (VALUE (e), '/').getstringval ()).getrootelement() AS tag , VALUE (e).getrootelement() AS tag2 FROM TABLE(XMLSEQUENCE(EXTRACT(XMLTYPE( ' 2 3 4 ') , '/A/*'))) e thanks, Shay -----Original Message----- From: Christian Antognini [mailto:Christian.Antognini@trivadis.com] Sent: Monday, December 05, 2005 7:58 PM To: Shay Toder Cc: oracle-l@freelists.org Subject: RE: extracting xml tag name 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 (' 4 2 5 3 6 4 7 ' 8 ), '/A/*'))) e; XML --------------------------------------------------------------------------------- B C D HTH Chris -- http://www.freelists.org/webpage/oracle-l