7.2. XML Declaration and Character Encoding

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


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page