<?xml-stylesheet type="text/css" href="xhtml2.css"?>
<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en">
<head>
   <title>This is an XHTML2 document</title>
   <link rel="stylesheet" href="xhtml2.css" type="text/css"/>
</head>
<body>
<h>An XHTML2 Document</h>
<p>This document attempts to include examples of all parts of <a href="http://www.w3.org/TR/xhtml2/">XHTML2</a>. It is currently served (during development) as XML, to avoid in-built meaning and display disturbing the development).</p>
<section>
   <h>Headers</h>
   <p>XHTML uses the <code>&lt;h&gt;</code> element for headers in combination with the <code>&lt;section&gt;</code> element.</p>
   <h2>This is an h2, and is the same 'level' as the previous header.</h2>
   <p>The traditional h1 to h6 headers are also available.</p>
   <section><h>A heading</h><p>Nested sections reduce the relative importance of headers</p>
       <section><h>A heading</h><p>Nested sections reduce the relative importance of headers</p>
           <section><h>A heading</h><p>Nested sections reduce the relative importance of headers</p>
               <section><h>A heading</h><p>Nested sections reduce the relative importance of headers</p>
               </section>
           </section>
       </section>
   </section>
</section>
<section>
<h>Paragraphs</h>
<p>The <code>&lt;p&gt;</code> element has a different content-model to the one in XHTML1, and in particular may include:
<ul>
<li>lists</li>
<li>tables</li>
<li>quotes</li>
</ul>
and the like.
</p>
</section>
<section>
<h>Whitespace</h>
<p>Whitespace is usually collapsed on output, with the exception of the <code>&lt;pre&gt;</code> and <code>&lt;blockcode&gt;</code> (see below) elements and any element with an attribute <code>layout="relevant"</code>. <code>Pre</code> elements are by default displayed with a monospace font.</p>
<pre>This     is
     a    pre    element
</pre>
<p layout="relevant"> And this      is
     a     paragraph
   with layout =         "relevant".
</p>
<pre layout="irrelevant">And this     is
     a    pre    element with
    layout =      "  irrelevant   " .
</pre>
</section>
<section>
<h>Structure</h>
<p>The <code>&lt;hr&gt;</code> element has been renamed <code>&lt;separator&gt;</code> since it needn't be horizontal, nor a rule (even though that is its default presentation):
<separator/>
</p>
<p>The traditional elements remain, like the nearly-useless <code>&lt;address&gt;</code>:
<address><a href="mailto:webmaster@example.com">Webmaster</a>.</address>
</p>
<p>
There is still a <code>&lt;blockquote&gt;</code> element with an optional <code>cite</code> attribute (which is a URI):

<blockquote cite="http://en.wikipedia.org/wiki/Molloy_(novel)">Should I set out on my autocycle? This was the question
with which I began. I had a methodical mind and never set out on a
mission without a prolonged reflection as to the best way of setting
out. It was the first problem to solve, at the outset of each enquiry,
and I never moved until I had solved it, to my satisfaction. Sometimes
I took my autocycle, sometimes the train, sometimes the motor-coach,
just as sometimes too I left on foot, or on my bicycle, silently, in
the night. For when you are beset with enemies, as I am, you cannot
leave on your autocycle, even in the night, without being noticed,
unless you employ it as an ordinary bicycle, which is
absurd.</blockquote>

There is the new <code>&lt;blockcode&gt;</code> to match <code>&lt;code&gt;</code>:
<blockcode>    HOW TO RETURN hsl.to.rgb(h, s, l): 
       SELECT: 
	  l&lt;=0.5: PUT l*(s+1) IN m2
	  ELSE: PUT l+s-l*s IN m2
       PUT l*2-m2 IN m1
       PUT hue.to.rgb(m1, m2, h+1/3) IN r
       PUT hue.to.rgb(m1, m2, h    ) IN g
       PUT hue.to.rgb(m1, m2, h-1/3) IN b
       RETURN (r, g, b)
