| 1 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 2 |
<head> |
| 3 |
<title>Modularization of XHTML in RELAX NG</title> |
| 4 |
</head> |
| 5 |
<body> |
| 6 |
<h1>Modularization of XHTML in RELAX NG</h1> |
| 7 |
|
| 8 |
<p>This directory contains an implementataion in RELAX NG of the |
| 9 |
modularization of XHTML specified by the <a |
| 10 |
href="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410" |
| 11 |
>Modularization of XHTML Recommendation</a>.</p> |
| 12 |
|
| 13 |
<p>The RELAX NG schema has not been mechanically derived from the DTDs. |
| 14 |
Rather, it has been hand-crafted so as to produce a good quality RELAX NG |
| 15 |
schema. However, it may well contain bugs.</p> |
| 16 |
|
| 17 |
<p>The <a href="modules"><code>modules</code></a> directory contains |
| 18 |
all the modules; <a |
| 19 |
href="xhtml-basic.rng"><code>xhtml-basic.rng</code></a> uses the |
| 20 |
modules to implement <a href="http://www.w3.org/TR/xhtml-basic/">XHTML |
| 21 |
Basic</a>; <a |
| 22 |
href="xhtml-strict.rng"><code>xhtml-strict.rng</code></a> uses the |
| 23 |
modules to implement <a href="http://www.w3.org/TR/xhtml1/">XHTML |
| 24 |
1.0</a> strict; <a href="xhtml.rng"><code>xhtml.rng</code></a> uses |
| 25 |
the modules to implement the union of <a |
| 26 |
href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> transitional and <a |
| 27 |
href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> frameset. You can |
| 28 |
<a href="http://www.thaiopensource.com/download">download</a> |
| 29 |
everything as part of the main Jing distribution. To create a custom |
| 30 |
version of XHTML, simply copy <code>xhtml.rng</code> and delete the |
| 31 |
inclusions of the modules that you do not want.</p> |
| 32 |
|
| 33 |
<p>The biggest difference between the RELAX NG implementation and the |
| 34 |
DTD implementation is that the RELAX NG implementation does not |
| 35 |
require you to create a model module specific to the combination of |
| 36 |
XHTML modules you are using. Instead, simply include the modules you |
| 37 |
want. The modules take care of redefining the content models |
| 38 |
appropriately.</p> |
| 39 |
|
| 40 |
<p>Note also the following differences:</p> |
| 41 |
|
| 42 |
<ul> |
| 43 |
|
| 44 |
<li>The frames module is used instead of the struct module, rather |
| 45 |
than in addition to it.</li> |
| 46 |
|
| 47 |
<li>In the frames module, the <code>frameset</code> element does not |
| 48 |
restrict the optional <code>noframes</code> element to follow all the |
| 49 |
other child elements. XHTML Modularization is inconsistent with both |
| 50 |
HTML 4.0 and XHTML 1.0 here.</li> |
| 51 |
|
| 52 |
<li>In the basic tables abstract module, the <code>table</code> |
| 53 |
element does not have a <code>width</code> attribute. The XHTML Rec is |
| 54 |
ambiguous here: the abstract module has the attribute, but the DTD |
| 55 |
does not.</li> |
| 56 |
|
| 57 |
<li>The object and applet modules takes advantage of RELAX NG's |
| 58 |
absence of restrictions on mixed content to enforce the requirement |
| 59 |
that <code>param</code>s precede other content.</li> |
| 60 |
|
| 61 |
<li>The forms module takes advantage of RELAX NG's absence of |
| 62 |
restrictions on mixed content to enforce the requirement that any |
| 63 |
<code>legend</code> precedes other content.</li> |
| 64 |
|
| 65 |
<li>The RELAX NG schema does not enforce exclusions. The HTML 4 DTD |
| 66 |
uses exclusions in several places, for example, to disallow an |
| 67 |
<code>a</code> element from having an <code>a</code> element as a |
| 68 |
descendant. It is not possible to represent this constraint in XML |
| 69 |
DTDs. XHTML Modularization takes the approach of partially |
| 70 |
representing this restriction by, for example, disallowing an |
| 71 |
<code>a</code> element from having an <code>a</code> element as a |
| 72 |
<em>child</em>, without disallowing it from having an <code>a</code> |
| 73 |
element as a non-immediate descendant. This partial restriction has a |
| 74 |
substantial cost in increasing the complexity and reducing the |
| 75 |
modularity of the schemas. This implementation adopts a different |
| 76 |
approach. The <a href="exclude"><code>exclude</code></a> directory |
| 77 |
contains separate, independent RELAX NG schemas that enforce |
| 78 |
exclusions. To check use of exclusions, a document should be |
| 79 |
validated against each of these schemas that is applicable <strong>in |
| 80 |
addition to</strong> being validated against the RELAX NG XHTML schema |
| 81 |
proper. The available schemas are as follows: |
| 82 |
|
| 83 |
<dl> |
| 84 |
|
| 85 |
<dt><a href="exclude/basic.rng"><code>exclude/basic.rng</code></a></dt> |
| 86 |
<dd>checks the exclusions relating to <code>a</code> and |
| 87 |
<code>pre</code> elements</dd> |
| 88 |
|
| 89 |
<dt><a |
| 90 |
href="exclude/basic-table.rng"><code>exclude/basic-table.rng</code></a></dt> |
| 91 |
|
| 92 |
<dd>checks the exclusions relating to basic tables module (i.e. |
| 93 |
checks that <code>table</code> elements are not nested)</dd> |
| 94 |
|
| 95 |
<dt><a href="exclude/form.rng"><code>exclude/form.rng</code></a></dt> |
| 96 |
|
| 97 |
<dd>checks the exclusions relating to forms and basic forms modules</dd> |
| 98 |
|
| 99 |
</dl> |
| 100 |
|
| 101 |
</li> |
| 102 |
|
| 103 |
</ul> |
| 104 |
|
| 105 |
<address><a href="mailto:[email protected]">James Clark</a></address> |
| 106 |
|
| 107 |
</body> |
| 108 |
</html> |