LexicalPreservationConfig PreserveXMLDeclaration Property XML Compare .NET API Documentation
XML Compare .NET API Documentation - DEPRECATED
Controls whether XML Declaration related information is converted into XML markup.

Namespace: DeltaXML.CoreS9Api.Config
Assembly: DeltaXML.CoreS9Api (in DeltaXML.CoreS9Api.dll) Version: 10.4.0.1000 (10.4.0.1000)
Syntax

public bool PreserveXMLDeclaration { get; set; }

Property Value

Type: Boolean
Remarks

Controls whether XML Declaration related information is converted into XML markup.

An XML declaration can specify the encoding, XML version and whether an XML file is 'standalone'. This information can be explicitly specified in an XML file but if it is not presebt, the parser will determine the information based on rules defined in the XML Specifications (see below).

The input settings will be preserved and used in the result file as long as they are not overridden with pipeline outputProperties e.g. if the inputs specify an encoding of UTF-16BE, this will be used as the encoding for files written by the comparison. However, if the encoding output property is set to UTF-8, the result file will be encoded using UTF-8.

N.B. Having no XML declaration in the inputs does not stop one from being output in the result file. The result will always contain a declaration specifying the XML version and File encoding unless the omit-xml-declaration output property has been set to 'yes'.

For example, when this method has been passed a value of true, an XML file with this declaration:

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

will produce output containing:

<preserve:xmldecl xml-version="1.0" encoding="UTF-8"/>

See Also