Web page standard beginner: standard definition of XHTML

Source: Internet
Author: User
Tags definition reference reserved version xmlns
xhtml| Standard | beginners | Web page

  Document consistency

This version of XHTML provides strict adherence to the XHTML document definition, subject to the tags and attributes provided by the XHTML name address. For information that uses XHTML's other address spaces, such as the metadata expressed by RDF, see section 3.1.2.

  Strictly follow the document.

A document that adheres strictly to XHTML requires only the mandatory functionality described in this specification, and must comply with the following criteria:

It must be validated by one of the DTDs in Appendix A appendix A, 3.

The root element of the document must be

The root element of the document must specify the XHTML name address with the xmlns attribute [xmlnames]. The name of the XHTML address is defined in http://www.w3.org/1999/xhtml.

Before the root element, there must be a DOCTYPE declaration. The public identifiers contained in the DOCTYPE declaration must reference one of the 3 DTDs in Appendix A, appendix A, each with its own official public identifier. System identifiers can be changed to fit the local system.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Dtd/xhtml1-strict.dtd" >

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Dtd/xhtml1-transitional.dtd" >

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//en" "Dtd/xhtml1-frameset.dtd" >

The following is an example of a minimal XHTML document:

<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE html
Public "-//W3C//DTD XHTML 1.0 strict//en"
"Dtd/xhtml1-strict.dtd" >
<title>virtual library</title>
<body>
<p>moved to <a href= "http://vlib.org/" >vlib.org</a>.</p>
</body>

Note that the XML declaration is included in this example. XML declarations are not required in all XML documents. XHTML is strongly recommended for use with XML declarations. Such a declaration is required when the character encoding is not the default UTF-8 or UTF-6.

  Use of other name-address spaces in XHTML

Other XML name address spaces can be used [xmlnames] in the XHTML name address space, although such documents are not strictly compliant with XHTML documents. The consortium will later be committed to specifying consistency for multiple address spaces.

The following examples illustrate the methods used jointly by the XHTML1.0 and MathML recommended standards.

<title>a Math example</title>
<body>
<p>the Following is MathML markup:</p>
<math xmlns= "Http://www.w3.org/1998/Math/MathML" >
<apply> <log/>
<logbase>
<cn> 3 </cn>
</logbase>
<ci> x </ci>
</apply>
</math>
</body>

The following example illustrates how XHTML1.0 and other XML address spaces are used jointly:

<?xml version= "1.0" encoding= "UTF-8"?>
<!--initially,the Default namespace is ' books '-->
<book xmlns= ' Urn:loc.gov:books '
xmlns:isbn= ' urn:isbn:0-395-36341-6 ' xml:lang= "en" lang= "en" >
<title>cheaper by the Dozen</title>
<isbn:number>1568491379</isbn:number>
<notes>
<!--make HTML the default namespace for a hypertext commentary-->
<p xmlns= ' http://www.w3.org/1999/xhtml ' >
This is also available <a href= "http://www.w3.org/" >ONLINE</A>.
</p>
</notes>
</book>

  User Agent Consistency

A compliant user agent must comply with all of the following criteria:

For consistent with XML1.0 recommendation [XML], user agents must analyze and evaluate the orchestration of XHTML documents. If the user agent claims to be a user agent with authentication capabilities, it must also validate the document in accordance with the DTD referenced by the [XML] security document.

When the user agent claims to support the functional facilities defined in this specification book, it must be supported by functional definition.

When a user agent processes an XHTML document in general XML, it should recognize only the attributes of the ID type, such as the id attribute of most XHTML elements, as fragment identifiers.

If the user agent encounters an element that it does not recognize, it must display the contents of the element.

If the user agent encounters a property that it does not recognize, it must ignore the definition of the entire property (that is, the attribute and its value).

If the user agent encounters a property value that it does not recognize, it must use the default value for the property.

If it encounters an entity reference (not a predefined entity), the user agent has not processed its declaration (if the declaration occurs in an external subset that the user agent does not read), the entity reference should be displayed as a character (beginning with A &, ending with a half colon) to be formatted as an entity reference.

When the content is displayed, the user agent should tell the user in a conspicuous way that an exception appears if it encounters a character that it does not recognize, but does not display a character entity reference.

The following characters are defined as whitespace (whitespace) characters in [XML]:

Space ()
Tab ()
Carriage return ()
Line Wrap ()

The XML handler normalizes the line end code of the different systems into a single newline to be passed to the application. Therefore, XHTML must also consider the following characters as whitespace characters:

Change page ()
0 width space ()

For an element with the ' Xml:space ' attribute set to ' reserved ', the user agent must keep all white-space characters intact (except for the boot and trailing whitespace, which should be deleted). Otherwise, whitespace characters are processed in the following rules:

Whitespace characters around all block elements should be deleted.

All annotations are removed without affecting the processing of whitespace characters. A blank character on either side of the note is processed as two blank characters

Boot and trailing whitespace characters should be deleted

A newline character within a block element must be converted to a space (the ' Xml:space ' property is set to the exception of ' reserved ').

A string of contiguous whitespace characters must be reduced to a single space (except when the ' Xml:space ' property is set to ' reserved ').

When displayed, the user agent should display in the appropriate way the language in which the contents of the document are written for the contents of the document. In languages that are mainly Latin, ASCII spaces are typically used to encode grammatical boundaries and typographical gaps; In languages related to Nagari writing (such as Sanskrit, Thai, etc.), grammatical boundaries can be encoded with ZW whitespace characters, but are generally not represented in printed spaces when displaying output; In the Arabic form of the language of the writing body, you can use the space character code printed on the blank, single can not use ZW space delimitation of the internal grammatical demarcation (for example, in English appears to be a word of ' kitabuhum ' = ' kitabu-hum ' = ' book them ' = = ' their book, Encoded in Arabic as several words); Chinese writing habits generally do not use this way to encode boundaries or to print blanks.

The whitespace in the value of the property is handled in the form of [XML].



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.