XMLSERIALIZE Ignore INDENT Parameter When I Use It With ENCODING Parameter Together

(Doc ID 2313574.1)

Last updated on OCTOBER 12, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Information in this document applies to any platform.

Symptoms

On : 12.2.0.1 version,

XMLSERIALIZE ignore INDENT parameter when use with ENCODING parameter together

For example:

SELECT XMLSERIALIZE(DOCUMENT xmltype('<data><a><b>111</b></a><c><d>222</d></c></data>') AS BLOB ENCODING 'UTF-8' INDENT SIZE=5) FROM dual

The BLOB content looks like

<?xml version="1.0" encoding="UTF-8"?>
<data>
<a>
<b>111</b>
</a>
<c>
<d>222</d>
</c>
</data>

There is no INDENT despite the fact that of using "INDENT SIZE=5" parameter in the statement.

although, executing the statement but without "ENCODING 'UTF-8'" parameter:

SELECT XMLSERIALIZE(DOCUMENT xmltype('<data><a><b>111</b></a><c><d>222</d></c></data>') AS BLOB INDENT SIZE=5) FROM dual

The BLOB content looks like
<data>
<a>
<b>111</b>
</a>
<c>
<d>222</d>
</c>
</data>

an INDENT exist before xml elements.

 

There is no indentations in the output xml file when using INDENT parameter along with ENCODING parameter.





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