My Oracle Support Banner

XMLSERIALIZE Ignore INDENT Parameter When I Use It With ENCODING Parameter Together (Doc ID 2313574.1)

Last updated on APRIL 12, 2022

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A 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

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.