</blockcode>
and the classic <code>&lt;div&gt;</code> element: <div>which has no more semantics than being a block of text</div>
</p>
</section>
<section>
<h>Text</h>
<p>Inline text should cause no surprises. There is <strong>strong</strong> text with <code>&lt;strong&gt;</code>; <em>emphasis</em> with <code>&lt;em&gt;</code>; and there is still the <code>&lt;span&gt;</code> element which on its own <span>has no visible effect at all.</span> There are abbreviations with the <code>&lt;abbr&gt;</code> element <abbr title="World Wide Web Consortium">W3C</abbr>. </p>
<p>cite, code, dfn, kbd, l, q, samp, var</p>
<p> sub, sup:  H<sub>2</sub>O, E=MC<sup>2</sup></p>
</section>

<section>
<h>Hypertext Module</h>
<p>The classic <code>&lt;a&gt;</code> element still exists: <a href="http://www.w3.org/">W3C</a>. However, just as any element may be the target of a link in HTML, in XHTML2 any element may also be the source of a link: any element may carry an <code>href</code> attribute, such as this span: <span href="http://www.w3.org/" title="www.w3.org">which refers to the W3C home page.</span> You'll see that it has no special styling (unless you hover over it), even though it carries an href, but you can still click on it. It is up to the author to use a different presentation style if it is needed (or use an <code>&lt;a&gt;</code> element).</p>
</section>
<section>
<h>List Module</h>
<p>
There are unordered lists:
<ul><li>One</li><li>Two</li><li>Three</li></ul>

Ordered lists:
<ol><li>One</li><li>Two</li><li>Three</li></ol>

And definition lists:

<dl><dt>One</dt><dd>The first number</dd>
<dt>Two</dt><dd>A secondary number</dd>
</dl>

There is a new sort of list, the <em>navigation list</em>, where each entry is a link:

<nl><label>Places to go</label>
<li href="/">home</li>
<li href="http://www.w3.org/">W3C</li>
<li href="..">up</li>
</nl>
</p>
</section>

<section>

<h>Core Attributes Module</h>
<p>The normal <code class="class">class</code>, <code id="id">id</code>, and <code title="title">title</code> attributes are available on all elements as usual.</p>
</section>

<section>
<h>Hypertext Attributes Module</h>
<p>Above you saw the discussion about the <code>&lt;a&gt;</code> element, and it was pointed out that <em>any</em> element may now take an <code>href</code> attribute. Along with <code>href</code>, there are a number of related attributes:</p>
<dl>
    <dt>hreftype</dt><dd>Normally when you click on a link content negotiation will take place between the browser and the server to decide which of any possible alternative documents at the URI should be used. You can use the <code>hreftype</code> attribute to force the content negotiation. For instance if at <code>http://example.com/document</code> there is an XHTML and a PDF version of the document, then <code>hreftype="application/pdf"</code> will only accept a PDF version.</dd>
    <dt>hreflang</dt><dd></dd>
    <dt>hrefmedia</dt><dd></dd>
    <dt>cite</dt><dd></dd>
    <dt>target</dt><dd></dd>
    <dt>access</dt><dd></dd>
    <dt>nextfocus</dt><dd></dd>
    <dt>prevfocus</dt><dd></dd>
    <dt>xml:base</dt><dd></dd></dl>
</section>

<section>
<h>Edit Attributes Module</h>
<p>Instead of the <code>&lt;ins&gt;</code> and <code>&lt;del&gt;</code> elements of earlier XHTML, XHTML2 has an attribute <code>edit</code> that can be used on any element. This attribute can have the values <code edit="inserted" datetime="2006-10-09T13:15:30Z">inserted</code>, <code edit="deleted">deleted</code>, <code edit="changed">changed</code> and <code edit="moved">moved</code>. Any element that has an <code>edit</code> attribute may also have a <code>datetime</code> attribute that indicates when the change was made.</p>

</section>

