XML Declarations

Declares the XML version and optionally declares the encoding and whether the XML document depends on any external resources. XML declarations are recommended, but not required, in XML 1.0.

Syntax

<?xml 
    version='version_number'
    encoding='encoding_value'
    standalone='yes'|'no'
?>

Attributes

The following sections describe the attributes of the XML declaration.

Attribute Description

version='version_number'

Required. Specifies the XML version. Although the number will change for future versions of XML, 1.0 is the current version.

encoding='encoding_value'

Optional if the file encoding is UTF-8 or UTF-16. If used, the encoding declaration must appear immediately after the version attribute, and must contain a value representing an existing character encoding.

The encoding declaration identifies which encoding is used to represent the characters in the document.

standalone='yes'|'no'

Optional. If used, the stand-alone declaration must appear last in the XML declaration.

The stand-alone declaration indicates whether a document relies on information from an external source, such as external document type definition (DTD), for its content. The default value is no.

Remarks

If used, the XML declaration must appear as the first line of the document without other content or white space before the opening angle bracket (<).

For additional information, see XML Declaration in the Microsoft MSDNĀ® Library.

Example

The following example shows a typical XML declaration for Notification Services application definition files (ADFs) and instance configuration files (ICFs). It specifies that the XML document complies with the XML version 1.0 specification, that the document uses UTF-8 encoding, and that the document does not rely on any external documents for additional information.

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>

See Also

Reference

Application Definition File Reference

Concepts

Instance Configuration File Reference

Help and Information

Getting SQL Server 2005 Assistance