1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE readme SYSTEM "readme.dtd" [
4 <!ENTITY % common SYSTEM "common.xml">
7 <!-- Special HTML config: -->
8 <!ENTITY % readme:html:up '<a href="../..">up</a>'>
10 <!ENTITY % config SYSTEM "config.xml">
15 <readme title="Extensions of the XML specification">
18 <title>This document</title>
19 <p>This parser has some options extending the XML specification. Here, the
20 options are explained.
25 <title>Optional declarations instead of mandatory declarations</title>
27 <p>The XML spec demands that elements, notations, and attributes must be
28 declared. However, there are sometimes situations where a different rule would
29 be better: <em>If</em> there is a declaration, the actual instance of the
30 element type, notation reference or attribute must match the pattern of the
31 declaration; but if the declaration is missing, a reasonable default declaration
32 should be assumed.</p>
34 <p>I have an example that seems to be typical: The inclusion of HTML into a
35 meta language. Imagine you have defined some type of "generator" or other tool
36 working with HTML fragments, and your document contains two types of elements:
37 The generating elements (with a name like "gen:xxx"), and the object elements
38 which are HTML. As HTML is still evolving, you do not want to declare the HTML
39 elements; the HTML fragments should be treated as well-formed XML fragments. In
40 contrast to this, the elements of the generator should be declared and
41 validated because you can more easily detect errors.</p>
43 <p>The following two processing instructions can be included into the DTD:</p>
45 <li><p><code><![CDATA[<?pxp:dtd optional-element-and-notation-declarations?>]]></code>
46 References to unknown element types and notations no longer cause an
47 error. The element may contain everything, but it must be still
48 well-formed. It may have arbitrary attributes, and every attribute is
49 treated as an #IMPLIED CDATA attribute.</p>
51 <li><p><code><![CDATA[<?pxp:dtd optional-attribute-declarations elements="x y ..."?>]]></code>
52 References to unknown attributes inside one of the enumerated elements
53 no longer cause an error. Such an attribute is treated as an #IMPLIED
57 <p>If there are several "optional-attribute-declarations" PIs, they are all
58 interpreted (implicitly merged).</p>