Wattle Software - producers of XMLwriter XML editor
 Home | Search | Site Map 
XMLwriter
 Screenshots
 Features
 About Latest Version
 Awards & Reviews
 User Comments
 Customers
Download
 Download XMLwriter
 Download Plug-ins
 Download Help Manual
 MSXML Updates
 Downloading FAQ
Buy
 Buy XMLwriter
 Pricing
 Upgrading
 Sales Support
 Sales FAQ
Support
 Sales Support
 Technical Support
 Submit a Bug Report
 Feedback & Requests
 Technical FAQ
Resources
 XML Links
 XML Training
 XMLwriter User Tools
 The XML Guide
 XML Book Samples
Wattle Software
 About Us
 Contact Details
XML Declaration

The XML declaration is a processing instruction that identifies the document as being XML. All XML documents should begin with an XML declaration.

<?xml
 version="version_number"
 encoding="encoding_declaration"
 standalone="standalone_status" ?>

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

Rules:

  • If the XML declaration is included, it must be situated at the first position of the first line in the XML documentwell-formedness constraint.
  • If the XML declaration is included, it must contain the version number attributewell-formedness constraint.
  • If all of the attributesglossary are declared in an XML declaration, they must be placed in the order shown abovewell-formedness constraint.
  • If any elements, attributes, or entities are used in the XML document that are referenced or defined in an external DTD, standalone="no" must be includedvalidity constraint.
  • The XML declaration must be in lower case (except for the encoding declarations)well-formedness constraint.

Note:

  • The XML declaration has no closing tag, that is </?xml>well-formedness constraint.

The following table shows a list of the possible attributes that may be used in the XML declaration.

Attribute Name: Possible Attribute Value: Attribute Description:
version 1.0 Specifies the version of the XML standard that the XML document conforms to. The version attribute must be included if the XML declaration is declaredwell-formedness constraint.
encoding UTF-8, UTF-16, ISO-10646-UCS-2, ISO-10646-UCS-4, ISO-8859-1 to ISO-8859-9, ISO-2022-JP, Shift_JIS, EUC-JP These are the encoding namesglossary of the most common character sets in use today. For a full list of encodings check the IANA'sglossary website.
standalone yes, no Use 'yes' if the XML document has an internal DTD. Use 'no' if the XML document is linked to an external DTD, or any external entity referencesvalidity constraint.


XML Guide TOC

XML Declaration
DOCTYPE Declaration & DTDs
ELEMENT Type Declaration
ATTLIST Declaration
ENTITY Declaration
NOTATION Declaration
CDATA Section
Processing Instruction
Conditional Section
Comments

Glossary

© Wattle Software 1998-2017. All rights reserved.