summaryrefslogtreecommitdiffstats
path: root/tests/auto/xml
diff options
context:
space:
mode:
authorJo Asplin <jo.asplin@nokia.com>2011-09-06 10:01:38 +0200
committerJo Asplin <jo.asplin@nokia.com>2011-09-06 10:31:40 +0200
commit665e4ec0ec959a12a6b66cdd0533bd40b29cd56d (patch)
tree98dd4ebb79d76067c3ec6dca15455e29fa35baae /tests/auto/xml
parent48ba459580c9e4ce28dbb2c3ce433175148da5a1 (diff)
Moved xml autotests into new directory structure
Task-number: QTBUG-21260 Change-Id: I7bc30227d4e71e8783f274dbfa758399dca546d4 Reviewed-on: http://codereview.qt.nokia.com/4146 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/xml')
-rw-r--r--tests/auto/xml/dom/dom.pro4
-rw-r--r--tests/auto/xml/dom/qdom/.gitattributes4
-rw-r--r--tests/auto/xml/dom/qdom/.gitignore1
-rw-r--r--tests/auto/xml/dom/qdom/doubleNamespaces.xml1
-rw-r--r--tests/auto/xml/dom/qdom/qdom.pro21
-rw-r--r--tests/auto/xml/dom/qdom/testdata/excludedCodecs.txt135
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc01.xml1
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc02.xml1
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc03.xml6
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc04.xml510
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc05.xml3554
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc_euc-jp.xml78
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc_iso-2022-jp.xml78
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc_little-endian.xmlbin0 -> 3186 bytes
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-16.xmlbin0 -> 3186 bytes
-rw-r--r--tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-8.xml77
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp1934
-rw-r--r--tests/auto/xml/dom/qdom/umlaut.xml2
-rw-r--r--tests/auto/xml/sax/qxml/.gitignore1
-rw-r--r--tests/auto/xml/sax/qxml/0x010D.xml1
-rw-r--r--tests/auto/xml/sax/qxml/qxml.pro12
-rw-r--r--tests/auto/xml/sax/qxml/tst_qxml.cpp243
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/.gitignore1
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/qxmlinputsource.pro6
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp210
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/.gitattributes8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/.gitignore1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/encodings/doc_euc-jp.xml78
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/encodings/doc_iso-2022-jp.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/encodings/doc_little-endian.xmlbin0 -> 3186 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-16.xmlbin0 -> 3186 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-8.xml77
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh43
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp123
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp455
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.h64
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.pro15
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro19
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp775
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml.ref14
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml0
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml.ref14
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml.refbin0 -> 309 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml.refbin0 -> 309 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml.ref5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml.ref3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml.ref6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml.ref11
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml.ref4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/null.ent0
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.ent0
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.entbin0 -> 4 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml.ref11
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.entbin0 -> 54 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml.ref11
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.ent0
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml.ref14
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml.ref12
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.entbin0 -> 12 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml13
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml.ref47
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml14
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml.ref47
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml.ref16
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.ent0
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-2.ent0
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent4
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent3
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml.ref8
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml.ref8
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml.ref8
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml.ref10
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml.ref8
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml.ref8
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml.ref8
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml.ref12
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml.ref7
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent3
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml.ref11
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml.ref11
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml.ref11
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml.ref20
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xmlbin0 -> 124 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xmlbin0 -> 132 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xmlbin0 -> 140 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml.ref20
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml.refbin0 -> 312 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml.ref15
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml.ref7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.refbin0 -> 381 bytes
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml.ref17
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.ent1
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml.ref12
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml7
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml.ref8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml.ref11
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml.ref10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml5
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml.ref9
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml.ref8
-rw-r--r--tests/auto/xml/sax/sax.pro6
-rw-r--r--tests/auto/xml/xml.pro5
800 files changed, 12546 insertions, 0 deletions
diff --git a/tests/auto/xml/dom/dom.pro b/tests/auto/xml/dom/dom.pro
new file mode 100644
index 0000000000..17cfafcea7
--- /dev/null
+++ b/tests/auto/xml/dom/dom.pro
@@ -0,0 +1,4 @@
+TEMPLATE=subdirs
+SUBDIRS=\
+ qdom \
+
diff --git a/tests/auto/xml/dom/qdom/.gitattributes b/tests/auto/xml/dom/qdom/.gitattributes
new file mode 100644
index 0000000000..68f316ef6f
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/.gitattributes
@@ -0,0 +1,4 @@
+testdata/toString_01/doc05.xml -crlf
+testdata/toString_01/doc_euc-jp.xml -crlf
+testdata/toString_01/doc_iso-2022-jp.xml -crlf
+testdata/toString_01/doc_utf-8.xml -crlf
diff --git a/tests/auto/xml/dom/qdom/.gitignore b/tests/auto/xml/dom/qdom/.gitignore
new file mode 100644
index 0000000000..79b84c36bb
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/.gitignore
@@ -0,0 +1 @@
+tst_qdom
diff --git a/tests/auto/xml/dom/qdom/doubleNamespaces.xml b/tests/auto/xml/dom/qdom/doubleNamespaces.xml
new file mode 100644
index 0000000000..c809aa17d3
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/doubleNamespaces.xml
@@ -0,0 +1 @@
+<a xmlns:p="NS"><b p:c="" p:d=""/></a>
diff --git a/tests/auto/xml/dom/qdom/qdom.pro b/tests/auto/xml/dom/qdom/qdom.pro
new file mode 100644
index 0000000000..0a3c167a4b
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/qdom.pro
@@ -0,0 +1,21 @@
+load(qttest_p4)
+SOURCES += tst_qdom.cpp
+
+QT = core xml
+QT -= gui
+
+wince*|symbian: {
+ addFiles.files = testdata doubleNamespaces.xml umlaut.xml
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+
+ wince*|qt_not_deployed {
+ DEPLOYMENT_PLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs
+ }
+ !symbian:DEFINES += SRCDIR=\\\"\\\"
+}
+else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
+symbian: TARGET.EPOCHEAPSIZE="0x100000 0x1000000"
diff --git a/tests/auto/xml/dom/qdom/testdata/excludedCodecs.txt b/tests/auto/xml/dom/qdom/testdata/excludedCodecs.txt
new file mode 100644
index 0000000000..1f0d871563
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/excludedCodecs.txt
@@ -0,0 +1,135 @@
+apple roman
+arabic
+asmo-708
+big5
+big5-0
+big5-eten
+big5-hkscs
+big5hkscs-0
+cp1250
+cp1251
+cp1252
+cp1253
+cp1254
+cp1255
+cp1256
+cp1257
+cp1258
+cp819
+cp850
+cp866
+cp874
+cp936
+cp949
+cp950
+cshproman8
+csibm866
+csisolatin1
+csisolatin2
+csisolatin3
+csisolatin4
+csisolatin5
+csisolatin6
+csisolatinarabic
+csisolatincyrillic
+csisolatingreek
+csisolatinhebrew
+cskoi8r
+cspc850multilingual
+cyrillic
+ecma-114
+ecma-118
+euc-jp
+euc-kr
+gb18030-0
+gb2312
+gb2312.1980-0
+gbk
+gbk-0
+greek
+hebrew
+hp-roman8
+ibm819
+ibm850
+ibm866
+ibm874
+iscii-bng
+iscii-dev
+iscii-gjr
+iscii-knd
+iscii-mlm
+iscii-ori
+iscii-pnj
+iscii-tlg
+iscii-tml
+iso-2022-jp
+iso-8859-1
+iso-8859-10
+iso-8859-10:1992
+iso 8859-11
+iso-8859-13
+iso-8859-14
+iso-8859-15
+iso-8859-16
+iso-8859-2
+iso-8859-3
+iso-8859-4
+iso-8859-5
+iso-8859-6
+iso-8859-6-i
+iso-8859-7
+iso-8859-8
+iso 8859-8-i
+iso-8859-9
+iso-celtic
+iso-ir-100
+iso-ir-101
+iso-ir-109
+iso-ir-110
+iso-ir-126
+iso-ir-127
+iso-ir-138
+iso-ir-144
+iso-ir-148
+iso-ir-157
+iso-ir-199
+iso-ir-226
+jis7
+jisx0201*-0
+jisx0208*-0
+koi8-r
+koi8-ru
+koi8-u
+ksc5601.1987-0
+latin1
+latin10
+latin2
+latin3
+latin4
+latin5
+latin6
+latin8
+latin9
+macintosh
+macroman
+ms936
+ms_kanji
+mulelao-1
+roman8
+shift_jis
+sjis
+system
+tis-620
+tscii
+windows-1250
+windows-1251
+windows-1252
+windows-1253
+windows-1254
+windows-1255
+windows-1256
+windows-1257
+windows-1258
+windows-936
+winsami2
+ws2
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc01.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc01.xml
new file mode 100644
index 0000000000..1ac45429fb
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc01.xml
@@ -0,0 +1 @@
+<top>Make a <blubb>stupid</blubb>, useless test sentence.</top>
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc02.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc02.xml
new file mode 100644
index 0000000000..3fb9aff884
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc02.xml
@@ -0,0 +1 @@
+<foo><bar><foobar/></bar><bar>blubber</bar></foo>
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc03.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc03.xml
new file mode 100644
index 0000000000..6121f70e25
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc03.xml
@@ -0,0 +1,6 @@
+<foo>
+ <bar>
+ <foobar/>
+ </bar>
+ <bar>blubber</bar>
+</foo>
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc04.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc04.xml
new file mode 100644
index 0000000000..541c44e31b
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc04.xml
@@ -0,0 +1,510 @@
+<?xml version='1.0'?>
+<!--
+<<<<<<< conformance.xsl
+ Original version copyright 1999 by Sun Microsystems, Inc.
+ All Rights Reserved.
+ Modifications copyright 1999 by OASIS.
+=======
+ XSL WD 1999-04-21 Stylesheet for documenting XML conformance tests.
+ Tested against James Clark's XT processor.
+>>>>>>> 1.3
+
+ 1999-06-08 22:50
+
+ XSL 1999-04-21 Stylesheet for documenting XML conformance tests.
+
+ This expects to be run on a document matching the DTD that Sun
+ defined for merging collections of self-descriptive XML tests.
+
+ Since all those collections will have (by design) the same test
+ architecture, this includes boilerplate describing that design,
+ to be used by all test documentation.
+
+ ISSUES:
+ - Sorting is a bit odd; section numbers can are like "3.3.3"
+ rather than straight numbers, so numeric sort can't work,
+ and yet neither does text sort (2.12 should be after 2.2).
+-->
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
+ >
+
+<!--
+ ### I don't have a nice algorithm to compare two QDomDocuments, so take
+ out the following arguments of the above element for now, since they
+ cause trouble (rms):
+
+ xmlns="http://www.w3.org/TR/REC-html40"
+ result-ns=""
+ indent-result="yes"
+-->
+
+ <!-- ROOT: write an HTML wrapper -->
+ <xsl:template match="/TESTSUITE">
+ <!-- XHTML namespace -->
+ <html><head>
+ <xsl:comment>Generated by an XSL stylesheet.</xsl:comment>
+ <title> XML Conformance Tests </title>
+ <meta http-equiv="Content-Type"
+ content="text/html;charset=utf-8"/>
+ <style>
+ <xsl:comment>
+ BODY {
+ font-family: Lucida, Helvetica, Univers, sans-serif;
+ }
+ H1, H2, H3, H4 {
+ text-align: left;
+ color: #0066CC;
+ }
+ </xsl:comment>
+ </style>
+ <style>
+ <xsl:comment>
+ a:hover {
+ color: white;
+ background-color: blue;
+ }
+ </xsl:comment>
+ </style>
+ </head><body bgcolor='#ffffff'>
+ <img src="files/a_oasis-logo.gif"/>
+ <h1> XML Conformance Tests </h1>
+ <p/>
+ <h4>OASIS XML Conformance Subcommittee<br/>Working Draft<br/>12 July 1999</h4>
+ <dl>
+ <dt><b>This version (normative at publishing time):</b></dt>
+ <dd><ul>
+ <li><a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf-19990712.xml">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf-19990712.xml</a></li>
+ </ul>
+ </dd>
+ <p/>
+ <dt><b>Current Normative Version:</b></dt>
+ <dd>
+ <ul>
+ <li><a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf.xml">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf.xml</a></li>
+ </ul>
+ </dd>
+ <p/>
+ <dt><b>Non-normative Renditions:</b></dt>
+ <dd>
+ <ul>
+ <li><a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf-19990712.htm">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf-19990712.htm</a></li>
+ <li><a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf.htm">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconf.htm</a></li>
+ </ul>
+ </dd>
+ <p/>
+ <dt><b>Available Stylesheets:</b></dt>
+ <dd>
+ <ul>
+ <li><a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconformance.msxsl">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconformance.msxsl</a></li>
+ <li><a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconformance.xsl">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/conf/xmlconformance.xsl</a></li>
+ </ul>
+ </dd>
+ <p/>
+ <dt><b>Comments:</b></dt>
+ <dd><ul><li>Mary Brady, NIST <a href="mailto:mbrady@nist.gov">&lt;mbrady@nist.gov&gt;</a>
+ </li></ul></dd>
+ <p/>
+ <dt><b>Public Information Page:</b></dt>
+ <dd><ul><li><a href="http://www.oasis-open.org/committees/xmlconf-pub.html">http://www.oasis-open.org/committees/xmlconf-pub.html</a>
+ </li></ul></dd>
+ </dl>
+
+ <a name="contents"/>
+ <h2>Table of Contents</h2>
+ <ol >
+ <li><a href="#intro">Introduction</a></li>
+ <li><a href="#matrix">Test Matrix</a></li>
+ <ol >
+ <li ><a href="#binary">Binary Tests</a></li>
+ <li><a href="#output">Output Tests</a></li>
+ </ol>
+ <li><a href="#listings">Test Case Descriptions</a></li>
+ <ol >
+ <li><a href="#valid">Valid Documents</a></li>
+ <li><a href="#invalid">Invalid Documents</a></li>
+ <li><a href="#not-wf">Not-WF Documents</a></li>
+ <li><a href="#error">Optional Errors</a></li>
+ </ol>
+ <li><a href="#contrib">Contributors</a></li>
+ </ol>
+ <a name="intro"/>
+ <h2>1. Introduction </h2>
+ <p> The <i>OASIS</i> XML Conformance Subcommittee is concerned with
+ improving the quality of XML processors. The tests described in this
+ document provide an initial set of metrics to determine how well a
+ particular implementation conforms to the
+ <a href="http://www.w3.org/TR/REC-xml">W3C XML 1.0 Recommendation</a>.
+ It is anticipated that this test suite will grow over time, and will
+ be expanded to test additional XML functionality as the set of XML
+ Recommendations evolve. The XML Conformance Test Suite is intended
+ to complement the W3C XML 1.0 Recommendation. All interpretations
+ of this Recommendation are subject to confirmation by the
+ <a href="http://www.w3.org/XML/Activity.html">W3C XML Coordination
+ Group</a>.
+ </p>
+ <p>
+ Conformance tests can be used by developers, content creators, and
+ users alike to increase their level of confidence in product quality. In
+ circumstances where interoperability is necessary, these tests can also
+ be used to determine that differing implementations support the same set
+ of features. </p>
+
+ <p>This report provides supporting documentation for all of the tests
+ contributed by members of the <i>OASIS</i> XML Conformance Subcommittee.
+ Sources from which these tests have been collected
+ include: <em>
+ <xsl:for-each select="//TESTCASES">
+ <xsl:value-of select="@PROFILE"/>
+ <xsl:text>; </xsl:text>
+ </xsl:for-each>
+ </em>. Although the tests came from a variety of sources, the actual test
+ descriptions and references back to the specification were in many instances
+ added by members of this subcommittee. It is anticipated that this report
+ will supplement the actual tests, which are available from
+ <a href="http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/">
+ http://sdct-sunsrv1.ncsl.nist.gov/~brady/xml/.</a></p>
+
+ <p>Comments/suggestions should be
+ forwarded to the XML Conformance Subcommittee Chair, Mary Brady
+ <a href="mailto:mbrady@nist.gov">&lt;mbrady@nist.gov&gt;</a>.</p>
+
+ <a name="matrix"/>
+ <h2>2. Test Matrix </h2>
+
+ <p> Two basic types of test are presented here. These are
+ respectively <em><a href="#binary">Binary Tests</a></em>
+ and <em><a href="#output">Output Tests</a></em>. </p>
+
+ <a name="binary"/>
+ <h3>2.1 Binary Tests </h3>
+
+ <p> <em>Binary</em> conformance tests are documents which
+ are grouped into one of four categories. Given a document
+ in a given category, each kind of XML parser must treat it
+ consistently and either accept it (a <em>positive test</em>)
+ or reject it (a <em>negative test</em>). It is in that sense
+ that the tests are termed "binary". The XML 1.0 Recommendation
+ talks in terms of two types of XML processor:
+ <em>validating</em> ones, and <em>nonvalidating</em> ones.
+ There are two differences between these types of processors: </p>
+
+ <ol>
+ <li> Validating processors check special productions that
+ nonvalidating parsers don't, called <em>validity
+ constraints</em>. (Both must check a basic set of productions,
+ requiring XML documents to be <em>well formed</em>.) </li>
+
+ <li> Nonvalidating processors are permitted to not
+ include <em>external entities</em>, such as files with
+ text. Accordingly, they may not report errors which
+ would have been detected had those entities been read.</li>
+ </ol>
+
+ <p> There are two types of such entity, <em>parameter
+ entities</em> holding definitions which affect validation
+ and other processing; and <em>general entities</em> which
+ hold marked up text. It will be appreciated that there are
+ then five kinds of XML processor: validating processors,
+ and four kinds of nonvalidating processor based on the
+ combinations of external entity which they include.</p>
+
+ <center>
+ <table border="1" bgcolor="#ffffff" cellpadding="4">
+
+ <caption>
+ <b>Basic XML Parsing Test Matrix</b><br/>
+ Test Document Type v. Parser Type
+ </caption>
+
+ <tr bgcolor="#ffffcc">
+ <th widthH="5%" rowspan="2">&#160;</th>
+ <th widthH="20%" colspan="2">Nonvalidating</th>
+ <th widthH="5%" rowspan="2">Validating</th>
+ </tr>
+
+ <tr bgcolor="#ffffcc">
+ <th>External Entities<br/>Ignored (3 cases)</th>
+ <th>External Entities<br/>Read</th>
+ </tr>
+
+ <tr>
+ <th bgcolor="#ffffcc">Valid Documents</th>
+ <td align="center"><b>accept</b></td>
+ <td align="center"><b>accept</b></td>
+ <td align="center"><b>accept</b></td>
+ </tr>
+
+ <tr>
+ <th bgcolor="#ffffcc">Invalid Documents</th>
+ <td align="center"><b>accept</b></td>
+ <td align="center"><b>accept</b></td>
+ <td align="center">reject</td>
+ </tr>
+
+ <tr>
+ <th bgcolor="#ffffcc">Non-WF Documents</th>
+ <td align="center">reject</td>
+ <td align="center">reject</td>
+ <td align="center">reject</td>
+ </tr>
+
+ <tr>
+ <th bgcolor="#ffffcc">WF Errors tied<br/>
+ to External Entity</th>
+ <td align="center"><b>accept</b><br/>(varies)</td>
+ <td align="center">reject</td>
+ <td align="center">reject</td>
+ </tr>
+
+ <tr>
+ <th bgcolor="#ffffcc">Documents with<br/> Optional Errors</th>
+ <td align="center">(not specified)</td>
+ <td align="center">(not specified)</td>
+ <td align="center">(not specified)</td>
+ </tr>
+
+ </table>
+ </center>
+
+ <p> At this time, the XML community primarily uses parsers
+ which are in the rightmost two columns of this table, calling
+ them <em>Well Formed XML Parsers</em> (or "WF Parsers") and
+ <em>Validating XML Parsers</em>. A second test matrix
+ could be defined to address the variations in the types of
+ of XML processor which do not read all external entities.
+ That additional matrix is not provided here at this time. </p>
+
+
+ <a name="output"/>
+ <h3>2.2 Output Tests</h3>
+
+ <p> The XML 1.0 Recommendation places a number of requirements
+ on XML processors, to ensure that they report information to
+ applications as needed. Such requirements are testable.
+ Validating processors are required to report slightly more
+ information than nonvalidating ones, so some tests will
+ require separate output files. Some of the information that
+ must be reported will not be reportable without reading all
+ the external entities in a particular test. Many of the tests for
+ valid documents are paired with an output file to ensure that the XML
+ processor provides the correct information. </p>
+
+ <p>The output of these tests is provided in one of two forms, as
+ described in <a href="sun/cxml.html">SUN Microsystems XML
+ Canonical Forms</a>. At present, the <em>James Clark</em>
+ collection provides corresponding output in <em>First XML
+ Canonical Form</em>, and the <em>SUN Microsystems</em>
+ collection provides corresponding output in <em>Second XML
+ Canonical Form</em>. When the <a href="http://www.w3.org/XML/">
+ W3C XML Group </a> finalizes its work on Canonical XML, these
+ output files will be updated.
+ </p>
+
+ <a name="listings"/>
+ <h2>3. Test Case Descriptions</h2>
+
+ <p> This section of this report contains descriptions of test
+ cases, each of which fits into the categories noted above.
+ Each test case includes a document of one of the types in the
+ binary test matrix above (e.g. valid or invalid documents).
+ </p>
+
+ <p> In some cases, an <a href="#output">output file </a>, as
+ described in Section 2.2, will also be associated with
+ a valid document, which is used for output testing. If such
+ a file exists, it will be noted at the end of the description
+ of the input document. </p>
+
+ <p> The description for each test case is presented as a two
+ part table. The right part describes what the test does.
+ This description is intended to have enough detail to evaluate
+ diagnostic messages. The left part includes: <ul>
+
+ <li> An entry describing the <em>Sections and/or Rules</em>
+ from the <a href="http://www.w3.org/TR/1998/REC-xml-19980210">
+ XML 1.0 Recommendation</a> which this case excercises.</li>
+
+ <li> The unique <em>Test ID</em> within a given <em>Collection</em>
+ for this test. </li>
+
+ <li> The <em>Collection</em> from which this test originated.
+ Given the <em>Test ID</em> and the <em>Collection</em>, each
+ test can be uniquely identified.</li>
+
+ <li> Some tests may have a field identifying the kinds of
+ external <em>Entities</em> a nonvalidating processor must
+ include (parameter, general, or both) to be able to
+ detect any errors in that test case. </li>
+
+ </ul></p>
+
+ <p><em>Note that the output format of this report is subject
+ to change. Also, since XSL does not currently support the
+ type of sorting rule necessary to make section numbers like
+ 2.12 appear after 2.2, the ordering is not quite what is
+ desired.</em></p>
+
+ <a name="valid"/>
+ <h3>3.1 Valid XML Documents</h3>
+
+ <p> All conforming <em> XML 1.0 Processors </em> are
+ <b>required</b> to accept valid documents, reporting no
+ errors. In this section of this test report are found
+ descriptions of test cases which fit into this category. </p>
+
+ <xsl:apply-templates select="//TEST[@TYPE='valid']">
+ <xsl:sort select="@SECTIONS"/>
+ </xsl:apply-templates>
+
+ <a name="invalid"/>
+ <h3>3.2 Invalid XML Documents</h3>
+
+ <p> All conforming XML 1.0 <em> Validating Processors </em>
+ are <b>required</b> to report recoverable errors in the case
+ of documents which are <em>Invalid</em>. Such errors are
+ violations of some <em>validity constraint (VC)</em>. </p>
+
+ <p> If a validating processor does not report an error when
+ given one of these test cases, or if the error reported is
+ a fatal error, it is not conformant. If the error reported
+ does not correspond to the problem listed in this test
+ description, that could also be a conformance problem; it
+ might instead be a faulty diagnostic. </p>
+
+ <p> All conforming XML 1.0 <em> Nonvalidating Processors </em>
+ should accept these documents, reporting no errors. </p>
+
+ <xsl:apply-templates select="//TEST[@TYPE='invalid']">
+ <xsl:sort select="@SECTIONS"/>
+ </xsl:apply-templates>
+
+ <a name="not-wf"/>
+ <h3>3.3 Documents that are Not Well Formed</h3>
+
+ <p> All conforming XML 1.0 Processors are <b>required</b> to
+ report fatal errors in the case of documents which are not
+ <em>Well Formed</em>. Such errors are basically of two types:
+ <em>(a)</em> the document violates the XML grammar; or else
+ <em>(b)</em> it violates a <em>well formedness constraint
+ (WFC)</em>. There is a single <em>exception to that
+ requirement</em>: nonvalidating processors which do not read
+ certain types of external entities are not required to detect
+ (and hence report) these errors. </p>
+
+ <p> If a processor does not report a fatal error when given
+ one of these test cases, it is not conformant. If the error
+ reported does not correspond to the problem listed in this
+ test description, that could also be a conformance problem;
+ it might instead be a faulty diagnostic. </p>
+
+ <xsl:apply-templates select="//TEST[@TYPE='not-wf']">
+ <xsl:sort select="@SECTIONS"/>
+ </xsl:apply-templates>
+
+ <a name="error"/>
+ <h3>3.4 XML Documents with Optional Errors</h3>
+
+ <p> Conforming XML 1.0 Processors are permitted to ignore
+ certain errors, or to report them at user option. In this
+ section of this test report are found descriptions of
+ test cases which fit into this category. </p>
+
+ <p> Processor behavior on such test cases does not affect
+ conformance to the XML 1.0 Recommendation, except as noted. </p>
+
+ <xsl:apply-templates select="//TEST[@TYPE='error']">
+ <xsl:sort select="@SECTIONS"/>
+ </xsl:apply-templates>
+
+ <a name="contrib"/>
+ <h3>4. Contributors (Non-normative)</h3>
+
+ <p> A team of volunteer members have participated in the
+ development of this work. Contributions have come from:
+ </p>
+ <ul>
+ <li>Murry Altheim, Sun Microsystems</li>
+ <li>Mary Brady, NIST</li>
+ <li>Tim Boland, NIST</li>
+ <li>David Brownell, Sun Microsystems</li>
+ <li>James Clark</li>
+ <li>Karin Donker, IBM</li>
+ <li>Irina Golfman, Inera Incorporated</li>
+ <li>Tony Graham, Mulberry Technologies</li>
+ <li>G. Ken Holman, Crane Softwrights Ltd</li>
+ <li>Alex Milowski, Veo Systems, Inc</li>
+ <li>Makota Murata, Fuji Xerox</li>
+ <li>Miles O'Reilly, Microstar Software, Ltd</li>
+ <li>Matt Timmermans, Microstar Software, Ltd</li>
+ <li>Richard Rivello, NIST</li>
+ <li>Lynne Rosenthal, NIST</li>
+ <li>Brian Schellar, Chrystal Software</li>
+ <li>Bill Smith, Sun Microsystems</li>
+ <li>Trevor Veary, Software AG</li>
+ </ul>
+
+ <p>End</p>
+ </body></html>
+ </xsl:template>
+
+ <xsl:template match="TEST">
+ <table width="100%">
+ <tr valign="top">
+ <td width='40%'><table bgcolor='#eeeeff'
+ border='1' width='100%' height="100%">
+ <tr>
+ <td width='50%'><b>Sections [Rules]:</b></td>
+ <td bgcolor='#ffffcc'>
+ <xsl:value-of select="@SECTIONS"/></td>
+ </tr>
+ <tr valign="top">
+ <td width='50%'><b>Test ID:</b></td>
+ <td bgcolor='#ffffcc'>
+ <xsl:value-of select="@ID"/></td>
+ </tr>
+ <xsl:if test="not ( @ENTITIES = 'none')
+ and ( @TYPE = 'not-wf' )">
+ <tr valign="top">
+ <td width='50%'><b>Entities:</b></td>
+ <td bgcolor='#ffffcc'><font color='blue'>
+ <xsl:value-of select="@ENTITIES"/>
+ </font></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="../@PROFILE">
+ <tr valign="top">
+ <td width='50%'><b>Collection:</b></td>
+ <td bgcolor='#ffffcc'>
+ <xsl:value-of select="../@PROFILE"/>
+ </td>
+ </tr>
+ </xsl:if>
+ </table></td>
+ <td bgcolor='#ccffff'>
+ <p>
+ <xsl:apply-templates/></p>
+ <xsl:if test="@OUTPUT | @OUTPUT3">
+ <p>There is an output test associated with this
+ input file.</p>
+ </xsl:if>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!-- XT takes 'B|EM' and xsl:copy, IE5b2 doesn't -->
+ <xsl:template match="EM">
+ <em><xsl:apply-templates/></em>
+ </xsl:template>
+ <xsl:template match="B">
+ <b><xsl:apply-templates/></b>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc05.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc05.xml
new file mode 100644
index 0000000000..76fce8b0ab
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc05.xml
@@ -0,0 +1,3554 @@
+<?xml version="1.0"?>
+<!DOCTYPE spec SYSTEM "spec.dtd" [
+
+<!-- 日本語訳のための解析対象実体(ここから) -->
+
+<!ENTITY TR-or-Rec "仕様書">
+<!-- <!ENTITY TR-or-Rec "標準情報(TR)"> -->
+<!ENTITY eTR-or-Rec "specification">
+<!-- <!ENTITY eTR-or-Rec "technical report(TR)"> -->
+<!ENTITY application "アプリケーション">
+<!ENTITY error "エラー">
+<!ENTITY fatal-error "致命的エラー">
+<!ENTITY parsed-data "解析されるデータ">
+<!ENTITY unparsed-data "解析されないデータ">
+<!ENTITY parsed-entity "解析対象実体">
+<!ENTITY parser "パーサ">
+<!ENTITY unparsed-entity "解析対象外実体">
+<!ENTITY well-formed "整形式">
+<!ENTITY valid "妥当">
+<!ENTITY validity "妥当性">
+<!ENTITY escape "別扱い">
+<!ENTITY prolog "書き">
+<!ENTITY surrogate-blocks "サロゲートブロック">
+<!ENTITY letter "字">
+<!ENTITY ideographic "統合漢字">
+<!ENTITY markup "マーク付け">
+<!ENTITY left-angle-bracket "不等号(小なり)">
+<!ENTITY right-angle-bracket "不等号(大なり)">
+<!ENTITY string "文字列">
+<!ENTITY char-string "文字列"><!-- string of chararacters,
+ character strings, strings,
+ characters はすべて文字列とする -->
+<!ENTITY replacement-text "置換テキスト">
+<!ENTITY single-quote "一重引用符">
+<!ENTITY double-quote "二重引用符">
+<!ENTITY adaptations-annex "適用附属書">
+<!ENTITY root "ルート">
+<!ENTITY base-character "基底文字">
+<!ENTITY diacritical-mark "発音符"><!--(ダイアクリティカルマーク)を初出のとき補う-->
+<!ENTITY composed-form "合成形式">
+<!ENTITY standalone "スタンドアロン">
+<!ENTITY double-hyphen "二連ハイフン">
+<!--<!ENTITY case-fold "大文字か小文字への統一">-->
+<!-- <!ENTITY case-fold "比較のとき,大文字と小文字の同一視">-->
+<!ENTITY parameter "パラメタ">
+<!ENTITY stream "ストリーム">
+<!ENTITY validating "妥当性を検証する">
+<!ENTITY non-validating "妥当性を検証しない">
+<!ENTITY user "ユーザ">
+<!--<!ENTITY at-user-option "ユーザがオプションを指定したとき">-->
+<!ENTITY at-user-option "ユーザのオプション指定によっては">
+<!ENTITY content-particle "内容素子">
+<!ENTITY processor "プロセサ">
+<!ENTITY default "デフォルト">
+<!ENTITY default-value "デフォルト値">
+<!ENTITY header "ヘッダ">
+<!ENTITY target "ターゲット">
+<!ENTITY mixed-content "混合内容">
+<!ENTITY country-code "国コード">
+<!ENTITY language-code "言語コード">
+<!ENTITY version "版"> <!-- version 1.0は第1.0版 -->
+<!ENTITY match "マッチ">
+<!ENTITY character-value "文字番号">
+<!ENTITY byte-order-mark "バイト順マーク">
+<!ENTITY bypass "処理しない">
+<!ENTITY identifier "識別子">
+<!-- <!ENTITY identify "識別する"> -->
+<!ENTITY identify "特定する">
+<!-- <!ENTITY identified "識別される"> -->
+<!ENTITY identified "特定される">
+<!ENTITY combining-character "結合文字">
+<!ENTITY subset "サブセット">
+<!ENTITY token "トークン">
+<!ENTITY literal "リテラル">
+
+<!ENTITY parenthesis "かっこ">
+<!ENTITY left-parenthesis "開きかっこ">
+<!ENTITY right-parenthesis "閉じかっこ">
+
+<!-- あとで気がついたもの JIS X0221を見る必要あり -->
+
+<!ENTITY extender "エクステンダ">
+<!ENTITY property "プロパティ">
+<!ENTITY property-list "プロパティリスト">
+<!ENTITY property-file "プロパティファイル">
+<!ENTITY font-decomposition "フォント分解">
+<!ENTITY compatibility-decomposition "互換性分解">
+<!ENTITY compatibility-area "互換性領域">
+
+<!ENTITY language-identification "言語識別">
+
+<!ENTITY space-character "スペース文字">
+<!ENTITY space "スペース">
+<!ENTITY code-value "コード値">
+<!ENTITY normative "規定の">
+<!ENTITY hueristics "ヒューリスティック">
+<!ENTITY informative "">
+
+<!ENTITY WebSGML 'ISO 8879へのWebSGML&adaptations-annex;'>
+<!ENTITY XML.version "1.0">
+<!ENTITY doc.date "1997年12月8日">
+<!ENTITY iso6.doc.date "971208">
+<!ENTITY w3c.doc.date "97年12月3日">
+<!ENTITY draft.day '8日'>
+<!ENTITY draft.month '12月'>
+<!ENTITY draft.year '1997年'>
+
+<!-- 日本語訳のための解析対象実体(ここまで) -->
+
+<!-- LAST TOUCHED BY: Tim Bray, 3 Dec 1997 -->
+
+<!-- The words 'FINAL EDIT' in comments mark places where changes
+need to be made after approval of the document by the ERB, before
+publication. -->
+
+<!ENTITY XML.version "1.0">
+<!ENTITY doc.date "8 December 1997">
+<!ENTITY iso6.doc.date "971208">
+<!ENTITY w3c.doc.date "03-Dec-97">
+<!ENTITY draft.day '8'>
+<!ENTITY draft.month 'December'>
+<!ENTITY draft.year '1997'>
+
+<!ENTITY WebSGML
+ 'WebSGML Adaptations Annex to ISO 8879'>
+
+<!ENTITY newline " ">
+<!-- old: <!ENTITY newline "&#8232;"> -->
+<!ENTITY lt "<">
+<!ENTITY gt ">">
+<!--<!ENTITY amp "&"> -->
+<!ENTITY xmlpio "'&lt;?xml'">
+<!ENTITY pic "'?>'">
+<!ENTITY br "\n">
+<!ENTITY cellback '#c0d9c0'>
+<!ENTITY mdash "--"> <!-- was: <!ENTITY mdash "&#38;#151;"> -->
+<!ENTITY com "--">
+<!ENTITY como "--">
+<!ENTITY comc "--">
+<!ENTITY hcro "&amp;#x">
+<!-- <!ENTITY nbsp ""> -->
+<!ENTITY nbsp "&#160;">
+<!ENTITY magicents "<code>amp</code>,
+<code>lt</code>,
+<code>gt</code>,
+<code>apos</code>,
+<code>quot</code>">
+
+<!--日本語訳について: コメントは翻訳対象から外しました。鈴木和夫 -->
+<!-- audience and distribution status: for use at publication time -->
+<!-- -->
+<!ENTITY doc.audience "公開レビュー及び議論">
+<!ENTITY doc.distribution "テキスト及び法律上の注意を改変しない限り,
+自由に配布してもよい">
+
+]>
+
+<!-- for Panorama *-->
+<?VERBATIM "eg" ?>
+
+<spec>
+<header>
+<title>拡張可能な&markup;言語 (XML)</title>
+<version>第1.0&version;</version>
+<w3c-designation>PR-xml-&iso6.doc.date;</w3c-designation>
+<w3c-doctype>World Wide Web Consortium</w3c-doctype>
+<pubdate><day>&draft.day;</day><month>&draft.month;</month><year>&draft.year;</year></pubdate>
+<notice><p>この草案は,XML WG及び他の関係者によるレビューのためのものであって,公開の議論のためのものではない。
+<!-- FINAL EDIT: FIX --></p></notice>
+<publoc>
+<loc href="http://www.w3.org/TR/PR-xml-&iso6.doc.date;">
+http://www.w3.org/TR/PR-xml-&iso6.doc.date;</loc></publoc>
+<prevlocs>
+<loc href='http://www.w3.org/TR/WD-xml-961114'>
+http://www.w3.org/TR/WD-xml-961114</loc>
+<loc href='http://www.w3.org/TR/WD-xml-lang-970331'>
+http://www.w3.org/TR/WD-xml-lang-970331</loc>
+<loc href='http://www.w3.org/TR/WD-xml-lang-970630'>
+http://www.w3.org/TR/WD-xml-lang-970630</loc>
+<loc href='http://www.w3.org/TR/WD-xml-970807'>
+http://www.w3.org/TR/WD-xml-970807</loc>
+<loc href='http://www.w3.org/TR/WD-xml-971117'>
+http://www.w3.org/TR/WD-xml-971117</loc>
+</prevlocs>
+<authlist>
+<author><name>Tim Bray</name>
+<affiliation>Textuality and Netscape</affiliation>
+<email
+href="mailto:tbray@textuality.com">tbray@textuality.com</email></author>
+<author><name>Jean Paoli</name>
+<affiliation>Microsoft</affiliation>
+<email href="mailto:jeanpa@microsoft.com">jeanpa@microsoft.com</email></author>
+<author><name>C. M. Sperberg-McQueen</name>
+<affiliation>University of Illinois at Chicago</affiliation>
+<email href="mailto:cmsmcq@uic.edu">cmsmcq@uic.edu</email></author>
+</authlist>
+<status>
+ <p>この&TR-or-Rec;は, 1997年12月にWorld Wide Web Consortiumから
+公表された勧告案Extensible Markup Language version第1.0版を翻訳し, 技
+術的内容を変更することなく作成した&TR-or-Rec;である。This &eTR-or-Rec;
+is a translation of the XML proposed recommendation 1.0
+published by the World Wide Web Consortium in December 1997. It is
+intended that &eTR-or-Rec; is technically identical to the original.</p>
+
+<p>原文にある、著作権に関しての記述を次に示す。The
+original copyright notice is shown below:</p>
+
+<p>この版のXMLの規定は,公開レビュー及び議論を
+目的とする。テキスト及び法律上の注意を改変しない限り,自由に
+配布してもよい。This version of the XML specification is for
+public review and discussion. It may be distributed freely,
+as long as all text and legal notices remain intact.</p>
+
+<p>この&TR-or-Rec;の元となったXML勧告案は,1998年2月にWorld
+Wide Web Consortiumから公表されたXML勧告によってすでに置き換
+えられている。この標準情報は,XML勧告に従って訂正することを
+予定している。The XML Proposed Recommendation is superseded
+by the XML Recommendation which was published by the World
+Wide Web Consortium in February 1998. It is intended that
+this &eTR-or-Rec; be revised accordingly in the near future.</p>
+
+<p>この&TR-or-Rec;は,安定したものであって,昨年来の<loc
+href='http://www.w3.org/XML'>XML活動</loc>を通じて作成された,一連の作
+業草案を元とする。現在,広範囲に使用されている国際的なテキスト処理の標
+準(標準一般化&markup;言語,Standard Generalized Markup Language, ISO
+8879:1986に追加及び訂正を加えたもの)の,WWW上での使用のために&subset;
+化した言語を,この&TR-or-Rec;は,規定する。ISO 8879のどの機能をこの
+&subset;に残すか,という決定についての詳細は,<loc
+href='http://www.w3.org/XML/#WG-decisions'>別途用意する</loc>。XMLは,
+既にいくつかの商品でサポートされ,XMLをサポートする<loc
+href='http://www.w3.org/XML/#software'>フリーウェア</loc>の数も増えて
+いる。XMLに関する公開の論議も,オンラインで<loc
+href='http://www.w3.org/XML/#discussion'>入手できる</loc>。It is a
+stable document derived from a series of working drafts produced over
+the last year as deliverables of the <loc
+href='http://www.w3.org/XML'>XML activity</loc>. It specifies a
+language created by subsetting an existing, widely used international
+text processing standard (Standard Generalized Markup Language, ISO
+8879:1986 as amended and corrected) for use on the World Wide Web.
+Details of the decisions regarding which features of ISO 8879 to
+retain in the subset <loc
+href='http://www.w3.org/XML/#WG-decisions'>are available
+separately</loc>. XML is already supported by some commercial
+products, and there are a growing number of <loc
+href='http://www.w3.org/XML/#software'>free implementations</loc>.
+Public discussions of XML <loc
+href='http://www.w3.org/XML/#discussion'>are accessible
+online</loc>.</p>
+
+<p>この&TR-or-Rec;では,<bibref ref="Berners-Lee"/>に定義する
+URI(Uniform Resource Identifier)を使用する。URIの制定作業は進行中であっ
+て,<bibref ref="RFC1738"/>及び<bibref ref="RFC1808"/>を更新する予定と
+なっている。この作業がRFCとして受け入れられない場合は,この規程内のURI
+への参照は,URL(Uniform Resource Locator)への参照に代わる。This
+specification uses the term URI, which is defined by <bibref
+ref="Berners-Lee"/>, a work in progress expected to update <bibref
+ref="RFC1738"/> and <bibref ref="RFC1808"/>. Should the work not be
+accepted as an RFC, the references to uniform resource identifiers
+(URIs) in this specification will become references to uniform
+resource locators (URLs).</p>
+
+ <p>XMLの仕様に準拠しているかどうかの基準となるはW3Cのサイトにあ
+る原文である。The normative version of the specification is
+the English version found at the W3C site.</p>
+
+ <p>この標準情報は原仕様と技術的に同一であることを意図しているが、
+翻訳上の誤りはあり得る。Although this technical report is
+intended to be technically identical to the original, it may
+contain errors from the translation.</p>
+
+ <p>備考: 原規定との規定箇所の対応関係を明らかにするため、この
+&TR-or-Rec;の節構成及び節番号は、原規定のそれらをできるだけ保存してい
+る。この&TR-or-Rec;のWeb版は、原規定のHTMLタグをそのまま保存している。
+</p>
+</status>
+<!-- out of date
+<statusp>This is a W3C Working Draft for review by W3C members and other
+interested parties. It is a draft document and may be updated,
+replaced, or obsoleted by other documents at any time. It is
+inappropriate to use W3C Working Drafts as reference material or to
+cite them as other than "work in progress". A list of current W3C
+working drafts can be found at
+<loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>.</statusp>
+<statusp><emph>Note:</emph> Since working drafts are subject to frequent
+change, you are advised to reference the above URL, rather than the
+URLs for working drafts themselves.</statusp>
+<statusp>This work is part of the W3C SGML Activity (for current
+status, see <loc href="http://www.w3.org/MarkUp/SGML/Activity"
+>http://www.w3.org/MarkUp/SGML/Activity</loc>).</statusp>
+<p>The current
+draft of this specification
+presupposes the successful completion of the current
+work on the &WebSGML;, being prepared by ISO/IEC JTC1
+at the time this draft specification was drafted.
+If it is not
+adopted in the expected form, some clauses of this specification
+may change, and some
+recommendations now labeled "<termref def="dt-interop">for
+interoperability</termref>" will become requirements labeled
+"<termref def="dt-compat">for compatibility</termref>".
+</p>
+<p>The current draft of this specification uses the term
+URI, which is defined by
+<bibref ref="Berners-Lee"/>,
+which is work in progress expected to update
+<bibref ref="RFC1738"/> and <bibref ref="RFC1808"/>.
+Should the work in this draft not be accepted as an RFC, the
+references to uniform resource identifiers (URIs) in this
+specification will become references to uniform resource
+locators (URLs).</p>
+</status> -->
+<abstract>
+<p>拡張可能な&markup;言語(XML)はSGMLの簡単な方言であって,この&TR-or-Rec;で,そのすべてを規定する。XMLの目標は,現在のHTMLと同様に,一般性のあるSGMLをウェブ上で配布,受信及び処理できることとする。XMLは実装が容易であって,SGML及びHTMLのどちらに対しても相互運用性を保つ設計がなされている。</p>
+</abstract>
+<pubstmt>
+<p>Chicago, Vancouver, Mountain View, et al.:
+World-Wide Web Consortium, XML作業グループ, 1996, 1997.</p>
+</pubstmt>
+<sourcedesc>
+<p>Created in electronic form.</p>
+</sourcedesc>
+<langusage>
+<language id='EN'>English</language>
+<language id='ebnf'>Extended Backus-Naur Form (formal grammar)</language>
+</langusage>
+<revisiondesc>
+<slist>
+<sitem>1997-12-03 : CMSMcQ : yet further changes</sitem>
+<sitem>1997-12-02 : TB : further changes (see TB to XML WG,
+2 December 1997)</sitem>
+<sitem>1997-12-02 : CMSMcQ : deal with as many corrections and
+comments from the proofreaders as possible:
+entify hard-coded document date in pubdate element,
+change expansion of entity WebSGML,
+update status description as per Dan Connolly (am not sure
+about refernece to Berners-Lee et al.),
+add 'The' to abstract as per WG decision,
+move Relationship to Existing Standards to back matter and
+combine with References,
+re-order back matter so normative appendices come first,
+re-tag back matter so informative appendices are tagged informdiv1,
+remove XXX XXX from list of 'normative' specs in prose,
+move some references from Other References to Normative References,
+add RFC 1738, 1808, and 2141 to Other References (they are not
+normative since we do not require the processor to enforce any
+rules based on them),
+add reference to 'Fielding draft' (Berners-Lee et al.),
+move notation section to end of body,
+drop URIchar non-terminal and use SkipLit instead,
+lose stray reference to defunct nonterminal 'markupdecls',
+move reference to Aho et al. into appendix (Tim's right),
+add prose note saying that hash marks and fragment identifiers are
+NOT part of the URI formally speaking, and are NOT legal in
+system identifiers (processor 'may' signal an error).
+Work through:
+Tim Bray reacting to James Clark,
+Tim Bray on his own,
+Eve Maler,
+
+NOT DONE YET:
+change binary / text to unparsed / parsed.
+handle James's suggestion about &lt; in attriubte values
+uppercase hex characters,
+namechar list,
+</sitem>
+<sitem>1997-12-01 : JB : add some column-width parameters</sitem>
+<sitem>1997-12-01 : CMSMcQ : begin round of changes to incorporate
+recent WG decisions and other corrections:
+binding sources of character encoding info (27 Aug / 3 Sept),
+correct wording of Faust quotation (restore dropped line),
+drop SDD from EncodingDecl,
+change text at version number 1.0,
+drop misleading (wrong!) sentence about ignorables and extenders,
+modify definition of PCData to make bar on msc grammatical,
+change grammar's handling of internal subset (drop non-terminal markupdecls),
+change definition of includeSect to allow conditional sections,
+add integral-declaration constraint on internal subset,
+drop misleading / dangerous sentence about relationship of
+entities with system storage objects,
+change table body tag to htbody as per EM change to DTD,
+add rule about space normalization in public identifiers,
+add description of how to generate our name-space rules from
+Unicode character database (needs further work!).
+</sitem>
+<sitem>1997-10-08 : TB : Removed %-constructs again, new rules
+for PE appearance.</sitem>
+<sitem>1997-10-01 : TB : Case-sensitive markup; cleaned up
+element-type defs, lotsa little edits for style</sitem>
+<sitem>1997-09-25 : TB : Change to elm's new DTD, with
+substantial detail cleanup as a side-effect</sitem>
+<sitem>1997-07-24 : CMSMcQ : correct error (lost *) in definition
+of ignoreSectContents (thanks to Makoto Murata)</sitem>
+<sitem>Allow all empty elements to have end-tags, consistent with
+SGML TC (as per JJC).</sitem>
+<sitem>1997-07-23 : CMSMcQ : pre-emptive strike on pending corrections:
+introduce the term 'empty-element tag', note that all empty elements
+may use it, and elements declared EMPTY must use it.
+Add WFC requiring encoding decl to come first in an entity.
+Redefine notations to point to PIs as well as binary entities.
+Change autodetection table by removing bytes 3 and 4 from
+examples with Byte Order Mark.
+Add content model as a term and clarify that it applies to both
+mixed and element content.
+</sitem>
+<sitem>1997-06-30 : CMSMcQ : change date, some cosmetic changes,
+changes to productions for choice, seq, Mixed, NotationType,
+Enumeration. Follow James Clark's suggestion and prohibit
+conditional sections in internal subset. TO DO: simplify
+production for ignored sections as a result, since we don't
+need to worry about parsers which don't expand PErefs finding
+a conditional section.</sitem>
+<sitem>1997-06-29 : TB : various edits</sitem>
+<sitem>1997-06-29 : CMSMcQ : further changes:
+Suppress old FINAL EDIT comments and some dead material.
+Revise occurrences of % in grammar to exploit Henry Thompson's pun,
+especially markupdecl and attdef.
+Remove RMD requirement relating to element content (?).
+</sitem>
+<sitem>1997-06-28 : CMSMcQ : Various changes for 1 July draft:
+Add text for draconian error handling (introduce
+the term Fatal Error).
+RE deleta est (changing wording from
+original announcement to restrict the requirement to validating
+parsers).
+Tag definition of validating processor and link to it.
+Add colon as name character.
+Change def of %operator.
+Change standard definitions of lt, gt, amp.
+Strip leading zeros from #x00nn forms.</sitem>
+<sitem>1997-04-02 : CMSMcQ : final corrections of editorial errors
+found in last night's proofreading. Reverse course once more on
+well-formed: Webster's Second hyphenates it, and that's enough
+for me.</sitem>
+<sitem>1997-04-01 : CMSMcQ : corrections from JJC, EM, HT, and self</sitem>
+<sitem>1997-03-31 : Tim Bray : many changes</sitem>
+<sitem>1997-03-29 : CMSMcQ : some Henry Thompson (on entity handling),
+some Charles Goldfarb, some ERB decisions (PE handling in miscellaneous
+declarations. Changed Ident element to accept def attribute.
+Allow normalization of Unicode characters. move def of systemliteral
+into section on literals.</sitem>
+<sitem>1997-03-28 : CMSMcQ : make as many corrections as possible, from
+Terry Allen, Norbert Mikula, James Clark, Jon Bosak, Henry Thompson,
+Paul Grosso, and self. Among other things: give in on "well formed"
+(Terry is right), tentatively rename QuotedCData as AttValue
+and Literal as EntityValue to be more informative, since attribute
+values are the <emph>only</emph> place QuotedCData was used, and
+vice versa for entity text and Literal. (I'd call it Entity Text,
+but 8879 uses that name for both internal and external entities.)</sitem>
+<sitem>1997-03-26 : CMSMcQ : resynch the two forks of this draft, reapply
+my changes dated 03-20 and 03-21. Normalize old 'may not' to 'must not'
+except in the one case where it meant 'may or may not'.</sitem>
+<sitem>1997-03-21 : TB : massive changes on plane flight from Chicago
+to Vancouver</sitem>
+<sitem>1997-03-21 : CMSMcQ : correct as many reported errors as possible.
+</sitem>
+<sitem>1997-03-20 : CMSMcQ : correct typos listed in CMSMcQ hand copy of spec.</sitem>
+<sitem>1997-03-20 : CMSMcQ : cosmetic changes preparatory to revision for
+WWW conference April 1997: restore some of the internal entity
+references (e.g. to docdate, etc.), change character xA0 to &amp;nbsp;
+and define nbsp as &amp;#160;, and refill a lot of paragraphs for
+legibility.</sitem>
+<sitem>1996-11-12 : CMSMcQ : revise using Tim's edits:
+Add list type of NUMBERED and change most lists either to
+BULLETS or to NUMBERED.
+Suppress QuotedNames, Names (not used).
+Correct trivial-grammar doc type decl.
+Rename 'marked section' as 'CDATA section' passim.
+Also edits from James Clark:
+Define the set of characters from which [^abc] subtracts.
+Charref should use just [0-9] not Digit.
+Location info needs cleaner treatment: remove? (ERB
+question).
+One example of a PI has wrong pic.
+Clarify discussion of encoding names.
+Encoding failure should lead to unspecified results; don't
+prescribe error recovery.
+Don't require exposure of entity boundaries.
+Ignore white space in element content.
+Reserve entity names of the form u-NNNN.
+Clarify relative URLs.
+And some of my own:
+Correct productions for content model: model cannot
+consist of a name, so "elements ::= cp" is no good.
+</sitem>
+<sitem>1996-11-11 : CMSMcQ : revise for style.
+Add new rhs to entity declaration, for parameter entities.</sitem>
+<sitem>1996-11-10 : CMSMcQ : revise for style.
+Fix / complete section on names, characters.
+Add sections on parameter entities, conditional sections.
+Still to do: Add compatibility note on deterministic content models.
+Finish stylistic revision.</sitem>
+<sitem>1996-10-31 : TB : Add Entity Handling section</sitem>
+<sitem>1996-10-30 : TB : Clean up term &amp; termdef. Slip in
+ERB decision re EMPTY.</sitem>
+<sitem>1996-10-28 : TB : Change DTD. Implement some of Michael's
+suggestions. Change comments back to //. Introduce language for
+XML namespace reservation. Add section on white-space handling.
+Lots more cleanup.</sitem>
+<sitem>1996-10-24 : CMSMcQ : quick tweaks, implement some ERB
+decisions. Characters are not integers. Comments are /* */ not //.
+Add bibliographic refs to 10646, HyTime, Unicode.
+Rename old Cdata as MsData since it's <emph>only</emph> seen
+in marked sections. Call them attribute-value pairs not
+name-value pairs, except once. Internal subset is optional, needs
+'?'. Implied attributes should be signaled to the app, not
+have values supplied by processor.</sitem>
+<sitem>1996-10-16 : TB : track down &amp; excise all DSD references;
+introduce some EBNF for entity declarations.</sitem>
+<sitem>1996-10-?? : TB : consistency check, fix up scraps so
+they all parse, get formatter working, correct a few productions.</sitem>
+<sitem>1996-10-10/11 : CMSMcQ : various maintenance, stylistic, and
+organizational changes:
+Replace a few literals with xmlpio and
+pic entities, to make them consistent and ensure we can change pic
+reliably when the ERB votes.
+Drop paragraph on recognizers from notation section.
+Add match, exact match to terminology.
+Move old 2.2 XML Processors and Apps into intro.
+Mention comments, PIs, and marked sections in discussion of
+delimiter escaping.
+Streamline discussion of doctype decl syntax.
+Drop old section of 'PI syntax' for doctype decl, and add
+section on partial-DTD summary PIs to end of Logical Structures
+section.
+Revise DSD syntax section to use Tim's subset-in-a-PI
+mechanism.</sitem>
+<sitem>1996-10-10 : TB : eliminate name recognizers (and more?)</sitem>
+<sitem>1996-10-09 : CMSMcQ : revise for style, consistency through 2.3
+(Characters)</sitem>
+<sitem>1996-10-09 : CMSMcQ : re-unite everything for convenience,
+at least temporarily, and revise quickly</sitem>
+<sitem>1996-10-08 : TB : first major homogenization pass</sitem>
+<sitem>1996-10-08 : TB : turn "current" attribute on div type into
+CDATA</sitem>
+<sitem>1996-10-02 : TB : remould into skeleton + entities</sitem>
+<sitem>1996-09-30 : CMSMcQ : add a few more sections prior to exchange
+ with Tim.</sitem>
+<sitem>1996-09-20 : CMSMcQ : finish transcribing notes.</sitem>
+<sitem>1996-09-19 : CMSMcQ : begin transcribing notes for draft.</sitem>
+<sitem>1996-09-13 : CMSMcQ : made outline from notes of 09-06,
+do some housekeeping</sitem>
+</slist>
+</revisiondesc>
+</header>
+<body>
+<div1 id='sec-intro'>
+<head>一般事項</head>
+<!-- <div2 id='sec-scope'>
+ <head>適用範囲</head> -->
+<p>拡張可能な&markup;言語XML(eXtensible Markup Language)は,<termref def="dt-xml-doc">XML文書</termref>というデータオブジェクトのクラスを規定し,XML文書を処理するプログラムの動作の一部を規定する。XMLは,SGML(標準一般化&markup;言語,Standard Generalized Markup Language)<bibref ref='ISO8879'/>の制限した&subset;とする。構造上,XML文書は,かならずSGML規格に適合する。</p>
+<p>XML文書は,<termref def="dt-entity">実体</termref>という記憶単位からなり,実体は,&parsed-data;又は&unparsed-data;からなる。&parsed-data;は,<termref def="dt-character">文字</termref>からなり,その一部は,文書の<termref def="dt-chardata">文字データ</termref>を構成し,一部は,<termref def="dt-markup">&markup;</termref>を構成する。&markup;は,文書の記憶レイアウト及び論理構造についての記述を表す符号とする。XMLは,記憶レイアウト及び論理構造についての制約条件を記述する機構を提供する。</p>
+<p><termdef id="dt-xml-proc" term="XML&processor;"><term>XML&processor;</term>というソフトウェアモジュールは,XML文書を読み込み,その内容及び構造へのアクセスを提供するために用いる。 </termdef> <termdef id="dt-app" term="&application;">XML&processor;は,他のモジュールのために動作することを前提とし,そのモジュールを<term>&application;</term>という。</termdef>この&TR-or-Rec;は,XML&processor;が行わなければならない振舞いを規定する。つまり,XMLデータの読込み方法を規定し,&application;に提供する情報を規定する。</p>
+<!-- </div2> -->
+<div2 id='sec-origin-goals'>
+<head>経緯及び目標</head>
+<p>1996年にWorld Wide Web Consortium(W3C)の中に設立したXML作業グループ(以前は, SGML編集レビュー委員会と呼ばれた)が,XMLを開発した。この作業グループの議長を,Sun MicrosystemsのJon Bosakが勤める。W3Cが組織し,以前はSGML作業グループと呼ばれたXML SIG(Special Interest Group)も,XMLの制定に非常に活発に参画した。
+<!--JISでは? XML作業グループのメンバを付録に示す。-->Dan Connollyは,作業グループのW3Cにおける連絡係を務めた。</p>
+<p>XMLの設計目標を,次に示す。<ulist>
+<item><p>a) XMLは,Internet上でそのまま使用できる。</p></item>
+<item><p>b) XMLは,広範囲の&application;を支援する。</p></item>
+<item><p>c) XMLは,SGMLと互換性をもつ。</p></item>
+<item><p>d) XML文書を処理するプログラムを書くことは,容易でなければならない。</p></item>
+<item><p>e) XMLでは,オプションの機能はできるだけ少なくし,一つも存在しないことを目指す。</p></item>
+<item><p>f) XML文書は,人間にとって読みやすく,十分に理解しやすい。</p></item>
+<item><p>g) XMLの設計は,すみやかに行えなければならない。</p></item>
+<item><p>h) XMLの設計は,厳密及び簡潔でなければならない。</p></item>
+<item><p>i) XML文書は,容易に作成できる。</p></item>
+<item><p>j) XMLでは,&markup;の数を減らすことは,重要ではない。</p></item></ulist>
+</p>
+<p>XML第&XML.version;&version;を理解し,それを処理する計算機プログラムを書くために十分な情報は,この&TR-or-Rec;及び関連する規格(文字用として,Unicode及びISO/IEC 10646,<!--* XXX for Uniform Resource Identifiers, *-->&language-identification;タグ用として,インタネット RFC 1766,&language-code;用として,ISO 639,並びに&country-code;用として,ISO 3166)で,すべて示す。</p>
+<p>この&version;のXMLの規定<!-- (&doc.date;) -->は,公開レビュー及び議論を目的とする。テキスト及び法律上の注意を改変しない限り,自由に配布してもよい。</p>
+</div2>
+<div2 id='sec-terminology'>
+<head>定義</head>
+<p>XML文書の規定のために使用する用語は,この&TR-or-Rec;内で定義する。次に示す語句は,それらの用語を定義するため,及びXML&processor;の動きを規定するために使用する。
+<glist>
+<gitem>
+<label>1.2.1 してもよい(may)</label>
+<def><p><termdef id="dt-may" term="してもよい">適合する文書又はXML&processor;は,記述されたとおりに動作してもよいが,そのとおりにする必要はない。</termdef></p></def>
+</gitem>
+<gitem>
+<label>1.2.2 しなければならない(must)</label>
+<def><p>適合する文書又はXML&processor;は,記述されたとおりに動作することが要求される。そうでなければ,&error;とする。<!-- do NOT change this! this is what defines a violation ofa 'must' clause as 'an error'. -MSM -->
+</p></def>
+</gitem>
+<gitem>
+<label>1.2.3 &error;(error)</label>
+<def><p><termdef id="dt-error" term="&error;">この&TR-or-Rec;が定める規則に対する違反。結果は定義しない。適合するソフトウェアは,&error;を検出して報告してもよく,&error;から回復してもよい。</termdef></p></def>
+</gitem>
+<gitem>
+<label>1.2.4 &fatal-error;(fatal error)</label>
+<def><p><termdef id="dt-fatal" term="&fatal-error;">適合する<termref def="dt-xml-proc">XML&processor;</termref>が検出しなければならず,&application;に報告しなければならない&error;。&fatal-error;を発見したあと,&processor;は,それ以降の&error;を探すためにデータ処理を続行してもよく,&error;を発見した場合は,その&error;を&application;に報告してもよい。&error;訂正をサポートするために,&processor;は,未処理データ(文字データ及び&markup;の混在したもの)を文書から取り出し,&application;に渡してもよい。しかし,一度,&fatal-error;を検出したら,&processor;は,通常の処理を続行してはならない。つまり,&processor;は,文字データ及び文書の論理構造についての情報を,通常の方法で&application;に渡し続けてはならない。</termdef></p></def>
+</gitem>
+<gitem>
+<label>1.2.5 &at-user-option;(at user option)</label>
+<def><p>適合するソフトウエアは,記述されたとおりに振る舞ってもよい(may),又は振る舞わなくてはならない(must)(文章中の助動詞による。)。そのとおりに振る舞う場合は,記述された振舞いを選択又は拒否する手段を&user;に提供しなければならない。</p></def>
+</gitem>
+<gitem>
+<label>1.2.6 &validity;制約(validity constraint)</label>
+<def><p>すべての<termref def="dt-valid">&valid;な</termref>XML文書に適用する規則。&validity;制約の違反は,&error;とする。&at-user-option;,<termref def="dt-validating">検証を行うXML&processor;</termref>は,この&error;を報告しなければならない。</p></def>
+</gitem>
+<gitem>
+<label>1.2.7 &well-formed;制約(well-formedness constraint)</label>
+<def><p>すべての<termref def="dt-wellformed">&well-formed;</termref>のXML文書に適用する規則。&well-formed;制約の違反は,<termref def="dt-fatal">&fatal-error;</termref>とする。</p></def>
+</gitem>
+<gitem>
+<label>1.2.8 &match;(match)</label>
+<def><p>a) <termdef id="dt-match" term="&match;">&string;又は名前の&match; 比較する二つの&string;又は名前は,同一でなければならない。ISO/IEC 10646において,複数の表現が可能な文字[例えば,&composed-form;及び基底+&diacritical-mark;(ダイアクリティカルマーク)形式]は,どちらの&string;も同じ表現のときに限り,&match;する。&at-user-option;,&processor;は,その文字を標準形に正規化してもよい。比較のとき、大文字と小文字との区別をする。<!-- Note that no processing of characters with respect to case is part of the matching process. -->&lt;BR>b) &string;と文法中の規則との&match; ある生成規則から生成する言語に,ある&string;が属するとき,この&string;は,この生成規則に&match;するという。&lt;BR>c) 内容と内容モデルとの&match; ある要素が,<titleref href='elementvalid'>要素の&validity;</titleref>の制約に示す意味で適合するとき,この要素は,その宣言に&match;するという。</termdef></p></def>
+</gitem>
+<gitem>
+<label>1.2.9 互換性のため(for compatibility)</label>
+<def><p><termdef id="dt-compat" term="互換性のため">XMLの機能であって,XMLがSGMLと互換であることを保証するためだけに導入されるもの。</termdef></p></def>
+</gitem>
+<gitem>
+<label>1.2.10 相互運用性のため(for interoperability)</label>
+<def><p><termdef id="dt-interop" term="相互運用性のため">拘束力はもたない推奨事項。&WebSGML;以前から存在するSGML&processor;が,XML文書を処理できる可能性を高めるために取り入れるもの。</termdef></p></def>
+</gitem>
+</glist>
+</p>
+</div2>
+</div1>
+<!-- &Docs; -->
+<div1 id='sec-documents'>
+<head>文書</head>
+<p><termdef id="dt-xml-doc" term="XML文書">
+<!-- A textual object -->
+この&TR-or-Rec;で定義する意味で,<termref def="dt-wellformed">&well-formed;</termref>とするデータオブジェクトを,<term>XML文書</term>という。&well-formed;のXML文書が,さらに,ある制約条件を満足すれば,<termref def="dt-valid">&valid;</termref>なXML文書とする。
+</termdef></p>
+
+<!-- why this div? -TB
+<div2 id='sec-log-phys'>
+<head>Logical and Physical Structure</head> -->
+
+<p>いずれのXML文書も,論理構造及び物理構造をもつ。物理的には,文書は,<termref def="dt-entity">実体</termref>と呼ぶ単位からなる。ある実体は,文書内に他の実体を含むために,その他の実体を<termref def="dt-entref">参照</termref>してもよい。文書は,“ルート”すなわち<termref def="dt-docent">文書実体</termref>から始まる。論理的には,文書は,宣言,要素,コメント,文字参照及び処理命令を含み,これらすべては,文書内で明示的な&markup;によって示す。論理構造及び物理構造は,<titleref href="wf-entities">以降</titleref>に示すとおりに,厳密に入れ子になっていなければならない。</p>
+
+<!--
+</div2> -->
+
+<div2 id='sec-well-formed'>
+<head>&well-formed;のXML文書</head>
+<p><termdef id="dt-wellformed" term="&well-formed;">あるテキストオブジェクトが,次のいずれかのとき,そのテキストオブジェクトを&well-formed;のXML文書と呼ぶ。</termdef>
+<ulist>
+<item><p>a) 全体として,<nt def='NT-document'>document</nt>というラベルをもつ生成規則に&match;する。</p></item>
+<item><p>b) この&TR-or-Rec;で定義する,すべての&well-formed;制約に従う。</p>
+</item>
+<item><p>c) それぞれの<termref def='dt-parsedent'>&parsed-entity;</termref>が,<titleref href='wf-entities'>&well-formed;</titleref>となる。</p></item>
+</ulist></p>
+<p>
+<scrap lang='ebnf' id='document'>
+<head>文書</head>
+<prod id='NT-document'><lhs>document</lhs>
+<rhs><nt def='NT-prolog'>prolog</nt>
+<nt def='NT-element'>element</nt>
+<nt def='NT-Misc'>Misc</nt>*</rhs></prod>
+</scrap>
+</p>
+<p><nt def="NT-document">document</nt>生成規則に&match;するとは,次を意味する。
+<ulist>
+<item><p>a) 一つ以上の<termref def="dt-element">要素</termref>を含む。</p>
+</item>
+
+<!--* N.B. some readers (notably JC) find the following
+paragraph awkward and redundant. I agree it's logically redundant:
+it *says* it is summarizing the logical implications of
+matching the grammar, and that means by definition it's
+logically redundant. I don't think it's rhetorically
+redundant or unnecessary, though, so I'm keeping it. It
+could however use some recasting when the editors are feeling
+stronger. -MSM *-->
+
+<item><p>b) <termdef id="dt-root" term="ルート要素"><term>ルート</term>又は文書要素という要素が一つだけ存在し,これは,他の要素の<termref def="dt-content">内容</termref>に含まれない。</termdef>これ以外のすべての要素は,その開始タグが他の要素の内容に含まれれば,対応する終了タグも同じ要素の内容に含まれる。つまり,要素は,開始タグ及び終了タグによって区切られ,入れ子構造をなす。
+</p></item>
+</ulist>
+</p>
+<p><termdef id="dt-parentchild" term="親要素/子要素">これらの結果として,文書内のどの非ルート要素<code>C</code>に対しても,ある他の要素<code>P</code>が存在し,<code>C</code>は,<code>P</code>の内容に含まれるが,<code>P</code>の内容に含まれる他の要素に含まれることはない。このとき,<code>P</code>を<code>C</code>の<code>親</code>といい,<code>C</code>を<code>P</code>の<code>子</code>という。</termdef></p>
+</div2>
+<div2 id="charsets">
+<head>文字</head>
+<p>
+
+<!--The data stored in an XML <termref def="dt-entity">entity</termref> is
+either <termref def="dt-text">parsed</termref> or <termref
+def="dt-unparsed">unparsed</termref>. -->
+
+<termdef id="dt-text" term="テキスト">&parsed-entity;は,<term>テキスト</term>(<termref def="dt-character">文字</termref>の並びであって,&markup;又は文字データを表してもよい。)を含む。</termdef><termdef id="dt-character" term="文字"><term>文字</term>は,テキストの最小単位であって,ISO/IEC 10646<bibref ref="ISO10646"/>に規定される。<!--Users may extend the ISO/IEC 10646 character repertoire by exploiting the private use areas. -->許容する文字は,タブ,改行,復帰並びにUnicode及びISO/IEC 10646が許容する図形文字とする。</termdef>
+<scrap lang="ebnf" id="char32">
+<head>文字の範囲</head>
+<prodgroup pcw2="4" pcw4="17.5" pcw5="11">
+<prod id="NT-Char"><lhs>Char</lhs>
+<rhs>#x9 | #xA | #xD | [#x20-#D7FF] | [#xE000-#xFFFD]
+| [#x10000-#x10FFFF]</rhs>
+<com>任意のUnicode文字。ただし,&surrogate-blocks;,FFFE及びFFFFは除く。</com>
+</prod>
+</prodgroup>
+</scrap>
+</p>
+<p>&character-value;をビットパタンに符号化する機構は,実体ごとに違ってもよい。すべてのXML&processor;は,ISO/IEC 10646のUTF-8符号化及びUTF-16符号化を受け付けなければならない。二つのどちらが用いられているかを明示するための機構,及び他の符号化方法を利用するための機構は,<titleref href='charencoding'>文字の符号化</titleref>に記述する。</p>
+<p>どの符号化方法を用いるかに関係なく,ISO/IEC 10646の文字集合にあるすべての文字は,そのUCS-4&code-value;<!-- bit string. -->と等価な10進数又は16進数によって,参照できる。</p>
+</div2>
+
+<div2 id='sec-common-syn'>
+<head>共通の構文構成子</head>
+
+<p>2.3では,文法内で広く使用するいくつかの記号を定義する。</p>
+<p><nt def="NT-S">S</nt> (空白)は,一つ若しくは複数の&space-character;(#x20),復帰,改行又はタブから成る。
+
+<scrap lang="ebnf" id='white'>
+<head>空白</head>
+<prodgroup pcw2="4" pcw4="17.5" pcw5="11">
+<prod id='NT-S'><lhs>S</lhs>
+<rhs>(#x20 | #x9 | #xD | #xA)+</rhs>
+</prod>
+</prodgroup>
+</scrap></p>
+<p>便宜上,文字を,&letter;,数字又は他の文字に分類する。&letter;は,アルファベット的又は表音的である基本文字(一つ又は複数の&combining-character;が,後に続くこともある。),&ideographic;から成る。
+<!--
+Certain layout and format-control characters defined by ISO/IEC 10646
+should be ignored when recognizing identifiers; these are defined by the
+classes <nt def='NT-Ignorable'>Ignorable</nt> and <nt def='NT-
+Extender'>Extender</nt>.
+-->
+各クラスにおける実際の文字についての完全な定義は,<titleref href='CharClasses'>文字クラス</titleref>に関する付録に規定する。</p>
+<p><termdef id="dt-name" term="Name"><term>Name</term>は,&letter;又はいくつかの区切り文字の一つで始まり,その後に&letter;,数字,ハイフン,下線,コロン又はピリオドが続く(これらを名前文字という。)。</termdef>&string;"<code>xml</code>"又は<code>(('X'|'x') ('M'|'m') ('L'|'l'))</code>に&match;する任意の&string;で始まる名前は,この&TR-or-Rec;の現在の版又は将来の版での標準化のために予約する。
+</p>
+<note>
+<p>XMLの名前の中のコロンは,名前空間での実験のために予約する。コロンの意味は,将来のある時点で標準化するものとし,そのときには,実験的な目的でコロンを使用する文書を更新する必要が生じる可能性がある。XMLで採用する名前空間の機構が,区切り子として実際にコロンを使用するという保証はない。事実上,これは,名前空間の実験の一つとして以外には,XMLの名前の中でコロンを使用しないほうがよいことを意味する。しかし,XML&processor;は,名前文字としてコロンを受け付けることが望ましい。
+</p>
+</note>
+<p>
+<nt def='NT-Nmtoken'>Nmtoken</nt> (名前&token;)は,名前文字で構成する列とする。
+<scrap lang='ebnf'>
+<head>名前及び&token;</head>
+<!--
+<prod id='NT-MiscName'><lhs>MiscName</lhs>
+<rhs></rhs>
+</prod>-->
+<prod id='NT-NameChar'><lhs>NameChar</lhs>
+<rhs><nt def="NT-Letter">Letter</nt>
+| <nt def='NT-Digit'>Digit</nt>
+<!--| <nt def='NT-MiscName'>MiscName</nt>-->
+| '.' | '-' | '_' | ':'
+| <nt def='NT-CombiningChar'>CombiningChar</nt>
+<!-- | <nt def='NT-Ignorable'>Ignorable</nt> -->
+| <nt def='NT-Extender'>Extender</nt></rhs>
+</prod>
+<prod id='NT-Name'><lhs>Name</lhs>
+<rhs>(<nt def='NT-Letter'>Letter</nt> | '_' | ':')
+(<nt def='NT-NameChar'>NameChar</nt>)*</rhs></prod>
+<prod id='NT-Names'><lhs>Names</lhs>
+<rhs><nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>)*</rhs></prod>
+<prod id='NT-Nmtoken'><lhs>Nmtoken</lhs>
+<rhs>(<nt def='NT-NameChar'>NameChar</nt>)+</rhs></prod>
+<prod id='NT-Nmtokens'><lhs>Nmtokens</lhs>
+<rhs><nt def='NT-Nmtoken'>Nmtoken</nt> (<nt def='NT-S'>S</nt> <nt
+def='NT-Nmtoken'>Nmtoken</nt>)*</rhs></prod>
+</scrap>
+</p>
+<p>&literal;データは,引用符で囲まれた&string;とし,その列の区切り子として使用する引用符は含まない。&literal;は,内部実体(<nt def='NT-EntityValue'>EntityValue</nt>),属性値(<nt def='NT-AttValue'>AttValue</nt>),外部&identifier;(<nt def="NT-SystemLiteral">SystemLiteral</nt>)の内容の指定に使用する。目的によっては,&literal;全体を,その中の&markup;の走査を行なわずに,スキップすることがある(<nt def='NT-SkipLit'>SkipLit</nt>。)。
+<scrap lang='ebnf'>
+<head>&literal;</head>
+<!-- is marked section end legal in entity values etc.?
+James says yes. Handbook page 392, sec. 10.4 seems to me to say no.
+If James is right, leave as is. Otherwise, uncomment
+the next comment and ...
+-->
+<!--
+<prod id='NT-EntityValue'><lhs>EntityValue</lhs>
+<rhs>' " '
+(([^%&amp;"]
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-Reference'>Reference</nt>)*
+- (<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-char'>Char</nt>*))
+' " '
+</rhs>
+<rhs>|&nbsp;
+" ' "
+(([^%&amp;']
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-Reference'>Reference</nt>)*
+- (<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-char'>Char</nt>*))
+" ' "</rhs>
+</prod>
+<prod id='NT-AttValue'><lhs>AttValue</lhs>
+<rhs>'"'
+(([^&lt;&amp;"]
+| <nt def='NT-Reference'>Reference</nt>)*
+- (<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-char'>Char</nt>*))
+' " '
+</rhs>
+<rhs>|&nbsp;
+" ' "
+(([^&lt;&amp;']
+| <nt def='NT-Reference'>Reference</nt>)*
+- (<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-char'>Char</nt>*))
+" ' "</rhs>
+<wfc def="CleanAttrVals"/>
+</prod>
+-->
+<!-- ... and comment out the following, down to ... -->
+<prod id='NT-EntityValue'><lhs>EntityValue</lhs>
+<rhs>' " '
+([^%&amp;"]
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-Reference'>Reference</nt>)*
+' " '
+</rhs>
+<rhs>|&nbsp;
+" ' "
+([^%&amp;']
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-Reference'>Reference</nt>)*
+" ' "</rhs>
+</prod>
+<prod id='NT-AttValue'><lhs>AttValue</lhs>
+<rhs>' " '
+([^&lt;&amp;"]
+| <nt def='NT-Reference'>Reference</nt>)*
+' " '
+</rhs>
+<rhs>|&nbsp;
+" ' "
+([^&lt;&amp;']
+| <nt def='NT-Reference'>Reference</nt>)*
+" ' "</rhs>
+<!--<wfc def="WF-Attvaldelim"/>-->
+</prod>
+<!-- ... down to here. -->
+<prod id="NT-SystemLiteral"><lhs>SystemLiteral</lhs>
+<rhs><nt def='NT-SkipLit'>SkipLit</nt></rhs>
+</prod>
+<!-- <prod id="NT-URIchar"><lhs>URIchar</lhs>
+<rhs><com>See <loc href="http://www.w3.org/XXX">XXX</loc></com>
+</rhs></prod>
+-->
+<prod id="NT-PubidLiteral"><lhs>PubidLiteral</lhs>
+<rhs>' " ' <nt def='NT-PubidChar'>PubidChar</nt>*
+' " '
+| " ' " (<nt def='NT-PubidChar'>PubidChar</nt> - " ' ")* " ' "</rhs>
+</prod>
+<prod id="NT-PubidChar"><lhs>PubidChar</lhs>
+<rhs>#x20 | #xD | #xA
+|&nbsp;[a-zA-Z0-9]
+|&nbsp;[-'()+,./:=?]</rhs>
+</prod>
+<prod id="NT-SkipLit"><lhs>SkipLit</lhs>
+<rhs>(' " ' [^"]* ' " ')
+|&nbsp;(" ' " [^']* " ' ")</rhs>
+</prod>
+<!-- alternate form, making ms end illegal: -->
+<!--
+<prod id="NT-SkipLit"><lhs>SkipLit</lhs>
+<rhs>(' " ' ([^"]* - ([^"]* ']]&gt;' [^"]*)) ' " ')
+|&nbsp;(" ' " ([^']* - ([^']* ']]&gt;' [^']*)) " ' ")</rhs>
+</prod>
+-->
+</scrap>
+</p>
+<!--
+<wfcnote id="WF-Attvaldelim">
+<head>Delimiters in Attribute Values</head>
+<p>After the expansion of character and entity references,
+an attribute value must not contain a "<code>&lt;</code>"
+or "<code>&amp;</code>" character unless that character was
+introduced by the expansion of a character reference
+or one of the entities &magicents;.</p>
+</wfcnote>-->
+<!--
+This is not quite right: &lt; should be legal, should it not?
+Suppress this WFC until we get it right.
+-->
+<!-- Henry Thompson suggests (in substance, not form: the wording needs
+to be clarified):
+"Cooked Attribute values must not contain &lt; &amp; or the
+quote which closed their uncooked literal,
+unless arising from the expansion of a character reference or
+magic reference
+directly contained in their uncooked literal."
+I'm not sure I agree with this rule, but it's at least coherent,
+which is more than I can say for my attempt.
+-->
+</div2>
+
+<div2 id='syntax'>
+<head>文字データ及び&markup;</head>
+<p><termref def='dt-text'>テキスト</termref>は,<termref def="dt-chardata">文字データ</termref>及び&markup;が混在するものとして構成する。<termdef id="dt-markup" term="Markup"><term>&markup;</term>は,<termref def="dt-stag">開始タグ</termref>,<termref def="dt-etag">終了タグ</termref>,<termref def="dt-empty">空要素</termref>,<termref def="dt-entref">実体参照</termref>,<termref def="dt-charref">文字参照</termref>,<termref def="dt-comment">コメント</termref>,<termref def="dt-cdsection">CDATAセクション</termref> の区切り子,<termref def="dt-doctype">文書型宣言</termref>及び<termref def="dt-pi">処理命令</termref>の形を取る。
+</termdef>
+</p>
+<p><termdef id="dt-chardata" term="Character Data">&markup;ではないすべてのテキストは,文書の<term>文字データ</term>を構成する。</termdef></p>
+<p>アンパサンド文字 (&amp;)及び&left-angle-bracket; (&lt;)は,&markup;の区切り子として,又は<termref def="dt-comment">コメント</termref>,<termref def="dt-pi">処理命令</termref>若しくは<termref def="dt-cdsection">CDATAセクション</termref>内で使用する場合に<emph>だけ</emph>,そのままの形で出現してよい。これらの文字は,内部実体宣言の<termref def='dt-litentval'>&literal;実体値</termref>内に記述してもよい。 詳しくは,<titleref href='wf-entities'>&well-formed;の実体</titleref>に関する規定を参照。<!-- FINAL EDIT: restore internal entity decl or leave it out. -->これらの文字が他の部分で必要な場合,数値による文字参照又は&string;"<code>&amp;amp;</code>"及び&string;"<code>&amp;lt;</code>"を使用し,<termref def="dt-escape">&escape;</termref>しなければならない。&right-angle-bracket; (>) は,&string;"<code>&amp;gt;</code>"を使用して表現してもよい。内容の中で列"<code>]]&gt;</code>"を使用するときは,それが,<termref def="dt-cdsection">CDATAセクション</termref>の終了を&markup;しない限り,<termref def='dt-compat'>互換性のため</termref>,"<code>&amp;gt;</code>"又は文字参照を使用し,&escape;しなければならない。</p>
+
+<p>要素の内容では,文字データは,いかなる&markup;の開始区切り子を含まない任意の&char-string;とする。CDATAセクションでは,文字データとは,CDATAセクションの終了区切り子"<code>]]&gt;</code>"を含まない任意の&char-string;とする。
+</p>
+<p>
+属性値に&single-quote;及び&double-quote;を含むためには,アポストロフィ又は&single-quote;(') は,"<code>&amp;apos;</code>"として表現し,&double-quote;(")は,"<code>&amp;quot;</code>"として表現する。
+<scrap lang="ebnf">
+<head>文字データ</head>
+<prod id='NT-CharData'>
+<lhs>CharData</lhs>
+<rhs>[^&lt;&amp;]* - ([^&lt;&amp;]* ']]&gt;' [^&lt;&amp;]*)</rhs>
+</prod>
+</scrap>
+</p>
+</div2>
+
+<div2 id='sec-comments'>
+<head>コメント</head>
+
+<p><termdef id="dt-comment" term="Comment"><term>コメント</term>は,他の<termref def='dt-markup'>&markup;</termref>の外ならば,文書のどこに現れてもよい。さらに,文書型宣言内で,文法が許す場所に現れてもよい。
+<!-- TB
+except in a <termref def="dt-cdsection">CDATA section</termref>, i.e. within
+<termref def="dt-elemcontent">element content</termref>, in
+<termref def="dt-mixed">mixed content</termref>, or in the prolog. They must
+not occur within declarations or tags. -->
+コメントは,文書の<termref def="dt-chardata">文字データ</termref>の一部ではない。XML&processor;は,&application;がコメントのテキストを取り出すことを可能としてもよいが,そうしなくともよい。
+<termref def="dt-compat">互換性のため</termref>,&string;"<code>--</code>" (&double-hyphen;)は,コメント内で現れてはならない。
+<scrap lang="ebnf">
+<head>コメント</head>
+<prod id='NT-Comment'><lhs>Comment</lhs>
+<rhs>'&lt;!--'
+((<nt def='NT-Char'>Char</nt> - '-')
+| ('-' (<nt def='NT-Char'>Char</nt> - '-')))*
+'-->'</rhs>
+<!--
+<rhs>'&lt;!&como;'
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* '&comc;' <nt def='NT-Char'>Char</nt>*))
+'&comc;&gt;'</rhs> -->
+</prod>
+</scrap>
+</termdef></p>
+<p>コメントの例を次に示す。
+<eg>&lt;!&como; declarations for &lt;head> &amp; &lt;body> &comc;&gt;</eg>
+</p>
+</div2>
+
+<div2 id='sec-pi'>
+<head>処理命令</head>
+
+<p><termdef id="dt-pi" term="Processing instruction"><term>処理命令</term>(PI)によって,&application;のための命令を文書に入れることができる。
+
+<scrap lang="ebnf">
+<head>処理命令</head>
+<prod id='NT-PI'><lhs>PI</lhs>
+<rhs>'&lt;?' <nt def='NT-PITarget'>PITarget</nt>
+(<nt def='NT-S'>S</nt>
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*)))?
+&pic;</rhs></prod>
+<prod id='NT-PITarget'><lhs>PITarget</lhs>
+<rhs><nt def='NT-Name'>Name</nt> -
+(('X' | 'x') ('M' | 'm') ('L' | 'l'))</rhs>
+</prod>
+</scrap></termdef>
+PIは,文書の<termref def="dt-chardata">文字データ</termref>の一部ではないが,&application;に渡されなければならない。PIは,命令が渡される&application;を&identify;ために使用する&target; (<nt def='NT-PITarget'>PITarget</nt>) で始まる。&target;名 "<code>XML</code>","<code>xml</code>"などは,この&TR-or-Rec;の現在の版又は将来の版の規格化用に予約する。XMLの<termref def='dt-notation'>記法</termref>機構を,PIの&target;を宣言するために使用してもよい。
+</p>
+</div2>
+
+<div2 id='sec-cdata-sect'>
+<head>CDATAセクション</head>
+
+<p><termdef id="dt-cdsection" term="CDATA Section"><term>CDATAセクション</term>は,文字データが出現するところであれば,どこに出現してもよい。これは,そうでなければ,&markup;として認識する文字を含む,テキストの区画を&escape;するのに使用する。CDATAセクションは,&string;"<code>&lt;![CDATA[</code>"で始まり,&string;
+"<code>]]&gt;</code>"で終わる。
+<scrap lang="ebnf">
+<head>CDATAセクション</head>
+<prod id='NT-CDSect'><lhs>CDSect</lhs>
+<rhs><nt def='NT-CDStart'>CDStart</nt>
+<nt def='NT-CData'>CData</nt>
+<nt def='NT-CDEnd'>CDEnd</nt></rhs></prod>
+<prod id='NT-CDStart'><lhs>CDStart</lhs>
+<rhs>'&lt;![CDATA['</rhs>
+</prod>
+<prod id='NT-CData'><lhs>CData</lhs>
+
+<rhs>(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-Char'>Char</nt>*))
+</rhs>
+</prod>
+<prod id='NT-CDEnd'><lhs>CDEnd</lhs>
+<rhs>']]&gt;'</rhs>
+</prod>
+</scrap>
+
+CDATAセクション内では,列<nt def='NT-CDEnd'>CDEnd</nt>だけを&markup;として認識するので,&left-angle-bracket;及びアンパサンドは,その&literal;形式で出現してよい。それらは,"<code>&amp;lt;</code>"及び"<code>&amp;amp;</code>"を使用して&escape;する必要はない。CDATAセクションは,入れ子にはできない。
+</termdef>
+</p>
+
+<p>"<code>&lt;greeting></code>"及び"<code>&lt;/greeting></code>"を,<termref def='dt-markup'>&markup;</termref>ではなく,<termref def='dt-chardata'>文字データ</termref>として認識するCDATAセクションの例を,次に示す。
+<eg>&lt;![CDATA[&lt;greeting>Hello, world!&lt;/greeting>]]&gt;</eg>
+</p>
+</div2>
+
+<div2 id='sec-prolog-dtd'>
+<head>&prolog;及び文書型宣言</head>
+
+<p><termdef id='dt-xmldecl' term='XML Declaration'>XML文書は,使用するXMLの&version;を指定する<term>XML宣言</term>で始めてもよく,又そうするのが望ましい。
+</termdef>
+</p>
+<p>この&TR-or-Rec;のこの&version;に適合することを示すためには,&version;番号 "<code>1.0</code>" を使用しなければならない。ある文書が,この&TR-or-Rec;のこの&version;に適合しないとき,値"<code>1.0</code>"を使用するのは,&error;とする。この&TR-or-Rec;の今後の&version;に"<code>1.0</code>"以外の値を付与することが,XML作業グループの意図だが,XMLの将来の&version;を作成することの確約を示すわけではなく,作成したとしても,番号付けについて,特定の方法を使用することの確約を示すわけでもない。将来の&version;の可能性を除外しないので,必要な場合,自動的な&version;の認識を可能とする手段として,この構成子を提供する。&processor;は,サポートしていない&version;でラベル付けした文書を受け取ったとき,&error;を通知してもよい。
+</p>
+<p>XML文書内の&markup;の機能は,記憶構造及び論理構造を記述すること,並びに属性及び属性値の対を論理構造に関連づけることにある。XMLは,論理構造についての制約条件を定義するため,及びあらかじめ定義された記憶単位を使用できるための機構として,<termref def="dt-doctype">文書型宣言</termref>を提供する。<!-- old
+The function of the markup in an XML document is to describe its
+storage and logical structures, and associate attribute-value pairs with the
+logical structure.
+XML provides a
+mechanism, the <termref def="dt-doctype">document type declaration</termref>,
+to
+define constraints on that logical structure and to support the use of
+predefined storage units. --><termdef id="dt-valid" term="Validity">XML文書が<term>&valid;</term>とは,文書型宣言をもち,その文書型宣言に示す制約条件を満たすこととする。
+</termdef></p>
+<p>文書型宣言は,文書の最初の<termref def="dt-element">要素</termref>の前に現れなければならない。
+<scrap lang="ebnf" id='xmldoc'>
+<head>&prolog;</head>
+<prodgroup pcw2="6" pcw4="17.5" pcw5="9">
+<prod id='NT-prolog'><lhs>prolog</lhs>
+<rhs><nt def='NT-XMLDecl'>XMLDecl</nt>?
+<nt def='NT-Misc'>Misc</nt>*
+(<nt def='NT-doctypedecl'>doctypedecl</nt>
+<nt def='NT-Misc'>Misc</nt>*)?</rhs></prod>
+<prod id='NT-XMLDecl'><lhs>XMLDecl</lhs>
+<rhs>&xmlpio;
+<nt def='NT-VersionInfo'>VersionInfo</nt>
+<nt def='NT-EncodingDecl'>EncodingDecl</nt>?
+<nt def='NT-SDDecl'>SDDecl</nt>?
+<nt def="NT-S">S</nt>?
+&pic;</rhs>
+</prod>
+<prod id='NT-VersionInfo'><lhs>VersionInfo</lhs>
+<rhs><nt def="NT-S">S</nt> 'version' <nt def='NT-Eq'>Eq</nt>
+('"<nt def="NT-VersionNum">VersionNum</nt>"'
+| "'<nt def="NT-VersionNum">VersionNum</nt>'")</rhs>
+</prod>
+<prod id='NT-Eq'><lhs>Eq</lhs>
+<rhs><nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>?</rhs></prod>
+<prod id="NT-VersionNum">
+<lhs>VersionNum</lhs>
+<rhs>([a-zA-Z0-9_.:] | '-')+</rhs>
+</prod>
+<prod id='NT-Misc'><lhs>Misc</lhs>
+<rhs><nt def='NT-Comment'>Comment</nt> | <nt def='NT-PI'>PI</nt> |
+<nt def='NT-S'>S</nt></rhs></prod>
+</prodgroup>
+</scrap></p>
+
+<p>
+例えば,次に示す完全なXML文書は,<termref def="dt-wellformed">&well-formed;</termref>であるが<termref def="dt-valid">&valid;</termref>ではない。
+<eg><![CDATA[<?xml version="1.0"?>
+<greeting>Hello, world!</greeting>
+]]></eg>
+次の文書も同様とする。
+<eg><![CDATA[<greeting>Hello, world!</greeting>
+]]></eg>
+</p>
+<p><termdef id="dt-doctype" term="Document Type Declaration">
+XMLの<term>文書型宣言</term>は,ある文書クラスのための文法を提供する<termref def='dt-markupdecl'>&markup;宣言</termref>を含むか,又は参照する。この文法を,文書型定義又は<term>DTD</term>という。文書型宣言は,&markup;宣言を含んだ外部&subset;(特別な種類の<termref def='dt-extent'>外部実体</termref>)を参照でき,又は内部&subset;に直接&markup;宣言を含むこともできる。さらに,その両方も可能とする。ある文書のDTDは,両方の&subset;をまとめたものとして構成する。</termdef>
+</p>
+<p><termdef id="dt-markupdecl" term="markup declaration">
+<term>&markup;宣言</term>は,<termref def="dt-eldecl">要素型宣言</termref>, <termref def="dt-attdecl">属性リスト宣言</termref>,<termref def="dt-entdecl">実体宣言</termref>又は<termref def="dt-notdecl">記法宣言</termref>とする。</termdef>次に示す&well-formed;制約及び&validity;制約に規定するが,これらの宣言は,<termref def='dt-PE'>&parameter;実体</termref>内に全体又は一部が含まれてもよい。詳しい規定は,<titleref xml-link="simple" href="sec-physical-struct">物理構造</titleref>に関する規定を参照のこと。</p>
+<scrap lang="ebnf" id='dtd'>
+<head>文書型定義</head>
+<prodgroup pcw2="6" pcw4="17.5" pcw5="9">
+<prod id='NT-doctypedecl'><lhs>doctypedecl</lhs>
+<rhs>'&lt;!DOCTYPE' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt>
+<nt def='NT-ExternalID'>ExternalID</nt>)?
+<nt def='NT-S'>S</nt>? ('['
+(<nt def='NT-markupdecl'>markupdecl</nt>
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-S'>S</nt>)*
+']'
+<nt def='NT-S'>S</nt>?)? '>'</rhs>
+<vc def="vc-roottype"/>
+<!--<vc def="vc-nonnullDTD"/>-->
+</prod>
+<!--
+<prod id='NT-markupdecls'><lhs>markupdecls</lhs>
+<rhs>
+(<nt def='NT-S'>S</nt>?
+<nt def='NT-markupdecl'>markupdecl</nt>
+<nt def='NT-S'>S</nt>?)*
+</rhs></prod>
+-->
+<prod id='NT-markupdecl'><lhs>markupdecl</lhs>
+<rhs><nt def='NT-elementdecl'>elementdecl</nt>
+| <nt def='NT-AttlistDecl'>AttlistDecl</nt>
+| <nt def='NT-EntityDecl'>EntityDecl</nt>
+| <nt def='NT-NotationDecl'>NotationDecl</nt>
+| <nt def='NT-PI'>PI</nt>
+| <nt def='NT-Comment'>Comment</nt>
+<!--| <nt def='NT-InternalPERef'>InternalPERef</nt> --></rhs>
+<vc def='vc-PEinMarkupDecl'/>
+<wfc def="wfc-PEinInternalSubset"/>
+</prod>
+<!--
+<prod id="NT-InternalPERef"><lhs>InternalPERef</lhs>
+<rhs><nt def="NT-PEReference">PEReference</nt></rhs>
+<wfc def="wfc-integraldec"/>
+</prod>
+-->
+</prodgroup>
+</scrap>
+<vcnote id="vc-roottype">
+<head>&root;要素型</head>
+<p>
+文書型宣言における<nt def='NT-Name'>Name</nt>は,&root;要素の型と&match;しなければならない。
+</p>
+</vcnote>
+<!--
+<vcnote id="vc-nonnullDTD">
+<head>Non-null DTD</head>
+<p>
+The internal and external subsets of the DTD must not both
+be empty.
+</p>
+</vcnote>
+-->
+<vcnote id='vc-PEinMarkupDecl'>
+<head>宣言及び&parameter;実体が厳密に入れ子をなすこと</head>
+<p>&parameter;実体<termref def='dt-repltext'>の&replacement-text;</termref>は,&markup;宣言内において,厳密に入れ子になっていなければならない。つまり,&markup;宣言(<nt def='NT-markupdecl'>markupdecl</nt>)の最初又は最後の文字が,<termref def='dt-PERef'>&parameter;実体参照</termref>の対象となる&replacement-text;に含まれれば,両方とも同じ&replacement-text;に含まれなければならない。</p>
+</vcnote>
+<wfcnote id="wfc-PEinInternalSubset">
+<head>内部&subset;内の&parameter;実体</head>
+<p>DTDの内部&subset;では,<termref def='dt-PERef'>&parameter;実体参照</termref>は,&markup;宣言が出現可能な場所だけに出現できる。&markup;宣言内には出現できない(この制約は,外部&parameter;実体又は外部&subset;での参照には適用しない。)。
+</p>
+</wfcnote>
+<p>
+内部&subset;のときと同様に,外部&subset;及びDTDにおいて参照する任意の外部&parameter;実体は,非終端記号<nt def="NT-markupdecl">markupdecl</nt>によって許される型の,一連の完全な&markup;宣言で構成されなければならない。&markup;宣言の間には,空白又は<termref def="dt-PERef">&parameter;実体参照</termref>を置いてもよい。しかし,外部&subset;又は外部&parameter;実体の内容の一部は,<termref def="dt-cond-section">条件付きセクション</termref>を使用して無視してもよい。内部サブセットでは,これは許されない。
+<!--In the external subset, however, parameter-entity references can
+be used to replace constructs prefixed by "<code>%</code>" in a production of
+the grammar, and <termref def="dt-cond-section">conditional sections</termref>
+may occur.
+In the internal subset, by contrast, conditional sections may not
+occur and the only parameter-entity references
+allowed are those which match the non-terminal
+<nt def="NT-InternalPERef">InternalPERef</nt>
+within the rule for <nt def="NT-doctypedecl">markupdecl</nt>.
+-->
+<scrap id="ext-Subset">
+<head>外部&subset;</head>
+<prodgroup pcw2="6" pcw4="17.5" pcw5="9">
+<prod id='NT-extSubset'><lhs>extSubset</lhs>
+<rhs>(
+<nt def='NT-markupdecl'>markupdecl</nt>
+| <nt def='NT-conditionalSect'>conditionalSect</nt>
+| <nt def='NT-PEReference'>PEReference</nt>
+| <nt def='NT-S'>S</nt>
+)*</rhs>
+</prod>
+</prodgroup>
+</scrap></p>
+<p>外部&subset;及び外部&parameter;実体は,その内では,&parameter;実体が&markup;宣言の<emph>間</emph>だけでなく,&markup;宣言の<emph>内</emph>でも認識される,という点でも内部&subset;とは異なる。
+</p>
+<p>文書型宣言付きのXML文書の例を,次に示す。
+<eg><![CDATA[<?xml version="1.0"?>
+<!DOCTYPE greeting SYSTEM "hello.dtd">
+<greeting>Hello, world!</greeting>
+]]></eg>
+<termref def="dt-sysid">システム&identifier;</termref> "<code>hello.dtd</code>"が,文書のDTDのURIとなる。</p>
+<p>次の例のとおり,宣言を局所的に与えることもできる。
+<eg><![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE greeting [
+ <!ELEMENT greeting (#PCDATA)>
+]>
+<greeting>Hello, world!</greeting>
+]]></eg>
+外部&subset;及び内部&subset;の両方を使用するときは,内部&subset;が外部&subset;より先に出現したと見なす。<!--* 'is considered to'? boo. whazzat mean? -->これは,内部&subset;の実体及び属性リスト宣言が,外部&subset;の実体及び属性リスト宣言より優先するという効果をもたらす。
+</p>
+</div2>
+
+<div2 id='sec-rmd'>
+<head>&standalone;文書宣言</head>
+<p><termref def="dt-xml-proc">XML&processor;</termref>は,&application;に文書の内容を渡すが,&markup;宣言は,この内容に影響を与えることがある。属性の&default-value;及び実体宣言をその例とする。XML宣言の一部分として出現できる&standalone;文書宣言は,文書が,その&markup;宣言の存在によって影響されないことを指し示す(普通,その&markup;宣言が存在しないために,これがいえる。)。
+<scrap lang="ebnf" id='fulldtd'>
+<head>&standalone;文書宣言</head>
+<prodgroup pcw2="4" pcw4="19.5" pcw5="9">
+<prod id='NT-SDDecl'><lhs>SDDecl</lhs>
+<rhs>
+<nt def="NT-S">S</nt>
+'standalone' <nt def='NT-Eq'>Eq</nt> "'" ('yes' | 'no') "'"
+</rhs>
+<rhs>
+| <nt def="NT-S">S</nt>
+'standalone' <nt def='NT-Eq'>Eq</nt> '"' ('yes' | 'no') '"'
+</rhs><vc def='vc-check-rmd'/></prod>
+</prodgroup>
+</scrap></p>
+<p>&standalone;文書宣言においては, "<code>yes</code>"の値は,<termref def='dt-docent'>文書実体</termref>の外部に(DTDの外部&subset;内に,又は内部&subset;から参照される外部パラメタ実体内に),XML&processor;から&application;へと渡される情報に影響する&markup;宣言が存在しないことを意味する。"<code>no</code>"の値は,その外部&markup;宣言が存在するか,又は存在する可能性があることを意味する。&standalone;文書宣言は,その<emph>宣言</emph>が文書外部に存在するかどうかを示すだけに注意すること。外部実体への参照が文書内に存在していても,その実体が内部的に宣言されているときは,文書の&standalone;の状態には影響を与えない。</p>
+
+<p>外部に&markup;宣言が存在しなければ,&standalone;文書宣言は意味をもたない。外部に&markup;宣言が存在し,&standalone;文書宣言が存在しない場合は,<code>"no"</code> の値の設定を仮定する。</p>
+<p>XML文書で <code>standalone="no"</code> が設定されているものは,あるアルゴリズムで&standalone;文書に変換でき,この文書は,ネットワーク配信&application;にとって望ましいかもしれない。</p>
+<vcnote id='vc-check-rmd'>
+<head>&standalone;文書宣言</head>
+<p>&standalone;文書宣言は,何らかの外部&markup;宣言が次のいずれかを宣言しているときは,値 "<code>no</code>" を取らなければならない。
+<ulist>
+<item><p>a) <termref def="dt-default">&default;</termref>値付きの属性であって,この属性が適用される要素が,属性値を指定せずに文書内に現れるもの。</p></item>
+<item><p>b) &magicents;以外の実体であって,その実体に対する<termref def="dt-entref">参照</termref>が文書内に出現するもの。</p>
+</item>
+<item><p>c) 値が<titleref href='AVNormalize'>正規化</titleref>の対象となる属性であって,正規化の結果として変化する値が文書内で属性に指定されるもの。</p></item>
+<item>
+<p>d) <termref def="dt-elemcontent">要素内容</termref>をもつ要素型であって,空白がその要素型のいずれかのインスタンス内に直接現れるもの。
+</p></item>
+</ulist>
+</p>
+</vcnote>
+<p>&standalone;文書宣言付きのXML宣言の例を,次に示す。
+<eg>&lt;?xml version="&XML.version;" standalone='yes'?></eg></p>
+</div2>
+<div2 id='sec-white-space'>
+<head>空白の取扱い</head>
+<p>XML文書を編集するときは,&markup;を目立たせ読みやすくするために,“空白”(&space;,タブ及び空白行。この&TR-or-Rec;では,非終端記号の<nt def='NT-S'>S</nt>で表す)を使うと便利なことが多い。その空白は,配布する&version;の文書の一部として含めることを意図しないのを普通とする。しかし,“意味のある”空白であって,配布する&version;に残さなければならないものも多い。例えば,詩及びソースコードにおける空白がある。</p>
+<p><termref def='dt-xml-proc'>XML&processor;</termref>は,文書内の&markup;以外のすべての文字を,そのまま変更せずに&application;に渡さなければならない。<termref def='dt-validating'>&validating;XML&processor;</termref>は,<termref def="dt-elemcontent">要素内容</termref>の中の空白を他の非&markup;文字から区別し,&application;側に要素内容の中の空白が重要でないということを伝えなければならない。</p>
+<p>
+"<code>xml:space</code>"という特別な<termref def='dt-attr'>属性</termref>を文書に挿入することによって,空白を重要とする意図を示してもよい。この属性を適用する要素に現れる空白を,アプリケーションが重要なものとして扱うことを要求する,という意図を示す。</p>
+<p>&valid;な文書では,この属性を使用する場合は,他の属性と同じように<termref def="dt-attdecl">宣言</termref>しなければならない。宣言するときは,取り得る値を"<code>default</code>"及び "<code>preserve</code>"だけとする<termref def='dt-enumerated'>列挙型</termref>でなければならない。
+</p>
+<p>値"<code>default</code>"は,&application;の&default;の空白処理モードを,その要素に適用可能とすることを意味する。値"<code>preserve</code>"は,&application;がすべての空白を保存することを意味する。この宣言の意図は,"<code>xml:space</code>" 属性の別の指定で上書きしない限り,要素の内容に現れるすべての要素に適用すると解釈する。</p>
+<p>文書の<termref def='dt-root'>&root;要素</termref>については,この属性の値を指定するか,又はこの属性の&default-value;がある場合を除いては,&application;による空白の取扱いについて,いかなる意図も示さないと解釈する。</p>
+<p>例を次に示す。
+<eg><![CDATA[ <!ATTLIST poem xml:space (default|preserve) 'preserve'>]]></eg>
+</p>
+</div2>
+<div2 id='sec-line-ends'>
+<head>行末の取扱い</head>
+<p>XMLの<termref def='dt-parsedent'>構文&parsed-entity;</termref>は,通常コンピュータのファイル内に保存され,編集の便宜のために複数の行に分けることが多い。これらの行は,普通は,<code>CR</code> (#xD)コード及び <code>LF</code> (#xA)コードの何らかの組合せによって分けられる。</p>
+<p><termref def='dt-app'>&application;</termref>の処理を簡単にするため,外部&parsed-entity;又は内部&parsed-entity;の&literal;実体値が,"<code>#xD#xA</code>" の2文字の連続とする&literal;又は<code>#xD</code>の単独の&literal;を含む場合に,<termref def='dt-xml-proc'>XML&processor;</termref>は,&application;に単一の文字<code>#xA</code>だけを渡さなければならない(この処理は,入力内に存在する改行コードを構文解析の前に正規化することによって,容易に実現できる。)。</p>
+</div2>
+<div2 id='sec-lang-tag'>
+<head>&language-identification;</head>
+<p>文書処理においては,その文書の中身がどんな自然言語又は形式言語で書かれているか明示することが,役に立つことが多い。<!--ここで使用する“言語”という言葉の意味は,"Espa&#x00F1;ol" 及び"EBNF"の双方で例示される意味とする。--><!-- x00F1: spanish's small ntilde--></p>
+<!--; この情報は(例をあげれば)文書の文字の表示,並びに情報抽出のための語幹・形態素解析及びテキストブロックの整形に影響を及ぼす可能性がある。-->
+<p>XML文書内の要素のもつ内容又は属性値において使用する<!--自然又は形式-->言語を指定するために,"<code>xml:lang</code>" という名前の特別な<termref def="dt-attr">属性</termref>を,文書内に挿入してもよい。
+<!--; この属性はXML規定の一部として,複数のXML&application;の相互運用性を高めるために定義する。-->
+属性の値は,<bibref ref="RFC1766"/>“RFC1766:&language-identification;のためのタグ”によって規定される&language-identification;コードに従う。
+<scrap lang='ebnf'>
+<head>&language-identification;</head>
+<prod id='NT-LanguageID'><lhs>LanguageID</lhs>
+<rhs><nt def='NT-Langcode'>Langcode</nt>
+('-' <nt def='NT-Subcode'>Subcode</nt>)*</rhs></prod>
+<prod id='NT-Langcode'><lhs>Langcode</lhs>
+<rhs><nt def='NT-ISO639Code'>ISO639Code</nt> |
+<nt def='NT-IanaCode'>IanaCode</nt> |
+<nt def='NT-UserCode'>UserCode</nt></rhs>
+</prod>
+<prod id='NT-ISO639Code'><lhs>ISO639Code</lhs>
+<rhs>([a-z] | [A-Z]) ([a-z] | [A-Z])</rhs></prod>
+<prod id='NT-IanaCode'><lhs>IanaCode</lhs>
+<rhs>('i' | 'I') '-' ([a-z] | [A-Z])+</rhs></prod>
+<prod id='NT-UserCode'><lhs>UserCode</lhs>
+<rhs>('x' | 'X') '-' ([a-z] | [A-Z])+</rhs></prod>
+<prod id='NT-Subcode'><lhs>Subcode</lhs>
+<rhs>([a-z] | [A-Z])+</rhs></prod>
+</scrap>
+<nt def='NT-Langcode'>Langcode</nt>は,次のどれでもよい。
+<ulist>
+<item><p>a) <bibref ref="ISO639"/>“言語の名前表現のためのコード”で規定される2文字の&language-code;</p></item>
+<item><p>b) Internet Assigned Numbers Authority (IANA)で登録されている&language-code;。これは,先頭が "<code>i-</code>" (又は"<code>I-</code>")で始まる。</p></item>
+<item><p>c) &user;によって定められた&language-code;,又は私的な使用のために複数の団体間が取り決めたコード。これらは,今後IANAにおいて標準化又は登録されるコードとの競合を避けるために,先頭を"<code>x-</code>" 又は "<code>X-</code>" で始める。</p></item>
+</ulist></p>
+<p><nt def='NT-Subcode'>Subcode</nt>は,複数回使ってもよい。最初のサブコードが存在し,その内容が二つの文字から成るときは,<bibref ref="ISO3166"/>ISO3166の“国名を表すコード(国コード)”でなければならない。最初のサブコードが3文字以上から成るときは,<nt def='NT-Langcode'>Langcode</nt>の先頭が,"<code>x-</code>" 又は "<code>X-</code>"で始まらない限り,指定した言語に対するサブコードとし,IANAに登録されたものでなければならない。</p>
+<p>&language-code;は,小文字での表記を,&country-code;は,(存在するならば)大文字での表記を慣行とする。しかし,XML文書内における他の名前とは異なり,これらの値については,大文字及び小文字の区別をしないことに注意すること。</p>
+<p>例を次に示す。
+<eg><![CDATA[<p xml:lang="en">The quick brown fox jumps over the lazy dog.</p>
+<p xml:lang="en-GB">What colour is it?</p>
+<p xml:lang="en-US">What color is it?</p>
+<sp who="Faust" desc='leise' xml:lang="de">
+ <l>Habe nun, ach! Philosophie,</l>
+ <l>Juristerei, und Medizin</l>
+ <l>und leider auch Theologie</l>
+ <l>]]><!-- x00DF german's es-zet; x00FC german's u-umlaut -->durchaus studiert mit hei&#223;em Bem&#252;h'n.<![CDATA[</l>
+ </sp>]]></eg></p>
+<!--<p>xml:lang の値は,要素の内容及び(属性の&default-value;で定めない限り)フリーテキスト(CDATA)の値をもつその要素へのすべての属性の値について,その両方に適用する。-->
+<p><code>xml:lang</code>で宣言する意図は,<code>xml:lang</code>の別の指定で上書しない限り,指定した要素の内容に含むすべての要素に適用する。</p>
+<!--ある要素における xml:lang 属性の値が定められておらず,DTDにおいてその&default-value;が定められていない場合,その要素のxml:lang 属性の値は,親要素での値が存在する場合は,それを引き継ぐ。 次の例における二つの<term>という名前の専門用語を表す要素は,xml:langの値に関しては,実際上,同じ値をもつ。
+
+ <p xml:lang="en">Here the keywords are
+ <term xml:lang="en">shift</term> and
+ <term>reduce</term>. ...</p>
+
+XML&processor;ではなく&application;が,この属性値の継承について責任をもつ。
+-->
+<p>
+&valid;な文書においては,この&TR-or-Rec;の他の場所で規定するとおり,この属性を必ず宣言しなければならない。通常,宣言は,次の形とする。
+<eg>xml:lang NMTOKEN #IMPLIED</eg>
+必要ならば,特定の&default-value;を与えてもよい。英語を母語とする学生用のフランス語の詩集では,説明及び注を英語で記述すれば,xml:lang 属性を次のとおりに宣言することとなる。
+<eg><![CDATA[ <!ATTLIST poem xml:lang NMTOKEN 'fr'>
+ <!ATTLIST gloss xml:lang NMTOKEN 'en'>
+ <!ATTLIST note xml:lang NMTOKEN 'en'>]]></eg>
+</p>
+<!--
+DTDの設計者は,スクリプトを言語(及びその派生体)に包摂して扱うのではなく,スクリプト及び言語を同次元で扱うのが適当な場合,言語属性と同様にスクリプト属性が存在すれば有用だと思うかもしれない。リンク要素において,参照された又はリンクされたリソースにおける(主要な)言語(場合によっては複数)を表す要素を定義するのも望ましい。しかし,これらの&application;は,この&TR-or-Rec;が規定する範囲外とする。-->
+</div2>
+</div1>
+<!-- &Elements; -->
+
+<div1 id='sec-logical-struct'>
+<head>論理構造</head>
+
+<p><termdef id="dt-element" term="Element">いかなる<termref def="dt-xml-doc">XML文書</termref>も,一つ以上の<term>要素</term>を含む。要素の境界は, <termref def="dt-stag">開始タグ</termref>及び<termref def="dt-etag">終了タグ</termref>によって区切る。要素が<termref def="dt-empty">空</termref>要素のときは,<termref def="dt-eetag">空要素タグ</termref>で示す。各々の要素は,型をもつ。要素型は名前(共通&identifier;(generic identifier)又はGIと呼ぶことがある。)によって&identified;。要素は,いくつかの属性をもつことができる。</termdef>属性は,<termref def="dt-attrname">名前</termref>及び<termref def="dt-attrval">値</termref>をもつ。</p>
+
+<scrap lang='ebnf'><head>要素</head>
+<prod id='NT-element'><lhs>element</lhs>
+<rhs><nt def='NT-EmptyElemTag'>EmptyElemTag</nt></rhs>
+<rhs>| <nt def='NT-STag'>STag</nt> <nt def='NT-content'>content</nt>
+<nt def='NT-ETag'>ETag</nt></rhs><wfc def='GIMatch'/></prod>
+</scrap>
+<p>この&TR-or-Rec;は,要素型及び属性の意味,使用方法,又は(構文に関することを除き)名前に制約を与えない。ただし,先頭が<code>(('X'|'x')('M'|'m')('L'|'l'))</code>に&match;する名前は,この版又は今後の版のこの&TR-or-Rec;での標準化のために予約する。</p>
+
+<wfcnote id='GIMatch'><head>要素型の&match;</head>
+<p>要素の終了タグの<nt def='NT-Name'>名前</nt>は,その要素の開始タグにおける型と&match;しなければならない。</p>
+</wfcnote>
+
+<div2 id='sec-starttags'>
+<head>開始タグ,終了タグ及び空要素タグ</head>
+<p><termdef id="dt-stag" term="Start-Tag">空でない任意のXML要素の始まりは,<term>開始タグ</term>によって&markup;する。
+<scrap lang='ebnf'><head>開始タグ</head>
+<prodgroup pcw2="6" pcw4="15" pcw5="11.5">
+<prod id='NT-STag'><lhs>STag</lhs><rhs>'&lt;' <nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt> <nt def='NT-Attribute'>Attribute</nt>)* <nt def='NT-S'>S</nt>? '>'</rhs><wfc def="uniqattspec"/></prod>
+<prod id='NT-Attribute'><lhs>Attribute</lhs><rhs><nt def='NT-Name'>Name</nt> <nt def='NT-Eq'>Eq</nt> <nt def='NT-AttValue'>AttValue</nt></rhs><vc def='ValueType'/><wfc def='NoExternalRefs'/><wfc def='CleanAttrVals'/></prod>
+</prodgroup>
+</scrap>
+開始タグ及び終了タグ内の<nt def='NT-Name'>Name</nt>は,要素の<term>型</term>を表わす。</termdef><termdef id="dt-attr" term="Attribute"><nt def='NT-Name'>Name</nt>及び<nt def='NT-AttValue'>AttValue</nt>の対を要素の<term>属性指定</term>といい</termdef>,<termdef id="dt-attrname" term="Attribute Name">個々の対における<nt def='NT-Name'>Name</nt>は,<term>属性名</term></termdef>及び<termdef id="dt-attrval" term="Attribute Value"><nt def='NT-AttValue'>AttValue</nt>の内容(区切り子<code>'</code>又は<code>"</code>の間の&string;)を<term>属性値</term>という。</termdef></p>
+
+<wfcnote id='uniqattspec'><head>属性指定の一意性</head>
+<p>開始タグ又は空要素タグでは,同一の属性名が2度以上出現してはならない。</p></wfcnote>
+<vcnote id='ValueType'><head>属性値の型</head>
+<p>属性は宣言されていなければならない。属性値の型は,その属性に対して宣言した型でなければならない(属性の型については,<titleref href='AttDecls'>属性リスト宣言</titleref>についての規定を参照。)。</p></vcnote>
+<wfcnote id='NoExternalRefs'><head>外部実体への参照がないこと</head>
+<p>属性値には,外部実体への直接的又は間接的な参照を含むことはできない。</p></wfcnote>
+<wfcnote id='CleanAttrVals'><head>属性値に<code>&lt;</code>を含まないこと</head>
+<p>属性値内で直接的又は間接的に参照する実体(<code>&amp;lt;</code>を除く。)の<termref def='dt-repltext'>&replacement-text;</termref>には,<code>&lt;</code>を含んではならない。</p></wfcnote>
+
+<p>開始タグの例を,次に示す。
+<eg>&lt;termdef id="dt-dog" term="dog"></eg></p>
+<p><termdef id="dt-etag" term="End Tag">開始タグで始まる要素の終わりは,<term>終了タグ</term>で&markup;しなければならない。この終了タグは,対応する開始タグの要素型と同じ名前をもつ。
+<scrap lang='ebnf'><head>終了タグ</head><prodgroup pcw2="6" pcw4="15" pcw5="11.5"><prod id='NT-ETag'><lhs>ETag</lhs><rhs>'&lt;/' <nt def='NT-Name'>Name</nt> <nt def='NT-S'>S</nt>? '>'</rhs></prod></prodgroup></scrap></termdef></p>
+<p>終了タグの例を,次に示す。
+<eg>&lt;/termdef></eg></p>
+
+<p><termdef id="dt-content" term="Content">要素の開始タグと終了タグとの間の<termref def='dt-text'>テキスト</termref>を,その要素の<term>内容</term>という。
+<scrap lang='ebnf'><head>要素の内容</head>
+<prodgroup pcw2="6" pcw4="15" pcw5="11.5"><prod id='NT-content'><lhs>content</lhs><rhs>(<nt def='NT-element'>element</nt> | <nt def='NT-CharData'>CharData</nt> | <nt def='NT-Reference'>Reference</nt> | <nt def='NT-CDSect'>CDSect</nt> | <nt def='NT-PI'>PI</nt> | <nt def='NT-Comment'>Comment</nt>)*</rhs></prod></prodgroup></scrap></termdef></p>
+
+<p><termdef id="dt-empty" term="Empty">要素が<term>空</term>のとき,その要素は,直後に終了タグをもつ開始タグ又は空要素タグで表現しなければならない。</termdef><termdef id="dt-eetag" term="empty-element tag"><term>空要素タグ</term>は,次の特別な形式をとる。
+<scrap lang='ebnf'><head>空要素のためのタグ</head><prodgroup pcw2="6" pcw4="15" pcw5="11.5"><prod id='NT-EmptyElemTag'><lhs>EmptyElemTag</lhs><rhs>'&lt;' <nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt> <nt def='NT-Attribute'>Attribute</nt>)* <nt def='NT-S'>S</nt>? '/&gt;'</rhs><wfc def="uniqattspec"/></prod></prodgroup></scrap></termdef></p>
+
+<!-- 門馬:上の“空要素のためのタグ(tags for empty elements)”は“空要素タグ(empty-element tag)”とすべきだと思いますが,いかがでしょうか -->
+
+<p>空要素タグは,内容をもたない任意の要素の表現に利用できる。空要素タグで表現する要素を,キーワード<kw>EMPTY</kw>を用いて宣言しなくともよい。</p>
+<p>空要素の例を,次に示す。
+<eg>&lt;IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" />&lt;br>&lt;/br>&lt;br/></eg></p>
+</div2>
+
+<div2 id='elemdecls'><head>要素宣言</head>
+<p><termref def="dt-valid">&validity;</termref>を保証するため,要素宣言及び属性リスト宣言を用いて<termref def="dt-xml-doc">XML文書</termref>の<termref def="dt-element">要素</termref>の構造に,制約を加えることができる。</p>
+<p>要素宣言は,要素の<termref def="dt-content">内容</termref>についての制約とする。</p>
+<p>要素宣言は,要素の<termref def="dt-parentchild">子</termref>として出現可能な要素型について,制約を加えることが多い。&at-user-option;,要素宣言をもたない要素型が他の要素宣言によって参照されれば,XML&processor;は,警告を出してもよい。しかし,これは&error;とはしない。</p>
+
+<p><termdef id="dt-eldecl" term="Element Type declaration"><term>要素型宣言</term>は,次の形式をとる。
+<scrap lang='ebnf'><head>要素型宣言</head><prodgroup pcw2="5.5" pcw4="18" pcw5="9">
+<prod id='NT-elementdecl'><lhs>elementdecl</lhs>
+<rhs>'&lt;!ELEMENT' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>
+<nt def='NT-contentspec'>contentspec</nt>
+<nt def='NT-S'>S</nt>? '>'</rhs>
+<vc def='EDUnique'/></prod>
+<prod id='NT-contentspec'><lhs>contentspec</lhs>
+<rhs>'EMPTY'
+| 'ANY'
+| <nt def='NT-Mixed'>Mixed</nt>
+| <nt def='NT-children'>children</nt>
+</rhs>
+<vc def='elementvalid'/>
+</prod>
+</prodgroup>
+</scrap>
+ここで,<nt def='NT-Name'>Name</nt>は,宣言されている要素の型とする。</termdef></p>
+
+<vcnote id='EDUnique'><head>要素宣言の一意性</head>
+<p>要素型を2度以上宣言できない。</p></vcnote>
+
+<vcnote id='elementvalid'><head>要素の&validity;</head>
+<p>要素が<!-- said to be -->&valid;とは,<nt def='NT-elementdecl'>elementdecl</nt>に&match;する宣言であって,その<nt def='NT-Name'>Name</nt>がその要素型と&match;し,次のいずれかの条件を満たす場合とする。<ulist>
+<item><p>a) 宣言が<kw>EMPTY</kw>に&match;し,要素が<termref def='dt-content'>内容</termref>をもたない。</p></item>
+<item><p>b) 宣言が<nt def='NT-children'>children</nt>に&match;し,要素の<termref def="dt-parentchild">子要素</termref>の並びが,内容モデルの正規表現によって生成される言語に属する。</p></item>
+<item><p>c) 宣言が<nt def='NT-Mixed'>mixed</nt>に&match;し,要素の内容が<termref def='dt-chardata'>文字データ</termref>及び<termref def='dt-parentchild'>子要素</termref>からなる。子要素の要素型は,要素の内容モデルに出現する名前に&match;する。</p></item>
+<item><p>d) 宣言が<kw>ANY</kw>に&match;し,どの<termref def='dt-parentchild'>子要素</termref>の要素型も宣言されている。</p></item></ulist>
+
+</p></vcnote>
+<!-- with the new VC, I don't think the next few paras add anything -TWB
+<p><termdef id="dt-model" term="content model">An element can declared using a <term>content model</term>, in which case its content can be categorized as <termref def="dt-elemcontent">element content</termref> or <termref def='dt-mixed'>mixed content</termref>, as explained below.</termdef></p>
+<p>An element whose type declared using the keyword <kw>EMPTY</kw> must be <termref def="dt-empty">empty</termref> and may be tagged using an <termref def="dt-eetag">empty-element tag</termref> when it appears in the document.</p>
+<p>If an element type is declared using the keyword <kw>ANY</kw>, then there are no validity constraints on its content: it may contain <termref def='dt-parentchild'>child elements</termref> of any type and number, interspersed with character data.</p> -->
+
+<p>要素宣言の例を,次に示す。
+<eg>
+&lt;!ELEMENT br EMPTY>
+&lt;!ELEMENT p (#PCDATA|emph)* >
+&lt;!ELEMENT %name.para; %content.para; >
+&lt;!ELEMENT container ANY>
+</eg></p>
+
+<div3 id='sec-element-content'><head>要素内容</head>
+
+<p><termdef id='dt-elemcontent' term='Element content'>ある型の要素が<termref def='dt-parentchild'>子</termref>要素だけを含む(文字データを含まない。)とき,その要素<termref def="dt-stag">型</termref>は,<term>要素内容</term>をもつ,という。</termdef>この場合,制約は,内容モデルを含む。内容モデルは,子要素の型及び子要素の出現順序を制御する簡単な文法とする。この文法は,&content-particle;(<nt def='NT-cp'>cp</nt>s)からなる。&content-particle;は,名前,&content-particle;の選択リスト又は&content-particle;の列リストから構成される。
+<scrap lang='ebnf'><head>要素内容モデル</head><prodgroup pcw2="5.5" pcw4="16" pcw5="11">
+<prod id='NT-children'><lhs>children</lhs><rhs>(<nt def='NT-choice'>choice</nt> | <nt def='NT-seq'>seq</nt>) ('?' | '*' | '+')?</rhs></prod><prod id='NT-cp'><lhs>cp</lhs><rhs>(<nt def='NT-Name'>Name</nt> | <nt def='NT-choice'>choice</nt> | <nt def='NT-seq'>seq</nt>) ('?' | '*' | '+')?</rhs></prod>
+<prod id='NT-choice'><lhs>choice</lhs><rhs>'(' <nt def='NT-S'>S</nt>? cp ( <nt def='NT-S'>S</nt>? '|' <nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> )*<nt def='NT-S'>S</nt>? ')'</rhs><vc def='vc-PEinGroup'/></prod>
+<prod id='NT-seq'><lhs>seq</lhs><rhs>'(' <nt def='NT-S'>S</nt>? cp ( <nt def='NT-S'>S</nt>? ',' <nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> )*<nt def='NT-S'>S</nt>? ')'</rhs><vc def='vc-PEinGroup'/></prod>
+<!-- <prod id='NT-cps'><lhs>cps</lhs><rhs><nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> <nt def='NT-S'>S</nt>?</rhs></prod>
+<prod id='NT-choice'><lhs>choice</lhs><rhs>'(' <nt def='NT-S'>S</nt>? <nt def='NT-ctokplus'>ctokplus</nt> (<nt def='NT-S'>S</nt>? '|' <nt def='NT-S'>S</nt>? <nt def='NT-ctoks'>ctoks</nt>)* <nt def='NT-S'>S</nt>? ')'</rhs></prod>
+<prod id="NT-ctokplus"><lhs>ctokplus</lhs><rhs><nt def="NT-cps">cps</nt>('|' <nt def="NT-cps">cps</nt>)+</rhs></prod>
+<prod id="NT-ctoks"><lhs>ctoks</lhs><rhs><nt def="NT-cps">cps</nt>('|' <nt def="NT-cps">cps</nt>)*</rhs></prod>
+<prod id='NT-seq'><lhs>seq</lhs><rhs>'(' <nt def='NT-S'>S</nt>?<nt def='NT-stoks'>stoks</nt> (<nt def='NT-S'>S</nt>? ',' <nt def='NT-S'>S</nt>? <nt def='NT-stoks'>stoks</nt>)*<nt def='NT-S'>S</nt>? ')'</rhs></prod>
+<prod id="NT-stoks"><lhs>stoks</lhs><rhs><nt def="NT-cps">cps</nt>(',' <nt def="NT-cps">cps</nt>)*</rhs></prod>
+-->
+</prodgroup></scrap>
+ここで,<nt def='NT-Name'>Name</nt>は,<termref def="dt-parentchild">子</termref>として出現してよい要素の型を示す。この文法で選択リストが現れる位置では,選択リスト内のいずれの&content-particle;も<termref def="dt-elemcontent">要素内容</termref>の中に現れてよい。列リストに現れる&content-particle;は,リストで指定する順番のとおりに,<termref def="dt-elemcontent">要素内容</termref>に現れなければならない。名前又はリストの後に出現するオプションの文字<!-- 門馬:characterを文字と訳しました -->は,リスト内の要素又は&content-particle;が,1回以上任意の回数(<code>+</code>),0回以上任意の回数(<code>*</code>)又は0回若しくは1回(<code>?</code>)出現可能なことを規定する。ここで示す構文及び意味は,この&TR-or-Rec;における生成規則で用いるものと同一とする。</p>
+
+<!-- 門馬:上の文では,“name又はlistの後に続く文字”が“listの出現を規定する”とあって,nameの出現を規定するとは書いてありません。修正が必要と考えます。 -->
+
+<p>要素の内容が内容モデルに&match;するのは,列,選択及び繰返し演算子にしたがって,内容の中の要素と内容モデル内の要素型とを&match;させながら,内容モデル内の一つのパスをたどれるときに限る。<termref def='dt-compat'>互換性のため</termref>,文書内の要素が,内容モデルにおける要素型の複数の出現位置と&match;することは,&error;とする。詳細な規定については,附属書の<titleref xml-link="simple" href="determinism">決定的内容モデル</titleref>の項を参照。
+<!-- appendix <specref ref="determinism"/>. -->
+<!-- appendix on deterministic content models. -->
+</p>
+
+<vcnote id='vc-PEinGroup'>
+<head>グループ及びパラメタ実体が厳密な入れ子をなしていること</head>
+<p>パラメタ実体の<termref def='dt-repltext'>&replacement-text;</termref>は,&parenthesis;で囲まれたグループによって,厳密な入れ子を構成しなければならない。つまり,<nt def='NT-choice'>選択</nt>,<nt def='NT-seq'>列</nt>又は<nt def='NT-Mixed'>混在</nt>部品に,&left-parenthesis;又は&right-parenthesis;のいずれか一方が<termref def='dt-PERef'>パラメタ実体</termref>の&replacement-text;に含れれば,他方も同じ&replacement-text;に含まれなければならない。</p>
+<p><termref def='dt-interop'>相互運用性のため</termref>,パラメタ実体参照が<nt def='NT-choice'>選択</nt>,<nt def='NT-seq'>列</nt>又は<nt def='NT-Mixed'>混在</nt>内容に含まれれば,その&replacement-text;は空でないことが望ましく,&replacement-text;の先頭及び末尾の空白でない文字は,コネクタ(<code>|</code>又は<code>,</code>)でない方がよい。
+</p>
+</vcnote>
+<p>要素内容モデルのいくつかの例を,次に示す。
+<eg>&lt;!ELEMENT spec (front, body, back?)>
+&lt;!ELEMENT div1 (head, (p | list | note)*, div2*)>
+&lt;!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*></eg></p>
+</div3>
+
+<div3 id='sec-mixed-content'>
+<head>&mixed-content;</head>
+
+<p><termdef id='dt-mixed' term='Mixed Content'>ある要素型の要素内に,<termref def="dt-parentchild">子</termref>要素に混在して文字データが含まれる可能性があるとき,その要素<termref def='dt-stag'>型</termref>は,<term>&mixed-content;</term>をもつという。</termdef>この場合,子要素の型についての制約が存在してもよい<!-- 門馬:“may be constrained”を単に「制約される」と訳しました。 -->が,子要素の順序又は出現回数についての制約はないとする。
+<scrap lang='ebnf'>
+<head>&mixed-content;宣言</head>
+<prodgroup pcw2="5.5" pcw4="16" pcw5="11">
+<prod id='NT-Mixed'><lhs>Mixed</lhs>
+<rhs>'(' <nt def='NT-S'>S</nt>?
+'#PCDATA'
+(<nt def='NT-S'>S</nt>?
+'|'
+<nt def='NT-S'>S</nt>?
+<nt def='NT-Name'>Name</nt>)*
+<nt def='NT-S'>S</nt>?
+')*' </rhs>
+<rhs>| '(' <nt def='NT-S'>S</nt>? '#PCDATA' <nt def='NT-S'>S</nt>? ')'
+</rhs><vc def='vc-PEinGroup'/>
+<vc def='vc-MixedChildrenUnique'/>
+</prod>
+<!--
+<prod id="NT-Mtoks"><lhs>Mtoks</lhs>
+<rhs><nt def="NT-Name">Name</nt>
+(<nt def='NT-S'>S</nt>?
+'|'
+<nt def='NT-S'>S</nt>?
+<nt def="NT-Name">Name</nt>)*
+</rhs>
+</prod>
+-->
+</prodgroup>
+</scrap>
+ここで,<nt def='NT-Name'>Name</nt>は,子として出現してもよい要素の型を示す。
+</p>
+
+<vcnote id='vc-MixedChildrenUnique'>
+<head>要素型の重複の禁止</head>
+<p>一つの&mixed-content;宣言内に,同じ名前が複数回出現してはならない。
+</p></vcnote>
+<p>&mixed-content;宣言の例を,次に示す。
+<eg>&lt;!ELEMENT p (#PCDATA|a|ul|b|i|em)*>
+&lt;!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >
+&lt;!ELEMENT b (#PCDATA)></eg></p>
+</div3>
+</div2>
+
+
+<div2 id='attdecls'>
+<head>属性リスト宣言</head>
+<p>
+<termref def="dt-attr">属性</termref>は,名前及び値の対を<termref def="dt-element">要素</termref>に関連付けるために用いる。属性指定は,<termref def="dt-stag">開始タグ</termref>又は<termref def="dt-eetag">空要素</termref>タグ内でだけ可能とする。したがって,属性を認識するための生成規則は,<titleref href='sec-starttags'>開始タグ</titleref>についての規定で示す。属性リスト宣言は,次の目的で用いる。
+<ulist>
+<item><p>a) ある要素型に適用する属性の集合を規定する。</p></item>
+<item><p>b) 属性への型制約を設定する。</p></item>
+<item><p>c) 属性の<termref def="dt-default">&default-value;</termref>を規定する。</p></item>
+</ulist>
+</p>
+<p>
+<termdef id="dt-attdecl" term="Attribute-List Declaration">
+<term>属性リスト宣言</term>は,ある要素型と関連付けられた各属性に対し,名前,データ型及び(存在すれば)&default-value;を規定する。
+<scrap lang='ebnf'>
+<head>属性リスト宣言</head>
+<prod id='NT-AttlistDecl'><lhs>AttlistDecl</lhs>
+<rhs>'&lt;!ATTLIST' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-AttDef'>AttDef</nt>*
+<nt def='NT-S'>S</nt>? '&gt;'</rhs>
+</prod>
+<prod id='NT-AttDef'><lhs>AttDef</lhs>
+<rhs><nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt> <nt def='NT-AttType'>AttType</nt>
+<nt def='NT-S'>S</nt> <nt def='NT-Default'>Default</nt></rhs>
+</prod>
+</scrap>
+
+<nt def='NT-AttlistDecl'>AttlistDecl</nt>規則に存在する<nt def="NT-Name">Name</nt>は,要素型の名前とする。&at-user-option;,宣言していない要素型に対し属性を宣言したならば,XML&processor;は,警告を出してもよい。しかし,これは&error;とはしない。
+<nt def='NT-AttDef'>AttDef</nt>規則における<nt def='NT-Name'>Name</nt>は,属性の名前とする。
+</termdef>
+</p>
+<p>
+ある要素に対して,複数の<nt def='NT-AttlistDecl'>AttlistDecl</nt>を与える場合,これらすべての内容はマージする。ある要素型の同じ属性に,複数の定義を与える場合には,最初の宣言を有効とし,他の宣言は無視する。<termref def='dt-interop'>相互運用性のために</termref>,DTDの作成者は,ある要素型には高々一つの属性リスト宣言しか与えない,ある属性名には高々一つの属性定義しか与えない,及びすべての属性リスト宣言には少なくとも一つの属性定義を与える,という選択をしてもよい。相互運用性のために,XML&processor;は,&at-user-option;,ある要素型に複数の属性リスト宣言を与えたり,ある属性に複数の属性定義を与えたりしたときに,警告を出してもよい。しかし,これは,&error;とはしない。
+</p>
+
+<div3 id='sec-attribute-types'>
+<head>属性の型</head>
+<p>
+XMLの属性の型は,3種類とする。これらは,&string;型,&token;化型及び列挙型とする。&string;型は,値として任意の&string;をとる。&token;化型は,次に示す字句及び意味に関する様々な制約をもつ。
+
+<scrap lang='ebnf'>
+<head>Attribute Types</head>
+<prodgroup pcw4="14" pcw5="11.5">
+<prod id='NT-AttType'><lhs>AttType</lhs>
+<rhs><nt def='NT-StringType'>StringType</nt>
+| <nt def='NT-TokenizedType'>TokenizedType</nt>
+| <nt def='NT-EnumeratedType'>EnumeratedType</nt>
+</rhs>
+</prod>
+<prod id='NT-StringType'><lhs>StringType</lhs>
+<rhs>'CDATA'</rhs>
+</prod>
+<prod id='NT-TokenizedType'><lhs>TokenizedType</lhs>
+<rhs>'ID'</rhs>
+<vc def='id'/>
+<vc def='one-id-per-el'/>
+<vc def='id-default'/>
+<rhs>| 'IDREF'</rhs>
+<vc def='idref'/>
+<rhs>| 'IDREFS'</rhs>
+<vc def='idref'/>
+<rhs>| 'ENTITY'</rhs>
+<vc def='entname'/>
+<rhs>| 'ENTITIES'</rhs>
+<vc def='entname'/>
+<rhs>| 'NMTOKEN'</rhs>
+<vc def='nmtok'/>
+<rhs>| 'NMTOKENS'</rhs>
+<vc def='nmtok'/></prod>
+</prodgroup>
+</scrap>
+</p>
+
+<vcnote id='id' >
+<head>ID</head>
+<p>
+この型の値は,生成規則<code>Name</code>に&match;しなければならない。一つのXML文書内では,一つの名前が,この型の値として複数回現れてはならない。つまり,IDの値は,要素を一意に&identify;しなければならない。
+</p>
+</vcnote>
+<vcnote id='one-id-per-el'>
+<head>1要素ごとに1ID</head>
+<p>
+要素型は,複数のID属性値をもってはならない。
+</p>
+</vcnote>
+<vcnote id='id-default'>
+<head>ID属性の&default;</head>
+<p>
+ID属性は,&default;として,<code>#IMPLIED</code>又は<code>#REQUIRED</code>を宣言しなければならない。
+</p>
+</vcnote>
+<vcnote id='idref'>
+<head>IDREF</head>
+<p>
+<kw>IDREF</kw>型の値は,生成規則<nt def="NT-Name">Name</nt>に&match;しなければならない。<kw>IDREFS</kw>型の値は,生成規則<nt def="NT-Names">Names</nt>に&match;しなければならない。各々の<nt def='NT-Name'>Name</nt>は,XML文書内に存在する要素のID属性の値と&match;しなければならない。つまり,<kw>IDREF</kw>の値は,あるID属性の値と&match;しなければならない。
+</p>
+</vcnote>
+<vcnote id='entname'>
+<head>実体名</head>
+<p>
+<kw>ENTITY</kw>型の値は,生成規則<nt def="NT-Name">Name</nt>に&match;しなければならない。<kw>ENTITIES</kw>型の値は,生成規則<nt def="NT-Names">Names</nt>に&match;しなければならない。各々の<nt def="NT-Name">Name</nt>は,<termref def="dt-doctype">DTD</termref>で宣言する<termref def="dt-unparsed">&unparsed-entity;</termref>と&match;しなければならない。
+</p>
+</vcnote>
+<vcnote id='nmtok'>
+<head>名前&token;</head>
+<p>
+<kw>NMTOKEN</kw>型の値は,非終端記号<termref def="NT-Nmtoken">Nmtoken</termref>と&match;する&string;から構成されなければならない。<kw>NMTOKENS</kw>型の値は,非終端記号<termref def="NT-Nmtokens">Nmtokens</termref>と&match;する&string;から構成されなければならない。
+</p>
+</vcnote>
+<p>
+XML&processor;は,&application;に属性値を渡す前に,<titleref href="AVNormalize">属性値の正規化</titleref>で規定するとおりに,属性値を正規化しなければならない。
+</p>
+<p>
+<termdef id='dt-enumerated' term='Enumerated Attribute Values'><term>列挙型の属性</term>は,宣言した値の一つを取ることができる。</termdef>列挙型には,2種類ある。
+
+<scrap lang='ebnf'>
+<head>列挙属性の型</head>
+<prod id='NT-EnumeratedType'><lhs>EnumeratedType</lhs>
+<rhs><nt def='NT-NotationType'>NotationType</nt>
+| <nt def='NT-Enumeration'>Enumeration</nt>
+</rhs></prod>
+<prod id='NT-NotationType'><lhs>NotationType</lhs>
+<rhs>'NOTATION'
+<nt def='NT-S'>S</nt>
+'('
+<nt def='NT-S'>S</nt>?
+<nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt>? '|' <nt def='NT-Name'>Name</nt>)*
+<nt def='NT-S'>S</nt>? ')'
+</rhs>
+<vc def='notatn' /></prod>
+<prod id='NT-Enumeration'><lhs>Enumeration</lhs>
+<rhs>'(' <nt def='NT-S'>S</nt>?
+<nt def='NT-Nmtoken'>Nmtoken</nt>
+(<nt def='NT-S'>S</nt>? '|'
+<nt def='NT-S'>S</nt>?
+<nt def='NT-Nmtoken'>Nmtoken</nt>)*
+<nt def='NT-S'>S</nt>?
+')'</rhs>
+<vc def='enum'/></prod>
+</scrap>
+</p>
+
+<vcnote id='notatn'>
+<head>記法属性</head>
+<p>この型の値は,宣言している<titleref href='Notations'>記法</titleref>の名前の一つと&match;しなければならない。つまり,宣言に存在する記法名は,すべて宣言されていなければならない。
+</p>
+</vcnote>
+<vcnote id='enum'>
+<head>列挙</head>
+<p>
+この型の値は,宣言に存在する<nt def='NT-Nmtoken'>Nmtoken</nt>&token;の一つと&match;しなければならない。
+</p>
+</vcnote>
+<p>
+<termref def='dt-interop'>相互運用性のため</termref>,同じ<nt def='NT-Nmtoken'>Nmtoken</nt>は,単一要素型の列挙型の属性として,複数回現れない方がよい。
+</p>
+</div3>
+
+<div3 id='sec-attr-defaults'>
+<head>属性の&default;</head>
+
+<p>
+<termref def="dt-attdecl">属性宣言</termref>は,属性の指定が必須かどうかについての情報を与える。必須でない場合には,文書内で属性を指定しないとき,XML&processor;の処理方法の情報も与える。
+
+<scrap lang='ebnf'>
+<head>属性の&default;</head>
+<prodgroup pcw4="14" pcw5="11.5">
+<prod id='NT-Default'><lhs>Default</lhs>
+<rhs>'#REQUIRED'
+|&nbsp;'#IMPLIED' </rhs>
+<rhs>| (('#FIXED' S)? <nt def='NT-AttValue'>AttValue</nt>)</rhs>
+<vc def='defattrvalid'/>
+<wfc def="CleanAttrVals"/>
+</prod>
+</prodgroup>
+</scrap>
+<!-- improved by bosak
+<scrap lang='ebnf'>
+<head>Attribute Defaults</head>
+<prod id='NT-Default'><lhs>Default</lhs>
+<rhs>'#REQUIRED'
+|&nbsp;'#IMPLIED' </rhs>
+<vc def='defattrvalid'/>
+<wfc def="CleanAttrVals"/>
+<rhs>| (('#FIXED' S)? <nt def='NT-AttValue'>AttValue</nt>)</rhs>
+</prod>
+</scrap>-->
+</p>
+
+<vcnote id='defattrvalid'>
+<head>属性&default;の正しさ</head>
+<p>
+宣言した&default-value;は,宣言した属性型の字句制約を満たさなければならない。
+</p>
+</vcnote>
+<p>
+<kw>#REQUIRED</kw>を指定したとき,この要素型の<termref def="dt-stag">開始タグ</termref>であって,この属性に値を与えないものをXML&processor;が見つけたならば,その文書は<termref def="dt-valid">&valid;</termref>とはしない。<kw>#IMPLIED</kw>を指定したとき,この属性を省略したら,XML&processor;は,属性値を指定しないことをアプリケーションに伝えなければならない。このとき,&application;の振舞いについての制約はない。
+</p>
+<p>
+<termdef id="dt-default" term="Attribute Default">
+属性が<kw>#REQUIRED</kw>でも<kw>#IMPLIED</kw>でもないときには,<nt def='NT-AttValue'>AttValue</nt>の値が,<term>&default-value;</term>となる。<kw>#FIXED</kw>の場合,&default-value;と異なる値が指定されれば,その文書は,<termref def="dt-valid">&valid;</termref>としない。&default-value;を宣言している場合,この属性の省略を見つけたら,宣言した&default-value;を属性値に指定しているとして,XML&processor;は振る舞うことが望ましい。
+</termdef></p>
+
+<p>属性リスト宣言の例を,次に示す。
+
+<eg>&lt;!ATTLIST termdef
+ id ID #REQUIRED
+ name CDATA #IMPLIED>
+&lt;!ATTLIST list
+ type (bullets|ordered|glossary) "ordered">
+&lt;!ATTLIST form
+ method CDATA #FIXED "POST"></eg></p>
+</div3>
+
+<div3 id='AVNormalize'>
+<head>属性値の正規化</head>
+<p>
+XML&processor;は,属性値を&application;に渡す前に,次のとおりに正規化しなければならない。
+
+<ulist>
+<item>
+<p>a) まず,属性値及びその中の実体内で,行末又は行境界(又はシステムによってはレコード境界)として使われる&string;を,&space-character;(#x20)一つに置き換えなければならない(「<titleref xml-link="simple" href="sec-line-ends">行末の扱い</titleref>」も参照のこと。)。
+</p></item>
+<item>
+<p>b) 次に,文字参照及び内部&parsed-entity;への参照は,展開しなければならない。外部実体への参照は,&error;とする。
+</p></item>
+<item>
+<p>c) 最後に,属性の型が<kw>CDATA</kw>でなければ,空白&string;は,すべて&space-character;(#x20)一つに正規化し,残りの空白文字は,削除しなければならない。
+</p></item>
+</ulist>
+
+&non-validating;&parser;は,宣言が見つからない属性は,すべて,<kw>CDATA</kw>を宣言しているとして扱うことが望ましい。</p>
+</div3>
+</div2>
+
+<div2 id='sec-condition-sect'>
+<head>条件付きセクション</head>
+<p>
+<termdef id='dt-cond-section' term='conditional section'>
+<term>条件付きセクション</term>とは,<termref def='dt-doctype'>文書型宣言の外部&subset;</termref>の一部とし,制御キーワードの指定によって,DTDの論理構造に含めたり,除いたりする部分とする。
+</termdef>
+
+<scrap lang='ebnf'>
+<head>条件付きセクション</head>
+<prodgroup pcw2="9" pcw4="14.5">
+<prod id='NT-conditionalSect'><lhs>conditionalSect</lhs>
+<rhs><nt def='NT-includeSect'>includeSect</nt>
+| <nt def='NT-ignoreSect'>ignoreSect</nt>
+</rhs>
+</prod>
+<prod id='NT-includeSect'><lhs>includeSect</lhs>
+<rhs>'&lt;![' S? 'INCLUDE' S? '['
+<!-- (<nt def='NT-markupdecl'>markupdecl</nt>
+ | <nt def="NT-conditionalSect">conditionalSect</nt>
+ | <nt def="NT-S">S</nt>)*
+-->
+<nt def="NT-extSubset">extSubset</nt>
+']]&gt;'
+</rhs>
+</prod>
+<prod id='NT-ignoreSect'><lhs>ignoreSect</lhs>
+<rhs>'&lt;![' S? 'IGNORE' S? '['
+<nt def="NT-ignoreSectContents">ignoreSectContents</nt>*
+']]&gt;'</rhs>
+</prod>
+<prod id='NT-ignoreSectContents'><lhs>ignoreSectContents</lhs>
+<rhs><nt def='NT-Ignore'>Ignore</nt>
+('&lt;![' <nt def='NT-ignoreSectContents'>ignoreSectContents</nt>
+']]&gt;'
+<nt def='NT-Ignore'>Ignore</nt>)*</rhs></prod>
+<prod id='NT-Ignore'><lhs>Ignore</lhs>
+<rhs><nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* ('&lt;![' | ']]&gt;')
+<nt def='NT-Char'>Char</nt>*)
+</rhs></prod>
+<!--<rhs>
+((<nt def='NT-SkipLit'>SkipLit</nt>
+| <nt def='NT-Comment'>Comment</nt>
+| <nt def='NT-PI'>PI</nt>) -
+(<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-Char'>Char</nt>*))
+| ('&lt;![' <nt def='NT-ignoreSectContents'>ignoreSectContents</nt>*
+']]&gt;')
+</rhs>
+<rhs>
+| (<nt def='NT-Char'>Char</nt> - (']' | [&lt;'"]))
+</rhs>
+<rhs>
+| ('&lt;!' (<nt def='NT-Char'>Char</nt> - ('-' | '[')))
+</rhs>-->
+</prodgroup>
+</scrap>
+</p>
+
+<p>条件付きセクションは,DTDの内部&subset;及び外部&subset;と同様に,完全な宣言,コメント又は入れ子になった条件付きセクションを,いくつか含んでよい。これらの間に,空白が現れてもよい。
+</p>
+<p>
+条件付きセクションのキーワードが<code>INCLUDE</code>ならば,XML&processor;は,この条件付きセクションの内容を,文書の一部として扱わなければならない。条件付きセクションのキーワードが<code>IGNORE</code>ならば,その条件付きセクションの内容は,文書の一部として扱わない。構文解析を正しく行うためには,無視する条件付きセクション(IGNORE)に関しても,内容を読まなければならないことに注意すること。これは,入れ子になった条件付きセクションを見つけ,(無視する)最も外側の条件付きセクションを正しく検出するためとする。キーワードを<code>INCLUDE</code>とする小さな条件付きセクションが,キーワードを<code>IGNORE</code>とするより大きな条件付きセクションに含まれるならば,外側及び内側の条件付きセクションの両方とも無視する。
+</p>
+<p>
+条件付きセクションのキーワードがパラメタ実体参照ならば,XML&processor;は条件付きセクションの扱いを判断する前に,このパラメタ実体を展開しなければならない。
+</p>
+
+<p>例を次に示す。
+
+<eg>&lt;!ENTITY % draft 'INCLUDE' >
+&lt;!ENTITY % final 'IGNORE' >
+
+&lt;![%draft;[
+&lt;!ELEMENT book (comments*, title, body, supplements?)>
+]]&gt;
+&lt;![%final;[
+&lt;!ELEMENT book (title, body, supplements?)>
+]]&gt;
+</eg>
+</p>
+</div2>
+<!--
+<div2 id='sec-pass-to-app'>
+<head>XML Processor Treatment of Logical Structure</head>
+<p>When an XML processor encounters a start-tag, it must make
+at least the following information available to the application:
+<ulist>
+<item>
+<p>the element type's generic identifier</p>
+</item>
+<item>
+<p>the names of attributes known to apply to this element type
+(validating processors must make available names of all attributes
+declared for the element type; non-validating processors must
+make available at least the names of the attributes for which
+values are specified.
+</p>
+</item>
+</ulist>
+</p>
+</div2>
+-->
+
+</div1>
+<!-- &Entities; -->
+
+<div1 id='sec-physical-struct'>
+<head>物理構造</head>
+
+<p>
+<termdef id="dt-entity" term="Entity">
+XML文書は,一つ以上の記憶単位から構成する。この記憶単位を,<term>実体</term>という。実体は,<term>内容</term>をもち,文書実体(以降参照)及び<termref def='dt-doctype'>外部DTD&subset;</termref>を除いて,<term>名前</term>で&identified;。
+</termdef>
+
+<!-- Added for CFG -->
+<!-- obscurity amputated by TWB -->
+<!-- entire sentence amputated by CMSMcQ: no one but NO ONE is
+ready for entities declared as
+<!ENTITY foo "http://www.foo.com/bar.xml#id">
+and it's pointless to suggest that it's possible
+under current circumstances. -->
+<!-- An entity may be stored in, -->
+<!--but need not be coterminous with, -->
+<!-- but need not comprise the whole of, -->
+<!-- a single physical storage object such as a file or -->
+<!-- database field. -->
+<!-- End sentence added for CFG -->各XML文書は,<termref def="dt-docent">文書実体</termref>と呼ぶ実体を一つもつ。<termref def="dt-xml-proc">XML&processor;</termref>は,この文書実体から処理を開始する。文書実体が,文書のすべてを含んでもよい。</p>
+
+<p>実体は,&parsed-entity;又は&unparsed-entity;とする。<termdef id="dt-parsedent" term="Text Entity"><term>&parsed-entity;</term>の内容は,&parsed-entity;の<termref def='dt-repltext'>&replacement-text;</termref>と呼ぶ。この<termref def="dt-text">テキスト</termref>は,文書の本体の一部として解釈する。
+</termdef>
+</p>
+
+<p>
+<termdef id="dt-unparsed" term="Unparsed Entity">
+<term>&unparsed-entity;</term>は,内容が<termref def='dt-text'>テキスト</termref>でもそうでなくともよいリソースとする。テキストの場合,XMLでなくともよい。各&unparsed-entity;には,<termref def="dt-notation">記法</termref>が関連付けられ,この記法は,名前で&identified;。記法の名前及び関連付けられた&identifier;を,XML&processor;が&application;に渡すという要件以外は,XMLは,&unparsed-entity;の内容を制限しない。
+</termdef>
+</p>
+
+<p>&parsed-entity;は,実体参照によって名前で呼び出す。&unparsed-entity;は,<kw>ENTITY</kw>型又は<kw>ENTITIES</kw>型の属性の値として,名前で参照する。</p>
+
+<p>
+<termdef id='gen-entity' term='general entity'><term>一般実体</term>は,文書内容の中で使用する&parsed-entity;とする。あいまいにならない限り,この&TR-or-Rec;では,一般実体を単に<emph>実体</emph>と呼ぶ。</termdef><termdef id='dt-PE' term='Parameter entity'>パラメタ実体は,DTD内で使用する&parsed-entity;とする。</termdef>これらの2種類の実体は,異なる書式で参照し,異なる文脈で認識する。</p>
+
+<!--
+<div2 id='sec-synchro'>
+<head>Logical and Physical Structures</head>
+<p>The logical and physical structures (elements and entities)
+in an XML document must
+be properly nested.
+<termref def='dt-stag'>Tags</termref> and <termref def='dt-element'>elements</termref> must
+each begin and end in the same <termref def='dt-entity'>entity</termref>, but may
+refer to other
+entities internally; <termref def='dt-comment'>comments</termref>,
+<termref def='dt-pi'>processing instructions</termref>,
+<termref def='dt-charref'>character
+references</termref>, and
+<termref def='dt-entref'>entity references</termref> must each be contained entirely
+within a single entity. Entities must each contain an integral number
+of elements, comments, processing instructions, and references,
+possibly together with character data not contained within any element
+in the entity, or else they must contain non-textual data, which by
+definition contains no elements.</p></div2>
+-->
+
+<div2 id='sec-references'>
+<head>文字参照及び実体参照</head>
+<p>
+<termdef id="dt-charref" term="Character Reference">
+<term>文字参照</term>は,ISO/IEC 10646文字集合の特定の文字,例えば,入力機器から直接入力不可能な文字を参照する。
+
+<scrap lang='ebnf'>
+<head>文字参照</head>
+<prod id='NT-CharRef'><lhs>CharRef</lhs>
+<rhs>'&amp;#' [0-9]+ ';' </rhs>
+<rhs>| '&hcro;' [0-9a-fA-F]+ ';'</rhs>
+<wfc def="wf-Legalchar"/>
+</prod>
+</scrap>
+<wfcnote id="wf-Legalchar">
+<head>正当な文字</head>
+<p>文字参照で参照する文字は,非終端記号<termref def="NT-Char">Char</termref>に従わなければならない。</p>
+</wfcnote>
+文字が "<code>&amp;#x</code>" で始まれば,終端の "<code>;</code>" までの数字及びアルファベットは,ISO/IEC 10646 の文字コードの16進数表現とする。
+<!--日本語訳について: letterはアルファベットと訳した。 三好 -->
+文字が "<code>&amp;#</code>" で始まれば,終端の "<code>;</code>" までの数字は,文字コードの10進数表現とする。
+</termdef>
+</p>
+
+<p>
+<termdef id="dt-entref" term="Entity Reference">
+<term>実体参照</term>は,名前の付いた実体の内容を参照する。</termdef><termdef id='dt-GERef' term='General Entity Reference'>一般実体への参照は,アンパサンド(<code>&amp;</code>)及びセミコロン(<code>;</code>)を区切り子として用いる。</termdef><termdef id='dt-PERef' term='Parameter-entity reference'><term>パラメタ実体</term>への参照は,パーセント記号(<code>%</code>)及びセミコロン(<code>;</code>)を区切り子として用いる。
+</termdef>
+</p>
+
+<scrap lang="ebnf">
+<head>実体参照</head>
+<prod id='NT-Reference'><lhs>Reference</lhs>
+<rhs><nt def='NT-EntityRef'>EntityRef</nt>
+| <nt def='NT-CharRef'>CharRef</nt></rhs></prod>
+<prod id='NT-EntityRef'><lhs>EntityRef</lhs>
+<rhs>'&amp;' <nt def='NT-Name'>Name</nt> ';'</rhs>
+<wfc def='wf-entdeclared'/>
+<vc def='vc-entdeclared'/>
+<wfc def='textent'/>
+<wfc def='norecursion'/>
+</prod>
+<prod id='NT-PEReference'><lhs>PEReference</lhs>
+<rhs>'%' <nt def='NT-Name'>Name</nt> ';'</rhs>
+<wfc def='wf-entdeclared'/>
+<vc def='vc-entdeclared'/>
+<wfc def='textent'/>
+<wfc def='norecursion'/>
+<wfc def='indtd'/>
+</prod>
+</scrap>
+
+<wfcnote id='wf-entdeclared'>
+<head>実体が宣言されていること</head>
+<p>DTDをもたない文書,パラメタ実体参照を含まない内部DTD&subset;だけをもつ文書,又は "<code>standalone='yes'</code>" をもつ文書において,実体参照で用いる <nt def='NT-Name'>Name</nt> は,その実体の宣言で与える名前と,<termref def="dt-match">&match;</termref>しなければならない。ただし,&well-formed;の文書は,実体&magicents; を宣言する必要はない。パラメタ実体の場合は,宣言は,参照に先行しなければならない。同様に,一般実体の場合は,属性リスト宣言の&default-value;内での参照より先に,宣言が現れなければならない。</p>
+
+<p>外部&subset;又は外部パラメタ実体で実体を宣言するとき,&non-validating;&processor;が,宣言を読み,処理することを<titleref href='include-if-valid'>義務づけない</titleref>。それらの文書では,実体は宣言されなければならないという規則は,&well-formed;制約ではない。
+</p>
+</wfcnote>
+
+<vcnote id="vc-entdeclared">
+<head>実体が宣言されていること</head>
+<p>
+外部&subset;又は外部パラメタ実体をもっていて,"<code>standalone='no'</code>"をもつ文書において,実体参照で用いる <nt def='NT-Name'>Name</nt> は,その実体の宣言で与える名前と<termref def="dt-match">&match;</termref>しなければならない。相互運用性のため,&valid;な文書は<titleref href="sec-escapes">あらかじめ定義した実体の規定</titleref>で指定した書式によって,実体 &magicents;を宣言することが望ましい。パラメタ実体の場合は,宣言は,参照に先行しなければならない。同様に,一般実体の場合は,属性リスト宣言の&default-value;内での参照よりも先に,宣言が現れなければならない。
+</p>
+</vcnote>
+
+<!-- FINAL EDIT: is this duplication too clumsy? -->
+
+<wfcnote id='textent'>
+<head>&parsed-entity;</head>
+<p>
+実体参照は,<termref def="dt-unparsed">&unparsed-entity;</termref>の名前を含んでいてはならない。&unparsed-entity;は,<kw>ENTITY</kw>型又は<kw>ENTITIES</kw> 型として宣言した<termref def="dt-attrval">属性値</termref>としてだけ参照できる。
+</p>
+</wfcnote>
+
+<wfcnote id='norecursion'>
+<head>再帰なし</head>
+<p>&parsed-entity;は,それ自体への参照を,直接にも間接にも含んではならない。</p>
+</wfcnote>
+
+<wfcnote id='indtd'>
+<head>DTDの中</head>
+<p>
+パラメタ実体参照は,<termref def='dt-doctype'>DTD</termref>内にだけ,出現してよい。
+<!--
+In the external DTD subset, a parameter-entity reference is
+recognized only at the locations where
+the nonterminal <nt def="NT-PEReference">PEReference</nt> or the
+special operator <code>%</code> appears in a production of the
+grammar. In the internal subset, parameter-entity references
+are recognized only when they match
+the <nt def="NT-InternalPERef">InternalPERef</nt> non-terminal
+in the production for <nt def="NT-markupdecl">markupdecl</nt>.
+-->
+</p>
+</wfcnote>
+
+<p>
+文字参照及び実体参照の例を,次に示す。
+<eg>Type &lt;key>less-than&lt;/key> (&hcro;3C;) to save options.
+This document was prepared on &amp;docdate; and
+is classified &amp;security-level;.</eg>
+</p>
+
+<p>
+パラメタ実体参照の例を,次に示す。
+<eg>&lt;!ENTITY % ISOLat2
+ SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >
+%ISOLat2;
+</eg>
+</p>
+</div2>
+
+<div2 id='sec-entity-decl'>
+<head>実体宣言</head>
+
+<p>
+<termdef id="dt-entdecl" term="entity declaration">
+実体は,次のとおりに宣言する。
+<scrap lang='ebnf'>
+<head>実体宣言</head>
+<prodgroup pcw2="5" pcw4="18.5">
+<prod id='NT-EntityDecl'><lhs>EntityDecl</lhs>
+<rhs><nt def="NT-GEDecl">GEDecl</nt></rhs><com>一般実体</com>
+<rhs>| <nt def="NT-PEDecl">PEDecl</nt></rhs><com>パラメタ実体</com>
+</prod>
+<prod id='NT-GEDecl'><lhs>GEDecl</lhs>
+<rhs>'&lt;!ENTITY' <nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt> <nt def='NT-EntityDef'>EntityDef</nt>
+<nt def='NT-S'>S</nt>? '&gt;'</rhs>
+</prod>
+<prod id='NT-PEDecl'><lhs>PEDecl</lhs>
+<rhs>| '&lt;!ENTITY' <nt def='NT-S'>S</nt> '%' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt> <nt def='NT-S'>S</nt>
+<nt def='NT-PEDef'>PEDef</nt> <nt def='NT-S'>S</nt>? '&gt;'</rhs>
+<com>パラメタ実体</com>
+</prod>
+<prod id='NT-EntityDef'><lhs>EntityDef</lhs>
+<rhs><nt def='NT-EntityValue'>EntityValue</nt>
+</rhs>
+<!--<wfc def="WF-EntityValue"/>-->
+<rhs>| <nt def='NT-ExternalDef'>ExternalDef</nt></rhs>
+<!--<wfc def="WF-External"/>-->
+</prod>
+<!-- FINAL EDIT: what happened to WFs here? -->
+<prod id='NT-PEDef'><lhs>PEDef</lhs>
+<rhs><nt def='NT-EntityValue'>EntityValue</nt>
+| <nt def='NT-ExternalID'>ExternalID</nt></rhs></prod>
+</prodgroup>
+</scrap>
+
+<nt def='NT-Name'>Name</nt> は,<termref def="dt-entref">実体参照</termref>において実体を&identify;。&unparsed-entity;ならば,<kw>ENTITY</kw> 型又は<kw>ENTITIES</kw>型の属性値内で,実体を&identify;。同一の実体が一回以上宣言されれば,最初の宣言を用いる。&at-user-option;,複数回宣言される実体に関し,XML&processor;は,警告を出してもよい。
+</termdef>
+</p>
+
+<!--
+<wfcnote id="WF-Entityvalue">
+<head>Well-Formed Internal Entity</head>
+<p>General entities defined by an <nt
+def="NT-EntityValue">EntityValue</nt> must be well-formed, as defined
+in section <specref ref="wf-entities"/>.
+</p>
+</wfcnote>
+<wfcnote id="WF-External">
+<head>Well-Formed External Entity</head>
+<p>General text entities defined by an <nt
+def="NT-ExternalDef">ExternalDef</nt>, must be well-formed, as defined
+in the section on <titleref xml-link="simple"
+href="wf-entities">well-formed entities.</titleref>.</p>
+</wfcnote>
+-->
+
+<div3 id='sec-internal-ent'>
+<head>内部実体</head>
+<p>
+<termdef id='dt-internent' term="Internal Entity Replacement Text">
+実体の定義が <nt def='NT-EntityValue'>EntityValue</nt>のとき,これを<term>内部実体</term>という。これは,別個の物理的記憶単位をもたず,実体の内容は,宣言内で与える。</termdef>正しく<termref def='dt-repltext'>&replacement-text;</termref>を生成するには,<termref def='dt-litentval'>&literal;実体値</termref>内での実体参照及び文字参照の処理が,必要となるかもしれないことに注意する。詳細は,<titleref href='intern-replacement'>内部実体の&replacement-text;の構築</titleref>を参照。
+
+<!-- redundant -TWB
+Within the <nt def="NT-EntityValue">EntityValue</nt>,
+parameter-entity references and character references are recognized
+and expanded immediately.
+General-entity references within the
+replacement text are not recognized
+at the time the entity declaration is parsed, though they may be
+recognized when the entity itself is referred to.
+-->
+
+</p>
+
+<p>
+内部実体は,<termref def="dt-parsedent">&parsed-entity;</termref>とする。
+</p>
+
+<p>内部実体宣言の例を,次に示す。
+<eg>&lt;!ENTITY Pub-Status "This is a pre-release of the specification."></eg></p>
+</div3>
+
+<div3 id='sec-external-ent'>
+<head>外部実体</head>
+<p>
+<termdef id="dt-extent" term="External Entity">
+実体が内部実体でなければ,<term>外部実体</term>とし,次のとおりに宣言する。
+
+<scrap lang='ebnf'>
+<head>外部実体宣言</head>
+<prod id='NT-ExternalDef'><lhs>ExternalDef</lhs>
+<rhs><nt def='NT-ExternalID'>ExternalID</nt>
+<nt def='NT-NDataDecl'>NDataDecl</nt>?</rhs></prod>
+<prod id='NT-ExternalID'><lhs>ExternalID</lhs>
+<rhs>'SYSTEM' <nt def='NT-S'>S</nt>
+<nt def='NT-SystemLiteral'>SystemLiteral</nt></rhs>
+<rhs>| 'PUBLIC' <nt def='NT-S'>S</nt>
+<nt def='NT-PubidLiteral'>PubidLiteral</nt>
+<nt def='NT-S'>S</nt>
+<nt def='NT-SystemLiteral'>SystemLiteral</nt>
+</rhs>
+</prod>
+<prod id='NT-NDataDecl'><lhs>NDataDecl</lhs>
+<rhs><nt def='NT-S'>S</nt> 'NDATA' <nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt></rhs>
+<vc def='not-declared'/></prod>
+</scrap>
+
+<nt def='NT-NDataDecl'>NDataDecl</nt> が存在すれば,この実体は,<termref def="dt-unparsed">&unparsed-entity;</termref>とし,そうでなければ,&parsed-entity;とする。</termdef>
+</p>
+
+<vcnote id='not-declared'>
+<head>記法が宣言されていること</head>
+<p>
+<nt def='NT-Name'>Name</nt> は,宣言した<termref def="dt-notation">記法</termref>の名前と&match;しなければならない。
+</p>
+</vcnote>
+
+<p>
+<termdef id="dt-sysid" term="System Identifier">
+キーワード <kw>SYSTEM</kw> の後の <nt def='NT-SystemLiteral'>SystemLiteral</nt> を,実体の<term>システム&identifier;</term>と呼ぶ。これはURIとし,その実体の内容を取り出すのに用いてもよい。</termdef>URIと共に使うことの多いハッシュ("<code>#</code>")及びフラグメント&identifier;は,正式には,URI自体の一部とはしない。フラグメント&identifier;が,システム&identifier;の部分として与えられている場合,XML&processor;は,&error;を出してもよい。この&TR-or-Rec;の範囲外の情報(例えば,ある特定のDTDの特別なXML要素又は特定の&application;の仕様によって定義された処理命令)によって上書きされない限り,相対的なURIは,その実体の位置,すなわち,その実体の宣言があるファイルに相対的とする。したがって,DTDの内部&subset;にある実体宣言での相対的なURIは,文書の位置について相対的とする。外部&subset;にある実体宣言での相対的なURIは,その外部&subset;を含むファイルの位置に相対的とする。
+</p>
+
+<p>
+<termdef id="dt-pubid" term="Public identifier">
+システム&identifier;以外に,外部実体は,<term>公開&identifier;</term>を含んでもよい。
+</termdef>
+実体の内容を取り出すXML&processor;は,この公開&identifier;を用いて,代わりのURIの生成を試みてもよい。XML&processor;がこれに失敗した場合は,システム&literal;として指定したURIを用いなければならない。&match;する前に,公開&identifier;内にある空白文字からなる&string;は,すべて単一の&space-character;(#x20)に正規化しなければならず,前後の空白文字は削除しなければならない。
+</p>
+
+<p>外部実体宣言の例を,次に示す。
+<eg>&lt;!ENTITY open-hatch
+ SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
+&lt;!ENTITY open-hatch
+ PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"
+ "http://www.textuality.com/boilerplate/OpenHatch.xml">
+&lt;!ENTITY hatch-pic
+ SYSTEM "../grafix/OpenHatch.gif"
+ NDATA gif ></eg></p>
+</div3>
+
+</div2>
+
+<div2 id='TextEntities'>
+<head>&parsed-entity;</head>
+<div3 id='sec-TextDecl'>
+<head>テキスト宣言</head>
+<p>外部&parsed-entity;は,<term>テキスト宣言</term>で始まってもよい。
+<scrap lang='ebnf'>
+<head>テキスト宣言</head>
+<prodgroup pcw4="12.5" pcw5="13">
+<prod id='NT-TextDecl'><lhs>TextDecl</lhs>
+<rhs>&xmlpio;
+<nt def='NT-VersionInfo'>VersionInfo</nt>?
+<nt def='NT-EncodingDecl'>EncodingDecl</nt>
+<nt def='NT-S'>S</nt>? &pic;</rhs>
+<!-- <wfc def='wfc-xmldecliteral'/> -->
+<!-- <wfc def='wfc-no-nonleading-encdec'/> -->
+</prod>
+</prodgroup>
+</scrap>
+</p>
+<p>テキスト宣言は,そのままの形で現れなければならず,&parsed-entity;への参照を経由してはならないことに注意する。</p>
+<p>外部&parsed-entity;において,テキスト宣言は,先頭以外のいかなる位置にも出現しない。</p>
+</div3>
+<div3 id='wf-entities'>
+<head>&well-formed;の&parsed-entity;</head>
+<p>ラベル<nt def='NT-document'>document</nt>をもつ生成規則に&match;すれば,文書実体は,&well-formed;とする。ラベル<nt def='NT-ExtParsedEnt'>ExtParsedEnt</nt>をもつ生成規則に&match;すれば,外部の一般&parsed-entity;は,&well-formed;とする。ラベル<nt def='NT-ExtPE'>ExtPE</nt>をもつ生成規則に&match;すれば,外部パラメタ実体は,&well-formed;とする。
+
+<scrap lang='ebnf'>
+<head>&well-formed;の&parsed-entity;</head>
+<prod id='NT-ExtParsedEnt'><lhs>ExtParsedEnt</lhs>
+<rhs><nt def='NT-TextDecl'>TextDecl</nt>?
+<nt def='NT-content'>content</nt></rhs>
+</prod>
+<prod id='NT-ExtPE'><lhs>ExtPE</lhs>
+<rhs><nt def='NT-TextDecl'>TextDecl</nt>?
+<nt def='NT-extSubset'>extSubset</nt></rhs>
+</prod>
+</scrap>
+&replacement-text;が,ラベル<nt def='NT-content'>content</nt>をもつ生成規則に&match;すれば,内部の一般&parsed-entity;は,&well-formed;とする。DTDを最後まで読み込まないと,確実にこれを判定できないことに注意。すべての内部のパラメタ実体は,定義によって&well-formed;とする。
+</p>
+<p>実体が&well-formed;な結果として,XML文書の論理的及び物理的構造は,正しく入れ子となる。<termref def='dt-stag'>開始タグ</termref>,<termref def='dt-etag'>終了タグ</termref>,<termref def="dt-empty">空要素タグ</termref>,<termref def='dt-element'>要素</termref>,<termref def='dt-comment'>コメント</termref>,<termref def='dt-pi'>処理命令</termref>,<termref def='dt-charref'>文字参照</termref>及び<termref def='dt-entref'>実体参照</termref>が,一つの実体で開始し,別の実体で終了することはない。</p>
+</div3>
+<div3 id='charencoding'>
+<head>実体における文字符号化</head>
+
+<p>XML文書内の外部&parsed-entity;は,各々,別の文字符号化方式を用いてもよい。すべてのXML&processor;は,UTF-8で符号化した実体,UTF-16で符号化した実体を処理できなければならない。
+<!--
+It is recognized that for some purposes, the use of additional
+ISO/IEC 10646 planes other than the Basic Multilingual Plane
+may be required.
+A facility for handling characters in these planes is therefore a
+desirable characteristic in XML processors and applications.
+-->
+</p>
+<p>UTF-16で符号化した実体は,ISO/IEC 10646の付録E及びUnicodeの付録Bで規定する&byte-order-mark;(ZERO WIDTH NO-BREAK SPACE文字,#xFEFF)で始まらなければならない。これは,符号化の標識であって,XML文書の&markup;の一部でも,文字データの一部でもない。XML&processor;は,UTF-8で符号化した文書とUTF-16で符号化した文書との区別を行うために,この文字を使用可能でなければならない。</p>
+<p>XML&processor;は,UTF-8及びUTF-16で符号化した実体だけを読むことを必須とするが,他の符号化を世界では用いており,それらの符号化を用いる実体をXML&processor;が処理できることが望ましい。UTF-8又はUTF-16以外の符号化方式を用いて格納する&parsed-entity;は,符号化宣言を含む<titleref href='TextDecl'>テキスト宣言</titleref>で始めなければならない。
+<scrap lang='ebnf'>
+<head>符号化宣言</head>
+<prod id='NT-EncodingDecl'><lhs>EncodingDecl</lhs>
+<rhs><nt def="NT-S">S</nt>
+'encoding' <nt def='NT-Eq'>Eq</nt>
+'"' <nt def='NT-EncName'>EncName</nt> '"' | "'"
+<nt def='NT-EncName'>EncName</nt> "'"
+</rhs>
+</prod>
+<prod id='NT-EncName'><lhs>EncName</lhs>
+<rhs>[A-Za-z] ([A-Za-z0-9._] | '-')*</rhs>
+<com>ラテン文字だけを含む符号化名</com>
+</prod>
+</scrap>
+<termref def='dt-docent'>文書実体</termref>では,符号化宣言は,<termref def="dt-xmldecl">XML宣言</termref>の一部とする。<nt def="NT-EncName">EncName</nt>は,使用する符号化方式の名前とする。
+</p>
+<!-- FINAL EDIT: check name of IANA and charset names -->
+<p>符号化宣言では,値<code>UTF-8</code>,<code>UTF-16</code>,<code>ISO-10646-UCS-2</code>及び<code>ISO-10646-UCS-4</code>は,Unicode及びISO/IEC 10646の各種符号化のために用いる。値<code>ISO-8859-1</code>から<code>ISO-8859-9</code>までは,ISO 8859の対応するパートのために用いる。値<code>ISO-2022-JP</code>,<code>Shift_JIS</code>及び<code>EUC-JP</code>は,JIS X-0208-1997の各種符号化のために用いる。XML&processor;は,それ以外の符号化方式を認識してもよい。Internet Assigned Numbers Authority (IANA)に,(<emph>charset</emph>sとして)登録された文字符号化方式については,これら以外についても,登録された名前で参照することが望ましい。これらの登録された名前は,大文字・小文字の区別をせずに定義されているので,これらに対する比較を試みる&processor;は,大文字・小文字の区別をしない方法をとるのが望ましいことに注意する。</p>
+<p>XML処理系に渡された実体が,符号化宣言を含むにもかかわらず,宣言で示したもの以外の方式で符号化されていたり,符号化宣言が,外部実体の最初以外の位置に出現すれば,<termref def="dt-error">&error;</termref>とする。
+</p>
+<p>&byte-order-mark;でも符号化宣言でも始まらない実体は,UTF-8符号化でなければならない。</p>
+
+<p><!-- XML processors should make an effort to use all available
+information, internal and external, to aid in detecting an entity's correct
+encoding. Such information may include, but is not limited to:
+<ulist><item><p>An HTTP header</p></item>
+<item><p>A MIME header obtained other than through HTTP</p></item>
+<item><p>Metadata provided by the native OS file system or by document
+management software</p></item>
+<item><p>The bit patterns at the front of an entity, which may
+be analyzed to determine if
+the application of any known encoding yields a valid encoding
+declaration. See <titleref href='sec-guessing'>the appendix on
+autodetection of character sets</titleref>
+for a fuller description.</p></item></ulist> -->
+処理できない符号化をもった実体をXML&processor;が発見したときは,&application;にその事実を通知し,<termref def='dt-fatal'>&fatal-error;</termref>として,処理を終了しなければならない。
+<!--
+inform the application of this fact and
+may
+allow the application to
+request either that the entity should be treated as an <termref
+def="dt-unparsed">unparsed entity</termref>, or that processing should
+cease.-->
+</p>
+<p>符号化宣言の例を,次に示す。
+<eg>&lt;?xml encoding='UTF-8'?>
+&lt;?xml encoding='EUC-JP'?></eg></p>
+</div3>
+</div2>
+<div2 id='entproc'>
+<head>XML&processor;による実体及び参照の扱い</head>
+<p>次の表は,文字参照,実体参照及び&unparsed-entity;の呼出しが現れる文脈及び各々の場合における<termref def='dt-xml-proc'>XML&processor;</termref>に要求する振舞いを要約する。一番左の列のラベルは,認識の文脈を示す。
+<glist>
+<gitem><label>内容における参照</label>
+<def><p>要素の<termref def='dt-stag'>開始タグ</termref>及び<termref def='dt-etag'>終了タグ</termref>の間の任意の場所での参照。非終端記号<nt def='NT-content'>content</nt>に対応する。</p></def>
+</gitem>
+<gitem>
+<label>属性値における参照</label>
+<def><p><termref def='dt-stag'>開始タグ</termref>の属性の値,又は<termref def='dt-attdecl'>属性宣言</termref>における&default-value;のいずれかでの参照。非終端記号<nt def='NT-AttValue'>AttValue</nt>に対応する。</p></def></gitem>
+<gitem>
+<label>属性値として出現</label>
+<def><p>参照ではなく,<nt def='NT-Name'>Name</nt>として出現。<code>ENTITY</code>型として宣言した属性の値,又は<code>ENTITIES</code>型として宣言した属性の値における&space;で区切る&token;の一つとして出現する。</p>
+</def></gitem>
+<gitem><label>実体値における参照</label>
+<def><p>実体の宣言における,パラメタ又は内部実体の<termref def='dt-litentval'>&literal;実体値</termref>内の参照。非終端記号<nt def='NT-EntityValue'>EntityValue</nt>に対応する。</p></def></gitem>
+<gitem><label>DTDにおける参照</label>
+<def><p><termref def='dt-doctype'>DTD</termref>の内部&subset;又は外部&subset;での参照。ただし,<nt def='NT-EntityValue'>EntityValue</nt>又は<nt def="NT-AttValue">AttValue</nt>の外側とする。</p></def>
+</gitem>
+</glist></p>
+<!-- border value changed by bosak -->
+<htable border='1' cellpadding='7' align='center'>
+<!-- tbody wrapper added by bosak -->
+<htbody>
+<tr><td bgcolor='&cellback;' rowspan='2' colspan='1'></td>
+<!--
+ ### I don't have a nice algorithm to compare two QDomDocuments, so take
+ out the following element since my algorithm mixes up the ordering of
+ its attributes at the moment (rms):
+<td bgcolor='&cellback;' align='center' valign='bottom' colspan='4'>実体の型</td>
+-->
+<td bgcolor='&cellback;' rowspan='2' align='center'>文字</td>
+</tr>
+<tr align='center' valign='bottom'>
+<td bgcolor='&cellback;'>パラメタ</td>
+<td bgcolor='&cellback;'>内部&newline;一般</td>
+<td bgcolor='&cellback;'>外部&newline;&parsed-entity;&newline;一般</td>
+<td bgcolor='&cellback;'>&unparsed-entity;</td>
+</tr>
+<tr align='center' valign='middle'>
+<!--<td bgcolor='&cellback;' rowspan='4'>Recognition
+Context</td>-->
+<td bgcolor='&cellback;' align='right'>内容での&newline;参照</td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>認識&newline;しない</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td>
+<td bgcolor='&cellback;'><titleref href='include-if-valid'>検証のために取込み</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>属性値での&newline;参照</td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>認識&newline;しない</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>属性値として&newline;出現</td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>認識&newline;しない</titleref></td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='not-recognized'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='notify'>通知</titleref></td>
+<td bgcolor='&cellback;'><titleref href='not recognized'>認識&newline;しない</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>実体値での&newline;参照</td>
+<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td>
+<td bgcolor='&cellback;'><titleref href='bypass'>&bypass;</titleref></td>
+<td bgcolor='&cellback;'><titleref href='bypass'>&bypass;</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td>
+</tr>
+<tr align='center' valign='middle'>
+<td bgcolor='&cellback;' align='right'>DTDでの&newline;参照</td>
+<td bgcolor='&cellback;'><titleref href='as-PE'>PEとして&newline;取込み</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td>
+</tr>
+</htbody>
+</htable>
+<div3 id='not-recognized'>
+<head>“認識しない”</head>
+<p>DTDの外では,<code>%</code>文字は,いかなる特定の意味も,もたない。したがって,DTDではパラメタ実体参照として認識するものであっても,<nt def='NT-content'>content</nt>内では&markup;としては認識しない。同様に,適切に宣言した属性の値の中に現れる場合を除き,&unparsed-entity;の名前は,認識しない。
+</p>
+</div3>
+<div3 id='included'>
+<head>“取込み”</head>
+<p><termdef id="dt-include" term="Include">実体は,その<termref def='dt-repltext'>&replacement-text;</termref>を取り出し,処理すると,参照自体の代わりに,参照があった位置で,文書の一部として含まれるかのように<term>取り込まれる</term>。&replacement-text;は,<termref def='dt-chardata'>文字データ</termref>及び(パラメタ実体を除く。)<termref def="dt-markup">&markup;</termref>のいずれを含んでもよく,これらは,通常の方法で認識されなければならない。ただし,&markup;の区切り子を&escape;するために用いる実体(&magicents;)の&replacement-text;は,常にデータとして扱う(&string;"<code>AT&amp;amp;T;</code>"は,"<code>AT&amp;T;</code>"に展開され,残されたアンパサンドは,実体参照の区切り子としては認識しない。)。文字参照は,示した文字を参照自体の代わりに処理するとき,<term>取り込まれる</term>。
+</termdef></p>
+</div3>
+<div3 id='include-if-valid'>
+<head>“検証のために取込み”</head>
+<p>文書の&validity;を<termref def="dt-valid">検証</termref>するには,XML&processor;が&parsed-entity;への参照を認識したとき,その&replacement-text;を<termref def="dt-include">取り込ま</termref>なければならない。実体が外部実体であって,XML文書の&validity;を検証しなければ,実体の&replacement-text;を取り込んでも<termref def="dt-may">よい</termref>が,そうしなくともよい。</p>
+<p>この取決めは,SGML及びXMLの実体の機構が提供する自動取込み機能が,文書作成時のモジュール化を主な目的として設計されており,その他の&application;(特に,文書のブラウズ)には,必ずしも適切ではない,という認識による。例えば,ブラウザは外部&parsed-entity;への参照を見つけると,その実体が存在するという表示だけを行い,表示を要求されたときにだけ,内容を取り出すかもしれない。
+</p>
+</div3>
+<div3 id='forbidden'>
+<head>“禁止”</head>
+<p>次は禁止されており,<termref def='dt-fatal'>&fatal-error;</termref>とする。
+<ulist>
+<item><p>a) <termref def='dt-unparsed'>&unparsed-entity;</termref>への参照の出現。
+</p></item>
+<item><p>b) DTDの<nt def='NT-EntityValue'>EntityValue</nt>又は<nt def="NT-AttValue">AttValue</nt>以外の部分における,文字参照又は一般実体への参照の出現。</p></item>
+<item><p>c) 属性値内の外部実体への参照。</p>
+</item>
+</ulist>
+</p>
+</div3>
+<div3 id='notify'>
+<head>“通知”</head>
+<p><termref def='dt-unparsed'>&unparsed-entity;</termref>の名前が,<kw>ENTITY</kw>又は<kw>ENTITIES</kw>の属性の値において&token;として現れたとき,&processor;は,&application;に対して,関連付けられた<termref def="dt-notation">記法</termref>名,記法に対する<termref def='dt-sysid'>システム</termref>&identifier;及び(存在すれば)<termref def='dt-pubid'>公開</termref>&identifier;を通知しなければならない。</p>
+</div3>
+<div3 id='bypass'>
+<head>“&bypass;”</head>
+<p>一般実体参照が,実体宣言における<nt def='NT-EntityValue'>EntityValue</nt>内に現れるとき,それは無視され,そのまま残る。</p>
+</div3>
+<div3 id='as-PE'>
+<head>“PEとして取込み”</head>
+<p>外部&parsed-entity;の場合と同様に,パラメタ実体は,&validity;を<titleref href='include-if-valid'>検証するときだけ取り込まれる</titleref>必要がある。パラメタ実体参照をDTD内に認識して取り込むとき,その<termref def='dt-repltext'>&replacement-text;</termref>は,その前後に一つの&space-character;(#x20)の付加によって引き伸ばされる。この意図は,パラメタ実体の&replacement-text;が,DTD内のいくつかの文法的&token;を完全に含むと,制約することにある。
+</p>
+</div3>
+<!--
+<div3 id='gen-char-entproc'>
+<head>General and Character Entity Processing</head>
+<p>General-entity and character references are recognized in three
+contexts: wherever the nonterminal <nt def='NT-content'>content</nt> may
+appear, at any point within the nonterminal
+<nt def='NT-AttValue'>AttValue</nt>,
+and within the
+<termref def='dt-litentval'>literal entity value</termref>
+(<nt def='NT-EntityValue'>EntityValue</nt>)
+of an internal entity declaration.
+This section discusses the first two cases; the third
+is discussed <titleref href='intern-replacement'>below</titleref>.
+When an <termref def="dt-xml-proc">XML processor</termref> encounters
+such a reference, or the name of an unparsed entity as the value
+of an <kw>ENTITY</kw> or <kw>ENTITIES</kw> attribute, then:
+<olist>
+
+<item><p>In all cases, the XML processor may
+inform the application of the reference's occurrence and its identifier
+(for an entity reference, the name; for a character
+reference,
+the character number in decimal, hexadecimal, or binary form).</p></item>
+
+<item><p>For both character and entity references, the processor must
+remove the reference itself from the <termref def="dt-text">text</termref> data
+before passing the data to the application.
+</p></item>
+
+<item><p>For character references, the processor must
+pass the character indicated
+to the application in
+place of the reference.
+</p></item>
+
+<item><p>For an external entity, the processor must inform the
+application of the entity's <termref def="dt-sysid">system
+identifier</termref>, and <termref def="dt-pubid">public identifier</termref>
+if any.
+All strings
+of white space in the public identifier must be normalized to single space characters (#x20),
+and leading and trailing white space must be removed.</p></item>
+
+<item><p>If the external entity is binary, the processor must inform the
+application of the associated <termref def="dt-notation">notation</termref>
+name, and the notation's associated <termref def='dt-sysid'>system</termref>
+and <termref def='dt-pubid'>public</termref> (if any)
+identifiers.</p></item>
+
+<item><p><termdef id="dt-include" term="Include">For an internal
+(parsed) entity, the processor must <term>include</term> the
+entity; that is, retrieve its replacement text
+and process it as a part of the document
+(i.e. as <nt def="NT-content">content</nt> or <nt
+def="NT-AttValue">AttValue</nt>, whichever was being processed when
+the reference was recognized), passing the result to the application
+in place of the reference. The replacement text may contain both
+<termref def='dt-chardata'>character data</termref>
+and <termref def="dt-markup">markup</termref>, which must be recognized in
+the usual way, except that the replacement text of entities used to escape
+markup delimiters (the entities &magicents;) is always treated as
+data. (The string "<code>AT&amp;amp;T;</code>" expands to
+"<code>AT&amp;T;</code>" since the ampersand replacing "<code>&amp;amp;</code>"
+is not recognized
+as an entity-reference delimiter.) </termdef></p>
+<p>Since the entity may contain other entity references,
+an XML processor may have to repeat the inclusion process recursively.</p>
+</item>
+<item><p>If the entity is an external parsed entity, then in order to
+<termref def="dt-valid">validate</termref> the XML document, the processor must
+<termref def="dt-include">include</termref> the content of the
+entity.</p></item>
+
+<item><p>If the entity is an external parsed entity, and the processor is not
+attempting to <termref def="dt-valid">validate</termref> the XML document, the
+processor <termref def="dt-may">may</termref>, but need not, <termref
+def="dt-include">include</termref> the entity's content.</p>
+<p>This rule is based on the recognition that the automatic inclusion
+provided by the SGML and XML entity mechanism, primarily designed
+to support modularity in authoring, is not necessarily
+appropriate for other applications, in particular document browsing.
+Browsers, for example, when encountering an external parsed entity reference,
+might choose to provide a visual indication of the entity's
+presence and retrieve it for display only on demand.
+</p></item>
+</olist>
+</p>
+<p><termdef id="dt-escape" term="escape">Entity and character
+references can both be used to <term>escape</term> the left angle bracket,
+ampersand, and other delimiters. A set of general entities
+(&magicents;) is specified for this purpose.
+Numeric character references may also be used; they are
+expanded immediately when recognized, and must be treated as
+character data, so the numeric character references
+"<code>&amp;#60;</code>" and "<code>&amp;#38;</code>" may be used to
+escape <code>&lt;</code> and <code>&amp;</code> when they occur
+in character data.</termdef></p>
+</div3>
+<div3 id='PE-proc'>
+<head>Parameter Entity Processing</head>
+<p>Parameter-entity references are only recognized in the
+<termref def='dt-doctype'>DTD</termref>.
+Their processing, when they appear
+within the
+<termref def='dt-litentval'>literal entity value</termref>
+(<nt def='NT-EntityValue'>EntityValue</nt>)
+of an internal entity declaration,
+is discussed <titleref href='intern-replacement'>below</titleref>.
+They have these intended uses:
+<olist>
+<item><p>as a replacement for one or more complete markup declarations</p></item>
+<item><p>as a replacement for one or more complete "groups" in
+element declarations</p></item>
+<item><p>as a replacement for one or more complete "tokens" in
+markup declarations</p></item>
+</olist>
+</p>
+<p>The constraints requiring that PE replacement texts be properly nested
+with <titleref href='vc-PEinMarkupDecl'>markup declarations</titleref>
+and <titleref href='vc-PEinGroup'>content groups</titleref>
+govern the first two usages.</p>
+<p>To support the third intended usage,
+when an XML processor encounters a parameter-entity reference
+(outside of the
+<termref def='dt-litentval'>literal entity value</termref> in an entity
+declaration),
+it must <termref def="dt-include">include</termref>
+the named entity, but first expand its
+<termref def='dt-repltext'>replacement text</termref> by attaching
+space (#x20) characters to its beginning and the end, before
+processing it.</p>
+<p>The DTD text must match the relevant
+rules of this specification's grammar after all parameter-entity
+references have been expanded.
+<!-In addition, parameter entities referred to in specific
+contexts are required to satisfy certain constraints in their
+replacement text; for example, a parameter entity referred to within
+the internal DTD subset must match the rule for <nt
+def="NT-markupdecl">markupdecl</nt>. ->
+</p>
+</div3>
+-->
+</div2>
+<div2 id='intern-replacement'>
+<head>内部実体&replacement-text;の構築</head>
+<p>内部実体の取扱いの規定で,実体値を二つの形式に区別することは役に立つ。<termdef id="dt-litentval" term='Literal Entity Value'><term>&literal;実体値</term>は,実体宣言内に実際に存在する,引用符で囲む&string;とする。これは,非終端記号<nt def='NT-EntityValue'>EntityValue</nt>に&match;する。</termdef><termdef id='dt-repltext' term='Replacement Text'><term>&replacement-text;</term>は,文字参照及び&parameter;実体参照の置換え後における,実体の内容とする。</termdef></p>
+
+<p>内部実体宣言内で与える&literal;実体値<!-- replacement text -->(<nt def='NT-EntityValue'>EntityValue</nt>)は,文字参照,&parameter;実体参照及び一般実体参照を含んでよい。これらの参照は,<!-- replacement text. -->&literal;実体値内に完全に含まれていなければならない。<termref def='dt-include'>展開する</termref>実際の&replacement-text;(先に示したもの)は,参照する&parameter;実体の<emph>&replacement-text;</emph>を含まなければならず,&literal;実体値内での文字参照の代わりに参照した文字を含まなければならない。しかし,一般実体参照は,そのまま残し, 展開してはならない。
+<!-- in the replacement text that is to be included. -->
+例えば,次の宣言を与えたとする。
+
+<eg><![CDATA[<!ENTITY % pub "&#xc9;ditions Gallimard" >
+<!ENTITY rights "All rights reserved" >
+<!ENTITY book "La Peste: Albert Camus,
+&#xA9; 1947 %pub;. &rights;" >]]></eg>
+実体の&replacement-text;"<code>book</code>"は,次のとおりとなる。
+<eg>La Peste: Albert Camus,
+&#169; 1947 &#201;ditions Gallimard. &amp;rights;</eg>
+参照"<code>&amp;book;</code>"が,文書の内容又は属性値内に出現していれば,一般実体参照"<code>&amp;rights;</code>"は,展開されている。</p>
+<p>これらの単純な規則は,複合相互作用をもつ。
+<!-- 日本語訳について: interaction = 相互作用(金本)-->
+難しい例についての詳細は,<titleref href='sec-entexpand'>実体参照の展開の付録</titleref>を参照のこと。
+</p>
+<!-- Replaced by the above -TB
+<p>Implementors of XML processors need to know the rules for
+expansion of references in more detail. These rules only come into
+play when the replacement text for an internal entity itself contains
+other references.
+<olist>
+<item><p>In the replacement text of an internal entity, parameter-entity
+references and character references in the replacement text
+are recognized and resolved
+when the entity declaration is parsed,
+before the replacement text is stored in
+the processor's symbol table.
+General-entity references in the replacement text are not
+resolved when the entity declaration is parsed.</p></item>
+<item><p>In the document, when a general-entity reference is
+resolved, its replacement text is parsed. Character references
+encountered in the replacement text are
+resolved immediately; general-entity references encountered in the
+replacement text may be resolved or left unresolved, as described
+<titleref href="entproc">above</titleref>.
+Character and general-entity references must be
+contained entirely within the entity's replacement text.
+</p></item>
+</olist>
+</p>
+
+<p>Simple character references do not suffice to escape delimiters
+within the replacement text of an internal entity: they will be
+expanded when the entity declaration is parsed, before the replacement
+text is stored in the symbol table. When the entity itself is
+referred to, the replacement text will be parsed again, and the
+delimiters (no longer character references)
+will be recognized as delimiters. To escape the
+characters &magicents; in an entity replacement text, use
+a general-entity reference or a doubly-escaped character reference.
+See <titleref href='sec-entexpand'>the appendix on expansion
+of entity references</titleref>
+for detailed examples.</p>
+-->
+
+
+</div2>
+<div2 id='sec-predefined-ent'>
+<head>定義済み実体</head>
+<p><termdef id="dt-escape" term="escape">
+実体参照及び文字参照のいずれも,&left-angle-bracket;,アンバサンド及び他の区切り子を<term>&escape;</term>するために使用できる。いくつかの一般実体(&magicents;)を,この目的のために指定する。数値による文字参照も,同様の目的のために使用できる。文字参照は,認識されると直ちに展開され,文字データとして扱われるので,数値による文字参照"<code>&amp;#60;</code>"及び"<code>&amp;#38;</code>"は,文字データ内に出現する<code>&lt;</code>及び<code>&amp;</code>を&escape;するために使用できる。</termdef></p>
+<p>すべてのXML&processor;は,宣言されているかどうかに関係なく,これらの実体を認識しなくてはならない。<termref def='dt-interop'>相互運用性のため</termref>,&valid;なXML文書は,これらの実体を使用する前に,他の実体と同様に,宣言することが望ましい。実体を宣言する場合は,&replacement-text;を&escape;する一文字とする内部実体として,次のとおりに宣言しなければならない。
+<eg><![CDATA[<!ENTITY lt "&#38;#60;">
+<!ENTITY gt "&#62;">
+<!ENTITY amp "&#38;#38;">
+<!ENTITY apos "&#39;">
+<!ENTITY quot "&#34;">
+]]></eg>
+"<code>lt</code>"及び"<code>amp</code>"宣言内の"<code>&lt;</code>"及び"<code>&amp;</code>"文字は,実体の置換テキストが,&well-formed;となるように二重に&escape;されることに注意。
+</p>
+</div2>
+
+
+<div2 id='Notations'>
+<head>記法宣言</head>
+
+
+<p>
+<termdef id="dt-notation" term="Notation">
+<term>記法</term>は,<termref def="dt-extent">&unparsed-entity;</termref>の形式を&identify;名前か,又は<termref def="dt-pi">処理命令</termref>の対象とする&application;を&identify;名前とする。</termdef></p>
+<p><termdef id="dt-notdecl" term="Notation Declaration">
+<term>記法宣言</term>は,記法の名前及び外部&identifier;を提供する。この名前は,実体及び属性リスト宣言並びに属性指定に用いる。外部&identifier;は,与えられた記法のデータを処理できるヘルパ&application;を,XML&processor;又はクライアントアプリケーションが探すために,利用できる。
+<scrap lang='ebnf'>
+<head>記法宣言</head>
+<prod id='NT-NotationDecl'><lhs>NotationDecl</lhs>
+<rhs>'&lt;!NOTATION' <nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>
+(<nt def='NT-ExternalID'>ExternalID</nt> |
+<nt def='NT-PublicID'>PublicID</nt>)
+<nt def='NT-S'>S</nt>? '>'</rhs></prod>
+<prod id='NT-PublicID'><lhs>PublicID</lhs>
+<rhs>'PUBLIC' <nt def='NT-S'>S</nt>
+<nt def='NT-PubidLiteral'>PubidLiteral</nt>
+</rhs></prod>
+</scrap>
+</termdef></p>
+<p>宣言し,属性値,属性定義又は実体宣言で参照するすべての記法について,XML&processor;は,記法の名前及び外部&identifier;を&application;に提供しなければならない。さらに,外部&identifier;を,<termref def="dt-sysid">システム&identifier;</termref>,ファイル名又はその他の情報に展開してもよく,これらを用いて,&application;は,その記法のデータを処理する&processor;を起動する。(しかし,XML&processor;又は&application;が動作するシステムでは利用できない記法を,XML文書が宣言し参照しても,これは,&error;とはしない。)</p>
+</div2>
+
+
+<div2 id='sec-doc-entity'>
+<head>文書実体</head>
+
+<p><termdef id="dt-docent" term="Document Entity"><term>文書実体</term>は,実体の形成する木構造の&root;であって,<termref def="dt-xml-proc">XML&processor;</termref>が,処理を開始する地点とする。</termdef>この&TR-or-Rec;は,XML&processor;が,文書実体の存在する場所をどのように見つけるかは,規定しない。他の実体と異なり,文書実体は名前をもたず,いかなる識別もなしに&processor;への入力&stream;に出現してもよい。</p>
+</div2>
+
+
+</div1>
+<!-- &Conformance; -->
+<div1 id='sec-conformance'>
+<head>適合性</head>
+
+<p>適合する<termref def="dt-xml-proc">XML&processor;</termref>は,&validating;もの及び&non-validating;ものの,二つに分類される。</p>
+<p>&validating;システム及び&non-validating;システムは,この&TR-or-Rec;が規定する&well-formed;制約への違反を報告しなければならない。</p>
+<p><termdef id="dt-validating" term="Validating Processor"><term>&validating;&processor;</term>は,<termref def="dt-doctype">DTD</termref>内の宣言によって示された,制約への違反を報告しなければならない。さらに,この&TR-or-Rec;が規定する&validity;制約への違反を,すべて報告しなければならない。
+</termdef>
+</p>
+</div1>
+
+<div1 id='sec-notation'>
+<head>記法</head>
+
+<p>XMLの形式的な文法は,簡単な拡張Backus-Naur Form(EBNF)記法によって与える。文法の各規則は,次の形式で,記号を一つ定義する。
+<eg>symbol ::= expression</eg></p>
+<p>記号は,正規表現で定義するときは大文字で始め,そうでなければ,小文字で始める。&string;&literal;は,引用符で囲む。
+<!--* The distinction between symbols which can and cannot be
+recognized using simple regular expressions may be used to set the
+boundary between an implementation's lexical scanner and its parser,
+but this specification neither constrains the placement of that
+boundary nor presupposes that all implementations will have one. *-->
+</p>
+
+<p>規則の右側の式内では,一つ又は複数の文字からなる&string;と&match;するために,次の式を使用する。
+<glist>
+<gitem>
+<label><code>#xN</code></label>
+<def><p>ここで,<code>N</code>は16進の整数とする。ISO/IEC 10646の文字であって,正規形(UCS-4)の&code-value;を符号なし2進数として解釈したとき,指定した値と等しいものと&match;する。<code>#xN</code>形式の先頭にゼロがいくつか現れるかは,意味をもたない。&code-value;<!-- bit string -->における先頭のゼロの数は,文字の符号化によって決定されるので,XMLにとっては意味がない。
+</p></def>
+</gitem>
+<gitem>
+<label><code>[a-zA-Z]</code>, <code>[#xN-#xN]</code></label>
+<def><p>指定した範囲の値(両端の値を含む。)をもつ任意の<termref def='dt-character'>文字</termref>と&match;する。</p></def>
+</gitem>
+<gitem>
+<label><code>[^a-z]</code>, <code>[^#xN-#xN]</code></label>
+<def><p>指定した範囲<emph>外</emph>の値をもつ任意の<termref def='dt-character'>文字</termref>と&match;する。</p></def>
+</gitem>
+<gitem>
+<label><code>[^abc]</code>, <code>[^#xN#xN#xN]</code></label>
+<def><p>指定した文字以外の値をもつ任意の<termref def='dt-character'>文字</termref>と&match;する。</p></def>
+</gitem>
+<gitem>
+<label><code>"string"</code></label>
+<def><p>&double-quote;で囲む&string;&literal;と<termref def="dt-match">&match;している</termref>&string;&literal;と&match;する。</p></def>
+</gitem>
+<gitem>
+<label><code>'string'</code></label>
+<def><p>&single-quote;で囲む&string;&literal;と<termref def="dt-match">&match;している</termref>&string;&literal;と&match;する。</p></def>
+</gitem>
+</glist>
+これらの記号は,次の形式の組合せで使用する。ここで,<code>A</code>及び<code>B</code>は,単純な式とする。
+<glist>
+<gitem>
+<label>(<code>expression</code>)</label>
+<def><p><code>expression</code>は,一つのまとまりとして扱い,ここに示す組合せで使ってもよい。</p></def>
+</gitem>
+<gitem>
+<label><code>A?</code></label>
+<def><p><code>A</code>又は何もなしと&match;する(オプションの<code>A</code>)。</p></def>
+</gitem>
+<gitem>
+<label><code>A B</code></label>
+<def><p><code>A</code>の次に<code>B</code>が出現するものと&match;する。
+</p></def>
+</gitem>
+<gitem>
+<label><code>A | B</code></label>
+<def><p><code>A</code>又は<code>B</code>,ただし,両方ではない,と&match;する。
+</p></def>
+</gitem>
+<gitem>
+<label><code>A - B</code></label>
+<def><p><code>A</code>と&match;するが,<code>B</code>とは&match;しない,任意の&string;と&match;する。</p></def>
+</gitem>
+<gitem>
+<label><code>A+</code></label>
+<def><p><code>A</code>の1回以上の繰返しと&match;する。</p></def>
+</gitem>
+<gitem>
+<label><code>A*</code></label>
+<def><p><code>A</code>の0回以上の繰返しと&match;する。</p></def>
+</gitem>
+<!-- DEATH TO %'s
+<gitem>
+<label><code>%a</code></label>
+<def><p>specifies that <emph>in the external DTD subset</emph> a
+<termref def='dt-param-entity'>parameter entity</termref> may occur in the
+text at the position where <code>a</code> may occur; if so, its
+replacement text must match <code>S? a S?</code>. If
+the expression <code>a</code> is governed by a suffix operator, then
+the suffix operator determines both the maximum number of parameter-entity
+references allowed and the number of occurrences of <code>a</code>
+in the replacement text of the parameter entities: <code>%a*</code>
+means that <code>a</code> must occur zero or more times, and
+that some of its occurrences may be replaced by references to
+parameter entities whose replacement text must contain zero or
+more occurrences of <code>a</code>; it is thus a more compact way
+of writing <code>%(a*)*</code>.
+Similarly, <code>%a+</code> means that <code>a</code>
+must occur one or more times, and may be replaced by
+parameter entities with replacement text matching
+<code>S? (a S?)+</code>.
+The recognition of parameter entities in the internal subset is much more
+highly constrained.
+</p></def>
+</gitem>
+-->
+</glist>
+生成規則内で使用する他の記法を,次に示す。
+<glist>
+<gitem>
+<label><code>/* ... */</code></label>
+<def><p>コメント。</p></def>
+</gitem>
+<gitem>
+<label><code>[ wfc: ... ]</code></label>
+<def><p>&well-formed;制約。生成規則に付与した,<termref def="dt-wellformed">&well-formed;</termref>の文書に関する制約を,名前によって&identify;。</p></def>
+</gitem>
+<gitem>
+<label><code>[ vc: ... ]</code></label>
+<def><p>&validity;制約。生成規則に付与した,<termref def="dt-valid">&valid;</termref>な文書に関する制約を,名前によって&identify;。
+</p></def>
+</gitem>
+</glist>
+</p></div1>
+
+</body>
+<back>
+<!-- &SGML; -->
+
+<!-- &Biblio; -->
+<div1 id='sec-bibliography'>
+
+<head>参考文献</head>
+<div2 id='sec-existing-stds'>
+<head>&normative;参考文献</head>
+<!--* <ulist><item>
+<p>Unicode and ISO/IEC 10646. This specification depends on the
+international standard ISO/IEC 10646 (with amendments AM 1 through AM 7)
+and the Unicode Standard, Version 2.0 <bibref ref='Unicode'/>,
+which define the encodings and meanings of
+the <termref def="dt-character">characters</termref> which
+make up XML <termref def="dt-text">text</termref>.
+All the characters in ISO/IEC 10646 are present, at the same code points,
+in Unicode.</p></item>
+<item><p>XXX XXX defines the syntax and semantics of
+Uniform Resource Identifiers, or URIs.</p></item>
+<item><p>IETF RFC 1766, with ISO 639 and 3166,
+describe the codes that may be used in the
+special <titleref href='sec-lang-tag'>xml:lang</titleref> attribute.</p>
+</item></ulist>
+*-->
+
+<blist>
+
+<bibl id='RFC1766' key='IETF RFC 1766'>
+IETF (Internet Engineering Task Force).
+<emph>RFC 1766: Tags for the Identification of Languages</emph>,
+ed. H. Alvestrand.
+1995.
+</bibl>
+
+<bibl id='ISO639' key='ISO 639'>
+(International Organization for Standardization).
+<emph>ISO 8879:1988 (E).
+Code for the representation of names of languages.</emph>
+[Geneva]: International Organization for
+Standardization, 1988.</bibl>
+
+<bibl id='ISO3166' key='ISO 3166'>
+(International Organization for Standardization).
+<emph>ISO 3166-1:1997 (E).
+Codes for the representation of names of countries and their subdivisions
+&mdash; Part 1: Country codes</emph>
+[Geneva]: International Organization for
+Standardization, 1997.</bibl>
+
+<bibl id='ISO10646' key='ISO/IEC 10646'>ISO
+(International Organization for Standardization).
+<emph>ISO/IEC 10646-1993 (E). Information technology &mdash; Universal
+Multiple-Octet Coded Character Set (UCS) &mdash; Part 1:
+Architecture and Basic Multilingual Plane.</emph>
+[Geneva]: International Organization for
+Standardization, 1993 (plus amendments AM 1 through AM 7).
+</bibl>
+
+<bibl id='Unicode' key='Unicode'>The Unicode Consortium.
+<emph>The Unicode Standard, Version 2.0.</emph>
+Reading, Mass.: Addison-Wesley Developers Press, 1996.</bibl>
+
+</blist>
+
+</div2>
+
+<div2><head>他の参考文献</head>
+
+<blist>
+
+<bibl id='Aho' key='Aho/Ullman'>Aho, Alfred V.,
+Ravi Sethi, and Jeffrey D. Ullman.
+<emph>Compilers: Principles, Techniques, and Tools</emph>.
+Reading: Addison-Wesley, 1986, rpt. corr. 1988.</bibl>
+
+<bibl id="Berners-Lee" xml-link="simple" key="Berners-Lee et al.">
+Berners-Lee, T., R. Fielding, and L. Masinter.
+<emph>Uniform Resource Identifiers (URI): Generic Syntax and
+Semantics</emph>.
+1997.
+(Work in progress; see updates to RFC1738.)</bibl>
+
+<bibl id='ABK' key='Br&#252;ggemann-Klein'>Br&#252;ggemann-Klein, Anne.
+<emph>Regular Expressions into Finite Automata</emph>.
+Extended abstract in I. Simon, Hrsg., LATIN 1992,
+S. 97-98. Springer-Verlag, Berlin 1992.
+Full Version in Theoretical Computer Science 120: 197-213, 1993.
+<!--
+Universitat Freiburg, Institut fur Informatik,
+Bericht 33, Juli 1991.-->
+</bibl>
+
+<bibl id='ABKDW' key='Br&#252;ggemann-Klein and Wood'>Br&#252;ggemann-Klein, Anne,
+and Derick Wood.
+<emph>Deterministic Regular Languages</emph>.
+Universit&#228;t Freiburg, Institut f&#252;r Informatik,
+Bericht 38, Oktober 1991.
+</bibl>
+
+<bibl id="RFC1738" xml-link="simple" key="IETF RFC1738">
+IETF (Internet Engineering Task Force).
+<emph>RFC 1738: Uniform Resource Locators (URL)</emph>,
+ed. T. Berners-Lee, L. Masinter, M. McCahill.
+1994.
+</bibl>
+
+<bibl id="RFC1808" xml-link="simple" key="IETF RFC1808">
+IETF (Internet Engineering Task Force).
+<emph>RFC 1808: Relative Uniform Resource Locators</emph>,
+ed. R. Fielding.
+1995.
+</bibl>
+
+<bibl id="RFC2141" xml-link="simple" key="IETF RFC2141">
+IETF (Internet Engineering Task Force).
+<emph>RFC 2141: URN Syntax</emph>,
+ed. R. Moats.
+1997.
+</bibl>
+
+<bibl id='ISO8879' key='ISO/IEC 8879'>ISO
+(International Organization for Standardization).
+<emph>ISO/IEC 8879-1986 (E). Information processing &mdash; Text and Office
+Systems &mdash; Standard Generalized Markup Language (SGML).</emph> First
+edition &mdash; 1986-10-15. [Geneva]: International Organization for
+Standardization, 1986.
+</bibl>
+
+
+<bibl id='ISO10744' key='ISO/IEC 10744'>ISO
+(International Organization for Standardization).
+<emph>ISO/IEC 10744-1992 (E). Information technology &mdash;
+Hypermedia/Time-based Structuring Language (HyTime).
+</emph>
+[Geneva]: International Organization for
+Standardization, 1992.
+<emph>Extended Facilities Annexe.</emph>
+[Geneva]: International Organization for
+Standardization, 1996.
+</bibl>
+
+
+
+</blist>
+</div2>
+</div1>
+<div1 id='CharClasses'>
+<head>文字クラス</head>
+
+<p>Unicode標準に定義する&property;にしたがって,文字は,&base-character;(BaseChar)(これらは,&diacritical-mark;を除くラテンアルファベットのアルファベット文字を含む),&ideographic;(ideographic)及び&combining-character;(CombiningChar)(このクラスは,ほとんどの&diacritical-mark;を含む)にクラス分けする。これらのクラスは,結合し,&letter;(Letter)のクラスとなる。10進数値(Digit)及び&extender;(Extender)も区別する。
+<scrap lang="ebnf" id="CHARACTERS">
+<head>文字</head>
+<prodgroup pcw3="3" pcw4="15">
+<prod id="NT-Letter"><lhs>Letter</lhs>
+<rhs><nt def="NT-BaseChar">BaseChar</nt>
+| <nt def="NT-Ideographic">Ideographic</nt></rhs> </prod>
+<prod id='NT-BaseChar'><lhs>BaseChar</lhs>
+<rhs>[#x0041-#x005A]
+|&nbsp;[#x0061-#x007A]
+|&nbsp;[#x00C0-#x00D6]
+|&nbsp;[#x00D8-#x00F6]
+|&nbsp;[#x00F8-#x00FF]
+|&nbsp;[#x0100-#x0131]
+|&nbsp;[#x0134-#x013E]
+|&nbsp;[#x0141-#x0148]
+|&nbsp;[#x014A-#x017E]
+|&nbsp;[#x0180-#x01C3]
+|&nbsp;[#x01CD-#x01F0]
+|&nbsp;[#x01F4-#x01F5]
+|&nbsp;[#x01FA-#x0217]
+|&nbsp;[#x0250-#x02A8]
+|&nbsp;[#x02BB-#x02C1]
+|&nbsp;#x0386
+|&nbsp;[#x0388-#x038A]
+|&nbsp;#x038C
+|&nbsp;[#x038E-#x03A1]
+|&nbsp;[#x03A3-#x03CE]
+|&nbsp;[#x03D0-#x03D6]
+|&nbsp;#x03DA
+|&nbsp;#x03DC
+|&nbsp;#x03DE
+|&nbsp;#x03E0
+|&nbsp;[#x03E2-#x03F3]
+|&nbsp;[#x0401-#x040C]
+|&nbsp;[#x040E-#x044F]
+|&nbsp;[#x0451-#x045C]
+|&nbsp;[#x045E-#x0481]
+|&nbsp;[#x0490-#x04C4]
+|&nbsp;[#x04C7-#x04C8]
+|&nbsp;[#x04CB-#x04CC]
+|&nbsp;[#x04D0-#x04EB]
+|&nbsp;[#x04EE-#x04F5]
+|&nbsp;[#x04F8-#x04F9]
+|&nbsp;[#x0531-#x0556]
+|&nbsp;#x0559
+|&nbsp;[#x0561-#x0586]
+|&nbsp;[#x05D0-#x05EA]
+|&nbsp;[#x05F0-#x05F2]
+|&nbsp;[#x0621-#x063A]
+|&nbsp;[#x0641-#x064A]
+|&nbsp;[#x0671-#x06B7]
+|&nbsp;[#x06BA-#x06BE]
+|&nbsp;[#x06C0-#x06CE]
+|&nbsp;[#x06D0-#x06D3]
+|&nbsp;#x06D5
+|&nbsp;[#x06E5-#x06E6]
+|&nbsp;[#x0905-#x0939]
+|&nbsp;#x093D
+|&nbsp;[#x0958-#x0961]
+|&nbsp;[#x0985-#x098C]
+|&nbsp;[#x098F-#x0990]
+|&nbsp;[#x0993-#x09A8]
+|&nbsp;[#x09AA-#x09B0]
+|&nbsp;#x09B2
+|&nbsp;[#x09B6-#x09B9]
+|&nbsp;[#x09DC-#x09DD]
+|&nbsp;[#x09DF-#x09E1]
+|&nbsp;[#x09F0-#x09F1]
+|&nbsp;[#x0A05-#x0A0A]
+|&nbsp;[#x0A0F-#x0A10]
+|&nbsp;[#x0A13-#x0A28]
+|&nbsp;[#x0A2A-#x0A30]
+|&nbsp;[#x0A32-#x0A33]
+|&nbsp;[#x0A35-#x0A36]
+|&nbsp;[#x0A38-#x0A39]
+|&nbsp;[#x0A59-#x0A5C]
+|&nbsp;#x0A5E
+|&nbsp;[#x0A72-#x0A74]
+|&nbsp;[#x0A85-#x0A8B]
+|&nbsp;#x0A8D
+|&nbsp;[#x0A8F-#x0A91]
+|&nbsp;[#x0A93-#x0AA8]
+|&nbsp;[#x0AAA-#x0AB0]
+|&nbsp;[#x0AB2-#x0AB3]
+|&nbsp;[#x0AB5-#x0AB9]
+|&nbsp;#x0ABD
+|&nbsp;#x0AE0
+|&nbsp;[#x0B05-#x0B0C]
+|&nbsp;[#x0B0F-#x0B10]
+|&nbsp;[#x0B13-#x0B28]
+|&nbsp;[#x0B2A-#x0B30]
+|&nbsp;[#x0B32-#x0B33]
+|&nbsp;[#x0B36-#x0B39]
+|&nbsp;#x0B3D
+|&nbsp;[#x0B5C-#x0B5D]
+|&nbsp;[#x0B5F-#x0B61]
+|&nbsp;[#x0B85-#x0B8A]
+|&nbsp;[#x0B8E-#x0B90]
+|&nbsp;[#x0B92-#x0B95]
+|&nbsp;[#x0B99-#x0B9A]
+|&nbsp;#x0B9C
+|&nbsp;[#x0B9E-#x0B9F]
+|&nbsp;[#x0BA3-#x0BA4]
+|&nbsp;[#x0BA8-#x0BAA]
+|&nbsp;[#x0BAE-#x0BB5]
+|&nbsp;[#x0BB7-#x0BB9]
+|&nbsp;[#x0C05-#x0C0C]
+|&nbsp;[#x0C0E-#x0C10]
+|&nbsp;[#x0C12-#x0C28]
+|&nbsp;[#x0C2A-#x0C33]
+|&nbsp;[#x0C35-#x0C39]
+|&nbsp;[#x0C60-#x0C61]
+|&nbsp;[#x0C85-#x0C8C]
+|&nbsp;[#x0C8E-#x0C90]
+|&nbsp;[#x0C92-#x0CA8]
+|&nbsp;[#x0CAA-#x0CB3]
+|&nbsp;[#x0CB5-#x0CB9]
+|&nbsp;#x0CDE
+|&nbsp;[#x0CE0-#x0CE1]
+|&nbsp;[#x0D05-#x0D0C]
+|&nbsp;[#x0D0E-#x0D10]
+|&nbsp;[#x0D12-#x0D28]
+|&nbsp;[#x0D2A-#x0D39]
+|&nbsp;[#x0D60-#x0D61]
+|&nbsp;[#x0E01-#x0E2E]
+|&nbsp;#x0E30
+|&nbsp;[#x0E32-#x0E33]
+|&nbsp;[#x0E40-#x0E45]
+|&nbsp;[#x0E81-#x0E82]
+|&nbsp;#x0E84
+|&nbsp;[#x0E87-#x0E88]
+|&nbsp;#x0E8A
+|&nbsp;#x0E8D
+|&nbsp;[#x0E94-#x0E97]
+|&nbsp;[#x0E99-#x0E9F]
+|&nbsp;[#x0EA1-#x0EA3]
+|&nbsp;#x0EA5
+|&nbsp;#x0EA7
+|&nbsp;[#x0EAA-#x0EAB]
+|&nbsp;[#x0EAD-#x0EAE]
+|&nbsp;#x0EB0
+|&nbsp;[#x0EB2-#x0EB3]
+|&nbsp;#x0EBD
+|&nbsp;[#x0EC0-#x0EC4]
+|&nbsp;[#x0F40-#x0F47]
+|&nbsp;[#x0F49-#x0F69]
+|&nbsp;[#x10A0-#x10C5]
+|&nbsp;[#x10D0-#x10F6]
+|&nbsp;#x1100
+|&nbsp;[#x1102-#x1103]
+|&nbsp;[#x1105-#x1107]
+|&nbsp;#x1109
+|&nbsp;[#x110B-#x110C]
+|&nbsp;[#x110E-#x1112]
+|&nbsp;#x113C
+|&nbsp;#x113E
+|&nbsp;#x1140
+|&nbsp;#x114C
+|&nbsp;#x114E
+|&nbsp;#x1150
+|&nbsp;[#x1154-#x1155]
+|&nbsp;#x1159
+|&nbsp;[#x115F-#x1161]
+|&nbsp;#x1163
+|&nbsp;#x1165
+|&nbsp;#x1167
+|&nbsp;#x1169
+|&nbsp;[#x116D-#x116E]
+|&nbsp;[#x1172-#x1173]
+|&nbsp;#x1175
+|&nbsp;#x119E
+|&nbsp;#x11A8
+|&nbsp;#x11AB
+|&nbsp;[#x11AE-#x11AF]
+|&nbsp;[#x11B7-#x11B8]
+|&nbsp;#x11BA
+|&nbsp;[#x11BC-#x11C2]
+|&nbsp;#x11EB
+|&nbsp;#x11F0
+|&nbsp;#x11F9
+|&nbsp;[#x1E00-#x1E9B]
+|&nbsp;[#x1EA0-#x1EF9]
+|&nbsp;[#x1F00-#x1F15]
+|&nbsp;[#x1F18-#x1F1D]
+|&nbsp;[#x1F20-#x1F45]
+|&nbsp;[#x1F48-#x1F4D]
+|&nbsp;[#x1F50-#x1F57]
+|&nbsp;#x1F59
+|&nbsp;#x1F5B
+|&nbsp;#x1F5D
+|&nbsp;[#x1F5F-#x1F7D]
+|&nbsp;[#x1F80-#x1FB4]
+|&nbsp;[#x1FB6-#x1FBC]
+|&nbsp;#x1FBE
+|&nbsp;[#x1FC2-#x1FC4]
+|&nbsp;[#x1FC6-#x1FCC]
+|&nbsp;[#x1FD0-#x1FD3]
+|&nbsp;[#x1FD6-#x1FDB]
+|&nbsp;[#x1FE0-#x1FEC]
+|&nbsp;[#x1FF2-#x1FF4]
+|&nbsp;[#x1FF6-#x1FFC]
+|&nbsp;#x2126
+|&nbsp;[#x212A-#x212B]
+|&nbsp;#x212E
+|&nbsp;[#x2180-#x2182]
+|&nbsp;[#x3041-#x3094]
+|&nbsp;[#x30A1-#x30FA]
+|&nbsp;[#x3105-#x312C]
+|&nbsp;[#xAC00-#xD7A3]
+</rhs></prod>
+<prod id='NT-Ideographic'><lhs>Ideographic</lhs>
+<rhs>[#x4E00-#x9FA5]
+|&nbsp;#x3007
+|&nbsp;[#x3021-#x3029]
+</rhs></prod>
+<prod id='NT-CombiningChar'><lhs>CombiningChar</lhs>
+<rhs>[#x0300-#x0345]
+|&nbsp;[#x0360-#x0361]
+|&nbsp;[#x0483-#x0486]
+|&nbsp;[#x0591-#x05A1]
+|&nbsp;[#x05A3-#x05B9]
+|&nbsp;#x05BB#x05BD
+|&nbsp;#x05BF
+|&nbsp;[#x05C1-#x05C2]
+|&nbsp;#x05C4
+|&nbsp;#x064B#x0652
+|&nbsp;#x0670
+|&nbsp;[#x06D6-#x06DC]
+|&nbsp;#x06DD#x06DF
+|&nbsp;[#x06E0-#x06E4]
+|&nbsp;[#x06E7-#x06E8]
+|&nbsp;[#x06EA-#x06ED]
+|&nbsp;[#x0901-#x0903]
+|&nbsp;#x093C
+|&nbsp;[#x093E-#x094C]
+|&nbsp;#x094D
+|&nbsp;[#x0951-#x0954]
+|&nbsp;[#x0962-#x0963]
+|&nbsp;[#x0981-#x0983]
+|&nbsp;#x09BC
+|&nbsp;#x09BE
+|&nbsp;#x09BF
+|&nbsp;[#x09C0-#x09C4]
+|&nbsp;[#x09C7-#x09C8]
+|&nbsp;[#x09CB-#x09CD]
+|&nbsp;#x09D7
+|&nbsp;[#x09E2-#x09E3]
+|&nbsp;#x0A02
+|&nbsp;#x0A3C
+|&nbsp;#x0A3E
+|&nbsp;#x0A3F
+|&nbsp;[#x0A40-#x0A42]
+|&nbsp;[#x0A47-#x0A48]
+|&nbsp;[#x0A4B-#x0A4D]
+|&nbsp;[#x0A70-#x0A71]
+|&nbsp;[#x0A81-#x0A83]
+|&nbsp;#x0ABC
+|&nbsp;[#x0ABE-#x0AC5]
+|&nbsp;[#x0AC7-#x0AC9]
+|&nbsp;[#x0ACB-#x0ACD]
+|&nbsp;[#x0B01-#x0B03]
+|&nbsp;#x0B3C
+|&nbsp;[#x0B3E-#x0B43]
+|&nbsp;[#x0B47-#x0B48]
+|&nbsp;[#x0B4B-#x0B4D]
+|&nbsp;[#x0B56-#x0B57]
+|&nbsp;[#x0B82-#x0B83]
+|&nbsp;[#x0BBE-#x0BC2]
+|&nbsp;[#x0BC6-#x0BC8]
+|&nbsp;[#x0BCA-#x0BCD]
+|&nbsp;#x0BD7
+|&nbsp;[#x0C01-#x0C03]
+|&nbsp;[#x0C3E-#x0C44]
+|&nbsp;[#x0C46-#x0C48]
+|&nbsp;[#x0C4A-#x0C4D]
+|&nbsp;[#x0C55-#x0C56]
+|&nbsp;[#x0C82-#x0C83]
+|&nbsp;[#x0CBE-#x0CC4]
+|&nbsp;[#x0CC6-#x0CC8]
+|&nbsp;[#x0CCA-#x0CCD]
+|&nbsp;[#x0CD5-#x0CD6]
+|&nbsp;[#x0D02-#x0D03]
+|&nbsp;[#x0D3E-#x0D43]
+|&nbsp;[#x0D46-#x0D48]
+|&nbsp;[#x0D4A-#x0D4D]
+|&nbsp;#x0D57
+|&nbsp;#x0E31
+|&nbsp;[#x0E34-#x0E3A]
+|&nbsp;[#x0E47-#x0E4E]
+|&nbsp;#x0EB1
+|&nbsp;[#x0EB4-#x0EB9]
+|&nbsp;[#x0EBB-#x0EBC]
+|&nbsp;[#x0EC8-#x0ECD]
+|&nbsp;[#x0F18-#x0F19]
+|&nbsp;#x0F35
+|&nbsp;#x0F37
+|&nbsp;#x0F39
+|&nbsp;#x0F3E
+|&nbsp;#x0F3F
+|&nbsp;[#x0F71-#x0F84]
+|&nbsp;[#x0F86-#x0F8B]
+|&nbsp;[#x0F90-#x0F95]
+|&nbsp;#x0F97
+|&nbsp;[#x0F99-#x0FAD]
+|&nbsp;[#x0FB1-#x0FB7]
+|&nbsp;#x0FB9
+|&nbsp;[#x20D0-#x20DC]
+|&nbsp;#x20E1
+|&nbsp;[#x302A-#x302F]
+|&nbsp;#x3099
+|&nbsp;#x309A
+</rhs></prod>
+<prod id='NT-Digit'><lhs>Digit</lhs>
+<rhs>[#x0030-#x0039]
+|&nbsp;[#x0660-#x0669]
+|&nbsp;[#x06F0-#x06F9]
+|&nbsp;[#x0966-#x096F]
+|&nbsp;[#x09E6-#x09EF]
+|&nbsp;[#x0A66-#x0A6F]
+|&nbsp;[#x0AE6-#x0AEF]
+|&nbsp;[#x0B66-#x0B6F]
+|&nbsp;[#x0BE7-#x0BEF]
+|&nbsp;[#x0C66-#x0C6F]
+|&nbsp;[#x0CE6-#x0CEF]
+|&nbsp;[#x0D66-#x0D6F]
+|&nbsp;[#x0E50-#x0E59]
+|&nbsp;[#x0ED0-#x0ED9]
+|&nbsp;[#x0F20-#x0F29]
+</rhs></prod>
+<prod id='NT-Extender'><lhs>Extender</lhs>
+<rhs>#x00B7
+|&nbsp;#x02D0
+|&nbsp;#x02D1
+|&nbsp;#x0387
+|&nbsp;#x0640
+|&nbsp;#x0E46
+|&nbsp;#x0EC6
+|&nbsp;#x3005
+|&nbsp;[#x3031-#x3035]
+|&nbsp;[#x309D-#x309E]
+|&nbsp;[#x30FC-#x30FE]
+</rhs></prod>
+
+</prodgroup>
+</scrap>
+</p>
+<p>ここで定義する文字クラスは,Unicode文字データベースから,次のとおりに得ることができる。
+<ulist>
+<item>
+<p>a) 名前開始文字は,Ll, Lu, Lo, Lt, Nlカテゴリ内の一つでなければならない。</p>
+</item>
+<item>
+<p>b) 名前開始文字以外の名前文字は,Mc, Me, Mn, Lm, Ndカテゴリ内の一つでなければならない。</p>
+</item>
+<item>
+<p>c) &compatibility-area;にある文字(文字符号で#xF900より大きく#xFFFEより小さい文字)は,XMLにおける名前としては,許されない。</p>
+</item>
+<item>
+<p>d) &font-decomposition;か&compatibility-decomposition;をもつ文字(つまり,データベース内の5番目のフィールドに"compatibility formatting tag"があるもの。これは,5番目のフィールドが,"&lt;"で始まることによってマーク付けされる。)は,許されない。</p>
+</item>
+<item>
+<p>e) 次の文字は,名前開始文字として扱う。これは,&property-file;が,これらの文字をアルファベットに類似すると見なすことによる。それらは
+[#x02BB-#x02C1], #x0559, #x06E5, #x06E6とする。</p>
+</item>
+<item>
+<p>f) 文字符号が#x20DD-#x20E0の文字は,(Unicode の5.14にしたがって)除外する。</p>
+</item>
+<item>
+<p>g) 文字符号が#x00B7の文字は,&property-list;にしたがって,&extender;(extender)に分類する。</p>
+</item>
+<item>
+<p>h) 文字#x0387は,これに相当する正規形が#x00B7なので,名前文字に追加する。</p>
+</item>
+<item>
+<p>i) 文字':'及び'_'は,名前開始文字として許す。</p>
+</item>
+<item>
+<p>j) 文字'-'及び'.'は,名前文字として許す。</p>
+</item>
+</ulist>
+</p>
+</div1>
+<inform-div1 id="sec-xml-and-sgml">
+<head>XML及びSGML</head>
+
+<p>XMLは,SGMLの&subset;として設計されている。すなわち,すべての<termref def="dt-valid">&valid;</termref>なXML文書は,規格に適合するSGML文書にもなる。SGMLが文書に課す制限以外に,XMLがいかなる制限を課すかに関する詳細は,別の<loc href='http://www.w3.org/TR/NOTE-sgml-xml'>規程</loc>を参照のこと。この規程は,XMLの制約条件を示すSGML宣言を含み,これは,SGML&parser;に使用できる。
+</p>
+</inform-div1>
+<inform-div1 id="sec-entexpand">
+<head>実体参照及び文字参照の展開</head>
+<p>この付録は,実体参照及び文字参照を認識し,展開する,一連の流れを,例に使って示す。</p>
+<p>
+DTDが,次の宣言を含む場合を考える。
+<eg><![CDATA[<!ENTITY example "<p>An ampersand (&#38;#38;) may be escaped
+numerically (&#38;#38;#38;) or with a general entity
+(&amp;amp;).</p>" >
+]]></eg>
+XML&processor;は,実体の宣言を構文解析した時点で文字参照を認識し,これを解決する。実体"<code>example</code>"の値として,次の&string;を保存する。
+<eg><![CDATA[<p>An ampersand (&#38;) may be escaped
+numerically (&#38;#38;) or with a general entity
+(&amp;amp;).</p>
+]]></eg>
+文書内で"<code>&amp;example;</code>"を参照すると,このテキストは,再び構文解析される。このとき,要素"<code>p</code>"の開始タグ及び終了タグを認識し,三つの参照を認識し展開する。その結果,要素"<code>p</code>"は,次の内容をもつ(すべてデータとし,区切り子又は&markup;は存在しない。)。
+<eg><![CDATA[An ampersand (&) may be escaped
+numerically (&#38;) or with a general entity
+(&amp;).
+]]></eg>
+</p>
+<p>規則及びその効果をより詳細に示すため,さらに複雑な例を示す。次の例で,行番号は,参照の便宜のためだけに付ける。
+<eg><![CDATA[1 <?xml version='1.0'?>
+2 <!DOCTYPE test [
+3 <!ELEMENT test (#PCDATA) >
+4 <!ENTITY % xx '&#37;zz;'>
+5 <!ENTITY % zz '&#60;!ENTITY tricky "error-prone" >' >
+6 %xx;
+7 ]>
+8 <test>This sample shows a &tricky; method.</test>
+]]></eg>
+これを処理すると,次のとおりとなる。
+<ulist spacing="compact">
+<item><p>a) 4行目で,37番目の文字への参照を直ちに展開し,パラメタ実体"<code>xx</code>"を,シンボルテーブルに"<code>%zz;</code>"という値とともに保存する。&replacement-text;を再び走査することはないので,パラメタ実体"<code>zz</code>"への参照は認識しない("<code>zz</code>"は,まだ宣言されていないので,走査されれば,&error;となる。)。</p></item>
+<item><p>b) 5行目で,文字参照"<code>&amp;#60;</code>"を直ちに展開し,パラメタ実体"<code>zz</code>"を"<code>&lt;!ENTITY tricky "error-prone" ></code>"という&replacement-text;とともに保存する。これは,&well-formed;の実体宣言とする。</p></item>
+<item><p>c) 6行目で,"<code>xx</code>"への参照を認識し,"<code>xx</code>"の&replacement-text;(すなわち,"<code>%zz;</code>")を構文解析する。"<code>zz</code>"への参照を続いて認識し,&replacement-text;("<code>&lt;!ENTITY tricky "error-prone" ></code>")を構文解析する。一般実体"<code>tricky</code>"は,この時点では,宣言されており,その&replacement-text;は,"<code>error-prone</code>"とする。 </p></item>
+<item><p>d) 8行目で,一般実体"<code>tricky</code>"への参照を認識し,展開する。要素"<code>test</code>"の完全な内容は,次の(内容をそれ自体表現する。)&string;となる。つまり,<emph>This sample shows a error-prone method.</emph>
+</p></item>
+</ulist>
+</p>
+</inform-div1>
+<inform-div1 id="determinism">
+<head>決定的内容モデル</head>
+<p><termref def='dt-compat'>互換性のため</termref>,要素宣言における内容モデルは,決定的とする必要がある。
+</p>
+<!-- FINAL EDIT: WebSGML allows ambiguity? -->
+<p>SGMLは,決定的内容モデル(SGMLでは,非あいまいと呼ぶ。)を要求する。SGMLシステムを用いて作成したXML&processor;は,非決定的内容モデルを&error;としてもよい。</p>
+<p>例えば,内容モデル<code>((b, c) | (b, d))</code>は非決定的となる。これは,最初に<code>b</code>を与えたとき,モデル内のいずれの<code>b</code>と&match;するのが望ましいか,その次の要素を先読みすることなしには,&parser;は知ることができないことによる。この場合は,<code>b</code>への二つの参照は,一つの参照にまとめることができ,モデルは,<code>(b, (c | d))</code>となる。これで,最初の<code>b</code>が,内容モデル内の一つの名前とだけ&match;することは明らかとなる。&parser;は,先読みして,次に来るものを知る必要がない。<code>c</code>も<code>d</code>も,受理される。</p>
+<p>形式的に示す。Aho, Sethi, and Ullman <bibref ref='Aho'/>の3.9のアルゴリズム3.5の標準的なアルゴリズムを用いて,内容モデルから有限オートマトンを構成することができる。この種の多くのアルゴリズムでは,正規表現における各々の位置(つまり,正規表現の構文木における各々の末端ノード)に対して,follow set(次にどの位置に移動可能かを表すもの)を構成する。ある位置に対するfollow setにおいて,複数の位置が同じ要素型名でラベル付けされていれば,その内容モデルは&error;となり,&error;を返す場合もある。
+</p>
+<p>すべての非決定的内容モデルを等価な決定的内容モデルに変換することはできないが,多くの非決定的内容モデルを変換するアルゴリズムが存在する。Br&#252;ggemann-Klein 1991 <bibref ref='ABK'/>を参照のこと。</p>
+</inform-div1>
+<inform-div1 id="sec-guessing">
+<head>文字符号化の自動検出</head>
+<p>
+XMLの符号化宣言は,各実体の内部ラベルとして機能し,どの文字符号化を使用するかを示す。しかし,XML&processor;は,内部ラベルを読む前に,どの文字符号化を使用するかを知る必要があり,これが,内部ラベルが示そうとすることになる。一般的には,これは,絶望的な状態となる。しかし,XMLにおいては,完全には絶望的ではない。これは,XMLが,次の二つの点で一般的な場合に対する制限を加えることによる。一つの制限は,どの実装も有限個の文字符号化だけのサポートを想定することとする。他の一つの制限は,各実体で使用する文字符号化を自動検出可能とする,XMLの符号化宣言の位置及び内容に関する制限とする。多くの場合に,XMLのデータストリームに加え,他の情報が利用できる。ここでは,XMLの実体が&processor;に渡されるとき,(外部)情報を伴うかどうかによって,二つの場合に分ける。まず最初の場合を示す。</p>
+<p>
+UTF-8形式又はUTF-16形式ではないXML実体は,最初の文字を‘<code>&lt;?xml</code>'とするXML符号化宣言で始まら<emph>なければならない</emph>ので,どの適合した&processor;も,入力にある2オクテット又は4オクテットを調べれば,次のどの場合があてはまるかを検出できる。このリストを読む際には,UCS-4の'&lt;'が"<code>#x0000003C</code>",'?'が"<code>#x0000003F</code>",及びUTF-16のデータ&stream;の必要とする&byte-order-mark;が"<code>#xFEFF</code>"ということを知っておくと役立つかもしれない。</p>
+<p>
+<ulist>
+<item>
+<p>a) <code>00 00 00 3C</code>: UCS-4, big-endian マシン (1234順)</p>
+</item>
+<item>
+<p>b) <code>3C 00 00 00</code>: UCS-4, little-endian マシン (4321順)</p>
+</item>
+<item>
+<p>c) <code>00 00 3C 00</code>: UCS-4, 普通ではないオクテット順 (2143)</p>
+</item>
+<item>
+<p>d) <code>00 3C 00 00</code>: UCS-4, 普通ではないオクテット順 (3412)</p>
+</item>
+<item>
+<p>e) <code>FE FF</code>: UTF-16, big-endian</p>
+</item>
+<item>
+<p>f) <code>FF FE</code>: UTF-16, little-endian</p>
+</item>
+<item>
+<p>g) <code>00 3C 00 3F</code>: UTF-16, big-endian, &byte-order-mark;なし(したがって,厳密にいえば,&error;とする。)。</p>
+</item>
+<item>
+<p>h) <code>3C 00 3F 00</code>: UTF-16, little-endian, &byte-order-mark;なし(したがって,厳密にいえば,&error;とする。)。</p>
+</item>
+<item>
+<p>i) <code>3C 3F 78 6D</code>: UTF-8, ISO 646, ASCII, ISO 8859の各パート,Shift-JIS,EUC,並びに任意の他の7ビット,8ビット又は混在幅の符号化であって,ASCII文字を通常の位置,幅及び値とすることを保証するもの。これらのどれに対応するかを検出するためには,実際の符号化宣言を読み込まなければならない。しかし,これらすべての符号化は,ASCII文字に対して同じビットパターンを使用するので,符号化宣言自体は,正確に読込み可能とする。
+</p>
+</item>
+<item>
+<p>j) <code>4C 6F A7 94</code>: EBCDIC (又はその変種。どのコードページを使用するかを知るためには,符号化宣言全体を読み込まれなければならない。)</p>
+</item>
+<item>
+<p>k) その他: 符号化宣言なしのUTF-8。そうでないときには,データ&stream;が壊れているか,断片的になっているか,何らかの形式にしたがって埋め込まれている。</p>
+</item>
+</ulist>
+</p>
+<p>
+この程度の自動判別でも,XMLの符号化宣言を読み込み,文字符号化の&identifier;を解析するには十分とする。&identifier;の解析は,類似する各々の符号化の一つ一つを区別するために必要とする(例えば,UTF-8及び8859を区別するため,8859の各パートを区別するため,使用している特定のEBCDICコードページを区別するため,など。)。
+</p>
+<p>
+符号化宣言の内容をASCII文字に限定しているので,どの分類の符号化を使用するかを検出すれば,&processor;は,符号化宣言全体を正確に読み込むことができる。現実問題として,広く使用されている文字符号化は,上の分類のいずれかにあてはまるので,オペレーティングシステム又は伝送プロトコルが与える外部情報を信頼不可能なときでさえも,内部ラベルで文字符号化をかなり正確に示すことが,XML符号化宣言によって可能となる。
+</p>
+<p>
+&processor;が使用する文字符号化を検出しさえすれば,それぞれの場合に対して別個の入力ルーチンを呼び出す,又は入力する各文字に対し適切な変換関数を呼び出すことによって,適切な動作が可能となる。</p>
+<p>
+自分自体にラベル付けをするいかなるシステムでも同様だが,ソフトウェアが,符号化宣言を更新せずに実体の文字集合又は符号化を変えたならば,XMLの符号化宣言は,機能しない。文字符号化ルーチンの実装者は,実体のラベル付けに使用する内部及び外部の情報の正確さの保証に注意するのが望ましい。
+</p>
+<p>2番目の場合は,XMLの実体の他に,符号化情報が存在するときであって,いくつかのファイルシステム及びネットワークプロトコルでは,その符号化情報が存在する。複数の情報が利用できるとき,<!-- (e.g. both the
+internal encoding declaration and an external label), -->それらの相対的な優先度及びそれらが矛盾したときの望ましい処理方法は,XMLの配送に使用する,より高水準のプロトコルの一部として規程するのがよい。例えば,内部ラベル及び外部&header;に存在するMIME形式のラベルの相対的な優先度に対する規則は,text/xml及びapplication/xmlのMIME型を定義するRFC文書の一部となる方がよい。しかし,相互運用性のために,次の規則に従うことが望ましい。
+<ulist>
+<item><p>a) XMLの実体がファイルに存在すれば,&byte-order-mark;及び符号化宣言PIは,(存在すれば)文字符号化を決定するために使用する。他のすべての&hueristics;及び情報は,&error;回復のためだけに用いる。
+</p></item>
+<item><p>b) XMLの実体をMIME型text/xmlで配送するときは,このMIME型のもつcharsetパラメタが文字符号化方法を決定する。他のすべての&hueristics;及び情報は,&error;回復のためだけに用いる。
+</p></item>
+<item><p>c) XMLの実体を <!-- via the HTTP protocol -->MIME型application/xmlで配送するときは,&byte-order-mark;及び符号化宣言PIを(存在すれば)文字符号化の決定のために使用する。他のすべての&hueristics;及び情報は&error;回復のためだけに用いる。
+</p></item>
+</ulist>
+これらの規則は,プロトコルについての資料がないときにだけ用いる。特に,MIME型text/xml及びapplication/xmlを定義したら,これらを規定するRFCに存在する規定が,これらの規則に取って代わる。
+</p>
+</inform-div1>
+<!--
+<div1 id='sec-trival-grammar'>
+<head>A Trivial Grammar for XML Documents</head>
+<p>The grammar given in the body of this specification is relatively
+simple, but for some purposes it is convenient to have an even simpler
+one.
+A very simple, though non-conforming, <termref def="dt-xml-proc">XML
+processor</termref> could parse a <termref
+def="dt-wellformed">well-formed</termref> XML document using the
+following simplified grammar, recognizing all element boundaries
+correctly, though not expanding entity references and not detecting
+all errors:
+
+<scrap lang="ebnf">
+<head>Trivial text grammar</head>
+<prodgroup pcw2="5.5" pcw4="17" pcw5="10">
+<prod id='NT-simpleDoc'><lhs>simpleDoc</lhs>
+<rhs>(<nt def='NT-SimpleData'>SimpleData</nt>
+| <nt def='NT-Markup'>Markup</nt>)*</rhs></prod>
+<prod id="NT-SimpleData"><lhs>SimpleData</lhs>
+<rhs>[^&lt;&amp;]*</rhs>
+<com>cf. PCData</com>
+</prod>
+<prod id="NT-SimpleLit"><lhs>SimpleLit</lhs>
+<rhs>('"' [^"]* '"')</rhs>
+<rhs>|&nbsp;("'" [^']* "'")</rhs>
+<com>cf. SkipLit</com>
+</prod>
+<prod id='NT-Markup'><lhs>Markup</lhs>
+<rhs>'&lt;' <nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>?
+<nt def='NT-SimpleLit'>SimpleLit</nt>)*
+<nt def='NT-S'>S</nt>? '&gt;'</rhs><com>start-tags </com>
+<rhs>| '&lt;' <nt def='NT-Name'>Name</nt>
+(<nt def='NT-S'>S</nt>
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>?
+<nt def='NT-SimpleLit'>SimpleLit</nt>)*
+<nt def='NT-S'>S</nt>? '/&gt;'</rhs><com>empty elements</com>
+<rhs>| '&lt;/'
+<nt def='NT-Name'>Name</nt>
+<nt def='NT-S'>S</nt>? '&gt;'</rhs>
+<com>end-tags </com>
+<rhs>| '&amp;' <nt def='NT-Name'>Name</nt> ';'</rhs>
+<com>entity references </com>
+<rhs>| '&amp;#' [0-9]+ ';'</rhs>
+<com>decimal character references </com>
+<rhs>| '&hcro;' [0-9a-fA-F]+ ';'</rhs>
+<com>hexadecimal character references </com>
+<rhs>| '&lt;!&como;'
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* '&comc;' <nt def='NT-Char'>Char</nt>*))
+'&comc;&gt;'</rhs>
+<com>comments </com>
+<rhs>| '&lt;?'
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*))
+'&pic;'</rhs>
+<com>processing instructions </com>
+<rhs>| '&lt;![CDATA['
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* ']]&gt;' <nt def='NT-Char'>Char</nt>*))
+']]&gt;'</rhs>
+<com>CDATA sections</com>
+<rhs>| '&lt;!DOCTYPE'
+(<nt def="NT-Char">Char</nt> - ('[' | ']'))+
+('['
+<nt def="NT-simpleDTD">simpleDTD</nt>*
+']')? '&gt;'</rhs>
+<com>doc type declaration</com>
+</prod>
+<prod id="NT-simpleDTD"><lhs>simpleDTD</lhs>
+<rhs>'&lt;!&como;'
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* '&comc;' <nt def='NT-Char'>Char</nt>*))
+'&comc;&gt;'</rhs>
+<com>comment </com>
+<rhs>| '&lt;?'
+(<nt def='NT-Char'>Char</nt>* -
+(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*))
+'&pic;'</rhs>
+<com>processing instruction </com>
+<rhs><nt def="NT-SimpleLit">SimpleLit</nt></rhs>
+<rhs>(<nt def="NT-Char">Char</nt> - (']' | '&lt;' | '"' | "'"))+
+</rhs>
+
+<rhs>'&lt;!' (<nt def="NT-Char">Char</nt> - ('-'))+</rhs>
+<com>declarations other than comment</com>
+</prod>
+</prodgroup>
+</scrap>
+Most processors will require the more complex
+grammar given in the body of this specification.
+
+</p>
+</div1>
+-->
+
+<inform-div1 id="sec-xml-wg">
+<head>&informative;W3C XML ワーキンググループ</head>
+
+<p>この&TR-or-Rec;は,W3C XML ワーキンググループ(WG)が準備し,公開を承認した。WGがこの&TR-or-Rec;を承認するということは,WGのすべての委員が承認投票を行ったということを必ずしも意味しない。XML WGの現在の委員及び以前の委員を次に示す。</p>
+
+<!-- parens and spaces removed from role elements by bosak 1997.11.07 -->
+<orglist>
+<member><name>Jon Bosak, Sun</name><role>Chair</role></member>
+<member><name>James Clark</name><role>Technical Lead</role></member>
+<member><name>Tim Bray, Textuality and Netscape</name><role>XML Co-editor</role></member>
+<member><name>Jean Paoli, Microsoft</name><role>XML Co-editor</role></member>
+<member><name>C. M. Sperberg-McQueen, U. of Ill.</name><role>XML Co-editor</role></member>
+<member><name>Dan Connolly, W3C</name></member>
+<member><name>Steve DeRose, INSO</name></member>
+<member><name>Dave Hollander, HP</name></member>
+<member><name>Eliot Kimber, Highland</name></member>
+<member><name>Eve Maler, ArborText</name></member>
+<member><name>Tom Magliery, NCSA</name></member>
+<member><name>Murray Maloney, Muzmo and Grif</name></member>
+<member><name>村田 真,富士ゼロックス情報システム(株)</name></member>
+<member><name>Joel Nava, Adobe</name></member>
+<member><name>Peter Sharpe, SoftQuad</name></member>
+<member><name>John Tigue, DataChannel</name></member>
+</orglist>
+
+</inform-div1>
+</back>
+</spec>
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+End:
+-->
+
+
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc_euc-jp.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_euc-jp.xml
new file mode 100644
index 0000000000..887ab5ec30
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_euc-jp.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="euc-jp"?>
+<!DOCTYPE SYSTEM "weekly-euc-jp.dtd">
+<!-- 󥵥ץ -->
+<>
+ <ǯ>
+ <ǯ>1997</ǯ>
+ <>1</>
+ <>1</>
+ </ǯ>
+
+ <̾>
+ <></>
+ <̾>Ϻ</̾>
+ </̾>
+
+ <̳ꥹ>
+ <̳>
+ <̳̾>XMLǥκ</̳̾>
+ <̳>X3355-23</̳>
+ <>
+ <Ѥ깩>1600</Ѥ깩>
+ <ӹ>320</ӹ>
+ <Ѥ깩>160</Ѥ깩>
+ <ӹ>24</ӹ>
+ </>
+ <ͽܥꥹ>
+ <ͽ>
+ <P>XMLǥδܻͤκ</P>
+ </ͽ>
+ </ͽܥꥹ>
+ <»ܻꥹ>
+ <»ܻ>
+ <P>XMLǥδܻͤκ</P>
+ </»ܻ>
+ <»ܻ>
+ <P>¾ʤεǽĴ</P>
+ </»ܻ>
+ </»ܻꥹ>
+ <Ĺؤꥹ>
+ <Ĺؤ>
+ <P>äˤʤ</P>
+ </Ĺؤ>
+ </Ĺؤꥹ>
+ <к>
+ <P>XMLȤϲ狼ʤ</P>
+ </к>
+ </̳>
+
+ <̳>
+ <̳̾>󥸥γȯ</̳̾>
+ <̳>S8821-76</̳>
+ <>
+ <Ѥ깩>120</Ѥ깩>
+ <ӹ>6</ӹ>
+ <Ѥ깩>32</Ѥ깩>
+ <ӹ>2</ӹ>
+ </>
+ <ͽܥꥹ>
+ <ͽ>
+ <P><A href="http://www.goo.ne.jp">goo</A>εǽĴ٤Ƥߤ</P>
+ </ͽ>
+ </ͽܥꥹ>
+ <»ܻꥹ>
+ <»ܻ>
+ <P>ˡɤ󥸥󤬤뤫Ĵ</P>
+ </»ܻ>
+ </»ܻꥹ>
+ <Ĺؤꥹ>
+ <Ĺؤ>
+ <P>ȯ򤹤ΤϤɤʤΤǡYahoo!Ʋ</P>
+ </Ĺؤ>
+ </Ĺؤꥹ>
+ <к>
+ <P>󥸥Ǽ֤餻뤳ȤǤʤĴ</P>
+ </к>
+ </̳>
+ </̳ꥹ>
+</>
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc_iso-2022-jp.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_iso-2022-jp.xml
new file mode 100644
index 0000000000..9a8e8545ac
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_iso-2022-jp.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="iso-2022-jp"?>
+<!DOCTYPE $B=5Js(B SYSTEM "weekly-iso-2022-jp.dtd">
+<!-- $B=5Js%5%s%W%k(B -->
+<$B=5Js(B>
+ <$BG/7n=5(B>
+ <$BG/EY(B>1997</$BG/EY(B>
+ <$B7nEY(B>1</$B7nEY(B>
+ <$B=5(B>1</$B=5(B>
+ </$BG/7n=5(B>
+
+ <$B;aL>(B>
+ <$B;a(B>$B;3ED(B</$B;a(B>
+ <$BL>(B>$BB@O:(B</$BL>(B>
+ </$B;aL>(B>
+
+ <$B6HL3Js9p%j%9%H(B>
+ <$B6HL3Js9p(B>
+ <$B6HL3L>(B>XML$B%(%G%#%?!<$N:n@.(B</$B6HL3L>(B>
+ <$B6HL3%3!<%I(B>X3355-23</$B6HL3%3!<%I(B>
+ <$B9)?t4IM}(B>
+ <$B8+@Q$b$j9)?t(B>1600</$B8+@Q$b$j9)?t(B>
+ <$B<B@S9)?t(B>320</$B<B@S9)?t(B>
+ <$BEv7n8+@Q$b$j9)?t(B>160</$BEv7n8+@Q$b$j9)?t(B>
+ <$BEv7n<B@S9)?t(B>24</$BEv7n<B@S9)?t(B>
+ </$B9)?t4IM}(B>
+ <$BM=Dj9`L\%j%9%H(B>
+ <$BM=Dj9`L\(B>
+ <P>XML$B%(%G%#%?!<$N4pK\;EMM$N:n@.(B</P>
+ </$BM=Dj9`L\(B>
+ </$BM=Dj9`L\%j%9%H(B>
+ <$B<B;\;v9`%j%9%H(B>
+ <$B<B;\;v9`(B>
+ <P>XML$B%(%G%#%?!<$N4pK\;EMM$N:n@.(B</P>
+ </$B<B;\;v9`(B>
+ <$B<B;\;v9`(B>
+ <P>$B6%9gB><R@=IJ$N5!G=D4::(B</P>
+ </$B<B;\;v9`(B>
+ </$B<B;\;v9`%j%9%H(B>
+ <$B>eD9$X$NMW@A;v9`%j%9%H(B>
+ <$B>eD9$X$NMW@A;v9`(B>
+ <P>$BFC$K$J$7(B</P>
+ </$B>eD9$X$NMW@A;v9`(B>
+ </$B>eD9$X$NMW@A;v9`%j%9%H(B>
+ <$BLdBjE@BP:v(B>
+ <P>XML$B$H$O2?$+$o$+$i$J$$!#(B</P>
+ </$BLdBjE@BP:v(B>
+ </$B6HL3Js9p(B>
+
+ <$B6HL3Js9p(B>
+ <$B6HL3L>(B>$B8!:w%(%s%8%s$N3+H/(B</$B6HL3L>(B>
+ <$B6HL3%3!<%I(B>S8821-76</$B6HL3%3!<%I(B>
+ <$B9)?t4IM}(B>
+ <$B8+@Q$b$j9)?t(B>120</$B8+@Q$b$j9)?t(B>
+ <$B<B@S9)?t(B>6</$B<B@S9)?t(B>
+ <$BEv7n8+@Q$b$j9)?t(B>32</$BEv7n8+@Q$b$j9)?t(B>
+ <$BEv7n<B@S9)?t(B>2</$BEv7n<B@S9)?t(B>
+ </$B9)?t4IM}(B>
+ <$BM=Dj9`L\%j%9%H(B>
+ <$BM=Dj9`L\(B>
+ <P><A href="http://www.goo.ne.jp">goo</A>$B$N5!G=$rD4$Y$F$_$k(B</P>
+ </$BM=Dj9`L\(B>
+ </$BM=Dj9`L\%j%9%H(B>
+ <$B<B;\;v9`%j%9%H(B>
+ <$B<B;\;v9`(B>
+ <P>$B99$K!"$I$&$$$&8!:w%(%s%8%s$,$"$k$+D4::$9$k(B</P>
+ </$B<B;\;v9`(B>
+ </$B<B;\;v9`%j%9%H(B>
+ <$B>eD9$X$NMW@A;v9`%j%9%H(B>
+ <$B>eD9$X$NMW@A;v9`(B>
+ <P>$B3+H/$r$9$k$N$O$a$s$I$&$J$N$G!"(BYahoo!$B$rGc<}$7$F2<$5$$!#(B</P>
+ </$B>eD9$X$NMW@A;v9`(B>
+ </$B>eD9$X$NMW@A;v9`%j%9%H(B>
+ <$BLdBjE@BP:v(B>
+ <P>$B8!:w%(%s%8%s$G<V$rAv$i$;$k$3$H$,$G$-$J$$!#!JMWD4::!K(B</P>
+ </$BLdBjE@BP:v(B>
+ </$B6HL3Js9p(B>
+ </$B6HL3Js9p%j%9%H(B>
+</$B=5Js(B>
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc_little-endian.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_little-endian.xml
new file mode 100644
index 0000000000..81f72e59e8
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_little-endian.xml
Binary files differ
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-16.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-16.xml
new file mode 100644
index 0000000000..6c8622aa43
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-16.xml
Binary files differ
diff --git a/tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-8.xml b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-8.xml
new file mode 100644
index 0000000000..402c163c5f
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/testdata/toString_01/doc_utf-8.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<!-- 週報サンプル -->
+<週報>
+ <年月週>
+ <年度>1997</年度>
+ <月度>1</月度>
+ <週>1</週>
+ </年月週>
+
+ <氏名>
+ <氏>山田</氏>
+ <名>太郎</名>
+ </氏名>
+
+ <業務報告リスト>
+ <業務報告>
+ <業務名>XMLエディターの作成</業務名>
+ <業務コード>X3355-23</業務コード>
+ <工数管理>
+ <見積もり工数>1600</見積もり工数>
+ <実績工数>320</実績工数>
+ <当月見積もり工数>160</当月見積もり工数>
+ <当月実績工数>24</当月実績工数>
+ </工数管理>
+ <予定項目リスト>
+ <予定項目>
+ <P>XMLエディターの基本仕様の作成</P>
+ </予定項目>
+ </予定項目リスト>
+ <実施事項リスト>
+ <実施事項>
+ <P>XMLエディターの基本仕様の作成</P>
+ </実施事項>
+ <実施事項>
+ <P>競合他社製品の機能調査</P>
+ </実施事項>
+ </実施事項リスト>
+ <上長への要請事項リスト>
+ <上長への要請事項>
+ <P>特になし</P>
+ </上長への要請事項>
+ </上長への要請事項リスト>
+ <問題点対策>
+ <P>XMLとは何かわからない。</P>
+ </問題点対策>
+ </業務報告>
+
+ <業務報告>
+ <業務名>検索エンジンの開発</業務名>
+ <業務コード>S8821-76</業務コード>
+ <工数管理>
+ <見積もり工数>120</見積もり工数>
+ <実績工数>6</実績工数>
+ <当月見積もり工数>32</当月見積もり工数>
+ <当月実績工数>2</当月実績工数>
+ </工数管理>
+ <予定項目リスト>
+ <予定項目>
+ <P><A href="http://www.goo.ne.jp">goo</A>の機能を調べてみる</P>
+ </予定項目>
+ </予定項目リスト>
+ <実施事項リスト>
+ <実施事項>
+ <P>更に、どういう検索エンジンがあるか調査する</P>
+ </実施事項>
+ </実施事項リスト>
+ <上長への要請事項リスト>
+ <上長への要請事項>
+ <P>開発をするのはめんどうなので、Yahoo!を買収して下さい。</P>
+ </上長への要請事項>
+ </上長への要請事項リスト>
+ <問題点対策>
+ <P>検索エンジンで車を走らせることができない。(要調査)</P>
+ </問題点対策>
+ </業務報告>
+ </業務報告リスト>
+</週報>
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
new file mode 100644
index 0000000000..4093010855
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -0,0 +1,1934 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QBuffer>
+#include <QByteArray>
+#include <QCoreApplication>
+#include <QDebug>
+#include <QFile>
+#include <QList>
+#include <QRegExp>
+#include <QTextStream>
+#include <QtTest/QtTest>
+#include <QtXml>
+#include <QVariant>
+
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+QT_FORWARD_DECLARE_CLASS(QDomDocument)
+QT_FORWARD_DECLARE_CLASS(QDomNode)
+
+class tst_QDom : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void namespacedAttributes() const;
+ void setContent_data();
+ void setContent();
+ void toString_01_data();
+ void toString_01();
+ void toString_02_data();
+ void toString_02();
+ void hasAttributes_data();
+ void hasAttributes();
+ void save_data();
+ void save();
+ void saveWithSerialization() const;
+ void saveWithSerialization_data() const;
+ void cloneNode_data();
+ void cloneNode();
+ void ownerDocument_data();
+ void ownerDocument();
+ void ownerDocumentTask27424_data();
+ void ownerDocumentTask27424();
+ void parentNode_data();
+ void parentNode();
+ void documentCreationTask27424_data();
+ void documentCreationTask27424();
+ void browseElements();
+ void ownerElementTask45192_data();
+ void ownerElementTask45192();
+ void domNodeMapAndList();
+
+ void nullDocument();
+ void invalidName_data();
+ void invalidName();
+ void invalidQualifiedName_data();
+ void invalidQualifiedName();
+ void invalidCharData_data();
+ void invalidCharData();
+
+ void roundTripAttributes() const;
+ void normalizeEndOfLine() const;
+ void normalizeAttributes() const;
+ void serializeWeirdEOL() const;
+ void reparentAttribute() const;
+ void serializeNamespaces() const;
+ void flagInvalidNamespaces() const;
+ void flagUndeclaredNamespace() const;
+
+ void indentComments() const;
+ void checkLiveness() const;
+ void reportDuplicateAttributes() const;
+ void appendChildFromToDocument() const;
+ void iterateCDATA() const;
+ void appendDocumentNode() const;
+ void germanUmlautToByteArray() const;
+ void germanUmlautToFile() const;
+ void setInvalidDataPolicy() const;
+ void crashInSetContent() const;
+ void doubleNamespaceDeclarations() const;
+ void setContentQXmlReaderOverload() const;
+ void toStringWithoutNewlines() const;
+ void checkIntOverflow() const;
+ void setContentWhitespace() const;
+ void setContentWhitespace_data() const;
+
+ void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const;
+ void cloneDTD_QTBUG8398() const;
+
+ void cleanupTestCase() const;
+
+private:
+ static QDomDocument generateRequest();
+ static int hasAttributesHelper( const QDomNode& node );
+ static bool compareDocuments( const QDomDocument &doc1, const QDomDocument &doc2 );
+ static bool compareNodes( const QDomNode &node1, const QDomNode &node2, bool deep );
+ static QDomNode findDomNode( const QDomDocument &doc, const QList<QVariant> &pathToNode );
+ static QString onNullWarning(const char *const functionName);
+ static bool isDeepEqual(const QDomNode &n1, const QDomNode &n2);
+ static bool isFakeXMLDeclaration(const QDomNode &node);
+
+ QList<QByteArray> m_excludedCodecs;
+};
+
+Q_DECLARE_METATYPE(QList<QVariant>)
+
+void tst_QDom::setContent_data()
+{
+ const QString doc01(
+ "<!DOCTYPE a1 [ <!ENTITY blubber 'and'> ]>\n"
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>foo</c1>\n"
+ " <c2>bar</c2>\n"
+ " <c3>foo &amp; bar</c3>\n"
+ " <c4>foo &blubber; bar</c4>\n"
+ " </b1>\n"
+ " <b2> </b2>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n"
+ );
+
+ QTest::addColumn<QString>("doc");
+ QTest::addColumn<QStringList>("featuresTrue");
+ QTest::addColumn<QStringList>("featuresFalse");
+ QTest::addColumn<QString>("res");
+
+/* QTest::newRow( "01" ) << doc01
+ << QStringList()
+ << QString("http://trolltech.com/xml/features/report-whitespace-only-CharData").split(' ')
+ << QString("<!DOCTYPE a1>\n"
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>foo</c1>\n"
+ " <c2>bar</c2>\n"
+ " <c3>foo &amp; bar</c3>\n"
+ " <c4>foo and bar</c4>\n"
+ " </b1>\n"
+ " <b2/>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n");
+
+ QTest::newRow( "02" ) << doc01
+ << QString("http://trolltech.com/xml/features/report-whitespace-only-CharData").split(' ')
+ << QStringList()
+ << QString("<!DOCTYPE a1>\n"
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>foo</c1>\n"
+ " <c2>bar</c2>\n"
+ " <c3>foo &amp; bar</c3>\n"
+ " <c4>foo and bar</c4>\n"
+ " </b1>\n"
+ " <b2> </b2>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n");
+
+ QTest::newRow( "03" ) << doc01
+ << QString("http://trolltech.com/xml/features/report-start-end-entity").split(' ')
+ << QString("http://trolltech.com/xml/features/report-whitespace-only-CharData").split(' ')
+ << QString("<!DOCTYPE a1 [\n"
+ "<!ENTITY blubber \"and\">\n"
+ "]>\n"
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>foo</c1>\n"
+ " <c2>bar</c2>\n"
+ " <c3>foo &amp; bar</c3>\n"
+ " <c4>foo &blubber; bar</c4>\n"
+ " </b1>\n"
+ " <b2/>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n");
+
+ QTest::newRow( "04" ) << doc01
+ << QString("http://trolltech.com/xml/features/report-whitespace-only-CharData http://trolltech.com/xml/features/report-start-end-entity").split(' ')
+ << QStringList()
+ << QString("<!DOCTYPE a1 [\n"
+ "<!ENTITY blubber \"and\">\n"
+ "]>\n"
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>foo</c1>\n"
+ " <c2>bar</c2>\n"
+ " <c3>foo &amp; bar</c3>\n"
+ " <c4>foo &blubber; bar</c4>\n"
+ " </b1>\n"
+ " <b2> </b2>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n");
+
+ */ QTest::newRow("05") << QString("<message>\n"
+ " <body>&lt;b&gt;foo&lt;/b&gt;>]]&gt;</body>\n"
+ "</message>\n")
+ << QStringList() << QStringList()
+ << QString("<message>\n"
+ " <body>&lt;b>foo&lt;/b>>]]&gt;</body>\n"
+ "</message>\n");
+
+}
+
+void tst_QDom::setContent()
+{
+ QFETCH( QString, doc );
+
+ QXmlInputSource source;
+ source.setData( doc );
+
+ QFETCH( QStringList, featuresTrue );
+ QFETCH( QStringList, featuresFalse );
+ QXmlSimpleReader reader;
+ QStringList::Iterator it;
+ for ( it = featuresTrue.begin(); it != featuresTrue.end(); ++it ) {
+ QVERIFY( reader.hasFeature( *it ) );
+ reader.setFeature( *it, TRUE );
+ }
+ for ( it = featuresFalse.begin(); it != featuresFalse.end(); ++it ) {
+ QVERIFY( reader.hasFeature( *it ) );
+ reader.setFeature( *it, FALSE );
+ }
+
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( &source, &reader ) );
+
+ QString eRes;
+ QTextStream ts( &eRes, QIODevice::WriteOnly );
+ domDoc.save( ts, 4 );
+
+ QTEST( eRes, "res" );
+
+ // make sure that if we parse our output again, we get the same document
+ QDomDocument domDoc1;
+ QDomDocument domDoc2;
+ QVERIFY( domDoc1.setContent( doc ) );
+ QVERIFY( domDoc2.setContent( eRes ) );
+ QVERIFY( compareDocuments( domDoc1, domDoc2 ) );
+}
+
+void tst_QDom::toString_01_data()
+{
+ QTest::addColumn<QString>("fileName");
+
+ QTest::newRow( "01" ) << QString(SRCDIR "testdata/toString_01/doc01.xml");
+ QTest::newRow( "02" ) << QString(SRCDIR "testdata/toString_01/doc02.xml");
+ QTest::newRow( "03" ) << QString(SRCDIR "testdata/toString_01/doc03.xml");
+ QTest::newRow( "04" ) << QString(SRCDIR "testdata/toString_01/doc04.xml");
+ QTest::newRow( "05" ) << QString(SRCDIR "testdata/toString_01/doc05.xml");
+
+ QTest::newRow( "euc-jp" ) << QString(SRCDIR "testdata/toString_01/doc_euc-jp.xml");
+ QTest::newRow( "iso-2022-jp" ) << QString(SRCDIR "testdata/toString_01/doc_iso-2022-jp.xml");
+ QTest::newRow( "little-endian" ) << QString(SRCDIR "testdata/toString_01/doc_little-endian.xml");
+ QTest::newRow( "utf-16" ) << QString(SRCDIR "testdata/toString_01/doc_utf-16.xml");
+ QTest::newRow( "utf-8" ) << QString(SRCDIR "testdata/toString_01/doc_utf-8.xml");
+
+}
+
+/*! \internal
+
+ This function tests that the QDomDocument::toString() function results in the
+ same XML document. The meaning of "same" in this context means that the
+ "information" in the resulting XML file is the same as in the original, i.e.
+ we are not intrested in different formatting, etc.
+
+ To achieve this, the XML document of the toString() function is parsed again
+ and the two QDomDocuments are compared.
+*/
+void tst_QDom::toString_01()
+{
+ QFETCH(QString, fileName);
+
+ QFile f(fileName);
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(QString::fromLatin1("Failed to open file %1, file error: %2").arg(fileName).arg(f.error())));
+
+ QDomDocument doc;
+ QString errorMsg;
+ int errorLine;
+ int errorCol;
+
+ QVERIFY(doc.setContent( &f, &errorMsg, &errorLine, &errorCol )); /*,
+ QString("QDomDocument::setContent() failed: %1 in line %2, column %3")
+ .arg( errorMsg ).arg( errorLine ).arg( errorCol )); */
+ // test toString()'s invariant with different indenting depths
+ for ( int i=0; i<5; i++ ) {
+ QString toStr = doc.toString( i );
+
+ QDomDocument res;
+ QVERIFY( res.setContent( toStr ) );
+
+ QVERIFY( compareDocuments( doc, res ) );
+ }
+}
+
+void tst_QDom::toString_02_data()
+{
+ save_data();
+}
+
+/*
+ Tests the new QDomDocument::toString(int) overload (basically the same test
+ as save()).
+*/
+void tst_QDom::toString_02()
+{
+ QFETCH( QString, doc );
+ QFETCH( int, indent );
+
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( doc ) );
+ QTEST( domDoc.toString(indent), "res" );
+}
+
+
+void tst_QDom::hasAttributes_data()
+{
+ QTest::addColumn<int>("visitedNodes");
+ QTest::addColumn<QByteArray>("xmlDoc");
+
+ QByteArray doc1("<top>Make a <blubb>stupid</blubb>, useless test sentence.</top>");
+ QByteArray doc2("<top a=\"a\">Make a <blubb a=\"a\">stupid</blubb>, useless test sentence.</top>");
+ QByteArray doc3("<!-- just a useless comment -->\n"
+ "<?pi foo bar?>\n"
+ "<foo>\n"
+ "<bar fnord=\"snafu\" hmpf=\"grmpf\">\n"
+ "<foobar/>\n"
+ "</bar>\n"
+ "<bar>blubber</bar>\n"
+ "more text, pretty unintresting, though\n"
+ "<hmpfl blubber=\"something\" />\n"
+ "<![CDATA[ foo bar @!<>] ]]>\n"
+ "</foo>\n"
+ "<!-- just a useless comment -->\n"
+ "<?pi foo bar?>\n");
+
+ QTest::newRow( "01" ) << 6 << doc1;
+ QTest::newRow( "02" ) << 6 << doc2;
+ QTest::newRow( "03" ) << 13 << doc3;
+}
+
+/*
+ This function tests that QDomNode::hasAttributes() returns TRUE if and only
+ if the node has attributes (i.e. QDomNode::attributes() returns a list with
+ attributes in it).
+*/
+void tst_QDom::hasAttributes()
+{
+ QFETCH( QByteArray, xmlDoc );
+
+ QDomDocument doc;
+ QVERIFY( doc.setContent( xmlDoc ) );
+
+ int visitedNodes = hasAttributesHelper( doc );
+ QTEST( visitedNodes, "visitedNodes" );
+}
+
+int tst_QDom::hasAttributesHelper( const QDomNode& node )
+{
+ int visitedNodes = 1;
+ if ( node.hasAttributes() ) {
+ if (node.attributes().count() == 0)
+ return -1;
+// QVERIFY( node.attributes().count() > 0 );
+ } else {
+ if (node.attributes().count() != 0)
+ return -1;
+// QVERIFY( node.attributes().count() == 0 );
+ }
+
+ QDomNodeList children = node.childNodes();
+ for ( int i=0; i<children.count(); i++ ) {
+ int j = hasAttributesHelper( children.item(i) );
+ if (j < 0)
+ return -1;
+ visitedNodes += j;
+ }
+ return visitedNodes;
+}
+
+
+void tst_QDom::save_data()
+{
+ const QString doc01(
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>\n"
+ " <d1/>\n"
+ " </c1>\n"
+ " <c2/>\n"
+ " </b1>\n"
+ " <b2/>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n"
+ );
+
+ QTest::addColumn<QString>("doc");
+ QTest::addColumn<int>("indent");
+ QTest::addColumn<QString>("res");
+
+ QTest::newRow( "01" ) << doc01 << 0 << QString(doc01).replace( QRegExp(" "), "" );
+ QTest::newRow( "02" ) << doc01 << 1 << doc01;
+ QTest::newRow( "03" ) << doc01 << 2 << QString(doc01).replace( QRegExp(" "), " " );
+ QTest::newRow( "04" ) << doc01 << 10 << QString(doc01).replace( QRegExp(" "), " " );
+}
+
+void tst_QDom::save()
+{
+ QFETCH( QString, doc );
+ QFETCH( int, indent );
+
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( doc ) );
+
+ QString eRes;
+ QTextStream ts( &eRes, QIODevice::WriteOnly );
+ domDoc.save( ts, indent );
+
+ QTEST( eRes, "res" );
+}
+
+void tst_QDom::initTestCase()
+{
+ QFile file(SRCDIR "testdata/excludedCodecs.txt");
+ QVERIFY(file.open(QIODevice::ReadOnly|QIODevice::Text));
+
+ QByteArray codecName;
+
+ m_excludedCodecs = file.readAll().split('\n');
+
+}
+
+void tst_QDom::saveWithSerialization() const
+{
+ QFETCH(QString, fileName);
+
+ QFile f(fileName);
+ QVERIFY(f.open(QIODevice::ReadOnly));
+
+ QDomDocument doc;
+
+ // Read the document
+ QVERIFY(doc.setContent(&f));
+
+ const QList<QByteArray> codecs(QTextCodec::availableCodecs());
+ QByteArray codecName;
+
+ foreach(codecName, codecs) {
+
+ /* Avoid codecs that can't handle the files we have. */
+ if(m_excludedCodecs.contains(codecName.toLower()))
+ continue;
+
+ /* Write out doc in the specified codec. */
+ QByteArray storage;
+ QBuffer writeDevice(&storage);
+ QVERIFY(writeDevice.open(QIODevice::WriteOnly));
+
+ QTextStream s(&writeDevice);
+ QTextCodec *codec = QTextCodec::codecForName(codecName);
+ QVERIFY2(codec, qPrintable(QString::fromLatin1("Failed to load codec %1, even though it was in QTextCodec::availableCodecs()")
+ .arg(QString::fromLatin1(codecName.constData()))));
+ s.setCodec(codec);
+
+ doc.save(s, 0, QDomNode::EncodingFromTextStream);
+ s.flush();
+ writeDevice.close();
+
+ QBuffer readDevice(&storage);
+ QVERIFY(readDevice.open(QIODevice::ReadOnly));
+
+ QDomDocument result;
+
+ QString msg;
+ int line = 0;
+ int column = 0;
+
+ QVERIFY2(result.setContent(&readDevice, &msg, &line, &column),
+ qPrintable(QString::fromLatin1("Failed for codec %1: line %2, column %3: %4, content: %5")
+ .arg(QString::fromLatin1(codecName.constData()),
+ QString::number(line),
+ QString::number(column),
+ msg,
+ codec->toUnicode(storage))));
+ if(!compareDocuments(doc, result))
+ {
+ QCOMPARE(doc.toString(), result.toString());
+
+ /* We put this one here as well, in case the QCOMPARE above for some strange reason
+ * nevertheless succeeds. */
+ QVERIFY2(false, qPrintable(QString::fromLatin1("Failed for codec %1").arg(QString::fromLatin1(codecName.constData()))));
+ }
+ }
+}
+
+void tst_QDom::saveWithSerialization_data() const
+{
+ QTest::addColumn<QString>("fileName");
+
+ QTest::newRow("doc01.xml") << QString(SRCDIR "testdata/toString_01/doc01.xml");
+ QTest::newRow("doc01.xml") << QString(SRCDIR "testdata/toString_01/doc01.xml");
+ QTest::newRow("doc02.xml") << QString(SRCDIR "testdata/toString_01/doc02.xml");
+ QTest::newRow("doc03.xml") << QString(SRCDIR "testdata/toString_01/doc03.xml");
+ QTest::newRow("doc04.xml") << QString(SRCDIR "testdata/toString_01/doc04.xml");
+ QTest::newRow("doc05.xml") << QString(SRCDIR "testdata/toString_01/doc05.xml");
+
+ QTest::newRow("doc_euc-jp.xml") << QString(SRCDIR "testdata/toString_01/doc_euc-jp.xml");
+ QTest::newRow("doc_iso-2022-jp.xml") << QString(SRCDIR "testdata/toString_01/doc_iso-2022-jp.xml");
+ QTest::newRow("doc_little-endian.xml") << QString(SRCDIR "testdata/toString_01/doc_little-endian.xml");
+ QTest::newRow("doc_utf-16.xml") << QString(SRCDIR "testdata/toString_01/doc_utf-16.xml");
+ QTest::newRow("doc_utf-8.xml") << QString(SRCDIR "testdata/toString_01/doc_utf-8.xml");
+}
+
+void tst_QDom::cloneNode_data()
+{
+ const QString doc01(
+ "<a1>\n"
+ " <b1>\n"
+ " <c1>\n"
+ " <d1/>\n"
+ " </c1>\n"
+ " <c2/>\n"
+ " </b1>\n"
+ " <b2/>\n"
+ " <b3>\n"
+ " <c1/>\n"
+ " </b3>\n"
+ "</a1>\n"
+ );
+ QList<QVariant> nodeB1;
+ nodeB1 << 0;
+
+ QList<QVariant> nodeC1;
+ nodeC1 << 0 << 0;
+
+ QList<QVariant> nodeC2;
+ nodeC2 << 0 << 1;
+
+ QTest::addColumn<QString>("doc");
+ QTest::addColumn<QList<QVariant> >("pathToNode");
+ QTest::addColumn<bool>("deep");
+
+ QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << (bool)FALSE;
+ QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << (bool)FALSE;
+ QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << (bool)FALSE;
+
+ QTest::newRow( "deep_01" ) << doc01 << nodeB1 << (bool)TRUE;
+ QTest::newRow( "deep_02" ) << doc01 << nodeC1 << (bool)TRUE;
+ QTest::newRow( "deep_03" ) << doc01 << nodeC2 << (bool)TRUE;
+}
+
+void tst_QDom::cloneNode()
+{
+ QFETCH( QString, doc );
+ QFETCH( QList<QVariant>, pathToNode );
+ QFETCH( bool, deep );
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( doc ) );
+ QDomNode node = findDomNode( domDoc, pathToNode );
+ QVERIFY(!node.isNull());
+
+ QDomNode clonedNode = node.cloneNode( deep );
+ QVERIFY( compareNodes( node, clonedNode, deep ) );
+
+ QDomNode parent = node.parentNode();
+ if ( !parent.isNull() ) {
+ node = parent.replaceChild( clonedNode, node ); // swap the nodes
+ QVERIFY( !node.isNull() );
+ QVERIFY( compareNodes( node, clonedNode, deep ) );
+ }
+}
+
+
+void tst_QDom::ownerElementTask45192_data()
+{
+ const QString doc(
+ "<root>\n"
+ " <item name=\"test\" >\n"
+ " </item>\n"
+ "</root>"
+ );
+
+ QTest::addColumn<QString>("doc");
+ QTest::newRow("doc") << doc;
+}
+
+void tst_QDom::ownerElementTask45192()
+{
+ QFETCH( QString, doc );
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( doc ) );
+
+ QDomNode item = domDoc.documentElement().firstChild();
+ QDomNode clone = item.cloneNode(false);
+
+ QVERIFY( clone == clone.attributes().namedItem("name").toAttr().ownerElement() );
+}
+
+void tst_QDom::ownerDocument_data()
+{
+ cloneNode_data();
+}
+
+#define OWNERDOCUMENT_CREATE_TEST( t, x ) \
+{ \
+ t n = x; \
+ QVERIFY( n.ownerDocument() == domDoc ); \
+}
+
+#define OWNERDOCUMENT_IMPORTNODE_TEST( t, x ) \
+{ \
+ QDomNode importedNode; \
+ t n = x; \
+ QVERIFY( n.ownerDocument() != domDoc ); \
+ importedNode = domDoc.importNode( n, deep ); \
+ QVERIFY( n.ownerDocument() != domDoc ); \
+ QVERIFY( importedNode.ownerDocument() == domDoc ); \
+}
+
+void tst_QDom::ownerDocument()
+{
+ QFETCH( QString, doc );
+ QFETCH( QList<QVariant>, pathToNode );
+ QFETCH( bool, deep );
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( doc ) );
+ QDomNode node = findDomNode( domDoc, pathToNode );
+ QVERIFY(!node.isNull());
+
+ QVERIFY( node.ownerDocument() == domDoc );
+
+ // Does cloneNode() keep the ownerDocument()?
+ {
+ QDomNode clonedNode = node.cloneNode( deep );
+ QVERIFY( node.ownerDocument() == domDoc );
+ QVERIFY( clonedNode.ownerDocument() == domDoc );
+ }
+
+ // If the original DOM node is replaced with the cloned node, does this
+ // keep the ownerDocument()?
+ {
+ QDomNode clonedNode = node.cloneNode( deep );
+ QDomNode parent = node.parentNode();
+ if ( !parent.isNull() ) {
+ node = parent.replaceChild( clonedNode, node ); // swap the nodes
+ QVERIFY( node.ownerDocument() == domDoc );
+ QVERIFY( clonedNode.ownerDocument() == domDoc );
+ }
+ }
+
+ // test QDomDocument::create...()
+ {
+ OWNERDOCUMENT_CREATE_TEST( QDomAttr, domDoc.createAttribute( "foo" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomAttr, domDoc.createAttributeNS( "foo", "bar" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomCDATASection, domDoc.createCDATASection( "foo" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomComment, domDoc.createComment( "foo" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomDocumentFragment, domDoc.createDocumentFragment() );
+ OWNERDOCUMENT_CREATE_TEST( QDomElement, domDoc.createElement( "foo" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomElement, domDoc.createElementNS( "foo", "bar" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomEntityReference, domDoc.createEntityReference( "foo" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomProcessingInstruction, domDoc.createProcessingInstruction( "foo", "bar" ) );
+ OWNERDOCUMENT_CREATE_TEST( QDomText, domDoc.createTextNode( "foo" ) );
+ }
+
+ // test importNode()
+ {
+ QDomDocument doc2;
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomAttr, doc2.createAttribute( "foo" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomAttr, doc2.createAttributeNS( "foo", "bar" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomCDATASection, doc2.createCDATASection( "foo" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomComment, doc2.createComment( "foo" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomDocumentFragment, doc2.createDocumentFragment() );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomElement, doc2.createElement( "foo" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomElement, doc2.createElementNS( "foo", "bar" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomEntityReference, doc2.createEntityReference( "foo" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomProcessingInstruction, doc2.createProcessingInstruction( "foo", "bar" ) );
+ OWNERDOCUMENT_IMPORTNODE_TEST( QDomText, doc2.createTextNode( "foo" ) );
+ }
+}
+
+void tst_QDom::ownerDocumentTask27424_data()
+{
+ QTest::addColumn<bool>("insertLevel1AfterCstr");
+ QTest::addColumn<bool>("insertLevel2AfterCstr");
+ QTest::addColumn<bool>("insertLevel3AfterCstr");
+
+ QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE;
+ QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE;
+ QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE;
+ QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE;
+ QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE;
+ QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE;
+ QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE;
+ QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE;
+}
+
+void tst_QDom::ownerDocumentTask27424()
+{
+ QFETCH( bool, insertLevel1AfterCstr );
+ QFETCH( bool, insertLevel2AfterCstr );
+ QFETCH( bool, insertLevel3AfterCstr );
+
+ QDomDocument doc("TestXML");
+
+ QDomElement level1 = doc.createElement("Level_1");
+ QVERIFY( level1.ownerDocument() == doc );
+
+ if ( insertLevel1AfterCstr ) {
+ doc.appendChild(level1);
+ QVERIFY( level1.ownerDocument() == doc );
+ }
+
+ QDomElement level2 = level1.ownerDocument().createElement("Level_2");
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+
+ if ( insertLevel2AfterCstr ) {
+ level1.appendChild(level2);
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ }
+
+ QDomElement level3 = level2.ownerDocument().createElement("Level_3");
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ QVERIFY( level3.ownerDocument() == doc );
+
+ if ( insertLevel3AfterCstr ) {
+ level2.appendChild(level3);
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ QVERIFY( level3.ownerDocument() == doc );
+ }
+
+ QDomNode level4 = level3.ownerDocument().createTextNode("This_is_a_value!");
+ QVERIFY( level4.ownerDocument() == doc );
+
+ level3.appendChild(level4);
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ QVERIFY( level3.ownerDocument() == doc );
+ QVERIFY( level4.ownerDocument() == doc );
+
+ if ( !insertLevel3AfterCstr ) {
+ level2.appendChild(level3);
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ QVERIFY( level3.ownerDocument() == doc );
+ QVERIFY( level4.ownerDocument() == doc );
+ }
+
+ if ( !insertLevel2AfterCstr ) {
+ level1.appendChild(level2);
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ QVERIFY( level3.ownerDocument() == doc );
+ QVERIFY( level4.ownerDocument() == doc );
+ }
+
+ if ( !insertLevel1AfterCstr ) {
+ doc.appendChild(level1);
+ QVERIFY( level1.ownerDocument() == doc );
+ QVERIFY( level2.ownerDocument() == doc );
+ QVERIFY( level3.ownerDocument() == doc );
+ QVERIFY( level4.ownerDocument() == doc );
+ }
+}
+
+void tst_QDom::parentNode_data()
+{
+ cloneNode_data();
+}
+
+#define PARENTNODE_CREATE_TEST( t, x ) \
+{ \
+ t n = x; \
+ QVERIFY( n.parentNode().isNull() ); \
+}
+
+void tst_QDom::parentNode()
+{
+ QFETCH( QString, doc );
+ QFETCH( QList<QVariant>, pathToNode );
+ QFETCH( bool, deep );
+ QDomDocument domDoc;
+ QVERIFY( domDoc.setContent( doc ) );
+ QDomNode node = findDomNode( domDoc, pathToNode );
+ QVERIFY(!node.isNull());
+ Q_UNUSED(deep);
+
+ // test QDomDocument::create...()
+ {
+ PARENTNODE_CREATE_TEST( QDomAttr, domDoc.createAttribute( "foo" ) );
+ PARENTNODE_CREATE_TEST( QDomAttr, domDoc.createAttributeNS( "foo", "bar" ) );
+ PARENTNODE_CREATE_TEST( QDomCDATASection, domDoc.createCDATASection( "foo" ) );
+ PARENTNODE_CREATE_TEST( QDomComment, domDoc.createComment( "foo" ) );
+ PARENTNODE_CREATE_TEST( QDomDocumentFragment, domDoc.createDocumentFragment() );
+ PARENTNODE_CREATE_TEST( QDomElement, domDoc.createElement( "foo" ) );
+ PARENTNODE_CREATE_TEST( QDomElement, domDoc.createElementNS( "foo", "bar" ) );
+ PARENTNODE_CREATE_TEST( QDomEntityReference, domDoc.createEntityReference( "foo" ) );
+ PARENTNODE_CREATE_TEST( QDomProcessingInstruction, domDoc.createProcessingInstruction( "foo", "bar" ) );
+ PARENTNODE_CREATE_TEST( QDomText, domDoc.createTextNode( "foo" ) );
+ }
+}
+
+
+void tst_QDom::documentCreationTask27424_data()
+{
+ QTest::addColumn<bool>("insertLevel1AfterCstr");
+ QTest::addColumn<bool>("insertLevel2AfterCstr");
+ QTest::addColumn<bool>("insertLevel3AfterCstr");
+
+ QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE;
+ QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE;
+ QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE;
+ QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE;
+ QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE;
+ QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE;
+ QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE;
+ QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE;
+}
+
+void tst_QDom::documentCreationTask27424()
+{
+ QFETCH( bool, insertLevel1AfterCstr );
+ QFETCH( bool, insertLevel2AfterCstr );
+ QFETCH( bool, insertLevel3AfterCstr );
+
+ QDomDocument docRes;
+ QVERIFY( docRes.setContent( QString(
+ "<!DOCTYPE TestXML>\n"
+ "<Level_1>\n"
+ " <Level_2>\n"
+ " <Level_3>This_is_a_value!</Level_3>\n"
+ " </Level_2>\n"
+ "</Level_1>"
+ ) ) );
+
+ QDomDocument doc("TestXML");
+
+ QDomElement level1 = doc.createElement("Level_1");
+ if ( insertLevel1AfterCstr )
+ doc.appendChild(level1);
+
+ QDomElement level2 = level1.ownerDocument().createElement("Level_2");
+ if ( insertLevel2AfterCstr )
+ level1.appendChild(level2);
+
+ QDomElement level3 = level2.ownerDocument().createElement("Level_3");
+ if ( insertLevel3AfterCstr )
+ level2.appendChild(level3);
+
+ QDomNode level4 = level3.ownerDocument().createTextNode("This_is_a_value!");
+ level3.appendChild(level4);
+
+ if ( !insertLevel3AfterCstr )
+ level2.appendChild(level3);
+ if ( !insertLevel2AfterCstr )
+ level1.appendChild(level2);
+ if ( !insertLevel1AfterCstr )
+ doc.appendChild(level1);
+
+ QVERIFY( compareDocuments( doc, docRes ) );
+}
+
+
+bool tst_QDom::isFakeXMLDeclaration(const QDomNode &node)
+{
+ return node.isProcessingInstruction() &&
+ node.nodeName() == QLatin1String("xml");
+}
+
+bool tst_QDom::isDeepEqual(const QDomNode &n1, const QDomNode &n2)
+{
+ const QDomNode::NodeType nt = n1.nodeType();
+
+ if(nt != n2.nodeType())
+ return false;
+
+ if(n1.nodeName() != n2.nodeName()
+ || n1.namespaceURI() != n2.namespaceURI()
+ || n1.nodeValue() != n2.nodeValue())
+ return false;
+
+ /* Check the children. */
+ const QDomNodeList children1(n1.childNodes());
+ const QDomNodeList children2(n2.childNodes());
+ uint len1 = children1.length();
+ uint len2 = children2.length();
+ uint i1 = 0;
+ uint i2 = 0;
+
+ if(len1 != 0 && isFakeXMLDeclaration(children1.at(0)))
+ ++i1;
+
+ if(len2 != 0 && isFakeXMLDeclaration(children2.at(0)))
+ ++i2;
+
+ if(len1 - i1 != len2 - i2)
+ return false;
+
+ // We jump over the first to skip the processing instructions that
+ // are (incorrectly) used as XML declarations.
+ for(; i1 < len1; ++i1)
+ {
+ if(!isDeepEqual(children1.at(i1), children2.at(i2)))
+ return false;
+
+ ++i2;
+ }
+
+ return true;
+}
+
+/*
+ Returns TRUE if \a doc1 and \a doc2 represent the same XML document, i.e.
+ they have the same informational content. Otherwise, this function returns
+ FALSE.
+*/
+bool tst_QDom::compareDocuments( const QDomDocument &doc1, const QDomDocument &doc2 )
+{
+ return isDeepEqual(doc1, doc2);
+}
+
+/*
+ Returns TRUE if \a node1 and \a node2 represent the same XML node, i.e.
+ they have the same informational content. Otherwise, this function returns
+ FALSE.
+
+ If \a deep is TRUE, children of the nodes are also tested. If \a deep is
+ FALSE, only \a node1 and \a node 2 are compared.
+*/
+bool tst_QDom::compareNodes( const QDomNode &node1, const QDomNode &node2, bool deep )
+{
+ if ( deep ) {
+ QString str1;
+ {
+ QTextStream stream( &str1 );
+ stream << node1;
+ }
+ QString str2;
+ {
+ QTextStream stream( &str2 );
+ stream << node2;
+ }
+ return str1 == str2;
+ }
+
+ if ( node1.isNull() && node2.isNull() )
+ return TRUE;
+ // ### I am not sure if this test is complete
+ bool equal = node1.nodeName() == node2.nodeName();
+ equal = equal && node1.nodeType() == node2.nodeType();
+ equal = equal && node1.localName() == node2.localName();
+ equal = equal && node1.nodeValue() == node2.nodeValue();
+ equal = equal && node1.prefix() == node2.prefix();
+
+ return equal;
+}
+
+/*
+ \a pathToNode is a list of indices to wanted node in \a doc. Returns the
+ wanted node.
+*/
+QDomNode tst_QDom::findDomNode( const QDomDocument &doc, const QList<QVariant> &pathToNode )
+{
+ QDomNode node = doc;
+ QList<QVariant>::const_iterator it;
+ for ( it = pathToNode.begin(); it != pathToNode.end(); ++it ) {
+ QDomNodeList children = node.childNodes();
+ node = children.item( (*it).toInt() );
+// QVERIFY( !node.isNull() );
+ }
+ return node;
+}
+
+void tst_QDom::browseElements()
+{
+ QDomDocument doc;
+ QDomElement root = doc.createElement("foo");
+ doc.appendChild(root);
+ root.appendChild(doc.createElement("bar"));
+ root.appendChild(doc.createElement("bop"));
+ root.appendChild(doc.createElement("bar"));
+ root.appendChild(doc.createElement("bop"));
+
+ QVERIFY(doc.firstChildElement("ding").isNull());
+ QDomElement foo = doc.firstChildElement("foo");
+ QVERIFY(!foo.isNull());
+ QVERIFY(foo.firstChildElement("ding").isNull());
+ QVERIFY(foo.nextSiblingElement("foo").isNull());
+ QVERIFY(foo.previousSiblingElement("bar").isNull());
+ QVERIFY(foo.nextSiblingElement().isNull());
+ QVERIFY(foo.previousSiblingElement().isNull());
+
+ QDomElement bar = foo.firstChildElement("bar");
+ QVERIFY(!bar.isNull());
+ QVERIFY(bar.previousSiblingElement("bar").isNull());
+ QVERIFY(bar.previousSiblingElement().isNull());
+ QVERIFY(bar.nextSiblingElement("bar").tagName() == "bar");
+ QVERIFY(bar.nextSiblingElement("bar").nextSiblingElement("bar").isNull());
+
+ QDomElement bop = foo.firstChildElement("bop");
+ QVERIFY(!bop.isNull());
+ QVERIFY(bar.nextSiblingElement() == bop);
+ QVERIFY(bop.nextSiblingElement("bop") == foo.lastChildElement("bop"));
+ QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement("bar"));
+ QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement());
+}
+
+void tst_QDom::domNodeMapAndList()
+{
+ QString xml_str = QString::fromLatin1("<foo ding='dong'></foo>");
+
+ QDomDocument doc;
+ QVERIFY(doc.setContent(xml_str));
+
+ QDomNamedNodeMap map = doc.documentElement().attributes();
+ QCOMPARE(map.item(0).nodeName(), QString("ding"));
+ QCOMPARE(map.item(1).nodeName(), QString()); // Make sure we don't assert
+
+ QDomNodeList list = doc.elementsByTagName("foo");
+ QCOMPARE(list.item(0).nodeName(), QString("foo"));
+ QCOMPARE(list.item(1).nodeName(), QString()); // Make sure we don't assert
+}
+
+// Verifies that a default-constructed QDomDocument is null, and that calling
+// any of the factory functions causes it to be non-null.
+#define TEST_NULL_DOCUMENT(func) \
+{ \
+ QDomDocument doc; \
+ QVERIFY(doc.isNull()); \
+ QVERIFY(!doc.func.isNull()); \
+ QVERIFY(!doc.isNull()); \
+}
+
+void tst_QDom::nullDocument()
+{
+ TEST_NULL_DOCUMENT(createAttribute("foo"))
+ TEST_NULL_DOCUMENT(createAttributeNS("http://foo/", "bar"))
+ TEST_NULL_DOCUMENT(createCDATASection("foo"))
+ TEST_NULL_DOCUMENT(createComment("foo"))
+ TEST_NULL_DOCUMENT(createDocumentFragment())
+ TEST_NULL_DOCUMENT(createElement("foo"))
+ TEST_NULL_DOCUMENT(createElementNS("http://foo/", "foo"))
+ TEST_NULL_DOCUMENT(createEntityReference("foo"))
+ TEST_NULL_DOCUMENT(createProcessingInstruction("foo", "bar"))
+ TEST_NULL_DOCUMENT(createTextNode("foo"))
+ QDomDocument doc2;
+ QDomElement elt = doc2.createElement("foo");
+ doc2.appendChild(elt);
+ TEST_NULL_DOCUMENT(importNode(elt, true))
+}
+
+#undef TEST_NULL_DOCUMENT
+
+void tst_QDom::invalidName_data()
+{
+ QTest::addColumn<QString>("in_name");
+ QTest::addColumn<bool>("ok_AcceptInvalidChars");
+ QTest::addColumn<bool>("ok_DropInvalidChars");
+ QTest::addColumn<bool>("ok_ReturnNullNode");
+ QTest::addColumn<QString>("out_name");
+
+ QTest::newRow( "foo" ) << QString("foo") << true << true << true << QString("foo");
+ QTest::newRow( "_f.o-o:" ) << QString("_f.o-o:") << true << true << true << QString("_f.o-o:");
+ QTest::newRow( "...:." ) << QString("...:.") << true << true << false << QString(":.");
+ QTest::newRow( "empty" ) << QString() << false << false << false << QString();
+ QTest::newRow( "~f~o~o~" ) << QString("~f~o~o~") << true << true << false << QString("foo");
+ QTest::newRow( "~" ) << QString("~") << true << false << false << QString();
+ QTest::newRow( "..." ) << QString("...") << true << false << false << QString();
+}
+
+void tst_QDom::invalidName()
+{
+ QFETCH( QString, in_name );
+ QFETCH( bool, ok_AcceptInvalidChars );
+ QFETCH( bool, ok_DropInvalidChars );
+ QFETCH( bool, ok_ReturnNullNode );
+ QFETCH( QString, out_name );
+
+ QDomImplementation impl;
+ QDomDocument doc;
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::AcceptInvalidChars);
+
+ {
+ QDomElement elt = doc.createElement(in_name);
+ QDomElement elt_ns = doc.createElementNS("foo", "foo:" + in_name);
+ QDomAttr attr = doc.createAttribute(in_name);
+ QDomAttr attr_ns = doc.createAttributeNS("foo", "foo:" + in_name);
+ QDomEntityReference ref = doc.createEntityReference(in_name);
+
+ QCOMPARE(!elt.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!elt_ns.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!attr.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!attr_ns.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!ref.isNull(), ok_AcceptInvalidChars);
+
+ if (ok_AcceptInvalidChars) {
+ QCOMPARE(elt.tagName(), in_name);
+ QCOMPARE(elt_ns.tagName(), in_name);
+ QCOMPARE(attr.name(), in_name);
+ QCOMPARE(attr_ns.name(), in_name);
+ QCOMPARE(ref.nodeName(), in_name);
+ }
+ }
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::DropInvalidChars);
+
+ {
+ QDomElement elt = doc.createElement(in_name);
+ QDomElement elt_ns = doc.createElementNS("foo", "foo:" + in_name);
+ QDomAttr attr = doc.createAttribute(in_name);
+ QDomAttr attr_ns = doc.createAttributeNS("foo", "foo:" + in_name);
+ QDomEntityReference ref = doc.createEntityReference(in_name);
+
+ QCOMPARE(!elt.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!elt_ns.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!attr.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!attr_ns.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!ref.isNull(), ok_DropInvalidChars);
+
+ if (ok_DropInvalidChars) {
+ QCOMPARE(elt.tagName(), out_name);
+ QCOMPARE(elt_ns.tagName(), out_name);
+ QCOMPARE(attr.name(), out_name);
+ QCOMPARE(attr_ns.name(), out_name);
+ QCOMPARE(ref.nodeName(), out_name);
+ }
+ }
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::ReturnNullNode);
+
+ {
+ QDomElement elt = doc.createElement(in_name);
+ QDomElement elt_ns = doc.createElementNS("foo", "foo:" + in_name);
+ QDomAttr attr = doc.createAttribute(in_name);
+ QDomAttr attr_ns = doc.createAttributeNS("foo", "foo:" + in_name);
+ QDomEntityReference ref = doc.createEntityReference(in_name);
+
+ QCOMPARE(!elt.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!elt_ns.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!attr.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!attr_ns.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!ref.isNull(), ok_ReturnNullNode);
+
+ if (ok_ReturnNullNode) {
+ QCOMPARE(elt.tagName(), in_name);
+ QCOMPARE(elt_ns.tagName(), in_name);
+ QCOMPARE(attr.name(), in_name);
+ QCOMPARE(attr_ns.name(), in_name);
+ QCOMPARE(ref.nodeName(), in_name);
+ }
+ }
+}
+
+void tst_QDom::invalidQualifiedName_data()
+{
+ QTest::addColumn<QString>("in_name");
+ QTest::addColumn<bool>("ok_AcceptInvalidChars");
+ QTest::addColumn<bool>("ok_DropInvalidChars");
+ QTest::addColumn<bool>("ok_ReturnNullNode");
+ QTest::addColumn<QString>("out_name");
+
+ QTest::newRow( "foo" ) << QString("foo") << true << true << true << QString("foo");
+ QTest::newRow( "foo:bar" ) << QString("foo:bar") << true << true << true << QString("foo:bar");
+ QTest::newRow( "bar:" ) << QString("bar:") << false << false << false << QString();
+ QTest::newRow( ":" ) << QString(":") << false << false << false << QString();
+ QTest::newRow( "empty" ) << QString() << false << false << false << QString();
+ QTest::newRow("foo:...:.") << QString("foo:...:.")<< true << true << false << QString("foo::.");
+ QTest::newRow("foo:~") << QString("foo:~") << true << false << false << QString();
+ QTest::newRow("foo:.~") << QString("foo:.~") << true << false << false << QString();
+}
+
+void tst_QDom::invalidQualifiedName()
+{
+ QFETCH( QString, in_name );
+ QFETCH( bool, ok_AcceptInvalidChars );
+ QFETCH( bool, ok_DropInvalidChars );
+ QFETCH( bool, ok_ReturnNullNode );
+ QFETCH( QString, out_name );
+
+ QDomImplementation impl;
+ QDomDocument doc;
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::AcceptInvalidChars);
+
+ {
+ QDomElement elt_ns = doc.createElementNS("foo", in_name);
+ QDomAttr attr_ns = doc.createAttributeNS("foo", in_name);
+ QDomDocumentType doctype = impl.createDocumentType(in_name, "foo", "bar");
+ QDomDocument doc2 = impl.createDocument("foo", in_name, doctype);
+
+ QCOMPARE(!elt_ns.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!attr_ns.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!doctype.isNull(), ok_AcceptInvalidChars);
+ QCOMPARE(!doc2.isNull(), ok_AcceptInvalidChars);
+
+ if (ok_AcceptInvalidChars) {
+ QCOMPARE(elt_ns.nodeName(), in_name);
+ QCOMPARE(attr_ns.nodeName(), in_name);
+ QCOMPARE(doctype.name(), in_name);
+ QCOMPARE(doc2.documentElement().nodeName(), in_name);
+ }
+ }
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::DropInvalidChars);
+
+ {
+ QDomElement elt_ns = doc.createElementNS("foo", in_name);
+ QDomAttr attr_ns = doc.createAttributeNS("foo", in_name);
+ QDomDocumentType doctype = impl.createDocumentType(in_name, "foo", "bar");
+ QDomDocument doc2 = impl.createDocument("foo", in_name, doctype);
+
+ QCOMPARE(!elt_ns.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!attr_ns.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!doctype.isNull(), ok_DropInvalidChars);
+ QCOMPARE(!doc2.isNull(), ok_DropInvalidChars);
+
+ if (ok_DropInvalidChars) {
+ QCOMPARE(elt_ns.nodeName(), out_name);
+ QCOMPARE(attr_ns.nodeName(), out_name);
+ QCOMPARE(doctype.name(), out_name);
+ QCOMPARE(doc2.documentElement().nodeName(), out_name);
+ }
+ }
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::ReturnNullNode);
+
+ {
+ QDomElement elt_ns = doc.createElementNS("foo", in_name);
+ QDomAttr attr_ns = doc.createAttributeNS("foo", in_name);
+ QDomDocumentType doctype = impl.createDocumentType(in_name, "foo", "bar");
+ QDomDocument doc2 = impl.createDocument("foo", in_name, doctype);
+
+ QCOMPARE(!elt_ns.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!attr_ns.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!doctype.isNull(), ok_ReturnNullNode);
+ QCOMPARE(!doc2.isNull(), ok_ReturnNullNode);
+
+ if (ok_ReturnNullNode) {
+ QCOMPARE(elt_ns.nodeName(), in_name);
+ QCOMPARE(attr_ns.nodeName(), in_name);
+ QCOMPARE(doctype.name(), in_name);
+ QCOMPARE(doc2.documentElement().nodeName(), in_name);
+ }
+ }
+}
+
+void tst_QDom::invalidCharData_data()
+{
+ QTest::addColumn<QString>("in_text");
+ QTest::addColumn<bool>("ok_AcceptInvalidChars");
+ QTest::addColumn<bool>("ok_DropInvalidChars");
+ QTest::addColumn<bool>("ok_ReturnNullNode");
+ QTest::addColumn<QString>("out_text");
+
+ QTest::newRow( "foo" ) << QString("foo") << true << true << true << QString("foo");
+ QTest::newRow( "f<o&o" ) << QString("f<o&o") << true << true << true << QString("f<o&o");
+ QTest::newRow( "empty" ) << QString() << true << true << true << QString();
+ QTest::newRow("f\\x07o\\x02")<< QString("f\x07o\x02")<< true << true << false << QString("fo");
+}
+
+void tst_QDom::invalidCharData()
+{
+ QFETCH( QString, in_text );
+ QFETCH( bool, ok_AcceptInvalidChars );
+ QFETCH( bool, ok_DropInvalidChars );
+ QFETCH( bool, ok_ReturnNullNode );
+ QFETCH( QString, out_text );
+
+ QDomDocument doc;
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::AcceptInvalidChars);
+
+ {
+ QDomText text_elt = doc.createTextNode(in_text);
+ QCOMPARE(!text_elt.isNull(), ok_AcceptInvalidChars);
+ if (ok_AcceptInvalidChars) {
+ QCOMPARE(text_elt.nodeValue(), in_text);
+ }
+ }
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::DropInvalidChars);
+
+ {
+ QDomText text_elt = doc.createTextNode(in_text);
+ QCOMPARE(!text_elt.isNull(), ok_DropInvalidChars);
+ if (ok_DropInvalidChars) {
+ QCOMPARE(text_elt.nodeValue(), out_text);
+ }
+ }
+
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::ReturnNullNode);
+
+ {
+ QDomText text_elt = doc.createTextNode(in_text);
+ QCOMPARE(!text_elt.isNull(), ok_ReturnNullNode);
+ if (ok_ReturnNullNode) {
+ QCOMPARE(text_elt.nodeValue(), in_text);
+ }
+ }
+}
+
+void tst_QDom::roundTripAttributes() const
+{
+ /* Create an attribute via the QDom API with weird whitespace content. */
+ QDomImplementation impl;
+
+ QDomDocument doc(impl.createDocument("", "localName", QDomDocumentType()));
+
+ QDomElement e(doc.documentElement());
+
+ QString ws;
+ ws.reserve(8);
+ ws.append(QChar(0x20));
+ ws.append(QChar(0x20));
+ ws.append(QChar(0x20));
+ ws.append(QChar(0xD));
+ ws.append(QChar(0xA));
+ ws.append(QChar(0x9));
+ ws.append(QChar(0x20));
+ ws.append(QChar(0x20));
+
+ e.setAttribute("attr", ws);
+
+ QByteArray serialized;
+ QBuffer buffer(&serialized);
+ buffer.open(QIODevice::WriteOnly);
+ QTextStream stream(&buffer);
+
+ doc.save(stream, 0);
+ stream.flush();
+
+ const QByteArray expected("<localName xmlns=\"\" attr=\" &#xd;&#xa;&#x9; \"/>\n");
+ QCOMPARE(QString::fromLatin1(serialized.constData()), QString::fromLatin1(expected.constData()));
+}
+
+void tst_QDom::normalizeEndOfLine() const
+{
+ QByteArray input("<a>\r\nc\rc\ra\na</a>");
+
+ QBuffer buffer(&input);
+ QVERIFY(buffer.open(QIODevice::ReadOnly));
+
+ QDomDocument doc;
+ QVERIFY(doc.setContent(&buffer, true));
+
+ const QString expected(QLatin1String("<a>\nc\nc\na\na</a>"));
+
+ // ### Qt 5: fix this, if we keep QDom at all
+ QEXPECT_FAIL("", "The parser doesn't perform newline normalization. Fixing that would change behavior.", Continue);
+ QCOMPARE(doc.documentElement().text(), expected);
+}
+
+void tst_QDom::normalizeAttributes() const
+{
+ QByteArray data("<element attribute=\"a\na\"/>");
+ QBuffer buffer(&data);
+
+ QVERIFY(buffer.open(QIODevice::ReadOnly));
+
+ QDomDocument doc;
+ QVERIFY(doc.setContent(&buffer, true));
+
+ // ### Qt 5: fix this, if we keep QDom at all
+ QEXPECT_FAIL("", "The parser doesn't perform Attribute Value Normalization. Fixing that would change behavior.", Continue);
+ QCOMPARE(doc.documentElement().attribute(QLatin1String("attribute")), QString::fromLatin1("a a"));
+}
+
+void tst_QDom::serializeWeirdEOL() const
+{
+ QDomImplementation impl;
+
+ QDomDocument doc(impl.createDocument("", "name", QDomDocumentType()));
+ QDomElement ele(doc.documentElement());
+ ele.appendChild(doc.createTextNode(QLatin1String("\r\nasd\nasd\rasd\n")));
+
+ QByteArray output;
+ QBuffer writeBuffer(&output);
+ QVERIFY(writeBuffer.open(QIODevice::WriteOnly));
+ QTextStream stream(&writeBuffer);
+
+ const QByteArray expected("<name xmlns=\"\">&#xd;\nasd\nasd&#xd;asd\n</name>\n");
+ doc.save(stream, 0);
+ QCOMPARE(QString::fromLatin1(output.constData()), QString::fromLatin1(expected.constData()));
+}
+
+void tst_QDom::reparentAttribute() const
+{
+ QDomImplementation impl;
+ QDomDocument doc(impl.createDocument("", "localName", QDomDocumentType()));
+
+ QDomElement ele(doc.documentElement());
+ QDomAttr attr(doc.createAttribute("localName"));
+ ele.setAttributeNode(attr);
+
+ QVERIFY(attr.ownerElement() == ele);
+ QVERIFY(attr.parentNode() == ele);
+}
+
+void tst_QDom::serializeNamespaces() const
+{
+ const char *const input = "<doc xmlns:b='http://example.com/'>"
+ "<b:element b:name=''/>"
+ "</doc>";
+
+ QByteArray ba(input);
+ QBuffer buffer(&ba);
+
+ QVERIFY(buffer.open(QIODevice::ReadOnly));
+
+ QXmlInputSource source(&buffer);
+ QXmlSimpleReader reader;
+ reader.setFeature("http://xml.org/sax/features/namespaces", true);
+ reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+
+ QDomDocument doc;
+ QVERIFY(doc.setContent(&source, &reader));
+
+ const QByteArray serialized(doc.toByteArray());
+
+ QDomDocument doc2;
+ QVERIFY(doc2.setContent(doc.toString(), true));
+
+ /* Here we test that it roundtrips. */
+ QVERIFY(isDeepEqual(doc2, doc));
+
+ QDomDocument doc3;
+ QVERIFY(doc3.setContent(QString::fromLatin1(serialized.constData()), true));
+
+ QVERIFY(isDeepEqual(doc3, doc));
+}
+
+void tst_QDom::flagInvalidNamespaces() const
+{
+ const char *const input = "<doc>"
+ "<b:element xmlns:b='http://example.com/' b:name='' xmlns:b='http://example.com/'/>"
+ "</doc>";
+
+ QDomDocument doc;
+ QVERIFY(!doc.setContent(QString::fromLatin1(input, true)));
+ QEXPECT_FAIL("", "The parser doesn't flag identical qualified attribute names. Fixing this would change behavior.", Continue);
+ QVERIFY(!doc.setContent(QString::fromLatin1(input)));
+}
+
+void tst_QDom::flagUndeclaredNamespace() const
+{
+ /* Note, prefix 'a' is not declared. */
+ const char *const input = "<a:doc xmlns:b='http://example.com/'>"
+ "<b:element b:name=''/>"
+ "</a:doc>";
+
+ QByteArray ba(input);
+ QBuffer buffer(&ba);
+
+ QVERIFY(buffer.open(QIODevice::ReadOnly));
+
+ QXmlInputSource source(&buffer);
+ QXmlSimpleReader reader;
+ reader.setFeature("http://xml.org/sax/features/namespaces", true);
+ reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+
+ QDomDocument doc;
+ QEXPECT_FAIL("", "The parser doesn't flag not declared prefixes. Fixing this would change behavior.", Continue);
+ QVERIFY(!doc.setContent(&source, &reader));
+}
+
+void tst_QDom::indentComments() const
+{
+ /* We test that:
+ *
+ * - Whitespace is not added if a text node appears after a comment.
+ * - Whitespace is not added if a text node appears before a comment.
+ * - Indentation depth is linear with level depth.
+ */
+ const char *const input = "<e>"
+ "<!-- A Comment -->"
+ "<b><!-- deep --></b>"
+ "textNode"
+ "<!-- Another Comment -->"
+ "<!-- Another Comment2 -->"
+ "textNode2"
+ "</e>";
+ const char *const expected = "<e>\n"
+ " <!-- A Comment -->\n"
+ " <b>\n"
+ " <!-- deep -->\n"
+ " </b>"
+ "textNode"
+ "<!-- Another Comment -->\n"
+ " <!-- Another Comment2 -->"
+ "textNode2"
+ "</e>\n";
+ QDomDocument doc;
+ QVERIFY(doc.setContent(QString::fromLatin1(input)));
+
+ const QString serialized(doc.toString(5));
+
+ QCOMPARE(serialized, QString::fromLatin1(expected));
+}
+
+void tst_QDom::checkLiveness() const
+{
+ QDomImplementation impl;
+
+ QDomDocument doc(impl.createDocument(QString(), "doc", QDomDocumentType()));
+ QDomElement ele(doc.documentElement());
+
+ const QDomElement e1(doc.createElement("name"));
+ const QDomElement e2(doc.createElement("name"));
+ const QDomText t1(doc.createTextNode("content"));
+
+ ele.appendChild(e1);
+ ele.appendChild(t1);
+ ele.appendChild(e2);
+
+ const QDomNodeList children(ele.childNodes());
+ QCOMPARE(children.count(), 3);
+
+ ele.removeChild(e1);
+
+ QCOMPARE(children.count(), 2);
+ QCOMPARE(children.at(0), static_cast<const QDomNode &>(t1));
+ QCOMPARE(children.at(1), static_cast<const QDomNode &>(e2));
+}
+
+void tst_QDom::reportDuplicateAttributes() const
+{
+ QDomDocument dd;
+ bool isSuccess = dd.setContent(QLatin1String("<test x=\"1\" x=\"2\"/>"));
+
+ QEXPECT_FAIL("", "The parser doesn't flag duplicate attributes. Fixing this would change behavior.", Continue);
+ QVERIFY2(!isSuccess, "Duplicate attributes are well-formedness errors, and should be reported as such.");
+}
+
+void tst_QDom::namespacedAttributes() const
+{
+ static const char *const xml =
+ "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n"
+ "<xan:td xmlns:xan=\"http://www.someurl.com/Something\" "
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ " xsi:schemaLocation=\"http://www.someurl.com/Something/../../xml/td.xsd\" "
+ " xmlns:xi=\"http://www.w3.org/2001/XInclude\" "
+ " xmlns=\"http://www.someurl.com/Something\">\n"
+ " <Title displayLabel='Title' >>>> SIMPLE BASIC OP - SEND - DUT AS SINK</Title>\n"
+ "</xan:td>\n";
+
+ QDomDocument one("document");
+ QString error;
+ bool docParsed = one.setContent(QByteArray(xml), true, &error);
+ QVERIFY2(docParsed, qPrintable(error));
+ QDomDocument two("document2");
+ docParsed = two.setContent(one.toByteArray(2), true, &error);
+ QVERIFY2(docParsed, qPrintable(error));
+
+ QVERIFY(isDeepEqual(one, two));
+}
+
+void tst_QDom::appendChildFromToDocument() const
+{
+ QDomDocument doc;
+ const QByteArray input("<e/>");
+
+ doc.setContent(input);
+
+ QDomDocument doc2(doc.documentElement().toDocument());
+ QDomElement element = doc2.createElement("name");
+ element.setAttribute("name", "value");
+ doc.documentElement().appendChild(element);
+}
+
+void tst_QDom::iterateCDATA() const
+{
+ const QByteArray input("<e><![CDATA[data]]></e>");
+
+ QDomDocument doc;
+ QVERIFY(doc.setContent(input));
+ QCOMPARE(doc.toString(), QString("<e><![CDATA[data]]></e>\n"));
+
+ const QDomElement element(doc.documentElement());
+ QVERIFY(!element.isNull());
+
+ /* The node at element.childNodes().at(0) is not an element,
+ * it's a CDATA section. */
+ const QDomElement child(element.childNodes().at(0).toElement());
+ QVERIFY(child.isNull());
+
+ QVERIFY(element.childNodes().at(0).isCDATASection());
+}
+
+/*!
+ \internal
+ \since 4.4
+ \brief This function cannot be factored into appendDocumentNode(). The
+ invocation of constructors/destructors is part of triggering the bug.
+ */
+QDomDocument tst_QDom::generateRequest()
+{
+ QDomDocument doc;
+ QDomElement elem = doc.createElement("test_elem");
+
+ elem.setAttribute("name", "value");
+ doc.appendChild(elem);
+ return doc;
+}
+
+void tst_QDom::appendDocumentNode() const
+{
+ QDomDocument doc;
+ QDomDocument xml = generateRequest();
+ QDomElement elem = doc.createElement("document");
+
+ doc.appendChild(elem);
+
+ QVERIFY(!xml.isNull());
+ const QString expected(QLatin1String("<document>\n<test_elem name=\"value\"/>\n</document>\n"));
+
+ elem.appendChild(xml);
+ QCOMPARE(doc.childNodes().count(), 1);
+ QCOMPARE(doc.toString(0), expected);
+
+ elem.appendChild(xml.firstChild());
+ QCOMPARE(doc.childNodes().count(), 1);
+ QCOMPARE(doc.toString(0), expected);
+}
+
+static const QChar umlautName[] =
+{
+ 'a', 0xfc, 'b'
+};
+
+/*!
+ \internal
+
+ Write a german umlaut to a QByteArray, via a QTextStream.
+ */
+void tst_QDom::germanUmlautToByteArray() const
+{
+ QCOMPARE(ulong(sizeof(umlautName) / sizeof(QChar)), ulong(3));
+ const QString name(umlautName, 3);
+
+ QDomDocument d;
+ d.appendChild(d.createElement(name));
+ QByteArray data;
+ QBuffer buffer(&data);
+ QVERIFY(buffer.open(QIODevice::WriteOnly));
+ QTextStream ts(&buffer);
+ ts.setCodec("UTF-8");
+ ts << d.toString();
+ buffer.close();
+
+ QByteArray baseline("<a");
+
+ /* http://www.fileformat.info/info/unicode/char/00FC/index.htm */
+ baseline += 0xC3;
+ baseline += 0xBC;
+ baseline += "b/>\n";
+
+ QCOMPARE(data, baseline);
+}
+
+/*!
+ \internal
+
+ Write a german umlaut to a QFile, via a QTextStream.
+ */
+void tst_QDom::germanUmlautToFile() const
+{
+ /* http://www.fileformat.info/info/unicode/char/00FC/index.htm */
+ QString name(QLatin1String("german"));
+ name += QChar(0xFC);
+ name += QLatin1String("umlaut");
+ QCOMPARE(name.length(), 13);
+
+ QDomDocument d("test");
+ d.appendChild(d.createElement(name));
+ QFile file("germanUmlautToFile.xml");
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ QTextStream ts(&file);
+ ts.setCodec("UTF-8");
+ ts << d.toString();
+ file.close();
+
+ QFile inFile("germanUmlautToFile.xml");
+ QVERIFY(inFile.open(QIODevice::ReadOnly));
+
+ QString baseline(QLatin1String("<!DOCTYPE test>\n<german"));
+ baseline += QChar(0xFC);
+ baseline += QLatin1String("umlaut/>\n");
+
+ const QByteArray in(inFile.readAll());
+ /* Check that it was wwritten out correctly. */
+ QCOMPARE(in.length(), 34);
+ QCOMPARE(in, baseline.toUtf8());
+ inFile.close();
+
+ /* Check that we read it in correctly with QDomDocument::setContent(). */
+ QVERIFY(inFile.open(QIODevice::ReadOnly));
+ QDomDocument dd;
+ QVERIFY(dd.setContent(&inFile));
+
+ QCOMPARE(dd.toString(), baseline);
+}
+
+void tst_QDom::setInvalidDataPolicy() const
+{
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::ReturnNullNode);
+ QDomDocument doc;
+ QDomElement elem = doc.createElement("invalid name");
+ QVERIFY(elem.isNull());
+}
+
+void tst_QDom::crashInSetContent() const
+{
+ QDomImplementation::setInvalidDataPolicy(QDomImplementation::ReturnNullNode);
+ QDomDocument docImport;
+
+ QCOMPARE(docImport.setContent(QLatin1String("<a:>text</a:>"), true), false);
+ QVERIFY(docImport.setContent(QLatin1String("<?xml version=\"1.0\"?><e/>")));
+}
+
+void tst_QDom::doubleNamespaceDeclarations() const
+{
+ QDomDocument doc;
+
+ QFile file(SRCDIR "doubleNamespaces.xml" );
+ QVERIFY(file.open(QIODevice::ReadOnly));
+
+ QXmlSimpleReader reader;
+
+ QXmlInputSource source(&file);
+ QVERIFY(doc.setContent(&source, &reader));
+
+ QVERIFY(doc.toString(0) == QString::fromLatin1("<a>\n<b p:c=\"\" xmlns:p=\"NS\" p:d=\"\"/>\n</a>\n") ||
+ doc.toString(0) == QString::fromLatin1("<a>\n<b p:c=\"\" p:d=\"\" xmlns:p=\"NS\"/>\n</a>\n"));
+}
+
+void tst_QDom::setContentQXmlReaderOverload() const
+{
+ QDomDocument doc;
+
+ QXmlSimpleReader reader;
+ QXmlInputSource data;
+ data.setData(QByteArray("<e/>"));
+
+ doc.setContent(&data, true);
+ QCOMPARE(doc.documentElement().nodeName(), QString::fromLatin1("e"));
+}
+
+void tst_QDom::cleanupTestCase() const
+{
+ QFile::remove("germanUmlautToFile.xml");
+}
+
+void tst_QDom::toStringWithoutNewlines() const
+{
+ QDomDocument doc;
+ doc.setContent(QLatin1String("<doc><e/></doc>"));
+
+ QCOMPARE(doc.toString(0), QString::fromLatin1("<doc>\n<e/>\n</doc>\n"));
+ QCOMPARE(doc.toString(-1), QString::fromLatin1("<doc><e/></doc>"));
+}
+
+void tst_QDom::checkIntOverflow() const
+{
+ /* This test takes a *very* long time to run, so it is at best a manual
+ * test. */
+ return;
+
+ /* QDom used an internal global int which overflowed. So iterate until an
+ * uint wrapsaround. */
+ const QString xmlMessage(QLatin1String("<test/>"));
+
+ bool hasWrapped = false;
+ for(uint i = 1; i != 0; ++i)
+ {
+ /* We want to exit the second time, not loop infinitely. */
+ if(i == 1 && hasWrapped)
+ break;
+ else
+ hasWrapped = true;
+
+ QDomDocument doc;
+ QVERIFY(doc.setContent(xmlMessage));
+
+ const QDomNodeList nl(doc.elementsByTagName(QLatin1String("test")));
+ QCOMPARE(nl.length(), uint(1));
+ }
+}
+
+void tst_QDom::setContentWhitespace() const
+{
+ QFETCH(QString, doc);
+ QFETCH(bool, expectedValidity);
+
+ QDomDocument domDoc;
+
+ QCOMPARE(domDoc.setContent(doc), expectedValidity);
+
+ if(expectedValidity)
+ QCOMPARE(domDoc.documentElement().nodeName(), QString::fromLatin1("e"));
+}
+
+void tst_QDom::setContentWhitespace_data() const
+{
+ QTest::addColumn<QString>("doc");
+ QTest::addColumn<bool>("expectedValidity");
+
+ QTest::newRow("") << QString::fromLatin1(" <e/>") << true;
+ QTest::newRow("") << QString::fromLatin1(" <e/>") << true;
+ QTest::newRow("") << QString::fromLatin1(" <e/>") << true;
+ QTest::newRow("") << QString::fromLatin1(" <e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\n<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\n\n<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\n\n\n<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\n\n\n\n<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\t<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\t\t<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\t\t\t<e/>") << true;
+ QTest::newRow("") << QString::fromLatin1("\t\t\t\t<e/>") << true;
+
+ /* With XML prolog. */
+ QTest::newRow("") << QString::fromLatin1("<?xml version='1.0' ?><e/>") << true;
+
+ QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\n<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\n\n<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\n\n\n<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\n\n\n\n<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\t<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\t\t<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\t\t\t<?xml version='1.0' ?><e/>") << false;
+ QTest::newRow("") << QString::fromLatin1("\t\t\t\t<?xml version='1.0' ?><e/>") << false;
+}
+
+void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const
+{
+ QString xmlWithUnknownEncoding("<?xml version='1.0' encoding='unknown-encoding'?>"
+ "<foo>"
+ " <bar>How will this sentence be handled?</bar>"
+ "</foo>");
+ QDomDocument d;
+ QVERIFY(d.setContent(xmlWithUnknownEncoding));
+
+ QString dontAssert = d.toString(); // this should not assert
+ QVERIFY(true);
+}
+
+void tst_QDom::cloneDTD_QTBUG8398() const
+{
+ QString dtd("<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<!DOCTYPE first [\n"
+ "<!ENTITY secondFile SYSTEM 'second.xml'>\n"
+ "<!ENTITY thirdFile SYSTEM 'third.xml'>\n"
+ "]>\n"
+ "<first/>\n");
+ QDomDocument domDocument;
+ QVERIFY(domDocument.setContent(dtd));
+ QDomDocument domDocument2 = domDocument.cloneNode(true).toDocument();
+
+ // for some reason, our DOM implementation reverts the order of entities
+ QString expected("<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<!DOCTYPE first [\n"
+ "<!ENTITY thirdFile SYSTEM 'third.xml'>\n"
+ "<!ENTITY secondFile SYSTEM 'second.xml'>\n"
+ "]>\n"
+ "<first/>\n");
+ QString output;
+ QTextStream stream(&output);
+ domDocument2.save(stream, 0);
+ QCOMPARE(output, expected);
+}
+QTEST_MAIN(tst_QDom)
+#include "tst_qdom.moc"
diff --git a/tests/auto/xml/dom/qdom/umlaut.xml b/tests/auto/xml/dom/qdom/umlaut.xml
new file mode 100644
index 0000000000..4b1dbe43ab
--- /dev/null
+++ b/tests/auto/xml/dom/qdom/umlaut.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE test>
+<germanüumlaut/>
diff --git a/tests/auto/xml/sax/qxml/.gitignore b/tests/auto/xml/sax/qxml/.gitignore
new file mode 100644
index 0000000000..6506151df0
--- /dev/null
+++ b/tests/auto/xml/sax/qxml/.gitignore
@@ -0,0 +1 @@
+tst_qxml
diff --git a/tests/auto/xml/sax/qxml/0x010D.xml b/tests/auto/xml/sax/qxml/0x010D.xml
new file mode 100644
index 0000000000..5f2fe4d940
--- /dev/null
+++ b/tests/auto/xml/sax/qxml/0x010D.xml
@@ -0,0 +1 @@
+<project čreated-by="{{build_number}}"/> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxml/qxml.pro b/tests/auto/xml/sax/qxml/qxml.pro
new file mode 100644
index 0000000000..c87518a7ff
--- /dev/null
+++ b/tests/auto/xml/sax/qxml/qxml.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+
+SOURCES += tst_qxml.cpp
+QT = core xml
+
+wince*|symbian: {
+ addFiles.files = 0x010D.xml
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+}
+
+
diff --git a/tests/auto/xml/sax/qxml/tst_qxml.cpp b/tests/auto/xml/sax/qxml/tst_qxml.cpp
new file mode 100644
index 0000000000..7b62b3deb8
--- /dev/null
+++ b/tests/auto/xml/sax/qxml/tst_qxml.cpp
@@ -0,0 +1,243 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+
+#include <qcoreapplication.h>
+#include <qdebug.h>
+#include <qxml.h>
+
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+class tst_QXml : public QObject
+{
+Q_OBJECT
+
+private slots:
+ void getSetCheck();
+ void interpretedAs0D() const;
+ void exception();
+};
+
+class MyXmlEntityResolver : public QXmlEntityResolver
+{
+public:
+ MyXmlEntityResolver() : QXmlEntityResolver() {}
+ QString errorString() const { return QString(); }
+ bool resolveEntity(const QString &, const QString &, QXmlInputSource *&) { return false; }
+};
+
+class MyXmlContentHandler : public QXmlContentHandler
+{
+public:
+ MyXmlContentHandler() : QXmlContentHandler() {}
+ bool characters(const QString &) { return false; }
+ bool endDocument() { return false; }
+ bool endElement(const QString &, const QString &, const QString &) { return false; }
+ bool endPrefixMapping(const QString &) { return false; }
+ QString errorString() const { return QString(); }
+ bool ignorableWhitespace(const QString &) { return false; }
+ bool processingInstruction(const QString &, const QString &) { return false; }
+ void setDocumentLocator(QXmlLocator *) { }
+ bool skippedEntity(const QString &) { return false; }
+ bool startDocument() { return false; }
+ bool startElement(const QString &, const QString &, const QString &, const QXmlAttributes &) { return false; }
+ bool startPrefixMapping(const QString &, const QString &) { return false; }
+};
+
+class MyXmlErrorHandler : public QXmlErrorHandler
+{
+public:
+ MyXmlErrorHandler() : QXmlErrorHandler() {}
+ QString errorString() const { return QString(); }
+ bool error(const QXmlParseException &) { return false; }
+ bool fatalError(const QXmlParseException &) { return false; }
+ bool warning(const QXmlParseException &) { return false; }
+};
+
+class MyXmlLexicalHandler : public QXmlLexicalHandler
+{
+public:
+ MyXmlLexicalHandler() : QXmlLexicalHandler() {}
+ bool comment(const QString &) { return false; }
+ bool endCDATA() { return false; }
+ bool endDTD() { return false; }
+ bool endEntity(const QString &) { return false; }
+ QString errorString() const { return QString(); }
+ bool startCDATA() { return false; }
+ bool startDTD(const QString &, const QString &, const QString &) { return false; }
+ bool startEntity(const QString &) { return false; }
+};
+
+class MyXmlDeclHandler : public QXmlDeclHandler
+{
+public:
+ MyXmlDeclHandler() : QXmlDeclHandler() {}
+ bool attributeDecl(const QString &, const QString &, const QString &, const QString &, const QString &) { return false; }
+ QString errorString() const { return QString(); }
+ bool externalEntityDecl(const QString &, const QString &, const QString &) { return false; }
+ bool internalEntityDecl(const QString &, const QString &) { return false; }
+};
+
+// Testing get/set functions
+void tst_QXml::getSetCheck()
+{
+ QXmlSimpleReader obj1;
+ // QXmlEntityResolver* QXmlSimpleReader::entityResolver()
+ // void QXmlSimpleReader::setEntityResolver(QXmlEntityResolver*)
+ MyXmlEntityResolver *var1 = new MyXmlEntityResolver;
+ obj1.setEntityResolver(var1);
+ QCOMPARE(static_cast<QXmlEntityResolver *>(var1), obj1.entityResolver());
+ obj1.setEntityResolver((QXmlEntityResolver *)0);
+ QCOMPARE((QXmlEntityResolver *)0, obj1.entityResolver());
+ delete var1;
+
+ // QXmlContentHandler* QXmlSimpleReader::contentHandler()
+ // void QXmlSimpleReader::setContentHandler(QXmlContentHandler*)
+ MyXmlContentHandler *var2 = new MyXmlContentHandler;
+ obj1.setContentHandler(var2);
+ QCOMPARE(static_cast<QXmlContentHandler *>(var2), obj1.contentHandler());
+ obj1.setContentHandler((QXmlContentHandler *)0);
+ QCOMPARE((QXmlContentHandler *)0, obj1.contentHandler());
+ delete var2;
+
+ // QXmlErrorHandler* QXmlSimpleReader::errorHandler()
+ // void QXmlSimpleReader::setErrorHandler(QXmlErrorHandler*)
+ MyXmlErrorHandler *var3 = new MyXmlErrorHandler;
+ obj1.setErrorHandler(var3);
+ QCOMPARE(static_cast<QXmlErrorHandler *>(var3), obj1.errorHandler());
+ obj1.setErrorHandler((QXmlErrorHandler *)0);
+ QCOMPARE((QXmlErrorHandler *)0, obj1.errorHandler());
+ delete var3;
+
+ // QXmlLexicalHandler* QXmlSimpleReader::lexicalHandler()
+ // void QXmlSimpleReader::setLexicalHandler(QXmlLexicalHandler*)
+ MyXmlLexicalHandler *var4 = new MyXmlLexicalHandler;
+ obj1.setLexicalHandler(var4);
+ QCOMPARE(static_cast<QXmlLexicalHandler *>(var4), obj1.lexicalHandler());
+ obj1.setLexicalHandler((QXmlLexicalHandler *)0);
+ QCOMPARE((QXmlLexicalHandler *)0, obj1.lexicalHandler());
+ delete var4;
+
+ // QXmlDeclHandler* QXmlSimpleReader::declHandler()
+ // void QXmlSimpleReader::setDeclHandler(QXmlDeclHandler*)
+ MyXmlDeclHandler *var5 = new MyXmlDeclHandler;
+ obj1.setDeclHandler(var5);
+ QCOMPARE(static_cast<QXmlDeclHandler *>(var5), obj1.declHandler());
+ obj1.setDeclHandler((QXmlDeclHandler *)0);
+ QCOMPARE((QXmlDeclHandler *)0, obj1.declHandler());
+ delete var5;
+}
+
+void tst_QXml::interpretedAs0D() const
+{
+ /* See task 172632. */
+
+ class MyHandler : public QXmlDefaultHandler
+ {
+ public:
+ virtual bool startElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName,
+ const QXmlAttributes &atts)
+ {
+ Q_UNUSED(namespaceURI);
+ Q_UNUSED(localName);
+ Q_UNUSED(qName);
+ attrName = atts.qName(0);
+ attrCount = atts.count();
+ return true;
+ }
+
+ QString attrName;
+ int attrCount;
+ };
+
+ const QString document(QLatin1String("<element ") +
+ QChar(0x010D) +
+ QLatin1String("reated-by=\"an attr value\"/>"));
+
+ QFile f("0x010D.xml");
+ QVERIFY(f.open(QIODevice::ReadOnly));
+ QXmlInputSource data(&f);
+
+ QXmlSimpleReader reader;
+
+ MyHandler myHandler;
+ reader.setContentHandler(&myHandler);
+ reader.setErrorHandler(&myHandler);
+
+ QVERIFY(reader.parse(&data));
+
+ QCOMPARE(myHandler.attrCount, 1);
+ QCOMPARE(myHandler.attrName, QChar(0x010D) + QString::fromLatin1("reated-by"));
+}
+
+void tst_QXml::exception()
+{
+#ifndef QT_NO_EXCEPTIONS
+ QString message = QString::fromLatin1("message");
+ int column = 3;
+ int line = 2;
+ QString publicId = QString::fromLatin1("publicId");
+ QString systemId = QString::fromLatin1("systemId");
+
+ try {
+ QXmlParseException e(message, column, line, publicId, systemId);
+ throw e;
+ }
+ catch (QXmlParseException e) {
+ QCOMPARE(e.message(), message);
+ QCOMPARE(e.columnNumber(), column);
+ QCOMPARE(e.lineNumber(), line);
+ QCOMPARE(e.publicId(), publicId);
+ QCOMPARE(e.systemId(), systemId);
+ }
+#else
+ QSKIP("Exceptions not available", SkipAll);
+#endif
+}
+
+QTEST_MAIN(tst_QXml)
+#include "tst_qxml.moc"
diff --git a/tests/auto/xml/sax/qxmlinputsource/.gitignore b/tests/auto/xml/sax/qxmlinputsource/.gitignore
new file mode 100644
index 0000000000..09ea68aa90
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlinputsource/.gitignore
@@ -0,0 +1 @@
+tst_qxmlinputsource
diff --git a/tests/auto/xml/sax/qxmlinputsource/qxmlinputsource.pro b/tests/auto/xml/sax/qxmlinputsource/qxmlinputsource.pro
new file mode 100644
index 0000000000..ec83f4729a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlinputsource/qxmlinputsource.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+SOURCES += tst_qxmlinputsource.cpp
+QT += core xml network
+QT -= gui
+
+
diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
new file mode 100644
index 0000000000..9d31b34772
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QDomDocument>
+#include <QHttp>
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QTimer>
+#include <QtDebug>
+#include <QtTest/QtTest>
+#include <QXmlDefaultHandler>
+#include <QXmlInputSource>
+#include <QXmlSimpleReader>
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+class tst_QXmlInputSource : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void reset() const;
+ void resetSimplified() const;
+ void waitForReadyIODevice() const;
+};
+
+/*!
+ \internal
+ \since 4.4
+
+ See task 166278.
+ */
+void tst_QXmlInputSource::reset() const
+{
+ const QString input(QString::fromLatin1("<element attribute1='value1' attribute2='value2'/>"));
+
+ QXmlSimpleReader reader;
+ QXmlDefaultHandler handler;
+ reader.setContentHandler(&handler);
+
+ QXmlInputSource source;
+ source.setData(input);
+
+ QCOMPARE(source.data(), input);
+
+ source.reset();
+ QCOMPARE(source.data(), input);
+
+ source.reset();
+ QVERIFY(reader.parse(source));
+ source.reset();
+ QCOMPARE(source.data(), input);
+}
+
+/*!
+ \internal
+ \since 4.4
+
+ See task 166278.
+ */
+void tst_QXmlInputSource::resetSimplified() const
+{
+ const QString input(QString::fromLatin1("<element/>"));
+
+ QXmlSimpleReader reader;
+
+ QXmlInputSource source;
+ source.setData(input);
+
+ QVERIFY(reader.parse(source));
+ source.reset();
+ QCOMPARE(source.data(), input);
+}
+
+class ServerAndClient : public QObject
+{
+ Q_OBJECT
+
+public:
+ ServerAndClient(QEventLoop &ev) : success(false)
+ , eventLoop(ev)
+ {
+ setObjectName("serverAndClient");
+ tcpServer = new QTcpServer(this);
+ connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
+ tcpServer->listen(QHostAddress::LocalHost, 1088);
+ httpClient = new QHttp(this);
+ connect(httpClient, SIGNAL(requestFinished(int, bool)), SLOT(requestFinished(int, bool)));
+ }
+
+ bool success;
+ QEventLoop &eventLoop;
+
+public slots:
+ void doIt()
+ {
+ QUrl url("http://127.0.0.1:1088");
+ httpClient->setHost( url.host(), 1088);
+ QHttpRequestHeader req_head("POST", url.path());
+ req_head.setValue("host", url.host());
+ req_head.setValue("user-agent", "xml-test");
+ req_head.setValue("keep-alive", "false");
+
+ QByteArray xmlrpc("<methodCall>\r\n\
+ <methodName>SFD.GetVersion</methodName>\r\n\
+ <params/>\r\n\
+ </methodCall>");
+ req_head.setContentLength(xmlrpc.size());
+ req_head.setContentType("text/xml");
+
+ httpClient->request(req_head, xmlrpc);
+ }
+
+ void requestFinished(int, bool isError)
+ {
+ QVERIFY(!isError);
+ }
+
+private slots:
+ void newConnection()
+ {
+ QTcpSocket *const s = tcpServer->nextPendingConnection();
+
+ if(s)
+ connect(s, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ }
+
+ void readyRead()
+ {
+ QTcpSocket *const s = static_cast<QTcpSocket *>(sender());
+ int bodyLength = -1;
+
+ while(s->canReadLine())
+ {
+ const QString line(s->readLine());
+
+ if(line.startsWith("content-length:"))
+ bodyLength = line.mid(15).toInt();
+
+ if(line == "\r\n")
+ {
+ if(bodyLength == -1)
+ {
+ qFatal("No length was specified in the header.");
+ }
+
+ QDomDocument domDoc;
+ success = domDoc.setContent(s->read(bodyLength));
+ eventLoop.exit();
+ }
+ }
+ }
+
+private:
+ QTcpServer *tcpServer;
+ QHttp* httpClient;
+};
+
+void tst_QXmlInputSource::waitForReadyIODevice() const
+{
+ QEventLoop el;
+ ServerAndClient sv(el);
+ QTimer::singleShot(1, &sv, SLOT(doIt()));
+
+ el.exec();
+ QVERIFY(sv.success);
+}
+
+QTEST_MAIN(tst_QXmlInputSource)
+#include "tst_qxmlinputsource.moc"
diff --git a/tests/auto/xml/sax/qxmlsimplereader/.gitattributes b/tests/auto/xml/sax/qxmlsimplereader/.gitattributes
new file mode 100644
index 0000000000..5521239fbe
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/.gitattributes
@@ -0,0 +1,8 @@
+encodings/doc_euc-jp.xml -crlf
+encodings/doc_utf-8.xml -crlf
+xmldocs/* -crlf
+xmldocs/*/* -crlf
+xmldocs/*/*/* -crlf
+xmldocs/*/*/*/* -crlf
+xmldocs/*/*/*/*/* -crlf
+xmldocs/*/*/*/*/*/* -crlf
diff --git a/tests/auto/xml/sax/qxmlsimplereader/.gitignore b/tests/auto/xml/sax/qxmlsimplereader/.gitignore
new file mode 100644
index 0000000000..31b604faaf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/.gitignore
@@ -0,0 +1 @@
+tst_qxmlsimplereader
diff --git a/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_euc-jp.xml b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_euc-jp.xml
new file mode 100644
index 0000000000..887ab5ec30
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_euc-jp.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="euc-jp"?>
+<!DOCTYPE SYSTEM "weekly-euc-jp.dtd">
+<!-- 󥵥ץ -->
+<>
+ <ǯ>
+ <ǯ>1997</ǯ>
+ <>1</>
+ <>1</>
+ </ǯ>
+
+ <̾>
+ <></>
+ <̾>Ϻ</̾>
+ </̾>
+
+ <̳ꥹ>
+ <̳>
+ <̳̾>XMLǥκ</̳̾>
+ <̳>X3355-23</̳>
+ <>
+ <Ѥ깩>1600</Ѥ깩>
+ <ӹ>320</ӹ>
+ <Ѥ깩>160</Ѥ깩>
+ <ӹ>24</ӹ>
+ </>
+ <ͽܥꥹ>
+ <ͽ>
+ <P>XMLǥδܻͤκ</P>
+ </ͽ>
+ </ͽܥꥹ>
+ <»ܻꥹ>
+ <»ܻ>
+ <P>XMLǥδܻͤκ</P>
+ </»ܻ>
+ <»ܻ>
+ <P>¾ʤεǽĴ</P>
+ </»ܻ>
+ </»ܻꥹ>
+ <Ĺؤꥹ>
+ <Ĺؤ>
+ <P>äˤʤ</P>
+ </Ĺؤ>
+ </Ĺؤꥹ>
+ <к>
+ <P>XMLȤϲ狼ʤ</P>
+ </к>
+ </̳>
+
+ <̳>
+ <̳̾>󥸥γȯ</̳̾>
+ <̳>S8821-76</̳>
+ <>
+ <Ѥ깩>120</Ѥ깩>
+ <ӹ>6</ӹ>
+ <Ѥ깩>32</Ѥ깩>
+ <ӹ>2</ӹ>
+ </>
+ <ͽܥꥹ>
+ <ͽ>
+ <P><A href="http://www.goo.ne.jp">goo</A>εǽĴ٤Ƥߤ</P>
+ </ͽ>
+ </ͽܥꥹ>
+ <»ܻꥹ>
+ <»ܻ>
+ <P>ˡɤ󥸥󤬤뤫Ĵ</P>
+ </»ܻ>
+ </»ܻꥹ>
+ <Ĺؤꥹ>
+ <Ĺؤ>
+ <P>ȯ򤹤ΤϤɤʤΤǡYahoo!Ʋ</P>
+ </Ĺؤ>
+ </Ĺؤꥹ>
+ <к>
+ <P>󥸥Ǽ֤餻뤳ȤǤʤĴ</P>
+ </к>
+ </̳>
+ </̳ꥹ>
+</>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_iso-2022-jp.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_iso-2022-jp.xml.ref
new file mode 100644
index 0000000000..28dcdd98c4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_iso-2022-jp.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='iso-2022-jp'")
+ fatalError(exception={columnNumber=11, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_little-endian.xml b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_little-endian.xml
new file mode 100644
index 0000000000..81f72e59e8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_little-endian.xml
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-16.xml b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-16.xml
new file mode 100644
index 0000000000..6c8622aa43
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-16.xml
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-8.xml b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-8.xml
new file mode 100644
index 0000000000..402c163c5f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/encodings/doc_utf-8.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<!-- 週報サンプル -->
+<週報>
+ <年月週>
+ <年度>1997</年度>
+ <月度>1</月度>
+ <週>1</週>
+ </年月週>
+
+ <氏名>
+ <氏>山田</氏>
+ <名>太郎</名>
+ </氏名>
+
+ <業務報告リスト>
+ <業務報告>
+ <業務名>XMLエディターの作成</業務名>
+ <業務コード>X3355-23</業務コード>
+ <工数管理>
+ <見積もり工数>1600</見積もり工数>
+ <実績工数>320</実績工数>
+ <当月見積もり工数>160</当月見積もり工数>
+ <当月実績工数>24</当月実績工数>
+ </工数管理>
+ <予定項目リスト>
+ <予定項目>
+ <P>XMLエディターの基本仕様の作成</P>
+ </予定項目>
+ </予定項目リスト>
+ <実施事項リスト>
+ <実施事項>
+ <P>XMLエディターの基本仕様の作成</P>
+ </実施事項>
+ <実施事項>
+ <P>競合他社製品の機能調査</P>
+ </実施事項>
+ </実施事項リスト>
+ <上長への要請事項リスト>
+ <上長への要請事項>
+ <P>特になし</P>
+ </上長への要請事項>
+ </上長への要請事項リスト>
+ <問題点対策>
+ <P>XMLとは何かわからない。</P>
+ </問題点対策>
+ </業務報告>
+
+ <業務報告>
+ <業務名>検索エンジンの開発</業務名>
+ <業務コード>S8821-76</業務コード>
+ <工数管理>
+ <見積もり工数>120</見積もり工数>
+ <実績工数>6</実績工数>
+ <当月見積もり工数>32</当月見積もり工数>
+ <当月実績工数>2</当月実績工数>
+ </工数管理>
+ <予定項目リスト>
+ <予定項目>
+ <P><A href="http://www.goo.ne.jp">goo</A>の機能を調べてみる</P>
+ </予定項目>
+ </予定項目リスト>
+ <実施事項リスト>
+ <実施事項>
+ <P>更に、どういう検索エンジンがあるか調査する</P>
+ </実施事項>
+ </実施事項リスト>
+ <上長への要請事項リスト>
+ <上長への要請事項>
+ <P>開発をするのはめんどうなので、Yahoo!を買収して下さい。</P>
+ </上長への要請事項>
+ </上長への要請事項リスト>
+ <問題点対策>
+ <P>検索エンジンで車を走らせることができない。(要調査)</P>
+ </問題点対策>
+ </業務報告>
+ </業務報告リスト>
+</週報>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh b/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh
new file mode 100755
index 0000000000..ae2a5ffb5c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+#############################################################################
+##
+## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## All rights reserved.
+## Contact: Nokia Corporation (qt-info@nokia.com)
+##
+## This file is the build configuration utility of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## GNU Lesser General Public License Usage
+## This file may be used under the terms of the GNU Lesser General Public
+## License version 2.1 as published by the Free Software Foundation and
+## appearing in the file LICENSE.LGPL included in the packaging of this
+## file. Please review the following information to ensure the GNU Lesser
+## General Public License version 2.1 requirements will be met:
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## In addition, as a special exception, Nokia gives you certain additional
+## rights. These rights are described in the Nokia Qt LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU General
+## Public License version 3.0 as published by the Free Software Foundation
+## and appearing in the file LICENSE.GPL included in the packaging of this
+## file. Please review the following information to ensure the GNU General
+## Public License version 3.0 requirements will be met:
+## http://www.gnu.org/copyleft/gpl.html.
+##
+## Other Usage
+## Alternatively, this file may be used in accordance with the terms and
+## conditions contained in a signed written agreement between you and Nokia.
+##
+##
+##
+##
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+for k in `find xmldocs -name \*.xml`; do echo $k...; ./parser/parser $k; done
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
new file mode 100644
index 0000000000..05d9ce6754
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include <qfile.h>
+#include <qstring.h>
+#include <qtextstream.h>
+
+#include "parser.h"
+
+static QTextStream qout(stdout, QIODevice::WriteOnly);
+static QTextStream qerr(stderr, QIODevice::WriteOnly);
+
+static void usage()
+{
+ qerr << "Usage: parse [-report-whitespace-only-chardata] [-report-start-end-entity] <in-file> [<out-file>]\n";
+ exit(1);
+}
+
+int main(int argc, const char *argv[])
+{
+ QString file_name;
+ QString out_file_name;
+ bool report_start_end_entity = false;
+ bool report_whitespace_only_chardata = false;
+
+ for (int i = 1 ; i < argc; ++i) {
+ QString arg = QString::fromLocal8Bit(argv[i]);
+ if (arg == QLatin1String("-report-whitespace-only-chardata"))
+ report_whitespace_only_chardata = true;
+ else if (arg == QLatin1String("-report-start-end-entity"))
+ report_start_end_entity = true;
+ else if (file_name.isEmpty())
+ file_name = arg;
+ else if (out_file_name.isEmpty())
+ out_file_name = arg;
+ else
+ usage();
+ }
+
+ if (file_name.isEmpty())
+ usage();
+
+ QFile in_file(file_name);
+ if (!in_file.open(QIODevice::ReadOnly)) {
+ qerr << "Could not open " << file_name << ": " << strerror(errno) << endl;
+ return 1;
+ }
+
+ if (out_file_name.isEmpty())
+ out_file_name = file_name + ".ref";
+
+ QFile _out_file;
+ QTextStream _out_stream;
+ QTextStream *out_stream;
+ if (out_file_name == "-") {
+ out_stream = &qout;
+ } else {
+ _out_file.setFileName(out_file_name);
+ if (!_out_file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ qerr << "Could not open " << out_file_name << ": " << strerror(errno) << endl;
+ return 1;
+ }
+ _out_stream.setDevice(&_out_file);
+ out_stream = &_out_stream;
+ }
+
+ Parser parser;
+ if (report_start_end_entity)
+ parser.setFeature("http://trolltech.com/xml/features/report-start-end-entity", true);
+ if (report_whitespace_only_chardata)
+ parser.setFeature("http://trolltech.com/xml/features/report-whitespace-only-CharData", true);
+
+ parser.parseFile(&in_file);
+
+ out_stream->setCodec("utf8");
+
+ *out_stream << parser.result();
+
+ return 0;
+}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
new file mode 100644
index 0000000000..d1f1c3cfda
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
@@ -0,0 +1,455 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <qxml.h>
+#include <qregexp.h>
+
+#include "parser.h"
+
+class ContentHandler : public QXmlDefaultHandler
+{
+ public:
+ ContentHandler();
+
+ // QXmlContentHandler methods
+ bool startDocument();
+ bool endDocument();
+ bool startElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName,
+ const QXmlAttributes & atts);
+ bool endElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName);
+ bool characters(const QString &ch);
+ void setDocumentLocator(QXmlLocator *locator);
+ bool startPrefixMapping (const QString &prefix, const QString & uri);
+ bool endPrefixMapping(const QString &prefix);
+ bool ignorableWhitespace (const QString & ch);
+ bool processingInstruction(const QString &target, const QString &data);
+ bool skippedEntity (const QString & name);
+
+ // QXmlErrorHandler methods
+ bool warning (const QXmlParseException & exception);
+ bool error (const QXmlParseException & exception);
+ bool fatalError (const QXmlParseException & exception);
+
+ // QXmlDTDHandler methods
+ bool notationDecl ( const QString & name, const QString & publicId,
+ const QString & systemId );
+ bool unparsedEntityDecl ( const QString & name,
+ const QString & publicId,
+ const QString & systemId,
+ const QString & notationName );
+
+ // QXmlEntityResolver methods
+ bool resolveEntity ( const QString & publicId,
+ const QString & systemId,
+ QXmlInputSource *&);
+
+ // QXmlLexicalHandler methods
+ bool startDTD ( const QString & name, const QString & publicId, const QString & systemId );
+ bool endDTD ();
+ bool startEntity ( const QString & name );
+ bool endEntity ( const QString & name );
+ bool startCDATA ();
+ bool endCDATA ();
+ bool comment ( const QString & ch );
+
+ // QXmlDeclHandler methods
+ bool attributeDecl ( const QString & eName, const QString & aName, const QString & type, const QString & valueDefault, const QString & value );
+ bool internalEntityDecl ( const QString & name, const QString & value );
+ bool externalEntityDecl ( const QString & name, const QString & publicId, const QString & systemId );
+
+
+ const QString &result() const { return m_result; }
+ const QString &errorMsg() const { return m_error_msg; }
+
+ private:
+ QString nestPrefix() const { return QString().fill(' ', 3*m_nest); }
+ QString formatAttributes(const QXmlAttributes & atts);
+ QString escapeStr(const QString &s);
+
+ unsigned m_nest;
+ QString m_result, m_error_msg;
+};
+
+ContentHandler::ContentHandler()
+{
+ m_nest = 0;
+}
+
+
+bool ContentHandler::startDocument()
+{
+ m_result += nestPrefix();
+ m_result += "startDocument()\n";
+ ++m_nest;
+ return TRUE;
+}
+
+bool ContentHandler::endDocument()
+{
+ --m_nest;
+ m_result += nestPrefix();
+ m_result += "endDocument()\n";
+ return TRUE;
+}
+
+bool ContentHandler::startElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName,
+ const QXmlAttributes & atts)
+{
+ m_result += nestPrefix();
+ m_result += "startElement(namespaceURI=\"" + escapeStr(namespaceURI)
+ + "\", localName=\"" + escapeStr(localName)
+ + "\", qName=\"" + escapeStr(qName)
+ + "\", atts=[" + formatAttributes(atts) + "])\n";
+ ++m_nest;
+ return TRUE;
+}
+
+QString ContentHandler::escapeStr(const QString &s)
+{
+ QString result = s;
+ result.replace(QRegExp("\""), "\\\"");
+ result.replace(QRegExp("\\"), "\\\\");
+ result.replace(QRegExp("\n"), "\\n");
+ result.replace(QRegExp("\r"), "\\r");
+ result.replace(QRegExp("\t"), "\\t");
+ return result;
+}
+
+QString ContentHandler::formatAttributes(const QXmlAttributes &atts)
+{
+ QString result;
+ for (int i = 0, cnt = atts.count(); i < cnt; ++i) {
+ if (i != 0) result += ", ";
+ result += "{localName=\"" + escapeStr(atts.localName(i))
+ + "\", qName=\"" + escapeStr(atts.qName(i))
+ + "\", uri=\"" + escapeStr(atts.uri(i))
+ + "\", type=\"" + escapeStr(atts.type(i))
+ + "\", value=\"" + escapeStr(atts.value(i)) + "\"}";
+ }
+ return result;
+}
+
+bool ContentHandler::endElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName)
+{
+ --m_nest;
+ m_result += nestPrefix();
+ m_result += "endElement(namespaceURI=\"" + escapeStr(namespaceURI)
+ + "\", localName=\"" + escapeStr(localName)
+ + "\", qName=\"" + escapeStr(qName) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::characters(const QString &ch)
+{
+ m_result += nestPrefix();
+ m_result += "characters(ch=\"" + escapeStr(ch) + "\")\n";
+ return TRUE;
+}
+
+void ContentHandler::setDocumentLocator(QXmlLocator *locator)
+{
+ m_result += nestPrefix();
+ m_result += "setDocumentLocator(locator={columnNumber="
+ + QString::number(locator->columnNumber())
+ + ", lineNumber=" + QString::number(locator->lineNumber())
+ + "})\n";
+}
+
+bool ContentHandler::startPrefixMapping (const QString &prefix, const QString & uri)
+{
+ m_result += nestPrefix();
+ m_result += "startPrefixMapping(prefix=\"" + escapeStr(prefix)
+ + "\", uri=\"" + escapeStr(uri) + "\")\n";
+ ++m_nest;
+ return TRUE;
+}
+
+bool ContentHandler::endPrefixMapping(const QString &prefix)
+{
+ --m_nest;
+ m_result += nestPrefix();
+ m_result += "endPrefixMapping(prefix=\"" + escapeStr(prefix) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::ignorableWhitespace(const QString & ch)
+{
+ m_result += nestPrefix();
+ m_result += "ignorableWhitespace(ch=\"" + escapeStr(ch) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::processingInstruction(const QString &target, const QString &data)
+{
+ m_result += nestPrefix();
+ m_result += "processingInstruction(target=\"" + escapeStr(target)
+ + "\", data=\"" + escapeStr(data) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::skippedEntity (const QString & name)
+{
+ m_result += nestPrefix();
+ m_result += "skippedEntity(name=\"" + escapeStr(name) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::warning(const QXmlParseException & exception)
+{
+ m_error_msg = QString("Warning %1:%2: %3")
+ .arg(exception.columnNumber())
+ .arg(exception.lineNumber())
+ .arg(exception.message());
+ m_result += nestPrefix();
+ m_result += "warning(exception={columnNumber="
+ + QString::number(exception.columnNumber())
+ + ", lineNumber="
+ + QString::number(exception.lineNumber())
+ + ", publicId=\"" + escapeStr(exception.publicId())
+ + "\", systemId=\"" + escapeStr(exception.systemId())
+ + "\", message=\"" + escapeStr(exception.message())
+ + "\"})\n";
+ return TRUE;
+}
+
+bool ContentHandler::error(const QXmlParseException & exception)
+{
+ m_error_msg = QString("Error %1:%2: %3")
+ .arg(exception.columnNumber())
+ .arg(exception.lineNumber())
+ .arg(exception.message());
+ m_result += nestPrefix();
+ m_result += "error(exception={columnNumber="
+ + QString::number(exception.columnNumber())
+ + ", lineNumber="
+ + QString::number(exception.lineNumber())
+ + ", publicId=\"" + escapeStr(exception.publicId())
+ + "\", systemId=\"" + escapeStr(exception.systemId())
+ + "\", message=\"" + escapeStr(exception.message())
+ + "\"})\n";
+ return TRUE;
+}
+
+bool ContentHandler::fatalError(const QXmlParseException & exception)
+{
+ m_error_msg = QString("Fatal error %1:%2: %3")
+ .arg(exception.columnNumber())
+ .arg(exception.lineNumber())
+ .arg(exception.message());
+ m_result += nestPrefix();
+ m_result += "fatalError(exception={columnNumber="
+ + QString::number(exception.columnNumber())
+ + ", lineNumber="
+ + QString::number(exception.lineNumber())
+ + ", publicId=\"" + escapeStr(exception.publicId())
+ + "\", systemId=\"" + escapeStr(exception.systemId())
+ + "\", message=\"" + escapeStr(exception.message())
+ + "\"})\n";
+ return TRUE;
+}
+
+bool ContentHandler::notationDecl ( const QString & name,
+ const QString & publicId,
+ const QString & systemId )
+{
+ m_result += nestPrefix();
+ m_result += "notationDecl(name=\"" + escapeStr(name) + "\", publicId=\""
+ + escapeStr(publicId) + "\", systemId=\""
+ + escapeStr(systemId) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::unparsedEntityDecl ( const QString & name,
+ const QString & publicId,
+ const QString & systemId,
+ const QString & notationName )
+{
+ m_result += nestPrefix();
+ m_result += "unparsedEntityDecl(name=\"" + escapeStr(name)
+ + "\", publicId=\"" + escapeStr(publicId)
+ + "\", systemId=\"" + escapeStr(systemId)
+ + "\", notationName=\"" + escapeStr(notationName)
+ + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::resolveEntity(const QString & publicId,
+ const QString & systemId,
+ QXmlInputSource *&)
+{
+ m_result += nestPrefix();
+ m_result += "resolveEntity(publicId=\"" + escapeStr(publicId)
+ + "\", systemId=\"" + escapeStr(systemId)
+ + "\", ret={})\n";
+ return TRUE;
+}
+
+bool ContentHandler::startDTD ( const QString & name, const QString & publicId, const QString & systemId )
+{
+ m_result += nestPrefix();
+ m_result += "startDTD(name=\"" + escapeStr(name)
+ + "\", publicId=\"" + escapeStr(publicId)
+ + "\", systemId=\"" + escapeStr(systemId) + "\")\n";
+ ++m_nest;
+ return TRUE;
+}
+
+bool ContentHandler::endDTD ()
+{
+ --m_nest;
+ m_result += nestPrefix();
+ m_result += "endDTD()\n";
+ return TRUE;
+}
+
+bool ContentHandler::startEntity ( const QString & name )
+{
+ m_result += nestPrefix();
+ m_result += "startEntity(name=\"" + escapeStr(name) + "\")\n";
+ ++m_nest;
+ return TRUE;
+}
+
+bool ContentHandler::endEntity ( const QString & name )
+{
+ --m_nest;
+ m_result += nestPrefix();
+ m_result += "endEntity(name=\"" + escapeStr(name) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::startCDATA ()
+{
+ m_result += nestPrefix();
+ m_result += "startCDATA()\n";
+ ++m_nest;
+ return TRUE;
+}
+
+bool ContentHandler::endCDATA ()
+{
+ --m_nest;
+ m_result += nestPrefix();
+ m_result += "endCDATA()\n";
+ return TRUE;
+}
+
+bool ContentHandler::comment ( const QString & ch )
+{
+ m_result += nestPrefix();
+ m_result += "comment(ch=\"" + escapeStr(ch) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::attributeDecl ( const QString & eName,
+ const QString & aName,
+ const QString & type,
+ const QString & valueDefault,
+ const QString & value )
+{
+ m_result += nestPrefix();
+ m_result += "attributeDecl(eName=\"" + escapeStr(eName) + "\", aName=\""
+ + escapeStr(aName) + "\", type=\"" + escapeStr(type)
+ + "\", valueDefault=\"" + escapeStr(valueDefault)
+ + "\", value=\"" + escapeStr(value) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::internalEntityDecl ( const QString & name,
+ const QString & value )
+{
+ m_result += nestPrefix();
+ m_result += "internatlEntityDecl(name=\"" + escapeStr(name)
+ + "\", value=\"" + escapeStr(value) + "\")\n";
+ return TRUE;
+}
+
+bool ContentHandler::externalEntityDecl ( const QString & name,
+ const QString & publicId,
+ const QString & systemId )
+{
+ m_result += nestPrefix();
+ m_result += "externalEntityDecl(name=\"" + escapeStr(name)
+ + "\", publicId=\"" + escapeStr(publicId)
+ + "\", systemId=\"" + escapeStr(systemId) + "\")\n";
+ return TRUE;
+}
+
+Parser::Parser()
+{
+ handler = new ContentHandler;
+ setContentHandler(handler);
+ setDTDHandler(handler);
+ setDeclHandler(handler);
+ setEntityResolver(handler);
+ setErrorHandler(handler);
+ setLexicalHandler(handler);
+}
+
+Parser::~Parser()
+{
+ delete handler;
+}
+
+bool Parser::parseFile(QFile *file)
+{
+ QXmlInputSource source(file);
+ return parse(source);
+}
+
+QString Parser::result() const
+{
+ return handler->result();
+}
+
+QString Parser::errorMsg() const
+{
+ return handler->errorMsg();
+}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
new file mode 100644
index 0000000000..e3d95ce811
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PARSER_H
+#define PARSER_H
+
+#include <qfile.h>
+#include <qstring.h>
+#include <qxml.h>
+
+class ContentHandler;
+
+class Parser : public QXmlSimpleReader
+{
+ public:
+ Parser();
+ ~Parser();
+
+ bool parseFile(QFile *file);
+ QString result() const;
+ QString errorMsg() const;
+
+ private:
+ ContentHandler *handler;
+};
+
+#endif
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.pro b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.pro
new file mode 100644
index 0000000000..93167f81c8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.pro
@@ -0,0 +1,15 @@
+######################################################################
+# Automatically generated by qmake (1.06a) Thu Jun 5 19:00:42 2003
+######################################################################
+
+TEMPLATE = app
+INCLUDEPATH += .
+
+# Input
+HEADERS += parser.h
+SOURCES += main.cpp parser.cpp
+
+CONFIG += qt warn_on debug
+QT += xml
+
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
new file mode 100644
index 0000000000..bc3cbd2dfd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
@@ -0,0 +1,19 @@
+load(qttest_p4)
+TEMPLATE = app
+DEPENDPATH += parser
+INCLUDEPATH += . parser
+
+# Input
+HEADERS += parser/parser.h
+SOURCES += tst_qxmlsimplereader.cpp parser/parser.cpp
+
+CONFIG += no_batch
+QT += network xml
+QT -= gui
+
+
+wince*|symbian: {
+ addFiles.files = encodings parser xmldocs
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
new file mode 100644
index 0000000000..f2a973c78e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -0,0 +1,775 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QDomDocument>
+#include <qthread.h>
+#include <qtcpserver.h>
+#include <qtcpsocket.h>
+#include <QtTest/QtTest>
+#include <qfile.h>
+#include <qstring.h>
+#include <qdir.h>
+#include <qbuffer.h>
+#include "parser/parser.h"
+
+static const char *const inputString = "<!DOCTYPE inferno [<!ELEMENT inferno (circle+)><!ELEMENT circle (#PCDATA)>]><inferno><circle /><circle /></inferno>";
+static const char *const refString = "setDocumentLocator(locator={columnNumber=1, lineNumber=1})\nstartDocument()\nstartDTD(name=\"inferno\", publicId=\"\", systemId=\"\")\nendDTD()\nstartElement(namespaceURI=\"\", localName=\"inferno\", qName=\"inferno\", atts=[])\nstartElement(namespaceURI=\"\", localName=\"circle\", qName=\"circle\", atts=[])\nendElement(namespaceURI=\"\", localName=\"circle\", qName=\"circle\")\nstartElement(namespaceURI=\"\", localName=\"circle\", qName=\"circle\", atts=[])\nendElement(namespaceURI=\"\", localName=\"circle\", qName=\"circle\")\nendElement(namespaceURI=\"\", localName=\"inferno\", qName=\"inferno\")\nendDocument()\n";
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+#define TEST_PORT 1088
+
+class XmlServer : public QThread
+{
+ Q_OBJECT
+public:
+ XmlServer();
+ bool quit_soon;
+
+protected:
+ virtual void run();
+};
+
+XmlServer::XmlServer()
+{
+ quit_soon = false;
+}
+
+#define CHUNK_SIZE 1
+
+void XmlServer::run()
+{
+ QTcpServer srv;
+
+ if (!srv.listen(QHostAddress::Any, TEST_PORT))
+ return;
+
+ for (;;) {
+ srv.waitForNewConnection(100);
+
+ if (QTcpSocket *sock = srv.nextPendingConnection()) {
+ QByteArray fileName;
+ for (;;) {
+ char c;
+ if (sock->getChar(&c)) {
+ if (c == '\n')
+ break;
+ fileName.append(c);
+ } else {
+ if (!sock->waitForReadyRead(-1))
+ break;
+ }
+ }
+
+ QFile file(QString::fromLocal8Bit(fileName));
+ if (!file.open(QIODevice::ReadOnly)) {
+ qWarning() << "XmlServer::run(): could not open" << fileName;
+ sock->abort();
+ delete sock;
+ continue;
+ }
+
+ QByteArray data = file.readAll();
+ for (int i = 0; i < data.size();) {
+// sock->putChar(data.at(i));
+ int cnt = qMin(CHUNK_SIZE, data.size() - i);
+ sock->write(data.constData() + i, cnt);
+ i += cnt;
+ sock->flush();
+ QTest::qSleep(1);
+
+ if (quit_soon) {
+ sock->abort();
+ break;
+ }
+ }
+
+ sock->disconnectFromHost();
+ delete sock;
+ }
+
+ if (quit_soon)
+ break;
+ }
+
+ srv.close();
+}
+
+class tst_QXmlSimpleReader : public QObject
+{
+ Q_OBJECT
+
+ public:
+ tst_QXmlSimpleReader();
+ ~tst_QXmlSimpleReader();
+
+ private slots:
+
+ void testGoodXmlFile();
+ void testGoodXmlFile_data();
+ void testBadXmlFile();
+ void testBadXmlFile_data();
+ void testIncrementalParsing();
+ void testIncrementalParsing_data();
+ void setDataQString();
+ void inputFromQIODevice();
+ void inputFromString();
+ void inputFromSocket_data();
+ void inputFromSocket();
+
+ void idsInParseException1();
+ void idsInParseException2();
+ void preserveCharacterReferences() const;
+ void reportNamespace() const;
+ void reportNamespace_data() const;
+ void roundtripWithNamespaces() const;
+
+ private:
+ static QDomDocument fromByteArray(const QString &title, const QByteArray &ba, bool *ok);
+ XmlServer *server;
+};
+
+tst_QXmlSimpleReader::tst_QXmlSimpleReader()
+{
+ server = new XmlServer();
+ server->setParent(this);
+ server->start();
+ QTest::qSleep(1000);
+}
+
+tst_QXmlSimpleReader::~tst_QXmlSimpleReader()
+{
+ server->quit_soon = true;
+ server->wait();
+}
+
+class MyErrorHandler : public QXmlErrorHandler
+{
+public:
+ QString publicId;
+ QString systemId;
+
+ virtual bool error(const QXmlParseException &)
+ {
+ return false;
+ }
+
+ virtual QString errorString() const
+ {
+ return QString();
+ }
+
+ virtual bool fatalError(const QXmlParseException &exception)
+ {
+ publicId = exception.publicId();
+ systemId = exception.systemId();
+ return true;
+ }
+
+ virtual bool warning(const QXmlParseException &)
+ {
+ return true;
+ }
+
+};
+
+void tst_QXmlSimpleReader::idsInParseException1()
+{
+ MyErrorHandler handler;
+ QXmlSimpleReader reader;
+
+ reader.setErrorHandler(&handler);
+
+ /* A non-wellformed XML document with PUBLIC and SYSTEM. */
+ QByteArray input("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" "
+ "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">"
+ "<head>"
+ "<a/><a/><a/>"
+ "<head/>");
+
+ QBuffer buff(&input);
+ QXmlInputSource source(&buff);
+
+ /* Yes, parsing should be reported as a failure. */
+ QVERIFY(!reader.parse(source));
+
+ QCOMPARE(handler.publicId, QString::fromLatin1("-//W3C//DTD XHTML 1.0 Strict//EN"));
+ QCOMPARE(handler.systemId, QString::fromLatin1("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"));
+}
+
+void tst_QXmlSimpleReader::idsInParseException2()
+{
+ MyErrorHandler handler;
+ QXmlSimpleReader reader;
+
+ reader.setErrorHandler(&handler);
+
+ /* A non-wellformed XML document with only SYSTEM. */
+ QByteArray input("<!DOCTYPE html SYSTEM \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">"
+ "<head>"
+ "<a/><a/><a/>"
+ "<head/>");
+
+ QBuffer buff(&input);
+ QXmlInputSource source(&buff);
+
+ /* Yes, parsing should be reported as a failure. */
+ QVERIFY(!reader.parse(source));
+
+ QCOMPARE(handler.publicId, QString());
+ QCOMPARE(handler.systemId, QString::fromLatin1("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"));
+}
+
+static QStringList findXmlFiles(QString dir_name)
+{
+ QStringList result;
+
+ QDir dir(dir_name);
+ QFileInfoList file_list = dir.entryInfoList(QStringList("*.xml"), QDir::Files, QDir::Name);
+
+ QFileInfoList::const_iterator it = file_list.begin();
+ for (; it != file_list.end(); ++it) {
+ const QFileInfo &file_info = *it;
+ result.append(file_info.filePath());
+ }
+
+ return result;
+}
+
+
+void tst_QXmlSimpleReader::testGoodXmlFile_data()
+{
+ const char * const good_data_dirs[] = {
+ "xmldocs/valid/sa",
+ "xmldocs/valid/not-sa",
+ "xmldocs/valid/ext-sa",
+ 0
+ };
+ const char * const *d = good_data_dirs;
+
+ QStringList good_file_list;
+ for (; *d != 0; ++d)
+ good_file_list += findXmlFiles(*d);
+
+ QTest::addColumn<QString>("file_name");
+ QStringList::const_iterator it = good_file_list.begin();
+ for (; it != good_file_list.end(); ++it)
+ QTest::newRow((*it).toLatin1()) << *it;
+}
+
+void tst_QXmlSimpleReader::testGoodXmlFile()
+{
+ QFETCH(QString, file_name);
+ QFile file(file_name);
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QString content = file.readAll();
+ file.close();
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ Parser parser;
+
+// static int i = 0;
+// qWarning("Test nr: " + QString::number(i)); ++i;
+ QEXPECT_FAIL("xmldocs/valid/sa/089.xml", "", Continue);
+ QVERIFY(parser.parseFile(&file));
+
+ QFile ref_file(file_name + ".ref");
+ QVERIFY(ref_file.open(QIODevice::ReadOnly | QIODevice::Text));
+ QTextStream ref_stream(&ref_file);
+ ref_stream.setCodec("UTF-8");
+ QString ref_file_contents = ref_stream.readAll();
+
+ QEXPECT_FAIL("xmldocs/valid/sa/089.xml", "", Continue);
+ QCOMPARE(parser.result(), ref_file_contents);
+}
+
+void tst_QXmlSimpleReader::testBadXmlFile_data()
+{
+ const char * const bad_data_dirs[] = {
+ "xmldocs/not-wf/sa",
+ 0
+ };
+ const char * const *d = bad_data_dirs;
+
+ QStringList bad_file_list;
+ for (; *d != 0; ++d)
+ bad_file_list += findXmlFiles(*d);
+
+ QTest::addColumn<QString>("file_name");
+ QStringList::const_iterator it = bad_file_list.begin();
+ for (; it != bad_file_list.end(); ++it)
+ QTest::newRow((*it).toLatin1()) << *it;
+}
+
+void tst_QXmlSimpleReader::testBadXmlFile()
+{
+ QFETCH(QString, file_name);
+ QFile file(file_name);
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ Parser parser;
+
+// static int i = 0;
+// qWarning("Test nr: " + QString::number(++i));
+ QEXPECT_FAIL("xmldocs/not-wf/sa/030.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/031.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/032.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/033.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/038.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/072.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/073.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/074.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/076.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/077.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/078.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/085.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/086.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/087.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/101.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/102.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/104.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/116.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/117.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/119.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/122.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/132.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/142.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/143.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/144.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/145.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/146.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/160.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/162.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/166.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/167.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/168.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/169.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/170.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/171.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/172.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/173.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/174.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/175.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/177.xml", "", Abort);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/180.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/181.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/182.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/185.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/186.xml", "", Continue);
+
+ QVERIFY(!parser.parseFile(&file));
+
+ QFile ref_file(file_name + ".ref");
+ QVERIFY(ref_file.open(QIODevice::ReadOnly | QIODevice::Text));
+ QTextStream ref_stream(&ref_file);
+ ref_stream.setCodec("UTF-8");
+ QString ref_file_contents = ref_stream.readAll();
+
+ QEXPECT_FAIL("xmldocs/not-wf/sa/144.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/145.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/146.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/167.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/166.xml", "", Continue);
+ QEXPECT_FAIL("xmldocs/not-wf/sa/170.xml", "", Continue);
+
+ QCOMPARE(parser.result(), ref_file_contents);
+}
+
+void tst_QXmlSimpleReader::testIncrementalParsing_data()
+{
+ QTest::addColumn<QString>("file_name");
+ QTest::addColumn<int>("chunkSize");
+
+ const char * const good_data_dirs[] = {
+ "xmldocs/valid/sa",
+ "xmldocs/valid/not-sa",
+ "xmldocs/valid/ext-sa",
+ 0
+ };
+ const char * const *d = good_data_dirs;
+
+ QStringList good_file_list;
+ for (; *d != 0; ++d)
+ good_file_list += findXmlFiles(*d);
+
+ for (int i=1; i<10; ++i) {
+ QStringList::const_iterator it = good_file_list.begin();
+ for (; it != good_file_list.end(); ++it) {
+ if ( *it == "xmldocs/valid/sa/089.xml" )
+ continue;// TODO: fails at the moment -- don't bother
+ if ( i==1 && (
+ *it == "xmldocs/valid/sa/049.xml" ||
+ *it == "xmldocs/valid/sa/050.xml" ||
+ *it == "xmldocs/valid/sa/051.xml" ||
+ *it == "xmldocs/valid/sa/052.xml" ) ) {
+ continue; // TODO: fails at the moment -- don't bother
+ }
+ QTest::newRow(QString("%1 %2").arg(*it).arg(i).toLatin1()) << *it << i;
+ }
+ }
+}
+
+void tst_QXmlSimpleReader::testIncrementalParsing()
+{
+ QFETCH(QString, file_name);
+ QFETCH(int, chunkSize);
+
+ QFile file(file_name);
+ QVERIFY(file.open(QIODevice::ReadOnly));
+
+ Parser parser;
+ QXmlInputSource source;
+ bool first = true;
+ while (!file.atEnd()) {
+ source.setData(file.read(chunkSize));
+ if(first) {
+ QVERIFY(parser.parse(&source, true));
+ first = false;
+ } else {
+ QVERIFY(parser.parseContinue());
+ }
+ }
+ // detect end of document
+ QVERIFY(parser.parseContinue());
+ // parsing should fail after the end of the document was reached
+ QVERIFY(!parser.parseContinue());
+
+ QFile ref_file(file_name + ".ref");
+ QVERIFY(ref_file.open(QIODevice::ReadOnly | QIODevice::Text));
+ QTextStream ref_stream(&ref_file);
+ ref_stream.setCodec("UTF-8");
+ QString ref_file_contents = ref_stream.readAll();
+
+ QCOMPARE(parser.result(), ref_file_contents);
+}
+
+void tst_QXmlSimpleReader::setDataQString()
+{
+ QString input = inputString;
+ QString ref = refString;
+
+ QXmlInputSource source;
+ Parser parser;
+
+ source.setData(input);
+ QVERIFY(parser.parse(&source,false));
+
+ QBuffer resultBuffer;
+ resultBuffer.setData(parser.result().toLatin1());
+
+ QBuffer refBuffer;
+ refBuffer.setData(ref.toLatin1());
+
+ resultBuffer.open(QIODevice::ReadOnly);
+ refBuffer.open(QIODevice::ReadOnly);
+
+ bool success = true;
+ while (resultBuffer.canReadLine()) {
+ if (!refBuffer.canReadLine()) {
+ success = false; break ;
+ }
+ if (resultBuffer.readLine().simplified() != refBuffer.readLine().simplified()) {
+ success = false; break ;
+ }
+ }
+ QVERIFY(success);
+}
+
+void tst_QXmlSimpleReader::inputFromQIODevice()
+{
+ QBuffer inputBuffer;
+ inputBuffer.setData(inputString);
+
+ QXmlInputSource source(&inputBuffer);
+ Parser parser;
+
+ QVERIFY(parser.parse(&source,false));
+
+ QBuffer resultBuffer;
+ resultBuffer.setData(parser.result().toLatin1());
+
+ QBuffer refBuffer;
+ refBuffer.setData(refString);
+
+ resultBuffer.open(QIODevice::ReadOnly);
+ refBuffer.open(QIODevice::ReadOnly);
+
+ bool success = true;
+ while (resultBuffer.canReadLine()) {
+ if (!refBuffer.canReadLine()) {
+ success = false; break ;
+ }
+ if (resultBuffer.readLine().simplified() != refBuffer.readLine().simplified()) {
+ success = false; break ;
+ }
+ }
+ QVERIFY(success);
+}
+
+void tst_QXmlSimpleReader::inputFromString()
+{
+ QString str = "<foo><bar>kake</bar><bar>ja</bar></foo>";
+ QBuffer buff;
+ buff.setData((char*)str.utf16(), str.size()*sizeof(ushort));
+
+ QXmlInputSource input(&buff);
+
+ QXmlSimpleReader reader;
+ QXmlDefaultHandler handler;
+ reader.setContentHandler(&handler);
+
+ QVERIFY(reader.parse(&input));
+}
+
+void tst_QXmlSimpleReader::inputFromSocket_data()
+{
+ QStringList files = findXmlFiles(QLatin1String("encodings"));
+ QVERIFY(files.count() > 0);
+
+ QTest::addColumn<QString>("file_name");
+
+ foreach (const QString &file_name, files)
+ QTest::newRow(file_name.toLatin1()) << file_name;
+}
+
+void tst_QXmlSimpleReader::inputFromSocket()
+{
+ QFETCH(QString, file_name);
+
+#if defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll);
+#endif
+
+#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC_NET))
+ QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll);
+#endif
+ QTcpSocket sock;
+ sock.connectToHost(QHostAddress::LocalHost, TEST_PORT);
+
+ const bool connectionSuccess = sock.waitForConnected();
+ if(!connectionSuccess) {
+ QTextStream out(stderr);
+ out << "QTcpSocket::errorString()" << sock.errorString();
+ }
+
+ QVERIFY(connectionSuccess);
+
+ sock.write(file_name.toLocal8Bit() + "\n");
+ QVERIFY(sock.waitForBytesWritten());
+
+ QXmlInputSource input(&sock);
+
+ QXmlSimpleReader reader;
+ QXmlDefaultHandler handler;
+ reader.setContentHandler(&handler);
+
+ QVERIFY(reader.parse(&input));
+
+// qDebug() << "tst_QXmlSimpleReader::inputFromSocket(): success" << file_name;
+}
+
+void tst_QXmlSimpleReader::preserveCharacterReferences() const
+{
+ class Handler : public QXmlDefaultHandler
+ {
+ public:
+ virtual bool characters(const QString &chars)
+ {
+ received = chars;
+ return true;
+ }
+
+ QString received;
+ };
+
+ {
+ QByteArray input("<e>A&#160;&#160;&#160;&#160;A</e>");
+
+ QBuffer buff(&input);
+ QXmlInputSource source(&buff);
+
+ Handler h;
+ QXmlSimpleReader reader;
+ reader.setContentHandler(&h);
+ QVERIFY(reader.parse(&source, false));
+
+ QCOMPARE(h.received, QLatin1Char('A') + QString(4, QChar(160)) + QLatin1Char('A'));
+ }
+
+ {
+ QByteArray input("<e>&#160;&#160;&#160;&#160;</e>");
+
+ QBuffer buff(&input);
+ QXmlInputSource source(&buff);
+
+ Handler h;
+ QXmlSimpleReader reader;
+ reader.setContentHandler(&h);
+ QVERIFY(reader.parse(&source, false));
+
+ QCOMPARE(h.received, QString(4, QChar(160)));
+ }
+}
+
+void tst_QXmlSimpleReader::reportNamespace() const
+{
+ class Handler : public QXmlDefaultHandler
+ {
+ public:
+ virtual bool startElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName,
+ const QXmlAttributes &)
+ {
+ startNamespaceURI = namespaceURI;
+ startLocalName = localName;
+ startQName = qName;
+
+ return true;
+ }
+
+ virtual bool endElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName)
+ {
+ endNamespaceURI = namespaceURI;
+ endLocalName = localName;
+ endQName = qName;
+
+ return true;
+ }
+
+ QString startLocalName;
+ QString startQName;
+ QString startNamespaceURI;
+ QString endLocalName;
+ QString endQName;
+ QString endNamespaceURI;
+ };
+
+ QXmlSimpleReader reader;
+ Handler handler;
+ reader.setContentHandler(&handler);
+
+ QFETCH(QByteArray, input);
+
+ QBuffer buffer(&input);
+ QVERIFY(buffer.open(QIODevice::ReadOnly));
+
+ QXmlInputSource source(&buffer);
+ QVERIFY(reader.parse(source));
+
+ QFETCH(QString, expectedQName);
+ QFETCH(QString, expectedLocalName);
+ QFETCH(QString, expectedNamespace);
+
+ QCOMPARE(handler.startNamespaceURI, expectedNamespace);
+ QCOMPARE(handler.startLocalName, expectedLocalName);
+ QCOMPARE(handler.startQName, expectedQName);
+
+ QCOMPARE(handler.endNamespaceURI, expectedNamespace);
+ QCOMPARE(handler.endLocalName, expectedLocalName);
+ QCOMPARE(handler.endQName, expectedQName);
+}
+
+void tst_QXmlSimpleReader::reportNamespace_data() const
+{
+ QTest::addColumn<QByteArray>("input");
+ QTest::addColumn<QString>("expectedQName");
+ QTest::addColumn<QString>("expectedLocalName");
+ QTest::addColumn<QString>("expectedNamespace");
+
+ QTest::newRow("default ns") << QByteArray("<element xmlns='http://example.com/'/>")
+ << QString("element")
+ << QString("element")
+ << QString("http://example.com/");
+
+ QTest::newRow("with prefix") << QByteArray("<p:element xmlns:p='http://example.com/'/>")
+ << QString("p:element")
+ << QString("element")
+ << QString("http://example.com/");
+}
+
+QDomDocument tst_QXmlSimpleReader::fromByteArray(const QString &title, const QByteArray &ba, bool *ok)
+{
+ QDomDocument doc(title);
+ *ok = doc.setContent(ba, true);
+ return doc;
+}
+
+void tst_QXmlSimpleReader::roundtripWithNamespaces() const
+{
+ const char *const expected = "<element b:attr=\"value\" xmlns:a=\"http://www.example.com/A\" xmlns:b=\"http://www.example.com/B\" />\n";
+ bool ok;
+
+ {
+ const char *const xml = "<element xmlns:b=\"http://www.example.com/B\" b:attr=\"value\" xmlns:a=\"http://www.example.com/A\"/>";
+
+ const QDomDocument one(fromByteArray("document", xml, &ok));
+ QVERIFY(ok);
+ const QDomDocument two(fromByteArray("document2", one.toByteArray(2), &ok));
+ QVERIFY(ok);
+
+ QEXPECT_FAIL("", "Known problem, see 154573. The fix happens to break uic.", Abort);
+
+ QCOMPARE(expected, one.toByteArray().constData());
+ QCOMPARE(one.toByteArray(2).constData(), two.toByteArray(2).constData());
+ QCOMPARE(two.toByteArray(2).constData(), two.toByteArray(2).constData());
+ }
+
+ {
+ const char *const xml = "<element b:attr=\"value\" xmlns:b=\"http://www.example.com/B\" xmlns:a=\"http://www.example.com/A\"/>";
+
+ const QDomDocument one(fromByteArray("document", xml, &ok));
+ QVERIFY(ok);
+ const QDomDocument two(fromByteArray("document2", one.toByteArray(2), &ok));
+ QVERIFY(ok);
+
+ QCOMPARE(expected, one.toByteArray().constData());
+ QCOMPARE(one.toByteArray(2).constData(), two.toByteArray(2).constData());
+ QCOMPARE(two.toByteArray(2).constData(), two.toByteArray(2).constData());
+ }
+}
+
+QTEST_MAIN(tst_QXmlSimpleReader)
+#include "tst_qxmlsimplereader.moc"
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml
new file mode 100644
index 0000000000..d33ec68dcd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml
@@ -0,0 +1,5 @@
+<doc>
+<doc
+?
+<a</a>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml.ref
new file mode 100644
index 0000000000..e0fa20f83d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/001.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=1, lineNumber=3, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml
new file mode 100644
index 0000000000..0a64d52428
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml
@@ -0,0 +1,4 @@
+<doc>
+<.doc></.doc>
+</doc>
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml.ref
new file mode 100644
index 0000000000..8ebfac2a80
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/002.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=2, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml
new file mode 100644
index 0000000000..e0b8bae4a4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml
@@ -0,0 +1 @@
+<doc><? ?></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml.ref
new file mode 100644
index 0000000000..988690b883
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/003.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml
new file mode 100644
index 0000000000..e85bc96e56
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml
@@ -0,0 +1 @@
+<doc><?target some data></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml.ref
new file mode 100644
index 0000000000..0085dfefe6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/004.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml
new file mode 100644
index 0000000000..7cd44ef10c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml
@@ -0,0 +1 @@
+<doc><?target some data?</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml.ref
new file mode 100644
index 0000000000..0085dfefe6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/005.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml
new file mode 100644
index 0000000000..8594c35cc7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml
@@ -0,0 +1 @@
+<doc><!-- a comment -- another --></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml.ref
new file mode 100644
index 0000000000..3d07b93d8e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/006.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=23, lineNumber=1, publicId="", systemId="", message="error occurred while parsing comment"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml
new file mode 100644
index 0000000000..286756fdd5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml
@@ -0,0 +1 @@
+<doc>&amp no refc</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml.ref
new file mode 100644
index 0000000000..bbd182b7f7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/007.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=10, lineNumber=1, publicId="", systemId="", message="error occurred while parsing reference"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml
new file mode 100644
index 0000000000..29ef40306b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml
@@ -0,0 +1 @@
+<doc>&.entity;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml.ref
new file mode 100644
index 0000000000..19d21b4b3e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/008.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=7, lineNumber=1, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml
new file mode 100644
index 0000000000..8e3ff7de10
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml
@@ -0,0 +1 @@
+<doc>&#RE;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml.ref
new file mode 100644
index 0000000000..a885634000
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/009.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="error occurred while parsing reference"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml
new file mode 100644
index 0000000000..a6790846c9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml
@@ -0,0 +1 @@
+<doc>A & B</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml.ref
new file mode 100644
index 0000000000..7db0ddb551
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/010.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=9, lineNumber=1, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml
new file mode 100644
index 0000000000..57eaf9fc48
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml
@@ -0,0 +1 @@
+<doc a1></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml.ref
new file mode 100644
index 0000000000..bb837957be
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/011.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml
new file mode 100644
index 0000000000..1b2539ffa6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml
@@ -0,0 +1 @@
+<doc a1=v1></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml.ref
new file mode 100644
index 0000000000..333fb0db76
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/012.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=9, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml
new file mode 100644
index 0000000000..3540df9143
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml
@@ -0,0 +1 @@
+<doc a1="v1'></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml.ref
new file mode 100644
index 0000000000..1fececc438
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/013.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=14, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml
new file mode 100644
index 0000000000..a613115609
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml
@@ -0,0 +1 @@
+<doc a1="<foo>"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml.ref
new file mode 100644
index 0000000000..a9230f2d7c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/014.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=10, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml
new file mode 100644
index 0000000000..f2baf947b5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml
@@ -0,0 +1 @@
+<doc a1=></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml.ref
new file mode 100644
index 0000000000..333fb0db76
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/015.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=9, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml
new file mode 100644
index 0000000000..22d4b2e265
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml
@@ -0,0 +1 @@
+<doc a1="v1" "v2"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml.ref
new file mode 100644
index 0000000000..e47a79ca68
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/016.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=14, lineNumber=1, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml
new file mode 100644
index 0000000000..a76f5929e9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml
@@ -0,0 +1 @@
+<doc><![CDATA[</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml.ref
new file mode 100644
index 0000000000..0085dfefe6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/017.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml
new file mode 100644
index 0000000000..66e204acc4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml
@@ -0,0 +1 @@
+<doc><![CDATA [ stuff]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml.ref
new file mode 100644
index 0000000000..651fa05573
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/018.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=14, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml
new file mode 100644
index 0000000000..b835c2d752
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml
@@ -0,0 +1 @@
+<doc></>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml.ref
new file mode 100644
index 0000000000..9196faad6d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/019.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml
new file mode 100644
index 0000000000..b30cfcfc10
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml
@@ -0,0 +1 @@
+<doc a1="A & B"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml.ref
new file mode 100644
index 0000000000..f52f775f12
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/020.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=13, lineNumber=1, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml
new file mode 100644
index 0000000000..1bfa84aa64
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml
@@ -0,0 +1 @@
+<doc a1="a&b"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml.ref
new file mode 100644
index 0000000000..02ae4699b6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/021.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=13, lineNumber=1, publicId="", systemId="", message="error occurred while parsing reference"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml
new file mode 100644
index 0000000000..44c803bf1b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml
@@ -0,0 +1 @@
+<doc a1="&#123:"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml.ref
new file mode 100644
index 0000000000..42bf38f488
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/022.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=15, lineNumber=1, publicId="", systemId="", message="error occurred while parsing reference"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml
new file mode 100644
index 0000000000..b877ae2a6b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml
@@ -0,0 +1 @@
+<doc 12="34"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml.ref
new file mode 100644
index 0000000000..94f5cfa68c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/023.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml
new file mode 100644
index 0000000000..cf68f2c073
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml
@@ -0,0 +1,3 @@
+<doc>
+<123></123>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml.ref
new file mode 100644
index 0000000000..8ebfac2a80
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/024.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=2, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml
new file mode 100644
index 0000000000..6cba95cd78
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml
@@ -0,0 +1 @@
+<doc>]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml.ref
new file mode 100644
index 0000000000..8f5d812e49
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/025.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="error occurred while parsing content"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml
new file mode 100644
index 0000000000..347984fa73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml
@@ -0,0 +1 @@
+<doc>]]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml.ref
new file mode 100644
index 0000000000..3d0c743f13
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/026.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=9, lineNumber=1, publicId="", systemId="", message="error occurred while parsing content"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml
new file mode 100644
index 0000000000..cfafaf0d70
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml
@@ -0,0 +1,3 @@
+<doc>
+<!-- abc
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml.ref
new file mode 100644
index 0000000000..178563e3d9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/027.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=1, lineNumber=4, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml
new file mode 100644
index 0000000000..522714993a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml
@@ -0,0 +1,4 @@
+<doc>
+<?a pi that is not closed
+</doc>
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml.ref
new file mode 100644
index 0000000000..45a61328b0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/028.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=1, lineNumber=5, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml
new file mode 100644
index 0000000000..9a8008bc9f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml
@@ -0,0 +1 @@
+<doc>abc]]]>def</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml.ref
new file mode 100644
index 0000000000..da043096c0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/029.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=12, lineNumber=1, publicId="", systemId="", message="error occurred while parsing content"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml
new file mode 100644
index 0000000000..25861fa19b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml
@@ -0,0 +1 @@
+<doc>A form feed ( ) is not legal in data</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml.ref
new file mode 100644
index 0000000000..3d7b2fd5f0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/030.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="A form feed ( ) is not legal in data")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml
new file mode 100644
index 0000000000..f946536f39
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml
@@ -0,0 +1 @@
+<doc><?pi a form feed ( ) is not allowed in a pi?></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml.ref
new file mode 100644
index 0000000000..240d633529
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/031.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ processingInstruction(target="pi", data="a form feed ( ) is not allowed in a pi")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml
new file mode 100644
index 0000000000..75952017ca
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml
@@ -0,0 +1 @@
+<doc><!-- a form feed ( ) is not allowed in a comment --></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml.ref
new file mode 100644
index 0000000000..a85cab71f0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/032.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ comment(ch=" a form feed ( ) is not allowed in a comment ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml
new file mode 100644
index 0000000000..afd2328402
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml
@@ -0,0 +1 @@
+<doc>abcdef</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml.ref
new file mode 100644
index 0000000000..a059f8e0b2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/033.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="abcdef")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml
new file mode 100644
index 0000000000..d74a77719b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml
@@ -0,0 +1 @@
+<doc >A form-feed is not white space or a name character</doc >
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml.ref
new file mode 100644
index 0000000000..723dc1aa00
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/034.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=5, lineNumber=1, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml
new file mode 100644
index 0000000000..e1fc920522
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml
@@ -0,0 +1 @@
+<doc>1 < 2 but not in XML</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml.ref
new file mode 100644
index 0000000000..6ca9412864
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/035.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="1 ")
+ fatalError(exception={columnNumber=9, lineNumber=1, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml
new file mode 100644
index 0000000000..b8ecb21ba1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml
@@ -0,0 +1,2 @@
+<doc></doc>
+Illegal data
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml.ref
new file mode 100644
index 0000000000..5341fe5c8a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/036.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml
new file mode 100644
index 0000000000..2e02662926
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml
@@ -0,0 +1,2 @@
+<doc></doc>
+&#32;
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml.ref
new file mode 100644
index 0000000000..5341fe5c8a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/037.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml
new file mode 100644
index 0000000000..68b2803f82
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml
@@ -0,0 +1 @@
+<doc x="foo" y="bar" x="baz"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml.ref
new file mode 100644
index 0000000000..914f7edc6a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/038.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="x", qName="x", uri="", type="CDATA", value="foo"}, {localName="y", qName="y", uri="", type="CDATA", value="bar"}, {localName="x", qName="x", uri="", type="CDATA", value="baz"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml
new file mode 100644
index 0000000000..80429e3e40
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml
@@ -0,0 +1 @@
+<doc><a></aa></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml.ref
new file mode 100644
index 0000000000..82a67116c1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/039.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ fatalError(exception={columnNumber=13, lineNumber=1, publicId="", systemId="", message="tag mismatch"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml
new file mode 100644
index 0000000000..dc8ba5a434
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml
@@ -0,0 +1,2 @@
+<doc></doc>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml.ref
new file mode 100644
index 0000000000..a28c24ab56
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/040.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=2, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml
new file mode 100644
index 0000000000..30bcdd6bfe
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml
@@ -0,0 +1,2 @@
+<doc/>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml.ref
new file mode 100644
index 0000000000..a28c24ab56
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/041.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=2, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml
new file mode 100644
index 0000000000..4ae50efc7b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml
@@ -0,0 +1 @@
+<doc/></doc/>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml.ref
new file mode 100644
index 0000000000..493c67a337
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/042.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml
new file mode 100644
index 0000000000..41824eee4b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml
@@ -0,0 +1,2 @@
+<doc/>
+Illegal data
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml.ref
new file mode 100644
index 0000000000..5341fe5c8a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/043.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml
new file mode 100644
index 0000000000..3fc232dc37
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml
@@ -0,0 +1 @@
+<doc/><doc/>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml.ref
new file mode 100644
index 0000000000..493c67a337
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/044.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml
new file mode 100644
index 0000000000..00c10f00bf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml
@@ -0,0 +1,4 @@
+<doc>
+<a/
+</doc>
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml.ref
new file mode 100644
index 0000000000..d030deb272
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/045.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ fatalError(exception={columnNumber=4, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml
new file mode 100644
index 0000000000..265cb15301
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml
@@ -0,0 +1,3 @@
+<doc>
+<a/</a>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml.ref
new file mode 100644
index 0000000000..d030deb272
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/046.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ fatalError(exception={columnNumber=4, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml
new file mode 100644
index 0000000000..d18a4a4440
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml
@@ -0,0 +1,3 @@
+<doc>
+<a / >
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml.ref
new file mode 100644
index 0000000000..4693ac42c3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/047.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ fatalError(exception={columnNumber=5, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml
new file mode 100644
index 0000000000..67419c1ed5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml
@@ -0,0 +1,3 @@
+<doc>
+</doc>
+<![CDATA[]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml.ref
new file mode 100644
index 0000000000..f8e19b6108
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/048.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=3, lineNumber=3, publicId="", systemId="", message="error occurred while parsing comment"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml
new file mode 100644
index 0000000000..3cf0e79422
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml
@@ -0,0 +1,4 @@
+<doc>
+<a><![CDATA[xyz]]]></a>
+<![CDATA[]]></a>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml.ref
new file mode 100644
index 0000000000..1d89054d77
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/049.xml.ref
@@ -0,0 +1,14 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ startCDATA()
+ characters(ch="xyz]")
+ endCDATA()
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\r\n")
+ startCDATA()
+ characters(ch="")
+ endCDATA()
+ fatalError(exception={columnNumber=16, lineNumber=3, publicId="", systemId="", message="tag mismatch"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml.ref
new file mode 100644
index 0000000000..2a3b59e093
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/050.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=1, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml
new file mode 100644
index 0000000000..b52df12cc4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml
@@ -0,0 +1,3 @@
+<!-- a comment -->
+<![CDATA[]]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml.ref
new file mode 100644
index 0000000000..71c3e0d2f9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/051.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ comment(ch=" a comment ")
+ fatalError(exception={columnNumber=3, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml
new file mode 100644
index 0000000000..8283895990
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml
@@ -0,0 +1,3 @@
+<!-- a comment -->
+&#32;
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml.ref
new file mode 100644
index 0000000000..42126fdb25
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/052.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ comment(ch=" a comment ")
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml
new file mode 100644
index 0000000000..9d7f36920f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml
@@ -0,0 +1 @@
+<doc></DOC>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml.ref
new file mode 100644
index 0000000000..515dd0b446
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/053.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=11, lineNumber=1, publicId="", systemId="", message="tag mismatch"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml
new file mode 100644
index 0000000000..eda553c6d3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY foo PUBLIC "some public id">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml.ref
new file mode 100644
index 0000000000..18412e39b2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/054.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=37, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml
new file mode 100644
index 0000000000..cbb3683a9d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc [
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml.ref
new file mode 100644
index 0000000000..3e1e132b5e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/055.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=2, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml
new file mode 100644
index 0000000000..a681684c58
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc -- a comment -- []>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml.ref
new file mode 100644
index 0000000000..938a47c172
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/056.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=15, lineNumber=1, publicId="", systemId="", message="error occurred while parsing document type definition"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml
new file mode 100644
index 0000000000..848d347120
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "whatever" -- a comment -->
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml.ref
new file mode 100644
index 0000000000..28576a7fdf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/057.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="whatever")
+ fatalError(exception={columnNumber=23, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml
new file mode 100644
index 0000000000..daba266af2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 (foo,bar) #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml.ref
new file mode 100644
index 0000000000..aa3101b7ef
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/058.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=22, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml
new file mode 100644
index 0000000000..316083dc25
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 NMTOKEN v1>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml.ref
new file mode 100644
index 0000000000..d0c60b2bf5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/059.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=26, lineNumber=3, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml
new file mode 100644
index 0000000000..9a610fd38f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 NAME #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml.ref
new file mode 100644
index 0000000000..22f1636205
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/060.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=19, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml
new file mode 100644
index 0000000000..59181e706f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e PUBLIC "whatever""e.ent">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml.ref
new file mode 100644
index 0000000000..d49ec689aa
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/061.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=29, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml
new file mode 100644
index 0000000000..e62e9cd370
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY foo"some text">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml.ref
new file mode 100644
index 0000000000..2388c50c2b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/062.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=13, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml
new file mode 100644
index 0000000000..98675b9040
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<![INCLUDE[ ]]>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml.ref
new file mode 100644
index 0000000000..c0c9152f3e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/063.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=3, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml
new file mode 100644
index 0000000000..3888c46b8b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST e a1 CDATA"foo">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml.ref
new file mode 100644
index 0000000000..11ba2bdc47
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/064.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=21, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml
new file mode 100644
index 0000000000..da9cafd137
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1(foo|bar) #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml.ref
new file mode 100644
index 0000000000..c91f8597df
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/065.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=17, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml
new file mode 100644
index 0000000000..9c09eb4e5d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 (foo|bar)#IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml.ref
new file mode 100644
index 0000000000..f044a71dd9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/066.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=27, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml
new file mode 100644
index 0000000000..7e0809bd34
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 (foo)"foo">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml.ref
new file mode 100644
index 0000000000..519e67fc02
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/067.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=23, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml
new file mode 100644
index 0000000000..53a80a83a8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 NOTATION(foo) #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml.ref
new file mode 100644
index 0000000000..aa7a9e3957
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/068.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=26, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml
new file mode 100644
index 0000000000..6f891dd5e1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!NOTATION eps SYSTEM "eps.exe">
+<!-- missing space before NDATA -->
+<!ENTITY foo SYSTEM "foo.eps"NDATA eps>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml.ref
new file mode 100644
index 0000000000..4d729c5075
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/069.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ notationDecl(name="eps", publicId="", systemId="eps.exe")
+ comment(ch=" missing space before NDATA ")
+ fatalError(exception={columnNumber=30, lineNumber=4, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml
new file mode 100644
index 0000000000..faf4b0ae4c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml
@@ -0,0 +1,2 @@
+<!-- a comment ending with three dashes --->
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml.ref
new file mode 100644
index 0000000000..f24226f8e5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/070.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=43, lineNumber=1, publicId="", systemId="", message="error occurred while parsing comment"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml
new file mode 100644
index 0000000000..5bd3908968
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e1 "&e2;">
+<!ENTITY e2 "&e3;">
+<!ENTITY e3 "&e1;">
+]>
+<doc>&e1;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml.ref
new file mode 100644
index 0000000000..da8c9347b2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/071.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e1", value="&e2;")
+ internatlEntityDecl(name="e2", value="&e3;")
+ internatlEntityDecl(name="e3", value="&e1;")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=9, lineNumber=6, publicId="", systemId="", message="recursive entities"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml
new file mode 100644
index 0000000000..743ba79429
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml
@@ -0,0 +1 @@
+<doc>&foo;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml.ref
new file mode 100644
index 0000000000..48fd72baf3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/072.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ skippedEntity(name="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml
new file mode 100644
index 0000000000..2578af42ec
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "whatever">
+]>
+<doc>&f;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml.ref
new file mode 100644
index 0000000000..b60c7d49ac
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/073.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="whatever")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ skippedEntity(name="f")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml
new file mode 100644
index 0000000000..f8abaeb22c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e "</foo><foo>">
+]>
+<doc>
+<foo>&e;</foo>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml.ref
new file mode 100644
index 0000000000..df8552d646
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/074.xml.ref
@@ -0,0 +1,14 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="</foo><foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ characters(ch="\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml
new file mode 100644
index 0000000000..d3dbf50ed6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ENTITY e1 "&e2;">
+<!ENTITY e2 "&e3;">
+<!ENTITY e3 "&e1;">
+]>
+<doc a="&e1;"></doc>
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml.ref
new file mode 100644
index 0000000000..5d8b1797b5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/075.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e1", value="&e2;")
+ internatlEntityDecl(name="e2", value="&e3;")
+ internatlEntityDecl(name="e3", value="&e1;")
+ endDTD()
+ fatalError(exception={columnNumber=12, lineNumber=6, publicId="", systemId="", message="recursive entities"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml
new file mode 100644
index 0000000000..60546720e7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml
@@ -0,0 +1 @@
+<doc a="&foo;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml.ref
new file mode 100644
index 0000000000..6a8b31965b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/076.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ skippedEntity(name="foo")
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value=""}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml
new file mode 100644
index 0000000000..f8ac23a5a2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY foo "&bar;">
+]>
+<doc a="&foo;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml.ref
new file mode 100644
index 0000000000..4458152467
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/077.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="foo", value="&bar;")
+ endDTD()
+ skippedEntity(name="bar")
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value=""}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml
new file mode 100644
index 0000000000..446cd85ef9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA "&foo;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml.ref
new file mode 100644
index 0000000000..985f71ca2b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/078.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ skippedEntity(name="foo")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml
new file mode 100644
index 0000000000..da016fd3b2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ENTITY e1 "&e2;">
+<!ENTITY e2 "&e3;">
+<!ENTITY e3 "&e1;">
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA "&e1;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml.ref
new file mode 100644
index 0000000000..a59833714d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/079.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e1", value="&e2;")
+ internatlEntityDecl(name="e2", value="&e3;")
+ internatlEntityDecl(name="e3", value="&e1;")
+ fatalError(exception={columnNumber=27, lineNumber=6, publicId="", systemId="", message="recursive entities"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml
new file mode 100644
index 0000000000..fa4b9e428d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ENTITY e1 "&e2;">
+<!ENTITY e2 "&e3;">
+<!ENTITY e3 "&e1;">
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #FIXED "&e1;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml.ref
new file mode 100644
index 0000000000..13ee47bdf4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/080.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e1", value="&e2;")
+ internatlEntityDecl(name="e2", value="&e3;")
+ internatlEntityDecl(name="e3", value="&e1;")
+ fatalError(exception={columnNumber=34, lineNumber=6, publicId="", systemId="", message="recursive entities"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml
new file mode 100644
index 0000000000..d676100e8a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e SYSTEM "nul">
+]>
+<doc a="&e;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml.ref
new file mode 100644
index 0000000000..4d386e4f34
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/081.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="nul")
+ endDTD()
+ fatalError(exception={columnNumber=11, lineNumber=4, publicId="", systemId="", message="external parsed general entity reference not allowed in attribute value"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml
new file mode 100644
index 0000000000..3217d6f8b4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e SYSTEM "nul">
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA "&e;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml.ref
new file mode 100644
index 0000000000..eb81754e50
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/082.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="nul")
+ fatalError(exception={columnNumber=26, lineNumber=4, publicId="", systemId="", message="external parsed general entity reference not allowed in attribute value"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml
new file mode 100644
index 0000000000..469d43fd42
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e SYSTEM "nul" NDATA n>
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml.ref
new file mode 100644
index 0000000000..ac1caa8f9c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/083.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ unparsedEntityDecl(name="e", publicId="", systemId="nul", notationName="n")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=4, publicId="", systemId="", message="unparsed entity reference in wrong context"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml
new file mode 100644
index 0000000000..abbbcdea69
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e SYSTEM "nul" NDATA n>
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA "&e;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml.ref
new file mode 100644
index 0000000000..9f69b94ccf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/084.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ unparsedEntityDecl(name="e", publicId="", systemId="nul", notationName="n")
+ fatalError(exception={columnNumber=26, lineNumber=4, publicId="", systemId="", message="unparsed entity reference in wrong context"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml
new file mode 100644
index 0000000000..ac0aeca3e4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc PUBLIC "[" "null.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml.ref
new file mode 100644
index 0000000000..4db671e035
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/085.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="[", systemId="null.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml
new file mode 100644
index 0000000000..df6adfd884
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY foo PUBLIC "[" "null.xml">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml.ref
new file mode 100644
index 0000000000..6254d59e0f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/086.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="foo", publicId="[", systemId="null.xml")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml
new file mode 100644
index 0000000000..ed49492a7a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!NOTATION foo PUBLIC "[" "null.ent">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml.ref
new file mode 100644
index 0000000000..8ec0ab3a12
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/087.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ notationDecl(name="foo", publicId="[", systemId="null.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml
new file mode 100644
index 0000000000..da0a68c401
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+<!ENTITY e '"'>
+]>
+<doc a="&e;></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml.ref
new file mode 100644
index 0000000000..27ed4e589d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/088.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ internatlEntityDecl(name="e", value="\"")
+ endDTD()
+ fatalError(exception={columnNumber=13, lineNumber=6, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml
new file mode 100644
index 0000000000..0c6cf404c2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY % foo SYSTEM "foo.xml" NDATA bar>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml.ref
new file mode 100644
index 0000000000..910213bf13
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/089.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%foo", publicId="", systemId="foo.xml")
+ fatalError(exception={columnNumber=33, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml
new file mode 100644
index 0000000000..3fb72f3cc0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "<foo a='&#60;'></foo>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml.ref
new file mode 100644
index 0000000000..bc4280aa82
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/090.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<foo a='<'></foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=4, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml
new file mode 100644
index 0000000000..a61d0914f8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!NOTATION n SYSTEM "n">
+<!ENTITY % foo SYSTEM "foo.xml" NDATA n>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml.ref
new file mode 100644
index 0000000000..c89444077e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/091.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ notationDecl(name="n", publicId="", systemId="n")
+ externalEntityDecl(name="%foo", publicId="", systemId="foo.xml")
+ fatalError(exception={columnNumber=33, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml
new file mode 100644
index 0000000000..be5266dada
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "<foo a='&#38;'></foo>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml.ref
new file mode 100644
index 0000000000..4469beb325
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/092.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<foo a='&'></foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=4, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml
new file mode 100644
index 0000000000..4af61bc645
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml
@@ -0,0 +1 @@
+<doc>&#X58;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml.ref
new file mode 100644
index 0000000000..a885634000
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/093.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=1, publicId="", systemId="", message="error occurred while parsing reference"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml
new file mode 100644
index 0000000000..bdec7a4660
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml
@@ -0,0 +1,2 @@
+<?xml VERSION="1.0"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml.ref
new file mode 100644
index 0000000000..f37fb5877f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/094.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=20, lineNumber=1, publicId="", systemId="", message="version expected while reading the XML declaration"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml
new file mode 100644
index 0000000000..090b8b4eec
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml
@@ -0,0 +1,2 @@
+<?xml encoding="UTF-8" version="1.0"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml.ref
new file mode 100644
index 0000000000..8852f79579
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/095.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=23, lineNumber=1, publicId="", systemId="", message="version expected while reading the XML declaration"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml
new file mode 100644
index 0000000000..d806c3b952
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"encoding="UTF-8" ?>
+<doc></doc> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml.ref
new file mode 100644
index 0000000000..ddca718431
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/096.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=20, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml
new file mode 100644
index 0000000000..d4def544b0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0' encoding="UTF-8" ?>
+<doc></doc> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml.ref
new file mode 100644
index 0000000000..962de94d11
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/097.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=31, lineNumber=1, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml
new file mode 100644
index 0000000000..9798496aa3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" version="1.0"?>
+<doc></doc> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml.ref
new file mode 100644
index 0000000000..c1665a4f03
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/098.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=34, lineNumber=1, publicId="", systemId="", message="encoding declaration or standalone declaration expected while reading the XML declaration"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml
new file mode 100644
index 0000000000..d5be08eff0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" valid="no" ?>
+<doc></doc> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml.ref
new file mode 100644
index 0000000000..2d4e8516bc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/099.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=31, lineNumber=1, publicId="", systemId="", message="encoding declaration or standalone declaration expected while reading the XML declaration"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml
new file mode 100644
index 0000000000..51e06231c2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="YES" ?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml.ref
new file mode 100644
index 0000000000..eba06f283c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/100.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=37, lineNumber=1, publicId="", systemId="", message="wrong value for standalone declaration"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml
new file mode 100644
index 0000000000..afa5a455fc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding=" UTF-8"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml.ref
new file mode 100644
index 0000000000..068a6ae657
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/101.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding=' UTF-8'")
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml
new file mode 100644
index 0000000000..8734adaa6e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0 " ?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml.ref
new file mode 100644
index 0000000000..86b6ce0d3a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/102.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0 '")
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml
new file mode 100644
index 0000000000..6c4716798f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#60;foo>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml.ref
new file mode 100644
index 0000000000..7a82f96305
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/103.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ fatalError(exception={columnNumber=14, lineNumber=4, publicId="", systemId="", message="tag mismatch"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml
new file mode 100644
index 0000000000..dd57396239
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "<foo>">
+]>
+<doc>&e;</foo></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml.ref
new file mode 100644
index 0000000000..8059be12c8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/104.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml
new file mode 100644
index 0000000000..809e705870
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml
@@ -0,0 +1,4 @@
+<?pi stuff?>
+<![CDATA[]]>
+<doc>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml.ref
new file mode 100644
index 0000000000..ff94b32716
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/105.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="pi", data="stuff")
+ fatalError(exception={columnNumber=3, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml
new file mode 100644
index 0000000000..d32319ef09
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml
@@ -0,0 +1,2 @@
+<?pi data?>
+&#32;<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml.ref
new file mode 100644
index 0000000000..e5c6c6b6a7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/106.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="pi", data="data")
+ fatalError(exception={columnNumber=1, lineNumber=2, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml
new file mode 100644
index 0000000000..3dfd8200e2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<![CDATA[]]>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml.ref
new file mode 100644
index 0000000000..c0c9152f3e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/107.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=3, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml
new file mode 100644
index 0000000000..af5cf50d48
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml
@@ -0,0 +1,3 @@
+<doc>
+<![CDATA [ ]]>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml.ref
new file mode 100644
index 0000000000..3be3623019
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/108.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=9, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml
new file mode 100644
index 0000000000..5afc03e8db
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "<doc></doc>">
+]>
+&e;
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml.ref
new file mode 100644
index 0000000000..13140d8022
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/109.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<doc></doc>")
+ endDTD()
+ fatalError(exception={columnNumber=1, lineNumber=4, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml
new file mode 100644
index 0000000000..cf54ebe5c0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e "">
+]>
+<doc></doc>
+&e;
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml.ref
new file mode 100644
index 0000000000..aa5b66c13f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/110.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=1, lineNumber=5, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml
new file mode 100644
index 0000000000..84a469f5d1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "foo='bar'">
+]>
+<doc &e;></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml.ref
new file mode 100644
index 0000000000..d611ecd0df
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/111.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="foo='bar'")
+ endDTD()
+ fatalError(exception={columnNumber=6, lineNumber=4, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml
new file mode 100644
index 0000000000..0c5c1a4341
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml
@@ -0,0 +1,3 @@
+<doc>
+<![cdata[data]]>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml.ref
new file mode 100644
index 0000000000..db6c1f3fe7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/112.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=4, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml
new file mode 100644
index 0000000000..04fc9d2318
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY % foo "&">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml.ref
new file mode 100644
index 0000000000..af3a1378d1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/113.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=18, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml
new file mode 100644
index 0000000000..1261ee49e1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY foo "&">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml.ref
new file mode 100644
index 0000000000..611a07b6a7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/114.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=16, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml
new file mode 100644
index 0000000000..f111dbe153
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#38;">
+]>
+<doc a="&e;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml.ref
new file mode 100644
index 0000000000..d4a1b97e12
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/115.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="&")
+ endDTD()
+ fatalError(exception={columnNumber=12, lineNumber=4, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml
new file mode 100644
index 0000000000..84bb762fdf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#38;#9">
+]>
+<doc>&e;7;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml.ref
new file mode 100644
index 0000000000..f69ee0b24e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/116.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="&#9")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="a")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml
new file mode 100644
index 0000000000..e4a5e572ef
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#38;">
+]>
+<doc>&e;#97;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml.ref
new file mode 100644
index 0000000000..9c54b53b28
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/117.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="&")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="a")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml
new file mode 100644
index 0000000000..494d53d208
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "#">
+]>
+<doc>&&e;97;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml.ref
new file mode 100644
index 0000000000..714b497120
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/118.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="#")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=7, lineNumber=4, publicId="", systemId="", message="error occurred while parsing reference"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml
new file mode 100644
index 0000000000..aefaa44a1c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#38;">
+]>
+<doc>
+&e;#38;
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml.ref
new file mode 100644
index 0000000000..625f318be6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/119.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="&")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n&\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml
new file mode 100644
index 0000000000..b7d6ff9ce9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#38;">
+]>
+<doc>
+&e;
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml.ref
new file mode 100644
index 0000000000..56edb37c66
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/120.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="&")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=4, lineNumber=5, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml
new file mode 100644
index 0000000000..2b4adcc6b4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY #DEFAULT "default">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml.ref
new file mode 100644
index 0000000000..a9f2c8f68d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/121.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=10, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml
new file mode 100644
index 0000000000..ef0b057cee
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a, (b) | c)?>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/122.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml
new file mode 100644
index 0000000000..06d65f045b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ((doc?)))>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml.ref
new file mode 100644
index 0000000000..66978b93a8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/123.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=23, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml
new file mode 100644
index 0000000000..3bbe0f91a6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (doc|#PCDATA)*>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml.ref
new file mode 100644
index 0000000000..dc05a44ce5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/124.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=20, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml
new file mode 100644
index 0000000000..5f9c22c0c6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ((#PCDATA))>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml.ref
new file mode 100644
index 0000000000..b60c5515b1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/125.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=17, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml
new file mode 100644
index 0000000000..13e74d6d5e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)+>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml.ref
new file mode 100644
index 0000000000..03465a21d5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/126.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=24, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml
new file mode 100644
index 0000000000..a379b9e539
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)?>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml.ref
new file mode 100644
index 0000000000..03465a21d5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/127.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=24, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml
new file mode 100644
index 0000000000..dd706bb21f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc CDATA>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml.ref
new file mode 100644
index 0000000000..45764a1653
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/128.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=15, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml
new file mode 100644
index 0000000000..d4e4461a6d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc - - (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml.ref
new file mode 100644
index 0000000000..45764a1653
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/129.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=15, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml
new file mode 100644
index 0000000000..fa7be641f1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (doc?) +(foo)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml.ref
new file mode 100644
index 0000000000..ad943c6e9e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/130.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=22, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml
new file mode 100644
index 0000000000..f34ed453b5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (doc?) -(foo)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml.ref
new file mode 100644
index 0000000000..ad943c6e9e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/131.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=22, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml
new file mode 100644
index 0000000000..ab6cc416e9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a, (b, c), (d, (e, f) | g))?>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/132.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml
new file mode 100644
index 0000000000..d2aa604e9f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a *)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml.ref
new file mode 100644
index 0000000000..d0b59c54cc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/133.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=18, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml
new file mode 100644
index 0000000000..c8919c5ef8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a) *>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml.ref
new file mode 100644
index 0000000000..9da787c53b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/134.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=19, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml
new file mode 100644
index 0000000000..e639e8b6ea
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a & b)?>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml.ref
new file mode 100644
index 0000000000..d0b59c54cc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/135.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=18, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml
new file mode 100644
index 0000000000..499e68bcea
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc O O (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml.ref
new file mode 100644
index 0000000000..45764a1653
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/136.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=15, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml
new file mode 100644
index 0000000000..723b77f776
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc(#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml.ref
new file mode 100644
index 0000000000..58b922aec8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/137.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=14, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml
new file mode 100644
index 0000000000..16934cc88e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (doc*?)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml.ref
new file mode 100644
index 0000000000..51b93a743e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/138.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=20, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml
new file mode 100644
index 0000000000..34df52ed93
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ()>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml.ref
new file mode 100644
index 0000000000..5344a45ef8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/139.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=16, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml
new file mode 100644
index 0000000000..467d5ed301
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "<&#x309a;></&#x309a;>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml.ref
new file mode 100644
index 0000000000..123df1a99c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/140.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<゚></゚>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=4, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml
new file mode 100644
index 0000000000..409d0a7568
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "<X&#xe5c;></X&#xe5c;>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml.ref
new file mode 100644
index 0000000000..1b6d92115a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/141.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<X๜></X๜>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=4, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml
new file mode 100644
index 0000000000..20e88f88b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#0;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml.ref
new file mode 100644
index 0000000000..7ce4da6a06
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/142.xml.ref
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml
new file mode 100644
index 0000000000..0ee1c614f8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#31;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml.ref
new file mode 100644
index 0000000000..664bfb7111
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/143.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml
new file mode 100644
index 0000000000..437548c0ba
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#xFFFF;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml.ref
new file mode 100644
index 0000000000..8d3143070d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/144.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="￿")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml
new file mode 100644
index 0000000000..71b187a933
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#xD800;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml.ref
new file mode 100644
index 0000000000..279ece7657
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/145.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml
new file mode 100644
index 0000000000..d0bfbca723
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#x110000;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml.ref
new file mode 100644
index 0000000000..7ce4da6a06
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/146.xml.ref
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml
new file mode 100644
index 0000000000..3b6145615f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml
@@ -0,0 +1,3 @@
+
+<?xml version="1.0"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml.ref
new file mode 100644
index 0000000000..dd85a80374
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/147.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=6, lineNumber=2, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml
new file mode 100644
index 0000000000..774dce18fd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml
@@ -0,0 +1,3 @@
+<!-- -->
+<?xml version="1.0"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml.ref
new file mode 100644
index 0000000000..9b58eb0b49
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/148.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ comment(ch=" ")
+ fatalError(exception={columnNumber=6, lineNumber=2, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml
new file mode 100644
index 0000000000..725eea0dec
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<?xml version="1.0"?>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml.ref
new file mode 100644
index 0000000000..aa73988e09
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/149.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=6, lineNumber=3, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml
new file mode 100644
index 0000000000..44f6b6df92
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml
@@ -0,0 +1,3 @@
+<doc>
+<?xml version="1.0"?>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml.ref
new file mode 100644
index 0000000000..2bc5abe271
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/150.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=6, lineNumber=2, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml
new file mode 100644
index 0000000000..fecc4f24e3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml
@@ -0,0 +1,3 @@
+<doc>
+</doc>
+<?xml version="1.0"?>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml.ref
new file mode 100644
index 0000000000..e5d98b1232
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/151.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ fatalError(exception={columnNumber=6, lineNumber=3, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml
new file mode 100644
index 0000000000..b5c5cb26ae
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml
@@ -0,0 +1,2 @@
+<?xml encoding="UTF-8"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml.ref
new file mode 100644
index 0000000000..8852f79579
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/152.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=23, lineNumber=1, publicId="", systemId="", message="version expected while reading the XML declaration"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml
new file mode 100644
index 0000000000..5e2973707e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "<?xml encoding='UTF-8'?>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml.ref
new file mode 100644
index 0000000000..1198fe07c6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/153.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<?xml encoding='UTF-8'?>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=8, lineNumber=5, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml
new file mode 100644
index 0000000000..96e01d63f5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml
@@ -0,0 +1,2 @@
+<?XML version="1.0"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml.ref
new file mode 100644
index 0000000000..74a9eb1488
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/154.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml
new file mode 100644
index 0000000000..4f16d0f163
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml
@@ -0,0 +1,2 @@
+<?xmL version="1.0"?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml.ref
new file mode 100644
index 0000000000..74a9eb1488
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/155.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml
new file mode 100644
index 0000000000..c6d93fd312
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml
@@ -0,0 +1,3 @@
+<doc>
+<?xMl version="1.0"?>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml.ref
new file mode 100644
index 0000000000..2bc5abe271
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/156.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=6, lineNumber=2, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml
new file mode 100644
index 0000000000..2f058dac3e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml
@@ -0,0 +1,3 @@
+<doc>
+<?xmL?>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml.ref
new file mode 100644
index 0000000000..2bc5abe271
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/157.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ fatalError(exception={columnNumber=6, lineNumber=2, publicId="", systemId="", message="invalid name for processing instruction"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml
new file mode 100644
index 0000000000..32b90b722d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!NOTATION gif PUBLIC "image/gif" "">
+<!ATTLIST #NOTATION gif a1 CDATA #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml.ref
new file mode 100644
index 0000000000..38210c24da
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/158.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ notationDecl(name="gif", publicId="image/gif", systemId="")
+ fatalError(exception={columnNumber=11, lineNumber=4, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml
new file mode 100644
index 0000000000..066244cb91
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "<![CDATA[Tim & Michael]]>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml.ref
new file mode 100644
index 0000000000..f044a71dd9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/159.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=27, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml
new file mode 100644
index 0000000000..85424acb1b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "">
+<!ENTITY foo "%e;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml.ref
new file mode 100644
index 0000000000..0c1afe80b8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/160.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="")
+ internatlEntityDecl(name="foo", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml
new file mode 100644
index 0000000000..4f8a5b7b6b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % e "#PCDATA">
+<!ELEMENT doc (%e;)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml.ref
new file mode 100644
index 0000000000..35ee5e8c6c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/161.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="#PCDATA")
+ fatalError(exception={columnNumber=16, lineNumber=3, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml
new file mode 100644
index 0000000000..efae4b190e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e1 "">
+<!ENTITY % e2 "%e1;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml.ref
new file mode 100644
index 0000000000..a802c74aed
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/162.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e1", value="")
+ internatlEntityDecl(name="%e2", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml
new file mode 100644
index 0000000000..e14fb76c31
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "">
+]>
+%e;
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml.ref
new file mode 100644
index 0000000000..e4c32252dd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/163.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="")
+ endDTD()
+ fatalError(exception={columnNumber=1, lineNumber=5, publicId="", systemId="", message="error occurred while parsing element"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml
new file mode 100644
index 0000000000..98dd267c21
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "">
+] %e; >
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml.ref
new file mode 100644
index 0000000000..80314341d6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/164.xml.ref
@@ -0,0 +1,5 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="")
+ fatalError(exception={columnNumber=3, lineNumber=4, publicId="", systemId="", message="error occurred while parsing document type definition"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml
new file mode 100644
index 0000000000..36c04618ef
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY% e "">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml.ref
new file mode 100644
index 0000000000..64fd8b4d0d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/165.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=9, lineNumber=2, publicId="", systemId="", message="letter is expected"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml
new file mode 100644
index 0000000000..ee2ce28630
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml
@@ -0,0 +1 @@
+<doc>￿</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml.ref
new file mode 100644
index 0000000000..dca4f7b1cd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/166.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml
new file mode 100644
index 0000000000..9bdc6c1278
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml
@@ -0,0 +1 @@
+<doc>￾</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml.ref
new file mode 100644
index 0000000000..dca4f7b1cd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/167.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml
new file mode 100644
index 0000000000..f83221a3ad
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml
@@ -0,0 +1 @@
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml.ref
new file mode 100644
index 0000000000..61659843c1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/168.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml
new file mode 100644
index 0000000000..310029b976
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml
@@ -0,0 +1 @@
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml.ref
new file mode 100644
index 0000000000..78385bd8bc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/169.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml
new file mode 100644
index 0000000000..cfa0aee155
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml
@@ -0,0 +1 @@
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml.ref
new file mode 100644
index 0000000000..0508ee88c7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/170.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml
new file mode 100644
index 0000000000..48b5c7d3bc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml
@@ -0,0 +1,2 @@
+<!-- ￿ -->
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml.ref
new file mode 100644
index 0000000000..f729ad3da3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/171.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml
new file mode 100644
index 0000000000..6651d4d299
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml
@@ -0,0 +1,2 @@
+<?pi ￿?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml.ref
new file mode 100644
index 0000000000..f729ad3da3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/172.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=6, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml
new file mode 100644
index 0000000000..f9f9f42023
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml
@@ -0,0 +1 @@
+<doc a="￿"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml.ref
new file mode 100644
index 0000000000..cda5d63d26
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/173.xml.ref
@@ -0,0 +1,3 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ fatalError(exception={columnNumber=9, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml
new file mode 100644
index 0000000000..42bef861c6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml
@@ -0,0 +1 @@
+<doc><![CDATA[￿]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml.ref
new file mode 100644
index 0000000000..5f23fbdcdb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/174.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=15, lineNumber=1, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml
new file mode 100644
index 0000000000..69912f36d2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "￿">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml.ref
new file mode 100644
index 0000000000..27549bc7de
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/175.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=15, lineNumber=3, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml
new file mode 100644
index 0000000000..39153ad5a8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml.ref
new file mode 100644
index 0000000000..4348506993
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/176.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=1, lineNumber=5, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml
new file mode 100644
index 0000000000..6bc8228879
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>A￿</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml.ref
new file mode 100644
index 0000000000..94f3c3b9e5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/177.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ fatalError(exception={columnNumber=7, lineNumber=4, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml
new file mode 100644
index 0000000000..e8f2d18eed
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="&#34;></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml.ref
new file mode 100644
index 0000000000..5aae44a1bf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/178.xml.ref
@@ -0,0 +1,6 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ fatalError(exception={columnNumber=15, lineNumber=5, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml
new file mode 100644
index 0000000000..e8f1f419db
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#34;>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml.ref
new file mode 100644
index 0000000000..a4c6cffd5d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/179.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=1, lineNumber=5, publicId="", systemId="", message="unexpected end of file"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml
new file mode 100644
index 0000000000..569d553a8c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA "&e;">
+<!ENTITY e "v">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml.ref
new file mode 100644
index 0000000000..42542d990e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/180.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ skippedEntity(name="e")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ internatlEntityDecl(name="e", value="v")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml
new file mode 100644
index 0000000000..4341d99ee2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#60;![CDATA[">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&e;]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml.ref
new file mode 100644
index 0000000000..8e1b4457fc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/181.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<![CDATA[")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startCDATA()
+ characters(ch="")
+ endCDATA()
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml
new file mode 100644
index 0000000000..920f431666
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#60;!--">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&e;--></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml.ref
new file mode 100644
index 0000000000..abb11afa92
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/182.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<!--")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ comment(ch="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml
new file mode 100644
index 0000000000..7a5677de54
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA | foo*)* >
+<!ELEMENT foo EMPTY>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml.ref
new file mode 100644
index 0000000000..d49ec689aa
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/183.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=29, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml
new file mode 100644
index 0000000000..103384a06e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA | (foo))* >
+<!ELEMENT foo EMPTY>
+]>
+<doc></doc>
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml.ref
new file mode 100644
index 0000000000..8d879bf2e6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/184.xml.ref
@@ -0,0 +1,4 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ fatalError(exception={columnNumber=26, lineNumber=2, publicId="", systemId="", message="unexpected character"})
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.ent
new file mode 100644
index 0000000000..e557426454
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.ent
@@ -0,0 +1 @@
+<!ELEMENT doc (#PCDATA)>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml
new file mode 100644
index 0000000000..81d5ef4bcd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE doc SYSTEM "185.ent">
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml.ref
new file mode 100644
index 0000000000..7f5838399b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/185.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' standalone='yes'")
+ startDTD(name="doc", publicId="", systemId="185.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml
new file mode 100644
index 0000000000..85b26ec0a2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE a [
+<!ELEMENT a EMPTY>
+<!ATTLIST a b CDATA #IMPLIED d CDATA #IMPLIED>
+]>
+<a b="c"d="e"/>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml.ref
new file mode 100644
index 0000000000..63d0d3e3f6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/186.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="a", publicId="", systemId="")
+ attributeDecl(eName="a", aName="b", type="", valueDefault="", value="")
+ attributeDecl(eName="a", aName="d", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="a", qName="a", atts=[{localName="b", qName="b", uri="", type="CDATA", value="c"}, {localName="d", qName="d", uri="", type="CDATA", value="e"}])
+ endElement(namespaceURI="", localName="a", qName="a")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/null.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/null.ent
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/not-wf/sa/null.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
new file mode 100755
index 0000000000..1cff3fd44f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
@@ -0,0 +1 @@
+Data
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml
new file mode 100644
index 0000000000..147d70d2d1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "001.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml.ref
new file mode 100644
index 0000000000..355c937e11
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="001.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="001.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
new file mode 100755
index 0000000000..45f6d8e74e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
@@ -0,0 +1 @@
+Data \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml
new file mode 100644
index 0000000000..9eaf91724f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "002.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml.ref
new file mode 100644
index 0000000000..f843995646
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="002.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="002.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.ent
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml
new file mode 100644
index 0000000000..bb60b663ef
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "003.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml.ref
new file mode 100644
index 0000000000..79d3531637
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/003.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="003.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="003.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
new file mode 100755
index 0000000000..3436f20001
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
@@ -0,0 +1 @@
+Data \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml
new file mode 100644
index 0000000000..074498ce19
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "004.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml.ref
new file mode 100644
index 0000000000..38abcb2fc6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="004.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="004.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
new file mode 100755
index 0000000000..c6e97f821f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
@@ -0,0 +1 @@
+<e/><e/><e/> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml
new file mode 100644
index 0000000000..82a6228205
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (e*)>
+<!ELEMENT e EMPTY>
+<!ENTITY e SYSTEM "005.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml.ref
new file mode 100644
index 0000000000..2601030f2a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="005.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="005.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
new file mode 100755
index 0000000000..4df2f0c2ac
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
@@ -0,0 +1,4 @@
+Data
+<e/>
+More data
+<e/>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml
new file mode 100644
index 0000000000..0b326cad4c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA|e)*>
+<!ELEMENT e EMPTY>
+<!ENTITY e SYSTEM "006.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml.ref
new file mode 100644
index 0000000000..17fd238b67
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="006.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="006.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
new file mode 100755
index 0000000000..ab1d696dd7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml
new file mode 100644
index 0000000000..825e3b286a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "007.ent">
+]>
+<doc>X&e;Z</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml.ref
new file mode 100644
index 0000000000..81e7ccdaf3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="007.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="007.ent", ret={})
+ skippedEntity(name="e")
+ characters(ch="XZ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
new file mode 100755
index 0000000000..c6ca61f9c8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml
new file mode 100644
index 0000000000..3c001b6cb3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "008.ent">
+]>
+<doc>X&e;Z</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml.ref
new file mode 100644
index 0000000000..eb7f1086e1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="008.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="008.ent", ret={})
+ skippedEntity(name="e")
+ characters(ch="XZ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
new file mode 100755
index 0000000000..67c3297611
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml
new file mode 100644
index 0000000000..a5866e5a77
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "009.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml.ref
new file mode 100644
index 0000000000..5c294de017
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="009.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="009.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.ent
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml
new file mode 100644
index 0000000000..418e9b0141
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "010.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml.ref
new file mode 100644
index 0000000000..4dc03c6dba
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/010.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="010.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="010.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
new file mode 100755
index 0000000000..b19be3a497
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
@@ -0,0 +1 @@
+xyzzy
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml
new file mode 100644
index 0000000000..2ceefa1d21
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e PUBLIC "a not very interesting file" "011.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml.ref
new file mode 100644
index 0000000000..c078139d84
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="a not very interesting file", systemId="011.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="a not very interesting file", systemId="011.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
new file mode 100755
index 0000000000..8eb1fb9c41
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
@@ -0,0 +1 @@
+&e4; \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml
new file mode 100644
index 0000000000..5a8f009b4a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE doc [
+<!ENTITY e1 "&e2;">
+<!ENTITY e2 "&e3;">
+<!ENTITY e3 SYSTEM "012.ent">
+<!ENTITY e4 "&e5;">
+<!ENTITY e5 "(e5)">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&e1;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml.ref
new file mode 100644
index 0000000000..2af77a3b99
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.xml.ref
@@ -0,0 +1,14 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e1", value="&e2;")
+ internatlEntityDecl(name="e2", value="&e3;")
+ externalEntityDecl(name="e3", publicId="", systemId="012.ent")
+ internatlEntityDecl(name="e4", value="&e5;")
+ internatlEntityDecl(name="e5", value="(e5)")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="012.ent", ret={})
+ skippedEntity(name="e3")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
new file mode 100755
index 0000000000..7f25c502dd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
@@ -0,0 +1 @@
+<e/> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml
new file mode 100644
index 0000000000..7717c97afe
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (e)>
+<!ELEMENT e (#PCDATA)>
+<!ATTLIST e
+ a1 CDATA "a1 default"
+ a2 NMTOKENS "a2 default"
+>
+<!ENTITY x SYSTEM "013.ent">
+]>
+<doc>&x;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml.ref
new file mode 100644
index 0000000000..92fb65a2d2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.xml.ref
@@ -0,0 +1,12 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="e", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="e", aName="a2", type="", valueDefault="", value="")
+ externalEntityDecl(name="x", publicId="", systemId="013.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="013.ent", ret={})
+ skippedEntity(name="x")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
new file mode 100755
index 0000000000..470fd6fe44
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml
new file mode 100644
index 0000000000..816fd1e796
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e SYSTEM "014.ent">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml.ref
new file mode 100644
index 0000000000..a087786e69
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId="", systemId="014.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ resolveEntity(publicId="", systemId="014.ent", ret={})
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml
new file mode 100644
index 0000000000..e91a10895e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<!DOCTYPE foo SYSTEM "foo.dtd" [
+ <!ENTITY def "foo">
+]>
+<foo>
+ <!-- check that the call to skippedEntity() is inserted in the right place -->
+ <a>abc&undef;gh</a>
+ <b>&undef;gh</b>
+ <c>abc&undef;</c>
+ <d>&undef;</d>
+ <e>&undef;&def;&undef;&def;</e>
+ <e>a&undef;b&def;c&undef;d&def;e</e>
+</foo>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml.ref
new file mode 100644
index 0000000000..67f1fbe808
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_1.xml.ref
@@ -0,0 +1,47 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='UTF-8' standalone='no'")
+ startDTD(name="foo", publicId="", systemId="foo.dtd")
+ internatlEntityDecl(name="def", value="foo")
+ endDTD()
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ characters(ch="\n ")
+ comment(ch=" check that the call to skippedEntity() is inserted in the right place ")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ characters(ch="abc")
+ skippedEntity(name="undef")
+ characters(ch="gh")
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="b", qName="b", atts=[])
+ skippedEntity(name="undef")
+ characters(ch="gh")
+ endElement(namespaceURI="", localName="b", qName="b")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="c", qName="c", atts=[])
+ characters(ch="abc")
+ skippedEntity(name="undef")
+ endElement(namespaceURI="", localName="c", qName="c")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="d", qName="d", atts=[])
+ skippedEntity(name="undef")
+ endElement(namespaceURI="", localName="d", qName="d")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[])
+ skippedEntity(name="undef")
+ characters(ch="foo")
+ skippedEntity(name="undef")
+ characters(ch="foo")
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[])
+ characters(ch="a")
+ skippedEntity(name="undef")
+ characters(ch="bfooc")
+ skippedEntity(name="undef")
+ characters(ch="dfooe")
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\n")
+ endElement(namespaceURI="", localName="foo", qName="foo")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml
new file mode 100644
index 0000000000..a1fb393371
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<!DOCTYPE foo SYSTEM "foo.dtd" [
+ <!ENTITY a1 "&a2;">
+ <!ENTITY a2 "&a3;">
+ <!ENTITY def "foo">
+]>
+<foo>
+ <a>abc&a1;gh</a>
+ <b>&a1;gh</b>
+ <c>abc&a1;</c>
+ <d>&a1;</d>
+ <e>&a1;&def;&a1;&def;</e>
+ <e>a&a1;b&def;c&a1;d&def;e</e>
+</foo>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml.ref
new file mode 100644
index 0000000000..a7ed3a2848
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_2.xml.ref
@@ -0,0 +1,47 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='UTF-8' standalone='no'")
+ startDTD(name="foo", publicId="", systemId="foo.dtd")
+ internatlEntityDecl(name="a1", value="&a2;")
+ internatlEntityDecl(name="a2", value="&a3;")
+ internatlEntityDecl(name="def", value="foo")
+ endDTD()
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ characters(ch="abc")
+ skippedEntity(name="a3")
+ characters(ch="gh")
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="b", qName="b", atts=[])
+ skippedEntity(name="a3")
+ characters(ch="gh")
+ endElement(namespaceURI="", localName="b", qName="b")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="c", qName="c", atts=[])
+ characters(ch="abc")
+ skippedEntity(name="a3")
+ endElement(namespaceURI="", localName="c", qName="c")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="d", qName="d", atts=[])
+ skippedEntity(name="a3")
+ endElement(namespaceURI="", localName="d", qName="d")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[])
+ skippedEntity(name="a3")
+ characters(ch="foo")
+ skippedEntity(name="a3")
+ characters(ch="foo")
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\n ")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[])
+ characters(ch="a")
+ skippedEntity(name="a3")
+ characters(ch="bfooc")
+ skippedEntity(name="a3")
+ characters(ch="dfooe")
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\n")
+ endElement(namespaceURI="", localName="foo", qName="foo")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml
new file mode 100644
index 0000000000..ae745d4da1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<!DOCTYPE foo SYSTEM "foo.dtd" [
+ <!ENTITY a1 "&a2;">
+ <!ENTITY a2 "&a3;">
+ <!ENTITY def "foo">
+]>
+<foo>
+ <a attr="foo&a1;bar&def;ding"/>
+</foo>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml.ref
new file mode 100644
index 0000000000..09f8e96b9c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/undef_entity_3.xml.ref
@@ -0,0 +1,16 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='UTF-8' standalone='no'")
+ startDTD(name="foo", publicId="", systemId="foo.dtd")
+ internatlEntityDecl(name="a1", value="&a2;")
+ internatlEntityDecl(name="a2", value="&a3;")
+ internatlEntityDecl(name="def", value="foo")
+ endDTD()
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ characters(ch="\n ")
+ skippedEntity(name="a3")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[{localName="attr", qName="attr", uri="", type="CDATA", value="foobarfooding"}])
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\n")
+ endElement(namespaceURI="", localName="foo", qName="foo")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.ent
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml
new file mode 100644
index 0000000000..2d6f41a137
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "001.ent" [
+<!ELEMENT doc EMPTY>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml.ref
new file mode 100644
index 0000000000..eea47ce41b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/001.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="001.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
new file mode 100755
index 0000000000..67c3297611
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml
new file mode 100644
index 0000000000..023fce8499
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "002.ent" [
+<!ELEMENT doc EMPTY>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml.ref
new file mode 100644
index 0000000000..cbaf6dc22d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="002.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
new file mode 100755
index 0000000000..931f3ad6d8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc EMPTY>
+<!ENTITY % e SYSTEM "003-2.ent">
+<!ATTLIST doc a1 CDATA %e; "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-2.ent
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-2.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml
new file mode 100644
index 0000000000..63a5e8bdfc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "003-1.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml.ref
new file mode 100644
index 0000000000..4f83c741fb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="003-1.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
new file mode 100755
index 0000000000..40f7ff58a2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
@@ -0,0 +1,4 @@
+<!ELEMENT doc EMPTY>
+<!ENTITY % e1 SYSTEM "004-2.ent">
+<!ENTITY % e2 "%e1;">
+%e1;
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
new file mode 100755
index 0000000000..61def75cb7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "value">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml
new file mode 100644
index 0000000000..adc9201496
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "004-1.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml.ref
new file mode 100644
index 0000000000..e2d3af888e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="004-1.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
new file mode 100755
index 0000000000..ade9599032
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc EMPTY>
+<!ENTITY % e SYSTEM "005-2.ent">
+%e;
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
new file mode 100755
index 0000000000..bef50b1f38
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml
new file mode 100644
index 0000000000..6bd44cfee0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "005-1.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml.ref
new file mode 100644
index 0000000000..8057322cf2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="005-1.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
new file mode 100755
index 0000000000..8f305a82bd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc EMPTY>
+<!ATTLIST doc a1 CDATA "w1" a2 CDATA "w2">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml
new file mode 100644
index 0000000000..eb80bb7409
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "006.ent" [
+<!ATTLIST doc a1 CDATA "v1">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml.ref
new file mode 100644
index 0000000000..e2e2584353
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="006.ent")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
new file mode 100755
index 0000000000..fbf4ca4947
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml
new file mode 100644
index 0000000000..38897e34ea
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "007.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml.ref
new file mode 100644
index 0000000000..d96790fb37
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="007.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
new file mode 100755
index 0000000000..fbf4ca4947
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml
new file mode 100644
index 0000000000..bf777a7ff2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc PUBLIC "whatever" "008.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml.ref
new file mode 100644
index 0000000000..08ba9c035b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="whatever", systemId="008.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
new file mode 100755
index 0000000000..fbf4ca4947
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml
new file mode 100644
index 0000000000..c17562fe68
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc PUBLIC "whatever" "009.ent" [
+<!ATTLIST doc a2 CDATA "v2">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml.ref
new file mode 100644
index 0000000000..d789785173
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="whatever", systemId="009.ent")
+ attributeDecl(eName="doc", aName="a2", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
new file mode 100755
index 0000000000..52a28f5deb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v2">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml
new file mode 100644
index 0000000000..2786b328f3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "010.ent" [
+<!ATTLIST doc a1 CDATA "v1">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml.ref
new file mode 100644
index 0000000000..6045d46296
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="010.ent")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
new file mode 100755
index 0000000000..fbf4ca4947
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml
new file mode 100644
index 0000000000..03b482bbb6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % e SYSTEM "011.ent">
+%e;
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml.ref
new file mode 100644
index 0000000000..09fd89bd38
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%e", publicId="", systemId="011.ent")
+ resolveEntity(publicId="", systemId="011.ent", ret={})
+ skippedEntity(name="%e")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
new file mode 100755
index 0000000000..7e372e65e9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml
new file mode 100644
index 0000000000..1967edbba7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % e SYSTEM "012.ent">
+%e;
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml.ref
new file mode 100644
index 0000000000..8d90b187dd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%e", publicId="", systemId="012.ent")
+ resolveEntity(publicId="", systemId="012.ent", ret={})
+ skippedEntity(name="%e")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
new file mode 100755
index 0000000000..a3691d9f08
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>
+<![ INCLUDE [
+<!ATTLIST doc a1 CDATA "v1">
+]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml
new file mode 100644
index 0000000000..cf44f2600a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "013.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml.ref
new file mode 100644
index 0000000000..d84839e625
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="013.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
new file mode 100755
index 0000000000..6eaf779329
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>
+<![ %e; [
+<!ATTLIST doc a1 CDATA "v1">
+]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml
new file mode 100644
index 0000000000..bd08502489
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "014.ent" [
+<!ENTITY % e "INCLUDE">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml.ref
new file mode 100644
index 0000000000..f9c8220bbb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="014.ent")
+ internatlEntityDecl(name="%e", value="INCLUDE")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
new file mode 100755
index 0000000000..00d2f30e1d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
@@ -0,0 +1,5 @@
+<!ELEMENT doc (#PCDATA)>
+<![ %e; [
+<!ATTLIST doc a1 CDATA "v1">
+]]>
+<!ATTLIST doc a2 CDATA "v2">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml
new file mode 100644
index 0000000000..e04e75ffca
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "015.ent" [
+<!ENTITY % e "IGNORE">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml.ref
new file mode 100644
index 0000000000..de94a45356
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="015.ent")
+ internatlEntityDecl(name="%e", value="IGNORE")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
new file mode 100755
index 0000000000..bf77ef8336
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>
+<![%e;[
+<!ATTLIST doc a1 CDATA "v1">
+]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml
new file mode 100644
index 0000000000..4ccf4af350
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "016.ent" [
+<!ENTITY % e "INCLUDE">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml.ref
new file mode 100644
index 0000000000..7c234cfc5f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="016.ent")
+ internatlEntityDecl(name="%e", value="INCLUDE")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
new file mode 100755
index 0000000000..ffd9adde61
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "<!ATTLIST doc a1 CDATA 'v1'>">
+%e;
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml
new file mode 100644
index 0000000000..7fe18f4c7a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "017.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml.ref
new file mode 100644
index 0000000000..25cc198610
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="017.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
new file mode 100755
index 0000000000..2d46f76fc3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "'v1'">
+<!ATTLIST doc a1 CDATA %e;>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml
new file mode 100644
index 0000000000..31e90f2405
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "018.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml.ref
new file mode 100644
index 0000000000..3db7bc846b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="018.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
new file mode 100755
index 0000000000..d18201a98b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "'v1'">
+<!ATTLIST doc a1 CDATA%e;>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml
new file mode 100644
index 0000000000..b7a18faba0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "019.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml.ref
new file mode 100644
index 0000000000..9961aa93b4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="019.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
new file mode 100755
index 0000000000..815291c6d2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
@@ -0,0 +1,3 @@
+<!ENTITY % e "doc">
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST%e;a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml
new file mode 100644
index 0000000000..d70892f7ad
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "020.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml.ref
new file mode 100644
index 0000000000..fc9a0535c1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="020.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
new file mode 100755
index 0000000000..9f8f2afd2b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
@@ -0,0 +1,3 @@
+<!ENTITY % e "doc a1 CDATA">
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST %e; "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml
new file mode 100644
index 0000000000..70c28730db
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "021.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml.ref
new file mode 100644
index 0000000000..e6d91722d3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="021.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
new file mode 100755
index 0000000000..26f2d8beb2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
@@ -0,0 +1,3 @@
+<!ENTITY % e "INCLUDE[">
+<!ELEMENT doc (#PCDATA)>
+<![ %e; <!ATTLIST doc a1 CDATA "v1"> ]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml
new file mode 100644
index 0000000000..b639f2551c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "022.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml.ref
new file mode 100644
index 0000000000..de3ddf732f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="022.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
new file mode 100755
index 0000000000..e3268819f7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
@@ -0,0 +1,5 @@
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e1 "do">
+<!ENTITY % e2 "c">
+<!ENTITY % e3 "%e1;%e2;">
+<!ATTLIST %e3; a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml
new file mode 100644
index 0000000000..1c2484b70b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "023.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml.ref
new file mode 100644
index 0000000000..a150bde52a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="023.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
new file mode 100755
index 0000000000..aa6d0eccac
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e1 "'v1'">
+<!ENTITY % e2 'a1 CDATA %e1;'>
+<!ATTLIST doc %e2;>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml
new file mode 100644
index 0000000000..96e1ecb61b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "024.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml.ref
new file mode 100644
index 0000000000..e97c61bd94
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="024.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
new file mode 100755
index 0000000000..389d259eb1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
@@ -0,0 +1,5 @@
+<!ELEMENT doc EMPTY>
+<!ENTITY % e "x">
+<!ENTITY % e "y">
+<!ENTITY % v "'%e;'">
+<!ATTLIST doc a1 CDATA %v;>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml
new file mode 100644
index 0000000000..8fdbc14c47
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "025.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml.ref
new file mode 100644
index 0000000000..1eca607181
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="025.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
new file mode 100755
index 0000000000..bdc93af639
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "w1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml
new file mode 100644
index 0000000000..7b109c0913
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ANY>
+<!ENTITY % e SYSTEM "026.ent">
+%e;
+<!ATTLIST doc a1 CDATA "x1" a2 CDATA "x2">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml.ref
new file mode 100644
index 0000000000..1bea883d9c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.xml.ref
@@ -0,0 +1,12 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%e", publicId="", systemId="026.ent")
+ resolveEntity(publicId="", systemId="026.ent", ret={})
+ skippedEntity(name="%e")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="doc", aName="a2", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
new file mode 100755
index 0000000000..712cce3700
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
@@ -0,0 +1,2 @@
+<!ENTITY % e "">
+<!ELEMENT doc (#PCDATA %e;)>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml
new file mode 100644
index 0000000000..d0c8c7abb5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "027.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml.ref
new file mode 100644
index 0000000000..d010327624
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="027.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
new file mode 100755
index 0000000000..ac249d7b2c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>
+<![INCLUDE[<!ATTLIST doc a1 CDATA "v1">]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml
new file mode 100644
index 0000000000..50e5248cbf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "028.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml.ref
new file mode 100644
index 0000000000..8466141897
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="028.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
new file mode 100755
index 0000000000..df94df5560
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>
+<![IGNORE[<!ATTLIST doc a1 CDATA "v1">]]>
+<!ATTLIST doc a1 CDATA "v2">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml
new file mode 100644
index 0000000000..07e226c1d7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "029.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml.ref
new file mode 100644
index 0000000000..0bffc4aaa7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="029.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
new file mode 100755
index 0000000000..e3864460df
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>
+<![IGNORE[]]>
+<![INCLUDE[]]>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml
new file mode 100644
index 0000000000..01fc2be4ca
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "030.ent">
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml.ref
new file mode 100644
index 0000000000..51e7f033f9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="030.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
new file mode 100755
index 0000000000..f7f94ab152
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e SYSTEM "031-2.ent">
+<!ENTITY e "<![CDATA[%e;]]>">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
new file mode 100755
index 0000000000..bef50b1f38
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "v1">
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml
new file mode 100644
index 0000000000..c3fe5fca71
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "031-1.ent">
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml.ref
new file mode 100644
index 0000000000..72ab9d974f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="031-1.ent")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml
new file mode 100644
index 0000000000..7fbef49502
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/001.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml
new file mode 100644
index 0000000000..2e3f1d81dd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc ></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/002.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml
new file mode 100644
index 0000000000..c841b81784
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc >
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/003.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml
new file mode 100644
index 0000000000..a9c5756933
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1="v1"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml.ref
new file mode 100644
index 0000000000..2d7bfdfd73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/004.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml
new file mode 100644
index 0000000000..b069efe727
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1 = "v1"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml.ref
new file mode 100644
index 0000000000..2d7bfdfd73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/005.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml
new file mode 100644
index 0000000000..39a346342f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1='v1'></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml.ref
new file mode 100644
index 0000000000..2d7bfdfd73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/006.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml
new file mode 100644
index 0000000000..cc3dc53166
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#32;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml.ref
new file mode 100644
index 0000000000..016a577ded
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/007.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch=" ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml
new file mode 100644
index 0000000000..b3370eb1cc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&amp;&lt;&gt;&quot;&apos;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml.ref
new file mode 100644
index 0000000000..2c879a43a9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/008.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="&<>\"'")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml
new file mode 100644
index 0000000000..0fa183eccf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#x20;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml.ref
new file mode 100644
index 0000000000..016a577ded
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/009.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch=" ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml
new file mode 100644
index 0000000000..eb64d18590
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1="v1" ></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml.ref
new file mode 100644
index 0000000000..2d7bfdfd73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/010.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml
new file mode 100644
index 0000000000..4cac44b4e4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED a2 CDATA #IMPLIED>
+]>
+<doc a1="v1" a2="v2"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml.ref
new file mode 100644
index 0000000000..9fc96fdb80
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/011.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="doc", aName="a2", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}, {localName="a2", qName="a2", uri="", type="CDATA", value="v2"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml
new file mode 100644
index 0000000000..6ce2a3eae2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc : CDATA #IMPLIED>
+]>
+<doc :="v1"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml.ref
new file mode 100644
index 0000000000..00c76deaf9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/012.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName=":", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="", qName=":", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml
new file mode 100644
index 0000000000..2f4aae4e28
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc _.-0123456789 CDATA #IMPLIED>
+]>
+<doc _.-0123456789="v1"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml.ref
new file mode 100644
index 0000000000..ef2903d87a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/013.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="_.-0123456789", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="_.-0123456789", qName="_.-0123456789", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml
new file mode 100644
index 0000000000..47f1f723e3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc abcdefghijklmnopqrstuvwxyz CDATA #IMPLIED>
+]>
+<doc abcdefghijklmnopqrstuvwxyz="v1"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml.ref
new file mode 100644
index 0000000000..bbf1ff75e7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/014.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="abcdefghijklmnopqrstuvwxyz", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="abcdefghijklmnopqrstuvwxyz", qName="abcdefghijklmnopqrstuvwxyz", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml
new file mode 100644
index 0000000000..861df8a610
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc ABCDEFGHIJKLMNOPQRSTUVWXYZ CDATA #IMPLIED>
+]>
+<doc ABCDEFGHIJKLMNOPQRSTUVWXYZ="v1"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml.ref
new file mode 100644
index 0000000000..882da5a6fd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/015.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="ABCDEFGHIJKLMNOPQRSTUVWXYZ", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="ABCDEFGHIJKLMNOPQRSTUVWXYZ", qName="ABCDEFGHIJKLMNOPQRSTUVWXYZ", uri="", type="CDATA", value="v1"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml
new file mode 100644
index 0000000000..66b1973c5d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><?pi?></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml.ref
new file mode 100644
index 0000000000..32c60b28a7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/016.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ processingInstruction(target="pi", data="")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml
new file mode 100644
index 0000000000..827ba963bf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><?pi some data ? > <??></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml.ref
new file mode 100644
index 0000000000..604d975e15
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/017.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ processingInstruction(target="pi", data="some data ? > <?")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml
new file mode 100644
index 0000000000..4570903fee
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><![CDATA[<foo>]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml.ref
new file mode 100644
index 0000000000..21117d22b4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/018.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startCDATA()
+ characters(ch="<foo>")
+ endCDATA()
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml
new file mode 100644
index 0000000000..3e6b74cbf2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><![CDATA[<&]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml.ref
new file mode 100644
index 0000000000..f95f625b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/019.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startCDATA()
+ characters(ch="<&")
+ endCDATA()
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml
new file mode 100644
index 0000000000..f749551a1b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><![CDATA[<&]>]]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml.ref
new file mode 100644
index 0000000000..ff6ff3683c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/020.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startCDATA()
+ characters(ch="<&]>]")
+ endCDATA()
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml
new file mode 100644
index 0000000000..13dda8c8a5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><!-- a comment --></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml.ref
new file mode 100644
index 0000000000..52bf68a717
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/021.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ comment(ch=" a comment ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml
new file mode 100644
index 0000000000..41d300e950
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><!-- a comment ->--></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml.ref
new file mode 100644
index 0000000000..b299ce71ee
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/022.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ comment(ch=" a comment ->")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml
new file mode 100644
index 0000000000..3837b831ad
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml.ref
new file mode 100644
index 0000000000..b59c216593
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/023.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml
new file mode 100644
index 0000000000..b0655c634c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (foo)>
+<!ELEMENT foo (#PCDATA)>
+<!ENTITY e "&#60;foo></foo>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml.ref
new file mode 100644
index 0000000000..00f7fce160
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/024.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<foo></foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml
new file mode 100644
index 0000000000..ed01f36d89
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (foo*)>
+<!ELEMENT foo (#PCDATA)>
+]>
+<doc><foo/><foo></foo></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml.ref
new file mode 100644
index 0000000000..6a7605c082
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/025.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml
new file mode 100644
index 0000000000..1ba033c1a7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (foo*)>
+<!ELEMENT foo EMPTY>
+]>
+<doc><foo/><foo></foo></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml.ref
new file mode 100644
index 0000000000..6a7605c082
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/026.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml
new file mode 100644
index 0000000000..ee02439051
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (foo*)>
+<!ELEMENT foo ANY>
+]>
+<doc><foo/><foo></foo></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml.ref
new file mode 100644
index 0000000000..6a7605c082
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/027.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml
new file mode 100644
index 0000000000..3d95747913
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml.ref
new file mode 100644
index 0000000000..dcda37de1e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/028.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml
new file mode 100644
index 0000000000..909f6ff712
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml.ref
new file mode 100644
index 0000000000..dcda37de1e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/029.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml
new file mode 100644
index 0000000000..3a7ddaa716
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml
@@ -0,0 +1,5 @@
+<?xml version = "1.0"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml.ref
new file mode 100644
index 0000000000..dcda37de1e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/030.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml
new file mode 100644
index 0000000000..a58e05867f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml.ref
new file mode 100644
index 0000000000..7d81068e24
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/031.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='UTF-8'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml
new file mode 100644
index 0000000000..be55c8d721
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0' standalone='yes'?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml.ref
new file mode 100644
index 0000000000..96d8f1014d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/032.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' standalone='yes'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml
new file mode 100644
index 0000000000..a3f9053868
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding="UTF-8" standalone='yes'?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml.ref
new file mode 100644
index 0000000000..d56d96d584
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/033.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='UTF-8' standalone='yes'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml
new file mode 100644
index 0000000000..7d52f31c0e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc/>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/034.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml
new file mode 100644
index 0000000000..f109a8b782
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc />
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/035.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml
new file mode 100644
index 0000000000..8ab2b3fb16
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
+<?pi data?>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml.ref
new file mode 100644
index 0000000000..db2cbb1e8d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/036.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ processingInstruction(target="pi", data="data")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml
new file mode 100644
index 0000000000..f9b2113940
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
+<!-- comment -->
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml.ref
new file mode 100644
index 0000000000..12d6a77cad
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/037.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+ comment(ch=" comment ")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml
new file mode 100644
index 0000000000..d14f41bfe2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml
@@ -0,0 +1,6 @@
+<!-- comment -->
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml.ref
new file mode 100644
index 0000000000..d24c10b495
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/038.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ comment(ch=" comment ")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml
new file mode 100644
index 0000000000..0897316e46
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml
@@ -0,0 +1,5 @@
+<?pi data?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml.ref
new file mode 100644
index 0000000000..9eb38b42bb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/039.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="pi", data="data")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml
new file mode 100644
index 0000000000..12c419b65b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1="&quot;&lt;&amp;&gt;&apos;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml.ref
new file mode 100644
index 0000000000..81409bdc13
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/040.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="\"<&>'"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml
new file mode 100644
index 0000000000..a59f536277
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+]>
+<doc a1="&#65;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml.ref
new file mode 100644
index 0000000000..13f83dffcf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/041.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="A"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml
new file mode 100644
index 0000000000..5d7c650944
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#00000000000000000000000000000000065;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml.ref
new file mode 100644
index 0000000000..ed02b8c709
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/042.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="A")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml
new file mode 100644
index 0000000000..a8095dfe28
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ATTLIST doc a1 CDATA #IMPLIED>
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc a1="foo
+bar"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml.ref
new file mode 100644
index 0000000000..3f898a182a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/043.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="foo\r\nbar"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml
new file mode 100644
index 0000000000..bee1d23e1a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (e*)>
+<!ELEMENT e EMPTY>
+<!ATTLIST e a1 CDATA "v1" a2 CDATA "v2" a3 CDATA #IMPLIED>
+]>
+<doc>
+<e a3="v3"/>
+<e a1="w1"/>
+<e a2="w2" a3="v3"/>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml.ref
new file mode 100644
index 0000000000..daab693b31
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/044.xml.ref
@@ -0,0 +1,20 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="e", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="e", aName="a2", type="", valueDefault="", value="")
+ attributeDecl(eName="e", aName="a3", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[{localName="a3", qName="a3", uri="", type="CDATA", value="v3"}])
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="w1"}])
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[{localName="a2", qName="a2", uri="", type="CDATA", value="w2"}, {localName="a3", qName="a3", uri="", type="CDATA", value="v3"}])
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml
new file mode 100644
index 0000000000..e2567f532d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
+<!ATTLIST doc a1 CDATA "z1">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml.ref
new file mode 100644
index 0000000000..566221ae0d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/045.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml
new file mode 100644
index 0000000000..c50a2846f9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "v1">
+<!ATTLIST doc a2 CDATA "v2">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml.ref
new file mode 100644
index 0000000000..7b1a28d90c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/046.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="doc", aName="a2", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml
new file mode 100644
index 0000000000..a4c688cf1a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>X
+Y</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml.ref
new file mode 100644
index 0000000000..3af5bf2d74
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/047.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="X\r\nY")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml
new file mode 100644
index 0000000000..c6b2dedbba
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>]</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml.ref
new file mode 100644
index 0000000000..0e8482350f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/048.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="]")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml
new file mode 100644
index 0000000000..c3cc797b59
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml.ref
new file mode 100644
index 0000000000..72897d1943
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/049.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="£")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml
new file mode 100644
index 0000000000..12303b1af2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml.ref
new file mode 100644
index 0000000000..8f39355258
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/050.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="เจมส์")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml
new file mode 100644
index 0000000000..7ae8f6c73a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml.ref
new file mode 100644
index 0000000000..71a89a922c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/051.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="เจมส์", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="เจมส์", qName="เจมส์", atts=[])
+ endElement(namespaceURI="", localName="เจมส์", qName="เจมส์")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml
new file mode 100644
index 0000000000..3f33a4c760
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>𐀀􏿽</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml.ref
new file mode 100644
index 0000000000..0b806c96a8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/052.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="𐀀􏿽")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml
new file mode 100644
index 0000000000..0d88f28718
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e "<e/>">
+<!ELEMENT doc (e)>
+<!ELEMENT e EMPTY>
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml.ref
new file mode 100644
index 0000000000..2aa90a79d0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/053.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<e/>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="e", qName="e", atts=[])
+ endElement(namespaceURI="", localName="e", qName="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml
new file mode 100644
index 0000000000..5d1c88b946
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+
+
+<doc
+></doc
+>
+
+
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/054.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml
new file mode 100644
index 0000000000..da0292c5bc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<?pi data?>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml.ref
new file mode 100644
index 0000000000..dc3312be38
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/055.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ processingInstruction(target="pi", data="data")
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml
new file mode 100644
index 0000000000..144871b2a3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#x0000000000000000000000000000000000000041;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml.ref
new file mode 100644
index 0000000000..ed02b8c709
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/056.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="A")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml
new file mode 100644
index 0000000000..c1ac849ed1
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a*)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/057.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml
new file mode 100644
index 0000000000..2ff23b233f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ATTLIST doc a1 NMTOKENS #IMPLIED>
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc a1=" 1 2 "></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml.ref
new file mode 100644
index 0000000000..0acf5f4acd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/058.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value=" 1 \t2 \t"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml
new file mode 100644
index 0000000000..2171480ecf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (e*)>
+<!ELEMENT e EMPTY>
+<!ATTLIST e a1 CDATA #IMPLIED a2 CDATA #IMPLIED a3 CDATA #IMPLIED>
+]>
+<doc>
+<e a1="v1" a2="v2" a3="v3"/>
+<e a1="w1" a2="v2"/>
+<e a1="v1" a2="w2" a3="v3"/>
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml.ref
new file mode 100644
index 0000000000..8a73895f0d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/059.xml.ref
@@ -0,0 +1,20 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="e", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="e", aName="a2", type="", valueDefault="", value="")
+ attributeDecl(eName="e", aName="a3", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}, {localName="a2", qName="a2", uri="", type="CDATA", value="v2"}, {localName="a3", qName="a3", uri="", type="CDATA", value="v3"}])
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="w1"}, {localName="a2", qName="a2", uri="", type="CDATA", value="v2"}])
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="e", qName="e", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="v1"}, {localName="a2", qName="a2", uri="", type="CDATA", value="w2"}, {localName="a3", qName="a3", uri="", type="CDATA", value="v3"}])
+ endElement(namespaceURI="", localName="e", qName="e")
+ characters(ch="\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml
new file mode 100644
index 0000000000..6cd6b4386b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>X&#10;Y</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml.ref
new file mode 100644
index 0000000000..ea1cbd40c0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/060.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="X\nY")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml
new file mode 100644
index 0000000000..bbdc152492
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#163;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml.ref
new file mode 100644
index 0000000000..72897d1943
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/061.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="£")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml
new file mode 100644
index 0000000000..f4ba53090a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#xe40;&#xe08;&#xe21;ส์</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml.ref
new file mode 100644
index 0000000000..8f39355258
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/062.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="เจมส์")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml
new file mode 100644
index 0000000000..9668f2da73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE เจมส์ [
+<!ELEMENT เจมส์ (#PCDATA)>
+]>
+<เจมส์></เจมส์>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml.ref
new file mode 100644
index 0000000000..71a89a922c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/063.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="เจมส์", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="เจมส์", qName="เจมส์", atts=[])
+ endElement(namespaceURI="", localName="เจมส์", qName="เจมส์")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml
new file mode 100644
index 0000000000..74a97aa431
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#x10000;&#x10FFFD;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml.ref
new file mode 100644
index 0000000000..579aeb52f6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/064.xml.ref
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml
new file mode 100644
index 0000000000..f708f2bc17
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#60;">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml.ref
new file mode 100644
index 0000000000..ba31414499
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/065.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml
new file mode 100644
index 0000000000..a27340b9a7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA #IMPLIED>
+<!-- 34 is double quote -->
+<!ENTITY e1 "&#34;">
+]>
+<doc a1="&e1;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml.ref
new file mode 100644
index 0000000000..d650af13d3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/066.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ comment(ch=" 34 is double quote ")
+ internatlEntityDecl(name="e1", value="\"")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="\""}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml
new file mode 100644
index 0000000000..a0ccf772a5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#13;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml.ref
new file mode 100644
index 0000000000..9a2358d700
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/067.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml
new file mode 100644
index 0000000000..8ed806b9a3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "&#13;">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml.ref
new file mode 100644
index 0000000000..8ebf150e48
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/068.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="\r")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml
new file mode 100644
index 0000000000..2437f60530
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!NOTATION n PUBLIC "whatever">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml.ref
new file mode 100644
index 0000000000..c5685c6d7a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/069.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ notationDecl(name="n", publicId="whatever", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml
new file mode 100644
index 0000000000..eef097df76
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % e "<!ELEMENT doc (#PCDATA)>">
+%e;
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml.ref
new file mode 100644
index 0000000000..2525ef6ae3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/070.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="<!ELEMENT doc (#PCDATA)>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml
new file mode 100644
index 0000000000..ebfba230a4
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a ID #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/071.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml
new file mode 100644
index 0000000000..6ef39dc49e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a IDREF #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/072.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml
new file mode 100644
index 0000000000..217476d9a9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a IDREFS #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/073.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml
new file mode 100644
index 0000000000..8b2354ff73
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a ENTITY #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/074.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml
new file mode 100644
index 0000000000..33c012441a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a ENTITIES #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/075.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml
new file mode 100644
index 0000000000..65b731cf6d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a NOTATION (n1|n2) #IMPLIED>
+<!NOTATION n1 SYSTEM "http://www.w3.org/">
+<!NOTATION n2 SYSTEM "http://www.w3.org/">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml.ref
new file mode 100644
index 0000000000..3145f641b2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/076.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ notationDecl(name="n1", publicId="", systemId="http://www.w3.org/")
+ notationDecl(name="n2", publicId="", systemId="http://www.w3.org/")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml
new file mode 100644
index 0000000000..e5f301eac8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a (1|2) #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/077.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml
new file mode 100644
index 0000000000..b31f40f94e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #REQUIRED>
+]>
+<doc a="v"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml.ref
new file mode 100644
index 0000000000..6b4e3c4f31
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/078.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="v"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml
new file mode 100644
index 0000000000..a3290d6cbb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #FIXED "v">
+]>
+<doc a="v"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml.ref
new file mode 100644
index 0000000000..6b4e3c4f31
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/079.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="v"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml
new file mode 100644
index 0000000000..3208fa9aa5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #FIXED "v">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml.ref
new file mode 100644
index 0000000000..0b8e512b33
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/080.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml
new file mode 100644
index 0000000000..51ee1a375c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a, b, c)>
+<!ELEMENT a (a?)>
+<!ELEMENT b (b*)>
+<!ELEMENT c (a | b)+>
+]>
+<doc><a/><b/><c><a/></c></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml.ref
new file mode 100644
index 0000000000..1bc73000f8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/081.xml.ref
@@ -0,0 +1,15 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ startElement(namespaceURI="", localName="b", qName="b", atts=[])
+ endElement(namespaceURI="", localName="b", qName="b")
+ startElement(namespaceURI="", localName="c", qName="c", atts=[])
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ endElement(namespaceURI="", localName="c", qName="c")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml
new file mode 100644
index 0000000000..d5245ac51a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % e SYSTEM "e.dtd">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml.ref
new file mode 100644
index 0000000000..a333feb826
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/082.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%e", publicId="", systemId="e.dtd")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml
new file mode 100644
index 0000000000..937cfc0bdd
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY % e PUBLIC 'whatever' "e.dtd">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml.ref
new file mode 100644
index 0000000000..d52b5aa8b9
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/083.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%e", publicId="whatever", systemId="e.dtd")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml
new file mode 100644
index 0000000000..82760767aa
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml
@@ -0,0 +1 @@
+<!DOCTYPE doc [<!ELEMENT doc (#PCDATA)>]><doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml.ref
new file mode 100644
index 0000000000..37b53fc0b3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/084.xml.ref
@@ -0,0 +1,7 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml
new file mode 100644
index 0000000000..cf5834f2a5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e "<foo>">
+<!ENTITY e "">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml.ref
new file mode 100644
index 0000000000..8f9cdcc6d0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/085.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="<foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ skippedEntity(name="e")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml
new file mode 100644
index 0000000000..bbc3080db6
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "">
+<!ENTITY e "<foo>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml.ref
new file mode 100644
index 0000000000..b59c216593
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/086.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml
new file mode 100644
index 0000000000..34797a67d7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY e "<foo/&#62;">
+<!ELEMENT doc (foo)>
+<!ELEMENT foo EMPTY>
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml.ref
new file mode 100644
index 0000000000..33d23092ef
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/087.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<foo/>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="foo", qName="foo", atts=[])
+ endElement(namespaceURI="", localName="foo", qName="foo")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml
new file mode 100644
index 0000000000..f97d96848d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "&lt;foo>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml.ref
new file mode 100644
index 0000000000..db24f3408f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/088.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="&lt;foo>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="<foo>")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml
new file mode 100644
index 0000000000..2d80c8f3fb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#x10000;&#x10FFFD;&#x10FFFF;">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak
new file mode 100644
index 0000000000..2d80c8f3fb
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e "&#x10000;&#x10FFFD;&#x10FFFF;">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.ref
new file mode 100644
index 0000000000..7c68c32286
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.ref
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml
new file mode 100644
index 0000000000..c392c96084
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ATTLIST e a NOTATION (n) #IMPLIED>
+<!ELEMENT doc (e)*>
+<!ELEMENT e (#PCDATA)>
+<!NOTATION n PUBLIC "whatever">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml.ref
new file mode 100644
index 0000000000..1cc0f1e082
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/090.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="e", aName="a", type="", valueDefault="", value="")
+ notationDecl(name="n", publicId="whatever", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml
new file mode 100644
index 0000000000..7343d0f795
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!NOTATION n SYSTEM "http://www.w3.org/">
+<!ENTITY e SYSTEM "http://www.w3.org/" NDATA n>
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a ENTITY "e">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml.ref
new file mode 100644
index 0000000000..da92a9d906
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/091.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ notationDecl(name="n", publicId="", systemId="http://www.w3.org/")
+ unparsedEntityDecl(name="e", publicId="", systemId="http://www.w3.org/", notationName="n")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml
new file mode 100644
index 0000000000..627b74ecdf
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a)*>
+<!ELEMENT a EMPTY>
+]>
+<doc>
+<a/>
+ <a/> <a/>
+
+
+</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml.ref
new file mode 100644
index 0000000000..3b9e06dc9e
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/092.xml.ref
@@ -0,0 +1,17 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\r\n ")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\t")
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ characters(ch="\r\n\r\n\r\n")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml
new file mode 100644
index 0000000000..968acb628f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>
+ </doc> \ No newline at end of file
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml.ref
new file mode 100644
index 0000000000..2e8bee6814
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/093.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="\r\n\r\r")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml
new file mode 100644
index 0000000000..5726e7db6f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ENTITY % e "foo">
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a1 CDATA "%e;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml.ref
new file mode 100644
index 0000000000..4f42980c0b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/094.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="%e", value="foo")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml
new file mode 100644
index 0000000000..1fe69596da
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ATTLIST doc a1 CDATA #IMPLIED>
+<!ATTLIST doc a1 NMTOKENS #IMPLIED>
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc a1="1 2"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml.ref
new file mode 100644
index 0000000000..567feee5ad
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/095.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a1", qName="a1", uri="", type="CDATA", value="1 2"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml
new file mode 100644
index 0000000000..a6f8f43620
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ATTLIST doc a1 NMTOKENS " 1 2 ">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml.ref
new file mode 100644
index 0000000000..1e3200f48c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/096.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.ent
new file mode 100644
index 0000000000..e06554ace2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.ent
@@ -0,0 +1 @@
+<!ATTLIST doc a2 CDATA #IMPLIED>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml
new file mode 100644
index 0000000000..c606afa97f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY % e SYSTEM "097.ent">
+<!ATTLIST doc a1 CDATA "v1">
+%e;
+<!ATTLIST doc a2 CDATA "v2">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml.ref
new file mode 100644
index 0000000000..b211a094ed
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/097.xml.ref
@@ -0,0 +1,12 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="%e", publicId="", systemId="097.ent")
+ attributeDecl(eName="doc", aName="a1", type="", valueDefault="", value="")
+ resolveEntity(publicId="", systemId="097.ent", ret={})
+ skippedEntity(name="%e")
+ attributeDecl(eName="doc", aName="a2", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml
new file mode 100644
index 0000000000..33a64ce5ae
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><?pi x
+y?></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml.ref
new file mode 100644
index 0000000000..5108be0763
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/098.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ processingInstruction(target="pi", data="x\r\ny")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml
new file mode 100644
index 0000000000..1b7214a137
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml.ref
new file mode 100644
index 0000000000..21cd9bced2
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/099.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ processingInstruction(target="xml", data="version='1.0' encoding='utf-8'")
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml
new file mode 100644
index 0000000000..5b839e76bc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ENTITY e PUBLIC ";!*#@$_%" "100.xml">
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml.ref
new file mode 100644
index 0000000000..aaeec27038
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/100.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ externalEntityDecl(name="e", publicId=";!*#@$_%", systemId="100.xml")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml
new file mode 100644
index 0000000000..f464484bf5
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "&#34;">
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml.ref
new file mode 100644
index 0000000000..5b7646c82f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/101.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="\"")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml
new file mode 100644
index 0000000000..f239ff5fee
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="&#34;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml.ref
new file mode 100644
index 0000000000..75b25052de
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/102.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="\""}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml
new file mode 100644
index 0000000000..1dbbd5bb7c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>&#60;doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml.ref
new file mode 100644
index 0000000000..63526243dc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/103.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="<doc>")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml
new file mode 100644
index 0000000000..666f43de0f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="x y"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml.ref
new file mode 100644
index 0000000000..2bccd0e3c7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/104.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="x\ty"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml
new file mode 100644
index 0000000000..6b3af2b847
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="x&#9;y"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml.ref
new file mode 100644
index 0000000000..2bccd0e3c7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/105.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="x\ty"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml
new file mode 100644
index 0000000000..8757c0a5ae
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="x&#10;y"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml.ref
new file mode 100644
index 0000000000..1e9cc0949b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/106.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="x\ny"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml
new file mode 100644
index 0000000000..3d2c2566a7
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="x&#13;y"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml.ref
new file mode 100644
index 0000000000..803dbc297b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/107.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="x\ry"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml
new file mode 100644
index 0000000000..e919bf229a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "
+">
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="x&e;y"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml.ref
new file mode 100644
index 0000000000..2199bd8fb3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/108.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="\r\n")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="x\r\ny"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml
new file mode 100644
index 0000000000..33fa38e13b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a=""></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml.ref
new file mode 100644
index 0000000000..789cb33821
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/109.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value=""}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml
new file mode 100644
index 0000000000..0c61c65119
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "&#13;&#10;">
+<!ATTLIST doc a CDATA #IMPLIED>
+]>
+<doc a="x&e;y"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml.ref
new file mode 100644
index 0000000000..2199bd8fb3
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/110.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="\r\n")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value="x\r\ny"}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml
new file mode 100644
index 0000000000..cb56f264b0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST doc a NMTOKENS #IMPLIED>
+]>
+<doc a="&#32;x&#32;&#32;y&#32;"></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml.ref
new file mode 100644
index 0000000000..152e284e58
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/111.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="doc", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[{localName="a", qName="a", uri="", type="CDATA", value=" x y "}])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml
new file mode 100644
index 0000000000..27b6a4c793
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (a | b)>
+<!ELEMENT a (#PCDATA)>
+]>
+<doc><a></a></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml.ref
new file mode 100644
index 0000000000..f82c6dca3f
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/112.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startElement(namespaceURI="", localName="a", qName="a", atts=[])
+ endElement(namespaceURI="", localName="a", qName="a")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml
new file mode 100644
index 0000000000..d2edd0f01d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ATTLIST e a CDATA #IMPLIED>
+]>
+<doc></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml.ref
new file mode 100644
index 0000000000..6342ccc536
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/113.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ attributeDecl(eName="e", aName="a", type="", valueDefault="", value="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml
new file mode 100644
index 0000000000..52e207096d
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e "<![CDATA[&foo;]]>">
+]>
+<doc>&e;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml.ref
new file mode 100644
index 0000000000..b11750e4b0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/114.xml.ref
@@ -0,0 +1,11 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e", value="<![CDATA[&foo;]]>")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startCDATA()
+ characters(ch="&foo;")
+ endCDATA()
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml
new file mode 100644
index 0000000000..d939a67010
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY e1 "&e2;">
+<!ENTITY e2 "v">
+]>
+<doc>&e1;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml.ref
new file mode 100644
index 0000000000..5b09ebd425
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/115.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="e1", value="&e2;")
+ internatlEntityDecl(name="e2", value="v")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="v")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml
new file mode 100644
index 0000000000..55ab49620b
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc><![CDATA[
+]]></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml.ref
new file mode 100644
index 0000000000..9bdec9e5cc
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/116.xml.ref
@@ -0,0 +1,10 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ startCDATA()
+ characters(ch="\r\n")
+ endCDATA()
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml
new file mode 100644
index 0000000000..e4f02b14c8
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY rsqb "]">
+]>
+<doc>&rsqb;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml.ref
new file mode 100644
index 0000000000..78dd11416a
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/117.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="rsqb", value="]")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="]")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml
new file mode 100644
index 0000000000..fba6c44668
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+<!ENTITY rsqb "]]">
+]>
+<doc>&rsqb;</doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml.ref
new file mode 100644
index 0000000000..c84da55fe0
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/118.xml.ref
@@ -0,0 +1,9 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ internatlEntityDecl(name="rsqb", value="]]")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ characters(ch="]]")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml
new file mode 100644
index 0000000000..876e74730c
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc ANY>
+]>
+<doc><!-- -á --></doc>
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml.ref b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml.ref
new file mode 100644
index 0000000000..d1c643ee03
--- /dev/null
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/119.xml.ref
@@ -0,0 +1,8 @@
+setDocumentLocator(locator={columnNumber=1, lineNumber=1})
+startDocument()
+ startDTD(name="doc", publicId="", systemId="")
+ endDTD()
+ startElement(namespaceURI="", localName="doc", qName="doc", atts=[])
+ comment(ch=" -á ")
+ endElement(namespaceURI="", localName="doc", qName="doc")
+endDocument()
diff --git a/tests/auto/xml/sax/sax.pro b/tests/auto/xml/sax/sax.pro
new file mode 100644
index 0000000000..13aeb21d07
--- /dev/null
+++ b/tests/auto/xml/sax/sax.pro
@@ -0,0 +1,6 @@
+TEMPLATE=subdirs
+SUBDIRS=\
+ qxmlinputsource \
+ qxml \
+ qxmlsimplereader \
+
diff --git a/tests/auto/xml/xml.pro b/tests/auto/xml/xml.pro
new file mode 100644
index 0000000000..4b90ffbe13
--- /dev/null
+++ b/tests/auto/xml/xml.pro
@@ -0,0 +1,5 @@
+TEMPLATE=subdirs
+SUBDIRS=\
+ dom \
+ sax \
+