In 11.2.0.3 fn:local-name Returns NULL Rather Than the Root Element Name (Doc ID 1373945.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: 11.2.0.3 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

In Oracle Server 11.2.0.3 getting the root element name of an XMLTYPE document using the XMLQuery and fn:local-name as in the following code

SELECT XMLCast(XMLQuery('fn:local-name($x)' PASSING XMLTYPE('<Clearing/>') AS "x" RETURNING CONTENT ) AS VARCHAR2(30)) root_element FROM dual;

returns NULL, while the same query returns the root element name in Oracle Server 11.2.0.2.

In 11.2.0.3
SQL> SELECT XMLCast(XMLQuery('fn:local-name($x)' PASSING
XMLTYPE('<Clearing/>') AS "x" RETURNING CONTENT ) AS VARCHAR2(30))
root_element FROM dual;

ROOT_ELEMENT
------------------------------



In 11.2.0.2
SQL> SELECT XMLCast(XMLQuery('fn:local-name($x)' PASSING
XMLTYPE('<Clearing/>') AS "x" RETURNING CONTENT ) AS VARCHAR2(30))
root_element FROM dual;

ROOT_ELEMENT
------------------------------
Clearing

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms