Oracle 10.1 and 11.2 produce different XML using the same operator

I am migrating a database from Oracle 10.1 to 11.2 and I have the following problem.

Statement

SELECT
      '<?xml version="1.0" encoding="utf-8" ?>' || (Xml).getClobVal() AS XmlClob
FROM
(
  SELECT
    XmlElement( "Element1",
      (
        SELECT
          XmlAgg(tpx.Xml)
        FROM 
          (
        SELECT
            XmlElement("Element3",XmlForest('content' as Element4)) AS Xml
        FROM dual 
        ) tpx
      ) AS "Element2"
    ) AS Xml
  FROM
    dual
)

In source database 10.1, XML is created like this ...

<?xml version="1.0" encoding="utf-8"?>
<Element1>
  <Element2>
    <Element3>
      <ELEMENT4>content</ELEMENT4>
    </Element3>
  </Element2>
</Element1>

On the new 11.2 system, it looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Element1>
  <Element3>
    <ELEMENT4>content</ELEMENT4>
  </Element3>
</Element1>

Is there some kind of environment variable I'm missing that tells Oracle how to format its XML. There are hundreds of thousands of PL / SQL rows in the database; it would be a gigantic task to rewrite if it turned out that they changed the way Oracle formats XML between versions.

Hope someone came to this earlier. thank

+5
source share
2 answers

v10, , Element2 XMLElement. XMLAgg Nodeset, , "Element2", , .

+1

Metalink, , - , .

10.2.0.1 11g, . 11g, , . Oracle, .

0

All Articles