Xml file line break

Hi,

i’m trying to add a node and save the xml file. We have a standard xml template for our sql database restore ( which we use third party for sql backups and restore ).

i will show the example how the template looks and how template changes when adding a node…

template looks like this…

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<TMMsg_CreateTaskReq>

<taskInfo>

<task>

<taskFlags>

<disabled>false</disabled>

</taskFlags>

<policyType>DATA_PROTECTION</policyType>

<taskType>IMMEDIATE</taskType>

<initiatedFrom>COMMANDLINE</initiatedFrom>

<alert>

<alertName></alertName>

</alert>

</task>

<associations>

<backupsetName>defaultBackupSet</backupsetName>

<subclientName></subclientName>

<clientName></clientName>

<appName>SQL Server</appName>

<instanceName></instanceName>

</associations>

In the above file, on first line there is a space after ‘no’ Â and no space in clientname and instancename

After saving the xml file…it changes like this…

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<TMMsg_CreateTaskReq>

<taskInfo>

<task>

<taskFlags>

<disabled>false</disabled>

</taskFlags>

<policyType>DATA_PROTECTION</policyType>

<taskType>IMMEDIATE</taskType>

<initiatedFrom>COMMANDLINE</initiatedFrom>

<alert>

<alertName>

</alertName>

</alert>

</task>

<associations>

<backupsetName>defaultBackupSet</backupsetName>

<subclientName>

</subclientName>

<clientName>

</clientName>

<appName>SQL Server</appName>

<instanceName>

</instanceName>

</associations>

After saving the xml file…client name ,instance name broke into two line and when i put them in one line there is huge space and no space after ‘no’ in first line…

<clientName> Â Â Â </clientName>

<instanceName> Â Â Â </instanceName>

do we have any issue if there is a line break or more space between the nodes ?

Please let me know

Thanks in advance

There should not be an issue, no. This isn’t PowerShell doing it, per se; it’s the underlying .NET Framework XML parser. XML isn’t sensitive to carriage returns; any carriage returns are just to help make the file easier for a human to read, and the .NET parser does tend to try and keep the file “pretty looking.” But any software that reads the file shouldn’t care about line breaks, or extra white space between elements.