0
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
@(#)testcases.dtd 1.6 99/01/21
|
|
4 |
Original version copyright 1998 by Sun Microsystems, Inc.
|
|
5 |
All Rights Reserved.
|
|
6 |
Modifications copyright 1999 by OASIS.
|
|
7 |
|
|
8 |
1999-06-09 00:20
|
|
9 |
|
|
10 |
DTD describing a database of XML tests.
|
|
11 |
|
|
12 |
NOTE: the OASIS/NIST test effort also has a DTD for its test
|
|
13 |
environment, but that DTD is not yet suited for automated test
|
|
14 |
processing. (Among other issues, it doesn't record information
|
|
15 |
putting any test case into the test matrix.) If that gets fixed,
|
|
16 |
it may be useful to switch over to that DTD.
|
|
17 |
-->
|
|
18 |
|
|
19 |
<!--
|
|
20 |
The root element of the whole collection is TESTSUITE. While not
|
|
21 |
very different from TESTCASES, it must be distinguished due to
|
|
22 |
improper processing by IE5.
|
|
23 |
-->
|
|
24 |
<!ELEMENT TESTSUITE ( TESTCASES+ )>
|
|
25 |
<!ATTLIST TESTSUITE
|
|
26 |
PROFILE CDATA #IMPLIED
|
|
27 |
>
|
|
28 |
|
|
29 |
<!--
|
|
30 |
The root element of a collection should be "TESTCASES". It groups
|
|
31 |
a set of tests in a particular "PROFILE", which is descriptive. For
|
|
32 |
example, a "Japanese" profile might group tests with documents
|
|
33 |
in standard Japanese encodings, using Japanese characters used
|
|
34 |
inside names and name tokens as well as inside text. Or the
|
|
35 |
profile might be associated with the test supplier.
|
|
36 |
-->
|
|
37 |
|
|
38 |
<!ELEMENT TESTCASES (TEST|TESTCASES)*>
|
|
39 |
<!ATTLIST TESTCASES
|
|
40 |
xml:base CDATA #IMPLIED
|
|
41 |
PROFILE CDATA #IMPLIED
|
|
42 |
>
|
|
43 |
|
|
44 |
<!--
|
|
45 |
The body of each TEST element is its description, used
|
|
46 |
to evaluate the diagnostic produced on negative tests.
|
|
47 |
People will generally read this to evaluate whether the
|
|
48 |
test failed for the correct reason.
|
|
49 |
|
|
50 |
The type of (external) ENTITIES required affect the results
|
|
51 |
permitted for certain types of nonvalidating parsers. In
|
|
52 |
some cases, errors (even well-formedness errors) can't be seen
|
|
53 |
without reading external parameter or general entities.
|
|
54 |
|
|
55 |
Each test has a unique ID used in diagnostics.
|
|
56 |
|
|
57 |
Tests with an OUTPUT attribute do dual duty: not only must parsers
|
|
58 |
accept the test, but the data they report must also have "Second
|
|
59 |
Canonical Form" as found in the specified output file. (This is
|
|
60 |
what James Clark titled "Canonical XML", with the addition of the
|
|
61 |
NOTATION declarations that all XML parsers are required to report.)
|
|
62 |
|
|
63 |
The OUTPUT3 attribute is like OUTPUT, but when sent through a
|
|
64 |
validating parser the data reported must have the "Third Canonical
|
|
65 |
Form" as found in the specified output file. (This is Second
|
|
66 |
Canonical form, with declarations of unparsed ENTITY values and
|
|
67 |
with all ignorable whitespace removed.)
|
|
68 |
|
|
69 |
The canonical forms are changed slightly for output files corresponding
|
|
70 |
to XML 1.1 input files. They start with an XML declaration specifying the
|
|
71 |
version number, and use character references for all C0 and C1 controls.
|
|
72 |
The grammars are changed as follows:
|
|
73 |
|
|
74 |
|
|
75 |
CanonXML ::= '<?xml version="1.1">' Pi* element Pi*
|
|
76 |
CanonXML2 ::= '<?xml version="1.1">' DTD2? Pi* element Pi*
|
|
77 |
CanonXML3 ::= '<?xml version="1.1">' DTD3? Pi* element Pi*
|
|
78 |
C0 ::= (Unicode characters #x1-#x1F)
|
|
79 |
C1 ::= (Unicode characters #x7F-#x9F)
|
|
80 |
EscapedC0 ::= (Decimal references to C0 characters,  - )
|
|
81 |
EscapedC1 ::= (Decimal references to C1 characters,  - Ÿ)
|
|
82 |
Datachar ::= '&' | '<' | '>' | '"'
|
|
83 |
| EscapedC0 | EscapedC1
|
|
84 |
| (Char - ('&' | '<' | '>' | '"' | C0 | C1))
|
|
85 |
|
|
86 |
|
|
87 |
where Char is the XML 1.1 rather than 1.0 production of that name.
|
|
88 |
|
|
89 |
|
|
90 |
Tests apply to one or more particular SECTIONS.
|
|
91 |
|
|
92 |
Each test has a TYPE:
|
|
93 |
* All parsers must accept "valid" testcases.
|
|
94 |
* Nonvalidating parsers must also accept "invalid" testcases,
|
|
95 |
but validating ones must reject them.
|
|
96 |
* No parser should accept a "not-wf" testcase unless it's a
|
|
97 |
nonvalidating parser and the test contains external entities
|
|
98 |
that the parser doesn't read.
|
|
99 |
* Parsers are not required to report "errors".
|
|
100 |
|
|
101 |
Each test is in a particular XML document, with a URI. If these
|
|
102 |
tests are accessed over a network, the path will be relative to
|
|
103 |
the base URI of the document holding the testcase.
|
|
104 |
|
|
105 |
Tests which apply only to certain versions of XML list those versions
|
|
106 |
in the VERSION attribute. An absent VERSION implies that the test
|
|
107 |
applies to all versions. Parsers should not run tests for versions
|
|
108 |
they do not support.
|
|
109 |
|
|
110 |
Parsers should enable namespace processing except for tests marked
|
|
111 |
with NAMESPACES="no". These are tests that use colons in ways
|
|
112 |
inconsistent with the Namespaces spec.
|
|
113 |
-->
|
|
114 |
|
|
115 |
<!ELEMENT TEST (#PCDATA | EM | B)*>
|
|
116 |
|
|
117 |
|
|
118 |
<!ATTLIST TEST
|
|
119 |
ENTITIES (both|none|parameter|general) "none"
|
|
120 |
ID ID #REQUIRED
|
|
121 |
OUTPUT CDATA #IMPLIED
|
|
122 |
OUTPUT3 CDATA #IMPLIED
|
|
123 |
SECTIONS CDATA #REQUIRED
|
|
124 |
RECOMMENDATION (XML1.0|XML1.1|NS1.0|NS1.1|
|
|
125 |
XML1.0-errata2e|XML1.0-errata3e|
|
|
126 |
NS1.0-errata1e) "XML1.0"
|
|
127 |
TYPE (valid|invalid|not-wf|error) #REQUIRED
|
|
128 |
VERSION NMTOKENS #IMPLIED
|
|
129 |
URI CDATA #REQUIRED
|
|
130 |
NAMESPACE (yes|no) "yes"
|
|
131 |
>
|
|
132 |
|
|
133 |
<!--
|
|
134 |
Really basic HTML font tweaks, to support highlighting
|
|
135 |
some aspects of test descriptions ...
|
|
136 |
EM == emphasis (e.g. italics, fun colors)
|
|
137 |
B == bold
|
|
138 |
-->
|
|
139 |
<!ELEMENT EM (#PCDATA | B)*>
|
|
140 |
<!ELEMENT B (#PCDATA | EM)*>
|