My Oracle Support Banner

UPDATEXML Adds an Empty Namespace (xmlns="") When Adding a New Element Without Namespace in an XML With Namespace (Doc ID 1617746.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.

Symptoms

Adding a new element without namespace in an XML having a namespace declared with UpdateXML statement,
adds an empty namespace 

xmlns=""

to the new added element

Example:

 select updatexml(
           xmltype(
             '<?xml version="1.0" encoding="utf-8"?>
              <root xmlns="evil.xsd">
                <node_a/>
                <node_b/>
              </root>'
           ),
           '/root/node_a',
          xmlelement("node_a", 'guff'),
          '/root/node_b',
          xmlelement("node_b", 'puff'),
          'xmlns="evil.xsd"'
       ) as xml_text
  from dual
/

returns

XML_TEXT
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="US-ASCII"?>
<root xmlns="evil.xsd">
  <node_a xmlns="">guff</node_a>
  <node_b xmlns="">puff</node_b>
</root>

 



Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.