<section>
<h>Embedding Attributes Module</h>
<p>There is still an <code>&lt;img&gt;</code> element. It takes a <code>src</code> attribute to specify the resource. The normal content negotiation takes place (e.g. with <code>&lt;img src="map"/&gt;</code>, there may be both <code>png</code> and <code>jpg</code> versions of the image, and the user agent and the server decide between them which is the best to deliver).
</p>
<p>The <code>type</code> attribute can be used to force the content negotiation. For instance <code>&lt;img src="map" type="image/png"/&gt;</code> would force the negotiation to only accept the <code>png</code> version. </p>
<p>The <code>img</code> element should have content. If the image fails to load (for instance because there is nothing at that point, it is not an image, or it isn't of the type specified in the <code>type</code> attribute) then the content is displayed instead. For example: <code>&lt;img src="icons/main"&gt;W3C&lt;/img&gt;</code>.
</p>
<p>Here is an image: <img src="http://www.w3.org/Icons/w3c_main">W3C</img></p>

<p>However, the <code>src</code> and <code>type</code> attributes may be put on <em>any</em> element, with the same effect: if the <code>src</code> resource is available, it is used, otherwise the content of the element is used. For instance:
<blockcode>&lt;p src="map"&gt;To get here from the station,
     turn left out of the main exit,
     and follow the train lines to the first bridge,
     we are the big white building in front of you on the left.&lt;/p&gt;
</blockcode>
</p>
</section>

<section>
<h>Internationalization Attribute Module</h>
There is an attribute <code>xml:lang</code> that may be used on any element, and specifies the (natural) language of the enclosed content:
<pre>    The window of the bakery proclaimed &lt;em xml:lang="fr"&gt;Pain&lt;/em&gt;.
    Poor baker!</pre>
</section>

<section>
<h>Media Attribute Module</h>
<p>The media attribute allows you to specify that certain sections of the content are only for use in certain circumstances. For instance, in a set of slides that uses <code>media="presentation"</code> for displaying the slides full-screen, there may be notes added to the slides that are only visible when printing the slides:
<pre>&lt;p media="print"&gt;These notes are only visible on the printed version&lt;/p&gt;
</pre>
</p>
</section>

<section>
<h>Metainformation Module and Metainformation Attributes Module</h>
<p>The traditional <code>meta</code> and <code>link</code> elements are part of XHTML2. However the attribute that used to be called <code>name</code> is now called <code>property</code>, and while there is still a <code>content</code> attribute, alternatively, the content may now really be the content of the element:
<pre>&lt;meta property="title" content="My Home Page"/&gt;
&lt;meta property="title"&gt;My Home Page&lt;/meta&gt;
</pre>
The <code>link</code> element looks the same:
<pre>&lt;link rel="index" href="index.html"/&gt;
&lt;link rev="contents" href="main.html"/&gt;
</pre>
</p>
<p>There are two new attributes:
<dl>
  <dt>about</dt><dd>Normally the metadata and link information refers to the current document. {{example}} The <code>about</code> attribute lets you give metadata about parts of the document, or even about other documents. {{examples}}</dd>
  <dt>datatype</dt><dd>This allows you to give a datatype for the content in the <code>content</code> attribute or the content of the element:
<pre>&lt;span content="2006-10-01" datatype="xsd:date"&gt;yesterday&lt;/span&gt;</pre>
</dd>
</dl>
</p>
<p>
Unlike earlier version, the <code>meta</code> and <code>link</code> elements do not need to only appear in the <code>head</code> element, but may appear anywhere. By default they are not presented.
</p>
<p>Furthermore, the attributes of <code>meta</code> and <code>link</code> may be used on <em>any</em> element to similar effect:
<pre>example here
</pre>
</p>
</section>



<section>
<h>Still to do</h>


<h>Bi-directional Text Module</h>
dir attribute

<h>Handler Module</h>
handler

<h>Image Map Attributes Module</h>
usemap, ismap, shape, and coords attributes

<h>Object Module</h>
object, param, standby

<h>Style Attribute Module</h>
style attribute

<h>Stylesheet Module</h>
style element

<h>Tables Module</h>
caption, col, colgroup, summary, table, tbody, td, tfoot, th, thead, tr

<h>Ruby Annotation Module [RUBY]</h>
ruby, rbc, rtc, rb, rt, rp

<h>XForms Module [XFORMS]</h>
action, alert, bind, case, choices, copy, delete, dispatch, extension, filename, group, help, hint, input, insert, instance, item, itemset, label, load, mediatype, message, model, output, range, rebuild, recalculate, refresh, repeat, reset, revalidate, secret, select, select1, send, setfocus, setindex, setvalue, submission, submit, switch, textarea, toggle, trigger, upload, and value elements, and repeat-model, repeat-bind, repeat-nodeset, repeat-startindex, and repeat-number attributes

<h>XML Events Module [XMLEVENTS]</h>
listener element, and defaultAction, event, handler, objserver, phase, propagate, and target attributes in the [XMLEVENTS] namespace
</section>
</body>
</html>
