Josef Zahner created NIFI-15378:
-----------------------------------
Summary: UI XML Viewer (Formatted) doesn't behave as expected
Key: NIFI-15378
URL: https://issues.apache.org/jira/browse/NIFI-15378
Project: Apache NiFi
Issue Type: Bug
Components: Core UI
Reporter: Josef Zahner
The UI XML Viewer doesn't work as intended for XML (at least for all NiFi 2.x.x
Versions). Please check the example below.
h3. Original XML File
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<myMessage xmlns="http://abc">
<header>
<timeStamp>20251218145856Z</timeStamp>
</header>
<responsePayload>
<ResponseRecord>
<recordNumber>0</recordNumber>
<recordPayload>
<myId>123456789</myId>
</recordPayload>
</ResponseRecord>
</responsePayload>
</myMessage>
{code}
h3. *XML Pretty - created via Notepad++*
What we would expect as output:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<myMessage xmlns="http://abc">
<header>
<timeStamp>20251218145856Z</timeStamp>
</header>
<responsePayload>
<ResponseRecord>
<recordNumber>0</recordNumber>
<recordPayload>
<myId>123456789</myId>
</recordPayload>
</ResponseRecord>
</responsePayload>
</myMessage>{code}
h3. *What we get as "pretty" from the NiFi UI XML viewer*
Btw. it's the same for the XML writer when pretty flag is enabled:
{code:java}
<myMessage xmlns="http://abc">
<header>
<timeStamp>20251218145856Z</timeStamp>
</header>
<responsePayload>
<ResponseRecord>
<recordNumber>0</recordNumber>
<recordPayload>
<myId>123456789</myId>
</recordPayload>
</ResponseRecord>
</responsePayload>
</myMessage>
{code}
h3. Summary
What we have seen:
* Newlines/CR will not be removed.
* It's even worse, we are getting additional newlines after each line with text
* XML Header will be removed
So the UI for XML isn't helpful for us. Would be great if this output could be
improved in future releases.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)