1 ******************************************************************************
2 Extensions of the XML specification
3 ******************************************************************************
6 ==============================================================================
8 ==============================================================================
10 This parser has some options extending the XML specification. Here, the options
13 ==============================================================================
14 Optional declarations instead of mandatory declarations
15 ==============================================================================
17 The XML spec demands that elements, notations, and attributes must be declared.
18 However, there are sometimes situations where a different rule would be better:
19 If there is a declaration, the actual instance of the element type, notation
20 reference or attribute must match the pattern of the declaration; but if the
21 declaration is missing, a reasonable default declaration should be assumed.
23 I have an example that seems to be typical: The inclusion of HTML into a meta
24 language. Imagine you have defined some type of "generator" or other tool
25 working with HTML fragments, and your document contains two types of elements:
26 The generating elements (with a name like "gen:xxx"), and the object elements
27 which are HTML. As HTML is still evolving, you do not want to declare the HTML
28 elements; the HTML fragments should be treated as well-formed XML fragments. In
29 contrast to this, the elements of the generator should be declared and
30 validated because you can more easily detect errors.
32 The following two processing instructions can be included into the DTD:
35 <?pxp:dtd optional-element-and-notation-declarations?>
37 References to unknown element types and notations no longer cause an error.
38 The element may contain everything, but it must be still well-formed. It may
39 have arbitrary attributes, and every attribute is treated as an #IMPLIED
43 <?pxp:dtd optional-attribute-declarations elements="x y ..."?>
45 References to unknown attributes inside one of the enumerated elements no
46 longer cause an error. Such an attribute is treated as an #IMPLIED CDATA
48 If there are several "optional-attribute-declarations" PIs, they are all
49 interpreted (implicitly merged).