]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/pxp/doc/EXTENSIONS
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / pxp / pxp / doc / EXTENSIONS
1 ******************************************************************************
2 Extensions of the XML specification
3 ******************************************************************************
4
5
6 ==============================================================================
7 This document
8 ==============================================================================
9
10 This parser has some options extending the XML specification. Here, the options 
11 are explained. 
12
13 ==============================================================================
14 Optional declarations instead of mandatory declarations
15 ==============================================================================
16
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.
22
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.
31
32 The following two processing instructions can be included into the DTD:
33
34 -  
35    <?pxp:dtd optional-element-and-notation-declarations?>
36    
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 
40    CDATA attribute.
41    
42 -  
43    <?pxp:dtd optional-attribute-declarations elements="x y ..."?>
44    
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 
47    attribute. 
48    If there are several "optional-attribute-declarations" PIs, they are all 
49    interpreted (implicitly merged).
50