7.2. XML Declaration and Character Encoding

Preferences - Do not show ads

All XHTML MP documents are XML documents. So, there is an XML declaration at the start. The XML declaration specifies the XML version of the document. The character encoding of the document can also be specified here, like this:

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

The above line states that the XML version of the XHTML MP document is 1.0 and the character encoding is UTF-8. If the character encoding of the XHTML MP document is UTF-8 or UTF-16, the encoding attribute can be omitted.

The XML declaration is not a compulsory component in XHTML MP. However, problems may occur in some WAP browsers if the XML declaration is omitted. For example, some Sony Ericsson WAP browsers make use of the XML declaration to distinguish XHTML MP documents from IHTML (a proprietary markup language defined by NTT DoCoMo) documents when the MIME type received is text/html: If the document contains the XML declaration, it is an XHTML MP document, otherwise it is an IHTML document.

Previous Page Page 9 of 36 Next Page

Contents at a Glance (Click Here for Full Table of Contents)
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?

XHTML MP Tutorial Table of Contents XHTML MP Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page