]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://github.com/dharmatech/factor
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 22 Jan 2009 22:24:04 +0000 (16:24 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 22 Jan 2009 22:24:04 +0000 (16:24 -0600)
696 files changed:
basis/alien/c-types/c-types-tests.factor
basis/alien/syntax/syntax.factor
basis/furnace/utilities/utilities.factor
basis/heaps/heaps-tests.factor
basis/http/client/client.factor
basis/http/http-tests.factor
basis/http/http.factor [changed mode: 0644->0755]
basis/http/server/cgi/cgi.factor
basis/http/server/server.factor [changed mode: 0644->0755]
basis/io/streams/limited/limited-docs.factor [new file with mode: 0755]
basis/io/streams/limited/limited-tests.factor
basis/io/streams/limited/limited.factor [changed mode: 0644->0755]
basis/mime/multipart/multipart-tests.factor
basis/mime/multipart/multipart.factor [changed mode: 0644->0755]
basis/multiline/multiline-tests.factor
basis/multiline/multiline.factor
basis/refs/refs-docs.factor
basis/regexp/nfa/nfa.factor
basis/regexp/regexp-tests.factor
basis/state-parser/authors.txt [deleted file]
basis/state-parser/state-parser-docs.factor [deleted file]
basis/state-parser/state-parser-tests.factor [deleted file]
basis/state-parser/state-parser.factor [deleted file]
basis/state-parser/summary.txt [deleted file]
basis/unicode/case/case.factor
basis/validators/validators.factor
basis/xml/autoencoding/authors.txt [new file with mode: 0644]
basis/xml/autoencoding/autoencoding.factor [new file with mode: 0644]
basis/xml/char-classes/char-classes.factor
basis/xml/data/data-docs.factor [new file with mode: 0644]
basis/xml/data/data.factor
basis/xml/dtd/authors.txt [new file with mode: 0644]
basis/xml/dtd/dtd.factor [new file with mode: 0644]
basis/xml/elements/authors.txt [new file with mode: 0644]
basis/xml/elements/elements.factor [new file with mode: 0644]
basis/xml/entities/entities-docs.factor [new file with mode: 0644]
basis/xml/entities/html/html-docs.factor [new file with mode: 0644]
basis/xml/entities/html/html.factor
basis/xml/errors/errors-docs.factor [new file with mode: 0644]
basis/xml/errors/errors-tests.factor
basis/xml/errors/errors.factor
basis/xml/interpolate/authors.txt [new file with mode: 0644]
basis/xml/interpolate/interpolate-tests.factor [new file with mode: 0644]
basis/xml/interpolate/interpolate.factor [new file with mode: 0644]
basis/xml/name/name.factor [new file with mode: 0644]
basis/xml/state/authors.txt [new file with mode: 0644]
basis/xml/state/state.factor [new file with mode: 0644]
basis/xml/tests/soap.xml
basis/xml/tests/state-parser-tests.factor [new file with mode: 0644]
basis/xml/tests/test.factor
basis/xml/tests/xmltest.factor [new file with mode: 0644]
basis/xml/tests/xmltest/canonxml.html [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/002.ent [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/005.ent [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/006.ent [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/invalid/not-sa/022.ent [new file with mode: 0644]
basis/xml/tests/xmltest/invalid/not-sa/022.xml [new file with mode: 0644]
basis/xml/tests/xmltest/invalid/not-sa/out/022.xml [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/ext-sa/001.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/ext-sa/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/ext-sa/002.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/ext-sa/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/ext-sa/003.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/ext-sa/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/001.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/003.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/004.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/005.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/006.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/007.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/008.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/not-sa/009.ent [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/not-sa/009.xml [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/not-sa/010.ent [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/not-sa/010.xml [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/not-sa/011.ent [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/not-sa/011.xml [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/sa/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/015.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/016.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/017.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/018.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/019.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/020.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/021.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/022.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/023.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/024.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/025.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/026.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/027.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/028.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/029.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/030.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/031.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/032.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/033.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/034.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/035.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/036.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/037.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/038.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/039.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/040.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/041.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/042.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/043.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/044.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/045.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/046.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/047.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/048.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/049.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/050.xml [new file with mode: 0644]
basis/xml/tests/xmltest/not-wf/sa/051.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/052.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/053.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/054.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/055.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/056.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/057.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/058.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/059.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/060.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/061.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/062.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/063.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/064.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/065.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/066.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/067.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/068.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/069.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/070.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/071.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/072.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/073.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/074.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/075.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/076.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/077.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/078.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/079.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/080.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/081.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/082.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/083.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/084.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/085.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/086.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/087.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/088.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/089.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/090.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/091.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/092.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/093.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/094.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/095.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/096.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/097.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/098.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/099.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/100.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/101.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/102.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/103.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/104.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/105.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/106.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/107.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/108.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/109.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/110.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/111.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/112.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/113.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/114.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/115.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/116.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/117.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/118.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/119.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/120.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/121.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/122.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/123.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/124.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/125.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/126.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/127.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/128.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/129.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/130.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/131.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/132.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/133.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/134.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/135.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/136.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/137.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/138.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/139.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/140.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/141.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/142.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/143.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/144.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/145.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/146.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/147.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/148.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/149.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/150.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/151.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/152.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/153.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/154.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/155.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/156.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/157.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/158.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/159.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/160.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/161.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/162.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/163.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/164.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/165.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/166.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/167.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/168.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/169.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/170.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/171.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/172.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/173.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/174.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/175.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/176.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/177.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/178.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/179.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/180.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/181.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/182.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/183.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/184.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/185.ent [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/185.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/186.xml [new file with mode: 0755]
basis/xml/tests/xmltest/not-wf/sa/null.ent [new file with mode: 0644]
basis/xml/tests/xmltest/readme.html [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/001.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/002.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/003.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/004.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/005.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/006.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/007.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/008.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/009.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/010.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/011.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/012.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/013.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/014.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/ext-sa/out/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/001.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/002.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/003-1.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/003-2.ent [new file with mode: 0644]
basis/xml/tests/xmltest/valid/not-sa/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/004-1.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/004-2.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/005-1.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/005-2.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/006.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/007.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/008.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/009.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/010.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/011.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/012.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/013.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/014.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/015.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/015.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/016.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/016.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/017.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/017.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/018.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/018.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/019.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/019.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/020.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/020.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/021.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/021.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/023.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/023.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/024.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/024.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/025.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/025.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/026.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/026.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/027.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/027.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/028.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/028.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/029.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/029.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/030.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/030.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/031-1.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/031-2.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/031.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/015.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/016.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/017.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/018.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/019.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/020.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/021.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/022.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/023.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/024.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/025.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/026.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/027.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/028.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/029.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/030.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/not-sa/out/031.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/015.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/016.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/017.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/018.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/019.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/020.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/021.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/022.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/023.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/024.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/025.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/026.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/027.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/028.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/029.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/030.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/031.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/032.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/033.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/034.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/035.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/036.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/037.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/038.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/039.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/040.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/041.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/042.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/043.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/044.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/045.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/046.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/047.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/048.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/049.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/050.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/051.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/052.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/053.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/054.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/055.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/056.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/057.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/058.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/059.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/060.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/061.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/062.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/063.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/064.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/065.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/066.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/067.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/068.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/069.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/070.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/071.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/072.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/073.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/074.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/075.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/076.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/077.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/078.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/079.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/080.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/081.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/082.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/083.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/084.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/085.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/086.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/087.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/088.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/089.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/090.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/091.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/092.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/093.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/094.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/095.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/096.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/097.ent [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/097.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/098.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/099.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/100.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/101.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/102.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/103.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/104.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/105.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/106.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/107.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/108.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/109.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/110.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/111.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/112.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/113.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/114.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/115.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/116.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/117.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/118.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/119.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/001.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/002.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/003.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/004.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/005.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/006.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/007.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/008.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/009.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/010.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/011.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/012.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/013.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/014.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/015.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/016.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/017.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/018.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/019.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/020.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/021.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/022.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/023.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/024.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/025.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/026.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/027.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/028.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/029.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/030.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/031.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/032.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/033.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/034.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/035.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/036.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/037.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/038.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/039.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/040.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/041.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/042.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/043.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/044.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/045.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/046.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/047.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/048.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/049.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/050.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/051.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/052.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/053.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/054.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/055.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/056.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/057.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/058.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/059.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/060.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/061.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/062.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/063.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/064.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/065.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/066.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/067.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/068.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/069.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/070.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/071.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/072.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/073.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/074.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/075.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/076.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/077.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/078.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/079.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/080.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/081.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/082.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/083.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/084.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/085.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/086.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/087.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/088.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/089.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/090.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/091.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/092.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/093.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/094.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/095.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/096.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/097.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/098.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/099.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/100.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/101.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/102.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/103.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/104.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/105.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/106.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/107.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/108.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/109.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/110.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/111.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/112.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/113.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/114.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/115.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/116.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/117.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/118.xml [new file with mode: 0755]
basis/xml/tests/xmltest/valid/sa/out/119.xml [new file with mode: 0755]
basis/xml/tests/xmltest/xmltest.xml [new file with mode: 0755]
basis/xml/tokenize/tokenize.factor
basis/xml/utilities/utilities-docs.factor [new file with mode: 0644]
basis/xml/writer/writer-docs.factor [new file with mode: 0644]
basis/xml/writer/writer-tests.factor
basis/xml/writer/writer.factor
basis/xml/xml-docs.factor
basis/xml/xml.factor
core/assocs/assocs-tests.factor
core/assocs/assocs.factor
core/classes/algebra/algebra.factor
core/sequences/sequences-docs.factor
core/slots/slots.factor
core/splitting/splitting.factor
extra/asn1/asn1-tests.factor
extra/asn1/asn1.factor
extra/fuel/fuel.factor
extra/fuel/help/help.factor
extra/fuel/remote/authors.txt [new file with mode: 0644]
extra/fuel/remote/remote.factor [new file with mode: 0644]
extra/fuel/xref/authors.txt [new file with mode: 0644]
extra/fuel/xref/xref.factor [new file with mode: 0644]
extra/html/parser/parser.factor
extra/html/parser/state/state-tests.factor [new file with mode: 0644]
extra/html/parser/state/state.factor [new file with mode: 0644]
extra/html/parser/utils/utils-tests.factor
extra/html/parser/utils/utils.factor
extra/tar/tar.factor
extra/webapps/imagebin/authors.txt [new file with mode: 0644]
extra/webapps/imagebin/imagebin.factor [new file with mode: 0755]
extra/webapps/imagebin/upload-image.xml [new file with mode: 0644]
extra/webapps/imagebin/uploaded-image.xml [new file with mode: 0644]
misc/fuel/README
misc/fuel/fu.el
misc/fuel/fuel-completion.el
misc/fuel/fuel-debug.el
misc/fuel/fuel-edit.el
misc/fuel/fuel-font-lock.el
misc/fuel/fuel-listener.el
misc/fuel/fuel-refactor.el
misc/fuel/fuel-syntax.el
misc/fuel/fuel-xref.el
vm/factor.c

index 31542b2699eb94224500aa3c5fe181e47d4f9fa0..40171f56e7917bda2b0916c6c1903f61672ca30d 100644 (file)
@@ -8,10 +8,6 @@ sequences system libc alien.strings io.encodings.utf8 ;
 
 [ { "blah" 123 } ] [ { "blah" xyz } expand-constants ] unit-test
 
-: foo ( -- n ) &: fdafd [ 123 ] unless* ;
-
-[ 123 ] [ foo ] unit-test
-
 [ -1 ] [ -1 <char> *char ] unit-test
 [ -1 ] [ -1 <short> *short ] unit-test
 [ -1 ] [ -1 <int> *int ] unit-test
index a02d2f3cb46e66de39a27d216d4da805e8800c26..bed454e81d1625aac2b335f83c9c1291904ef782 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors arrays alien alien.c-types alien.structs
 alien.arrays alien.strings kernel math namespaces parser
 sequences words quotations math.parser splitting grouping
 effects assocs combinators lexer strings.parser alien.parser 
-fry vocabs.parser ;
+fry vocabs.parser words.constant ;
 IN: alien.syntax
 
 : DLL" lexer get skip-blank parse-string dlopen parsed ; parsing
@@ -31,10 +31,11 @@ IN: alien.syntax
 
 : C-ENUM:
     ";" parse-tokens
-    dup length
-    [ [ create-in ] dip 1quotation define ] 2each ;
+    [ [ create-in ] dip define-constant ] each-index ;
     parsing
 
+: address-of ( name library -- value )
+    load-library dlsym [ "No such symbol" throw ] unless* ;
+
 : &:
-    scan "c-library" get
-    '[ _ _ load-library dlsym ] over push-all ; parsing
+    scan "c-library" get '[ _ _ address-of ] over push-all ; parsing
index 7f71a131eda164a1103ccc882516bc9380c5b2fe..f84519b9c189769a1d214004296aad3c2c0890d9 100644 (file)
@@ -96,11 +96,7 @@ M: object modify-form drop ;
     dup method>> {
         { "GET" [ url>> query>> ] }
         { "HEAD" [ url>> query>> ] }
-        { "POST" [
-            post-data>>
-            dup content-type>> "application/x-www-form-urlencoded" =
-            [ content>> ] [ drop f ] if
-        ] }
+        { "POST" [ post-data>> params>> ] }
     } case ;
 
 : referrer ( -- referrer/f )
index 8fa6a274e7e65aa4cae36b22eb1d111fbea3bda3..7e780cbe5ef674cf56b22a4aef1335d362306143 100644 (file)
@@ -32,10 +32,8 @@ IN: heaps.tests
 
 : random-alist ( n -- alist )
     [
-        [
-            32 random-bits dup number>string swap set
-        ] times
-    ] H{ } make-assoc ;
+        drop 32 random-bits dup number>string
+    ] H{ } map>assoc ;
 
 : test-heap-sort ( n -- ? )
     random-alist dup >alist sort-keys swap heap-sort = ;
index fc6e296a4f04694504a6e7c5cf3c0ac540d39b0e..f8106f4c83370fbf62dc32a2d2eb73f05e7b742d 100644 (file)
@@ -25,7 +25,7 @@ IN: http.client
     dup header>> >hashtable
     over url>> host>> [ over url>> url-host "host" pick set-at ] when
     over post-data>> [
-        [ raw>> length "content-length" pick set-at ]
+        [ data>> length "content-length" pick set-at ]
         [ content-type>> "content-type" pick set-at ]
         bi
     ] when*
@@ -34,21 +34,39 @@ IN: http.client
 
 GENERIC: >post-data ( object -- post-data )
 
+M: f >post-data ;
+
 M: post-data >post-data ;
 
-M: string >post-data utf8 encode "application/octet-stream" <post-data> ;
+M: string >post-data
+    utf8 encode
+    "application/octet-stream" <post-data>
+        swap >>data ;
 
-M: byte-array >post-data "application/octet-stream" <post-data> ;
+M: assoc >post-data
+    "application/x-www-form-urlencoded" <post-data>
+        swap >>params ;
 
-M: assoc >post-data assoc>query ascii encode "application/x-www-form-urlencoded" <post-data> ;
+M: object >post-data
+    "application/octet-stream" <post-data>
+        swap >>data ;
 
-M: f >post-data ;
+: normalize-post-data ( request -- request )
+    dup post-data>> [
+        dup params>> [
+            assoc>query ascii encode >>data
+        ] when* drop
+    ] when* ;
 
 : unparse-post-data ( request -- request )
-    [ >post-data ] change-post-data ;
+    [ >post-data ] change-post-data
+    normalize-post-data ;
 
 : write-post-data ( request -- request )
-    dup method>> [ "POST" = ] [ "PUT" = ] bi or [ dup post-data>> raw>> write ] when ; 
+    dup method>> { "POST" "PUT" } member?  [
+        dup post-data>> data>> dup sequence?
+        [ write ] [ output-stream get stream-copy ] if
+    ] when ; 
 
 : write-request ( request -- )
     unparse-post-data
index 92a296c2d3ef6f225a2bf88192cf9f1c2aec0df2..6fa23b4b1f8722fa37cde832050a18bdf5cff70f 100644 (file)
@@ -35,7 +35,7 @@ blah
         { method "POST" }
         { version "1.1" }
         { header H{ { "some-header" "1; 2" } { "content-length" "4" } { "content-type" "application/octet-stream" } } }
-        { post-data T{ post-data { content "blah" } { raw "blah" } { content-type "application/octet-stream" } } }
+        { post-data T{ post-data { data "blah" } { content-type "application/octet-stream" } } }
         { cookies V{ } }
     }
 ] [
old mode 100644 (file)
new mode 100755 (executable)
index 4702f88..c85cfc9
@@ -213,12 +213,11 @@ body ;
     raw-response new
         "1.1" >>version ;
 
-TUPLE: post-data raw content content-type ;
+TUPLE: post-data data params content-type content-encoding ;
 
-: <post-data> ( raw content-type -- post-data )
+: <post-data> ( content-type -- post-data )
     post-data new
-        swap >>content-type
-        swap >>raw ;
+        swap >>content-type ;
 
 : parse-content-type-attributes ( string -- attributes )
     " " split harvest [ "=" split1 [ >lower ] dip ] { } map>assoc ;
index 0c2f639cba947edbed08273bd309f70d00045c3b..959642b706fea44ac8a95b0d6e3ca6a29f06bea0 100644 (file)
@@ -34,7 +34,7 @@ IN: http.server.cgi
         request get "accept" header "HTTP_ACCEPT" set\r
 \r
         post-request? [\r
-            request get post-data>> raw>>\r
+            request get post-data>> data>>\r
             [ "CONTENT_TYPE" set ]\r
             [ length number>string "CONTENT_LENGTH" set ]\r
             bi\r
@@ -54,7 +54,7 @@ IN: http.server.cgi
     swap '[\r
         binary encode-output\r
         _ output-stream get swap <cgi-process> binary <process-stream> [\r
-            post-request? [ request get post-data>> raw>> write flush ] when\r
+            post-request? [ request get post-data>> data>> write flush ] when\r
             input-stream get swap (stream-copy)\r
         ] with-stream\r
     ] >>body ;\r
old mode 100644 (file)
new mode 100755 (executable)
index 697dec2..c328e1d
@@ -15,6 +15,8 @@ io.streams.limited
 io.servers.connection
 io.timeouts
 fry logging logging.insomniac calendar urls urls.encoding
+mime.multipart
+unicode.categories
 http
 http.parsers
 http.server.responses
@@ -36,17 +38,34 @@ IN: http.server
 : read-request-header ( request -- request )
     read-header >>header ;
 
-: parse-post-data ( post-data -- post-data )
-    [ ] [ raw>> ] [ content-type>> ] tri
-    "application/x-www-form-urlencoded" = [ query>assoc ] when
-    >>content ;
+ERROR: no-boundary ;
+
+: parse-multipart-form-data ( string -- separator )
+    ";" split1 nip
+    "=" split1 nip [ no-boundary ] unless* ;
+
+: read-multipart-data ( request -- form-variables uploaded-files )
+    [ "content-type" header ]
+    [ "content-length" header string>number ] bi
+    unlimit-input
+    stream-eofs limit-input
+    binary decode-input
+    parse-multipart-form-data parse-multipart ;
+
+: read-content ( request -- bytes )
+    "content-length" header string>number read ;
+
+: parse-content ( request content-type -- post-data )
+    [ <post-data> swap ] keep {
+        { "multipart/form-data" [ read-multipart-data assoc-union >>params ] }
+        { "application/x-www-form-urlencoded" [ read-content query>assoc >>params ] }
+        [ drop read-content >>data ]
+    } case ;
 
 : read-post-data ( request -- request )
     dup method>> "POST" = [
-        [ ]
-        [ "content-length" header string>number read ]
-        [ "content-type" header ] tri
-        <post-data> parse-post-data >>post-data
+        dup dup "content-type" header
+        ";" split1 drop parse-content >>post-data
     ] when ;
 
 : extract-host ( request -- request )
@@ -80,7 +99,7 @@ GENERIC: write-full-response ( request response -- )
     [ content-type>> "application/octet-stream" or ]
     [ content-charset>> encoding>name ]
     bi
-    [ "; charset=" swap 3append ] when* ;
+    [ "; charset=" glue ] when* ;
 
 : ensure-domain ( cookie -- cookie )
     [
@@ -236,7 +255,7 @@ TUPLE: http-server < threaded-server ;
 M: http-server handle-client*
     drop
     [
-        64 1024 * limit-input
+        64 1024 * stream-throws limit-input
         ?refresh-all
         [ read-request ] ?benchmark
         [ do-request ] ?benchmark
diff --git a/basis/io/streams/limited/limited-docs.factor b/basis/io/streams/limited/limited-docs.factor
new file mode 100755 (executable)
index 0000000..90f7860
--- /dev/null
@@ -0,0 +1,90 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax kernel math io ;
+IN: io.streams.limited
+
+HELP: <limited-stream>
+{ $values
+     { "stream" "an input stream" } { "limit" integer } { "mode" "a " { $link limited-stream } " mode singleton" }
+     { "stream'" "an input stream" }
+}
+{ $description "Constructs a new " { $link limited-stream } " from an existing stream. User code should use " { $link limit } " or " { $link limit-input } "." } ;
+
+HELP: limit
+{ $values
+     { "stream" "an input stream" } { "limit" integer } { "mode" "a " { $link limited-stream } " mode singleton" }
+     { "stream'" "a stream" }
+}
+{ $description "Changes a decoder's stream to be a limited stream, or wraps " { $snippet "stream" } " in a " { $link limited-stream } "." }
+{ $examples "Throwing an exception:"
+    { $example
+        "USING: continuations io io.streams.limited io.streams.string"
+        "kernel prettyprint ;"
+        "["
+        "    \"123456\" <string-reader> 3 stream-throws limit"
+        "    100 swap stream-read ."
+        "] [ ] recover ."
+        "T{ limit-exceeded }"
+    }
+    "Returning " { $link f } " on exhaustion:"
+    { $example
+        "USING: accessors continuations io io.streams.limited"
+        "io.streams.string kernel prettyprint ;"
+        "\"123456\" <string-reader> 3 stream-eofs limit"
+        "100 swap stream-read ."
+        "\"123\""
+    }
+} ;
+
+HELP: unlimit
+{ $values
+     { "stream" "an input stream" }
+     { "stream'" "a stream" }
+}
+{ $description "Returns the underlying stream of a limited stream." } ;
+
+HELP: limited-stream
+{ $values
+    { "value" "a limited-stream class" }
+}
+{ $description "Limited streams wrap other streams, changing their behavior to throw an exception or return " { $link f } " upon exhaustion." } ;
+
+HELP: limit-input
+{ $values
+     { "limit" integer } { "mode" "a " { $link limited-stream } " mode singleton" }
+}
+{ $description "Wraps the current " { $link input-stream } " in a " { $link limited-stream } "." } ;
+
+HELP: unlimit-input
+{ $description "Returns the underlying stream of the limited-stream stored in " { $link input-stream } "." } ;
+
+HELP: stream-eofs
+{ $values
+    { "value" "a " { $link limited-stream } " mode singleton" }
+}
+{ $description "If the " { $slot "mode" } " of a limited stream is set to this singleton, the stream will return " { $link f } " upon exhaustion." } ;
+
+HELP: stream-throws
+{ $values
+    { "value" "a " { $link limited-stream } " mode singleton" }
+}
+{ $description "If the " { $slot "mode" } " of a limited stream is set to this singleton, the stream will throw " { $link limit-exceeded } " upon exhaustion." } ;
+
+{ stream-eofs stream-throws } related-words
+
+ARTICLE: "io.streams.limited" "Limited input streams"
+"The " { $vocab-link "io.streams.limited" } " vocabulary wraps a stream to behave as if it had only a limited number of bytes, either throwing an error or returning " { $link f } " upon reaching the end." $nl
+"Wrap a stream in a limited stream:"
+{ $subsection limit }
+"Wrap the current " { $link input-stream } " in a limited stream:"
+{ $subsection limit-input }
+"Unlimits a limited stream:"
+{ $subsection unlimit }
+"Unlimits the current " { $link input-stream } ":"
+{ $subsection limit-input }
+"Make a limited stream throw an exception on exhaustion:"
+{ $subsection stream-throws }
+"Make a limited stream return " { $link f } " on exhaustion:"
+{ $subsection stream-eofs } ;
+
+ABOUT: "io.streams.limited"
index eb5b9212607a3fb8cac46d9dd3bea444c04f6fbd..c88d52be81e3959b094e177bcb4729a06714c498 100644 (file)
@@ -1,14 +1,14 @@
-IN: io.streams.limited.tests
 USING: io io.streams.limited io.encodings io.encodings.string
 io.encodings.ascii io.encodings.binary io.streams.byte-array
-namespaces tools.test strings kernel ;
+namespaces tools.test strings kernel io.streams.string accessors ;
+IN: io.streams.limited.tests
 
 [ ] [
     "hello world\nhow are you today\nthis is a very long line indeed"
     ascii encode binary <byte-reader> "data" set
 ] unit-test
 
-[ ] [ "data" get 24 <limited-stream> "limited" set ] unit-test
+[ ] [ "data" get 24 stream-throws <limited-stream> "limited" set ] unit-test
 
 [ CHAR: h ] [ "limited" get stream-read1 ] unit-test
 
@@ -25,7 +25,7 @@ namespaces tools.test strings kernel ;
     ascii encode binary <byte-reader> "data" set
 ] unit-test
 
-[ ] [ "data" get 7 <limited-stream> "limited" set ] unit-test
+[ ] [ "data" get 7 stream-throws <limited-stream> "limited" set ] unit-test
 
 [ "abc" CHAR: \n ] [ "\n" "limited" get stream-read-until [ >string ] dip ] unit-test
 
@@ -34,7 +34,28 @@ namespaces tools.test strings kernel ;
 [ "he" CHAR: l ] [
     B{ CHAR: h CHAR: e CHAR: l CHAR: l CHAR: o }
     ascii <byte-reader> [
-        5 limit-input
+        5 stream-throws limit-input
         "l" read-until
     ] with-input-stream
 ] unit-test
+
+[ CHAR: a ]
+[ "a" <string-reader> 1 stream-eofs <limited-stream> stream-read1 ] unit-test
+
+[ "abc" ]
+[
+    "abc" <string-reader> 3 stream-eofs <limited-stream>
+    4 swap stream-read
+] unit-test
+
+[ f ]
+[
+    "abc" <string-reader> 3 stream-eofs <limited-stream>
+    4 over stream-read drop 10 swap stream-read
+] unit-test
+
+[ t ]
+[
+    "abc" <string-reader> 3 stream-eofs limit unlimit
+    "abc" <string-reader> =
+] unit-test
old mode 100644 (file)
new mode 100755 (executable)
index ecc4992..71c6eb6
@@ -1,45 +1,80 @@
-! Copyright (C) 2008 Slava Pestov
+! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel math io io.encodings destructors accessors
-sequences namespaces byte-vectors ;
+sequences namespaces byte-vectors fry combinators ;
 IN: io.streams.limited
 
-TUPLE: limited-stream stream count limit ;
+TUPLE: limited-stream stream count limit mode ;
 
-: <limited-stream> ( stream limit -- stream' )
+SINGLETONS: stream-throws stream-eofs ;
+
+: <limited-stream> ( stream limit mode -- stream' )
     limited-stream new
+        swap >>mode
         swap >>limit
         swap >>stream
         0 >>count ;
 
-GENERIC# limit 1 ( stream limit -- stream' )
+GENERIC# limit 2 ( stream limit mode -- stream' )
+
+M: decoder limit ( stream limit mode -- stream' )
+    [ clone ] 2dip '[ _ _ limit ] change-stream ;
+
+M: object limit ( stream limit mode -- stream' )
+    <limited-stream> ;
 
-M: decoder limit [ clone ] dip [ limit ] curry change-stream ;
+: unlimit ( stream -- stream' )
+    [ stream>> ] change-stream ;
 
-M: object limit <limited-stream> ;
+: limit-input ( limit mode -- ) input-stream [ -rot limit ] change ;
 
-: limit-input ( limit -- ) input-stream [ swap limit ] change ;
+: unlimit-input ( -- ) input-stream [ unlimit ] change ;
 
 ERROR: limit-exceeded ;
 
-: check-limit ( n stream -- )
-    [ + ] change-count
-    [ count>> ] [ limit>> ] bi >=
-    [ limit-exceeded ] when ; inline
+ERROR: bad-stream-mode mode ;
+
+<PRIVATE
+
+: adjust-limit ( n stream -- n' stream )
+    2dup [ + ] change-count
+    [ count>> ] [ limit>> ] bi >
+    [
+        dup mode>> {
+            { stream-throws [ limit-exceeded ] }
+            { stream-eofs [ 
+                dup [ count>> ] [ limit>> ] bi -
+                '[ _ - ] dip
+            ] }
+            [ bad-stream-mode ]
+        } case
+    ] when ; inline
+
+: maybe-read ( n limited-stream quot: ( n stream -- seq/f ) -- seq/f )
+    [ adjust-limit ] dip
+    pick 0 <= [ 3drop f ] [ [ stream>> ] dip call ] if ; inline
+
+PRIVATE>
 
 M: limited-stream stream-read1
-    1 over check-limit stream>> stream-read1 ;
+    1 swap 
+    [ nip stream-read1 ] maybe-read ;
 
 M: limited-stream stream-read
-    2dup check-limit stream>> stream-read ;
+    [ stream-read ] maybe-read ;
 
 M: limited-stream stream-read-partial
-    2dup check-limit stream>> stream-read-partial ;
+    [ stream-read-partial ] maybe-read ;
+
+<PRIVATE
 
 : (read-until) ( stream seps buf -- stream seps buf sep/f )
     3dup [ [ stream-read1 dup ] dip memq? ] dip
     swap [ drop ] [ push (read-until) ] if ;
 
+PRIVATE>
+
 M: limited-stream stream-read-until
     swap BV{ } clone (read-until) [ 2nip B{ } like ] dip ;
 
index 1fb2530705de3b7930926c5a2ef2890346523c1f..e1bf0483bcff84cd44afec52cf6e51f035ff3577 100644 (file)
-USING: accessors checksums checksums.md5 io io.encodings.ascii
-io.encodings.binary io.files io.files.temp io.files.info
-io.streams.byte-array io.streams.string kernel make
-mime.multipart mime.multipart.private multiline sequences
-strings tools.test ;
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.ascii io.files io.files.unique kernel
+mime.multipart tools.test io.streams.duplex io multiline
+assocs ;
 IN: mime.multipart.tests
 
-[ { "a" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "z" <multipart-stream> 1 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "a" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "z" <multipart-stream> 2 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "a" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "z" <multipart-stream> 3 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "a" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "z" <multipart-stream> 4 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "a" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "z" <multipart-stream> 5 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-
-[ { "a" "a" } ] [
-    [
-        "aazzbzzczzdzz" <string-reader> "z" <multipart-stream> 1 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "aa" } ] [
-    [
-        "aazzbzzczzdzz" <string-reader> "z" <multipart-stream> 2 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "aa" } ] [
-    [
-        "aazzbzzczzdzz" <string-reader> "z" <multipart-stream> 3 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "aa" } ] [
-    [
-        "aazzbzzczzdzz" <string-reader> "z" <multipart-stream> 4 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "aa" } ] [
-    [
-        "aazzbzzczzdzz" <string-reader> "z" <multipart-stream> 5 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-
-
-[ { "a" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "zz" <multipart-stream> 1 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
+: upload-separator ( -- seq )
+   "----WebKitFormBoundary6odjpVPXIighAE2L" ;
 
-[ { "a" "z" "z" "b" "z" "z" "c" "z" "z" "d" "zz" } ] [
-    [
-        "azzbzzczzdzz" <string-reader> "zzz" <multipart-stream> 1 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
+: upload ( -- seq )
+   "------WebKitFormBoundary6odjpVPXIighAE2L\r\nContent-Disposition: form-data; name=\"file1\"; filename=\"up.txt\"\r\nContent-Type: text/plain\r\n\r\nuploaded!\n\r\n------WebKitFormBoundary6odjpVPXIighAE2L\r\nContent-Disposition: form-data; name=\"file2\"; filename=\"\"\r\n\r\n\r\n------WebKitFormBoundary6odjpVPXIighAE2L\r\nContent-Disposition: form-data; name=\"file3\"; filename=\"\"\r\n\r\n\r\n------WebKitFormBoundary6odjpVPXIighAE2L\r\nContent-Disposition: form-data; name=\"text1\"\r\n\r\nlol\r\n------WebKitFormBoundary6odjpVPXIighAE2L--\r\n" ;
 
-[ { "a" "z" "z" "b" "z" "z" "c" "z" "z" "d" } ] [
-    [
-        "azzbzzczzdzzz" <string-reader> "zzz" <multipart-stream> 1 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
+: mime-test-stream ( -- stream )
+   upload
+   "mime" "test" make-unique-file ascii
+   [ set-file-contents ] [ <file-reader> ] 2bi ;
 
-[ { "az" "zb" "zz" "cz" "zd" } ] [
-    [
-        "azzbzzczzdzzz" <string-reader> "zzz" <multipart-stream> 2 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
-
-[ { "a" "zzb" "zzc" "zzd" } ] [
-    [
-        "azzbzzczzdzzz" <string-reader> "zzz" <multipart-stream> 3 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
-] unit-test
+[ ] [ mime-test-stream [ ] with-input-stream ] unit-test
 
-[ { "az" "zbzz" "czzd" } ] [
-    [
-        "azzbzzczzdzzz" <string-reader> "zzz" <multipart-stream> 4 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
+[ t ] [
+    mime-test-stream [ upload-separator parse-multipart ] with-input-stream
+    nip "\"up.txt\"" swap key?
 ] unit-test
 
-[ { "azz" "bzzcz" "zd" } ] [
-    [
-        "azzbzzczzdzzz" <string-reader> "zzz" <multipart-stream> 5 >>n
-        [ , ] multipart-step-loop drop
-    ] { } make
+[ t ] [
+    mime-test-stream [ upload-separator parse-multipart ] with-input-stream
+    drop "\"text1\"" swap key?
 ] unit-test
 
-
-
-: dog-test-empty-bytes-safari ( -- bytes )
-    B{
-        45 45 45 45 45 45 87 101 98 75 105 116 70 111 114 109 66
-        111 117 110 100 97 114 121 74 57 98 119 65 87 115 51 121
-        110 112 113 115 72 53 75 13 10 67 111 110 116 101 110 116
-        45 68 105 115 112 111 115 105 116 105 111 110 58 32 102 111
-        114 109 45 100 97 116 97 59 32 110 97 109 101 61 34 102 105
-        108 101 49 34 59 32 102 105 108 101 110 97 109 101 61 34
-        100 111 103 46 106 112 103 34 13 10 67 111 110 116 101 110
-        116 45 84 121 112 101 58 32 105 109 97 103 101 47 106 112
-        101 103 13 10 13 10 255 216 255 224 0 16 74 70 73 70 0 1 1
-        0 0 1 0 1 0 0 255 219 0 67 0 5 3 4 4 4 3 5 4 4 4 5 5 5 6 7
-        12 8 7 7 7 7 15 11 11 9 12 17 15 18 18 17 15 17 17 19 22 28
-        23 19 20 26 21 17 17 24 33 24 26 29 29 31 31 31 19 23 34 36
-        34 30 36 28 30 31 30 255 219 0 67 1 5 5 5 7 6 7 14 8 8 14
-        30 20 17 20 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
-        30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
-        30 30 30 30 30 30 30 30 30 30 30 30 30 30 255 192 0 17 8 1
-        49 1 64 3 1 34 0 2 17 1 3 17 1 255 196 0 29 0 0 2 2 3 1 1 1
-        0 0 0 0 0 0 0 0 0 4 5 6 7 2 3 8 0 1 9 255 196 0 74 16 0 2 1
-        3 3 2 4 4 3 4 5 10 5 3 5 1 1 2 3 0 4 17 5 18 33 6 49 19 34
-        65 81 7 50 97 113 20 35 129 21 51 66 82 36 52 145 161 177 8
-        53 83 98 114 115 147 178 193 209 22 37 67 116 241 99 130
-        240 23 68 84 100 146 225 255 196 0 25 1 0 3 1 1 1 0 0 0 0 0
-        0 0 0 0 0 0 1 2 3 0 4 5 255 196 0 39 17 0 2 2 2 2 3 0 2 1 5
-        1 0 0 0 0 0 0 1 2 17 3 33 18 49 34 50 65 19 81 4 5 20 35 66
-        97 82 255 218 0 12 3 1 0 2 17 3 17 0 63 0 228 200 149 136
-        219 131 200 207 233 68 196 145 112 60 21 45 234 91 181 57
-        177 178 138 75 56 95 111 152 196 51 250 209 11 167 198 14
-        118 138 22 138 153 104 150 118 82 46 217 45 161 98 79 242
-        102 157 38 151 98 174 64 211 237 72 247 49 46 104 11 8 140
-        111 229 247 166 194 70 137 12 146 112 61 235 57 36 172 31
-        82 7 154 199 78 244 176 178 255 0 132 41 100 195 76 15 183
-        240 118 60 31 244 85 237 126 241 237 237 157 213 176 113
-        197 66 158 254 234 82 74 49 45 187 144 42 49 155 158 217
-        108 152 99 21 68 214 88 116 217 83 17 218 218 171 250 109
-        138 180 254 6 221 83 205 109 1 199 115 225 10 141 90 106 23
-        106 187 95 59 73 239 237 77 44 111 89 79 136 24 186 250 131
-        235 86 199 166 71 143 20 52 181 211 237 24 143 232 150 236
-        61 140 66 155 65 167 233 251 64 252 5 158 127 221 45 3 99
-        42 220 42 186 240 79 247 83 139 38 86 92 21 57 20 76 246
-        140 78 155 98 88 31 217 246 125 191 209 45 108 253 159 97
-        255 0 240 44 255 0 225 45 22 216 200 199 181 99 88 74 98 77
-        99 78 178 69 111 14 194 213 23 28 226 48 15 246 212 30 242
-        21 252 105 8 145 170 103 178 213 137 172 121 162 127 181 87
-        151 141 182 247 31 235 210 180 216 209 28 88 217 219 120 99
-        250 52 100 255 0 172 155 168 248 108 109 11 103 240 208 127
-        194 173 118 82 71 225 47 148 246 163 11 169 30 74 81 140
-        102 182 178 35 203 97 104 62 162 46 104 41 45 109 119 127
-        86 131 254 21 48 144 225 9 198 104 105 198 24 118 53 76 77
-        81 141 73 105 109 143 234 176 127 193 21 146 89 219 110 63
-        209 97 255 0 131 69 65 183 110 15 39 218 182 144 160 159 41
-        6 169 102 5 22 54 138 114 109 45 216 123 24 184 53 177 45
-        44 137 231 79 179 237 254 138 179 118 101 112 167 159 181
-        102 131 140 212 35 236 99 95 224 172 119 143 252 190 207
-        254 21 18 186 125 129 92 254 2 207 254 16 172 15 148 230
-        182 71 46 225 198 106 178 78 204 40 213 237 109 83 33 45
-        224 237 223 195 199 247 214 189 30 222 222 69 45 37 165 187
-        156 227 12 161 177 245 230 143 214 212 8 75 123 138 15 69
-        96 7 220 214 159 169 135 31 129 177 192 198 159 102 120 255
-        0 68 181 240 216 217 12 15 217 214 156 246 252 165 230 137
-        139 205 235 128 7 204 123 80 183 154 148 118 202 66 225 156
-        118 62 148 169 174 38 91 55 193 167 233 191 60 214 22 96 14
-        249 137 107 84 199 69 137 246 174 157 100 255 0 65 18 210
-        43 237 82 105 148 188 108 64 254 31 102 164 243 223 204 146
-        249 155 39 233 73 38 50 84 137 156 112 233 19 200 4 118 54
-        201 238 22 33 68 54 153 166 52 96 173 149 163 15 115 16 205
-        66 244 189 77 141 226 40 115 143 90 155 91 73 192 116 245
-        29 141 77 233 140 177 169 46 64 109 167 88 45 203 31 217
-        246 92 127 244 171 19 97 99 226 16 218 125 152 227 63 186
-        20 100 204 56 247 245 175 66 84 145 191 147 235 246 174 140
-        125 18 180 125 183 211 108 72 7 246 125 158 63 221 45 109
-        151 77 177 219 254 111 179 255 0 132 180 68 76 163 133 206
-        51 197 103 43 0 184 166 158 144 72 133 244 54 113 220 5 91
-        120 50 59 254 77 7 120 109 188 48 22 8 1 207 242 98 152 106
-        170 191 137 45 239 218 149 93 41 97 129 239 73 97 143 96 19
-        172 103 204 161 23 232 181 164 71 152 93 143 173 110 117
-        101 67 90 142 239 195 55 165 97 229 251 37 122 124 138 182
-        48 118 253 210 81 66 116 250 82 123 2 205 103 108 55 30 99
-        31 221 218 140 134 63 56 221 200 169 147 26 90 229 159 56
-        20 109 242 171 89 16 217 251 80 214 190 80 49 197 110 212
-        63 168 147 234 107 74 62 44 166 36 156 209 17 234 235 140
-        193 26 170 182 230 227 21 40 248 113 208 240 234 214 169 53
-        194 224 63 166 57 168 167 85 55 136 34 5 87 126 124 170 123
-        26 233 15 129 214 42 221 59 108 123 112 51 27 14 223 90 142
-        61 68 233 206 227 249 58 35 7 224 252 57 252 133 141 91 25
-        82 71 24 255 0 189 44 212 254 21 222 99 16 171 120 139 234
-        160 97 171 165 99 81 143 5 145 74 142 199 29 171 239 225 99
-        121 138 149 80 127 133 241 205 22 229 96 121 19 84 145 199
-        250 231 77 106 61 62 210 25 35 114 189 212 1 198 43 237 133
-        210 72 71 24 56 228 125 107 167 186 179 163 236 245 93 61
-        149 35 76 148 42 43 154 186 195 167 175 58 123 85 149 9 37
-        67 103 63 74 117 39 123 37 151 26 110 226 20 14 64 53 246
-        132 211 174 22 234 21 216 217 111 83 69 22 80 72 197 89 245
-        103 61 238 128 117 60 155 121 15 174 218 174 239 8 23 141
-        158 251 170 192 213 36 219 11 175 169 28 85 123 169 237 93
-        64 240 57 52 99 32 142 45 89 191 15 229 231 154 46 201 155
-        60 214 141 48 43 69 141 163 24 162 109 227 61 199 21 57 118
-        96 244 57 92 227 52 43 198 219 143 126 244 68 18 3 88 202
-        172 141 134 108 147 205 8 107 64 62 65 223 145 131 239 91
-        25 188 199 39 38 181 163 99 191 122 250 112 199 118 59 213
-        83 160 114 54 59 46 211 239 89 39 203 90 93 89 88 115 197
-        110 64 74 113 83 138 169 5 59 62 183 35 214 189 16 193 197
-        124 109 202 123 154 251 19 13 199 35 38 170 242 69 62 194
-        105 214 255 0 171 138 85 166 169 82 204 164 237 60 103 235
-        77 181 129 226 66 184 98 163 220 82 155 73 24 202 45 34 81
-        201 239 75 44 138 141 7 114 72 110 146 203 36 73 12 42 207
-        150 193 197 73 52 191 135 215 186 168 241 220 180 113 177
-        206 49 200 90 153 124 40 248 122 110 151 241 183 65 66 12
-        48 207 191 189 94 54 186 61 165 156 94 28 123 10 149 10 78
-        59 138 231 109 252 58 163 8 163 159 236 254 19 73 53 176 86
-        80 176 175 171 1 197 107 185 248 77 101 105 103 51 204 187
-        36 199 24 25 39 255 0 249 93 18 176 195 18 157 177 168 30
-        212 191 85 132 201 109 39 134 138 204 227 110 8 160 175 232
-        210 227 196 226 14 170 210 27 66 215 60 46 54 110 5 72 31
-        227 82 141 57 214 72 145 137 198 64 237 70 127 148 13 146
-        219 107 208 145 150 5 240 91 211 245 165 58 75 237 130 48
-        72 36 47 117 237 71 39 113 4 23 248 216 202 224 96 100 114
-        107 24 148 183 126 62 213 182 101 57 231 145 89 70 6 7 2
-        174 221 35 133 71 102 248 84 40 245 172 110 57 38 182 175 3
-        140 86 19 1 142 194 145 182 199 34 250 129 197 226 100 241
-        154 211 52 121 77 194 182 234 67 117 238 223 236 162 150 17
-        248 81 218 138 116 52 72 228 225 183 246 21 241 148 126 30
-        79 76 46 234 62 234 16 27 181 7 34 55 135 55 63 250 116 232
-        210 118 168 117 167 172 127 132 183 220 224 15 13 127 187
-        189 16 10 135 194 144 69 43 176 144 155 88 23 212 71 70 32
-        110 251 129 165 170 25 99 99 139 78 127 182 179 213 220 199
-        167 141 190 86 35 191 189 42 241 228 132 174 50 65 246 162
-        53 9 89 172 227 221 158 212 178 151 139 54 61 100 68 118
-        241 86 227 89 182 132 121 247 72 1 2 186 187 225 157 184
-        131 70 182 143 28 162 128 203 234 167 235 92 181 211 246 87
-        23 221 92 145 198 173 133 144 121 192 249 107 170 250 103
-        242 236 35 241 147 194 157 84 6 99 252 85 36 169 34 249 98
-        229 34 100 89 89 139 43 6 97 192 35 211 233 95 94 86 17 2
-        199 56 238 105 119 226 188 171 223 183 39 222 190 27 172 16
-        95 113 79 95 173 16 199 30 134 246 242 11 133 60 242 59 212
-        75 226 103 77 91 235 58 101 204 138 159 154 145 147 145 235
-        78 97 152 171 248 145 200 10 31 65 222 138 155 100 200 21
-        178 222 167 29 171 5 87 211 144 110 214 109 31 80 240 36
-        111 32 39 57 244 57 237 77 224 152 92 69 226 174 49 142 126
-        149 105 124 86 232 27 125 70 22 187 178 132 9 2 229 177 247
-        53 76 66 38 209 181 65 109 48 111 8 156 18 123 81 229 20
-        170 201 101 196 253 163 208 94 161 14 251 105 27 217 106
-        189 213 20 11 226 125 51 138 177 181 70 205 153 104 249 87
-        28 85 117 117 253 117 247 251 241 84 87 240 231 26 233 108
-        192 5 3 131 77 145 78 243 74 180 213 193 7 138 115 18 229
-        137 172 227 33 27 48 183 64 24 26 202 126 13 108 140 169
-        242 142 9 236 79 106 26 92 150 228 250 209 140 93 140 124
-        254 48 107 34 195 39 154 215 255 0 231 122 247 191 253 234
-        188 65 196 223 27 151 24 144 101 253 40 152 179 130 49 233
-        90 109 85 29 124 217 163 226 218 19 28 98 163 123 176 165
-        64 46 219 13 122 22 223 39 28 147 216 86 219 133 4 19 90 1
-        240 161 50 28 131 252 52 91 131 219 55 144 62 189 56 91 68
-        133 88 110 245 30 213 37 248 49 210 178 106 58 188 51 73
-        144 138 119 19 233 140 208 189 61 210 211 245 12 232 193 79
-        204 57 32 226 186 51 161 250 90 195 65 211 161 138 8 255 0
-        51 104 46 125 106 115 146 78 145 124 17 113 143 146 37 26
-        85 188 122 109 132 113 68 184 96 49 159 165 125 185 185 85
-        59 90 64 119 124 198 180 205 43 5 43 156 31 79 181 10 178
-        36 44 26 70 222 205 223 30 148 165 210 177 139 150 149 10
-        227 98 142 192 250 214 155 147 253 28 199 177 88 122 238
-        244 250 208 171 52 155 134 88 98 133 150 237 164 36 46 112
-        15 53 129 56 190 145 65 255 0 148 77 158 235 69 153 118 182
-        199 218 54 118 239 154 175 116 73 72 181 129 135 204 203
-        218 174 31 142 22 18 234 26 36 203 2 72 21 60 229 64 253
-        225 207 106 165 244 67 38 194 37 36 178 240 51 90 91 175
-        248 104 234 13 18 169 228 221 230 127 46 43 5 151 196 228
-        214 55 127 186 221 238 43 85 187 100 227 158 213 94 71 20
-        180 232 103 23 43 197 125 145 84 168 201 230 176 135 182 43
-        100 156 40 165 9 22 212 144 45 249 247 163 161 254 174 40
-        93 79 157 67 62 153 166 22 234 166 1 197 96 53 98 235 149
-        12 167 222 147 234 3 242 102 81 220 71 82 41 99 12 59 129
-        74 117 91 114 45 167 117 31 250 103 251 169 148 140 129 45
-        55 44 17 99 253 29 23 12 204 28 6 3 20 20 19 127 71 139 159
-        253 42 223 28 129 136 7 156 154 103 208 255 0 153 177 205
-        170 120 204 3 12 12 240 69 111 213 199 134 145 66 163 36
-        143 90 246 154 141 148 231 143 74 203 89 138 67 123 11 6 57
-        199 21 63 134 139 243 68 211 224 110 159 102 218 140 243
-        189 188 178 60 152 249 192 192 171 213 173 128 140 176 141
-        15 25 193 244 168 39 193 43 63 15 79 19 76 7 140 199 206
-        184 171 30 250 50 146 43 42 228 48 193 168 219 163 177 55
-        200 71 226 254 97 228 140 28 99 210 183 69 117 30 226 31
-        105 30 222 148 46 161 152 75 141 229 148 156 226 149 60 140
-        70 248 137 80 189 241 75 143 34 186 101 158 54 201 25 102
-        241 55 70 35 3 216 118 162 108 39 87 144 66 242 108 61 243
-        239 244 168 180 119 82 49 253 233 136 123 10 206 207 82 89
-        36 88 174 150 38 195 121 37 76 247 250 213 123 36 224 214
-        201 204 169 20 145 60 61 148 240 72 245 170 127 227 23 70
-        172 150 134 226 214 223 107 103 141 130 173 155 70 86 183
-        66 28 179 3 250 26 58 242 194 43 232 66 92 66 187 79 189
-        115 201 108 56 230 163 105 156 115 105 60 208 196 214 23 80
-        148 145 71 5 135 122 132 235 145 201 29 249 42 188 22 245
-        174 164 248 151 240 207 198 70 212 45 21 81 145 142 204 10
-        160 186 163 71 154 222 77 183 49 8 157 84 246 254 35 239 93
-        112 206 180 145 203 60 93 201 116 37 211 39 10 0 126 41 220
-        119 81 1 144 213 22 120 174 35 92 237 226 135 146 250 234
-        33 235 143 65 87 228 217 13 50 87 226 199 254 144 126 149
-        245 166 141 200 243 10 133 46 162 232 115 146 72 172 206
-        175 41 238 191 223 67 147 9 51 12 132 227 114 214 82 120
-        106 56 113 80 209 170 72 88 5 76 31 189 20 215 178 152 212
-        149 201 197 50 102 37 118 211 195 242 150 227 222 140 18 71
-        129 181 137 168 84 119 151 1 73 197 49 180 191 153 148 110
-        200 199 106 231 250 104 246 74 29 148 174 230 227 29 177 89
-        232 58 77 246 183 172 195 20 112 177 141 125 135 6 153 244
-        151 75 234 157 65 36 113 136 241 9 0 230 186 15 162 250 19
-        79 208 225 79 42 25 145 130 183 31 74 76 146 138 71 84 49
-        211 183 209 143 68 244 245 174 149 167 6 252 56 86 28 246
-        169 45 207 130 182 134 66 222 30 61 187 214 251 192 182 235
-        26 15 40 39 210 144 107 247 22 176 249 46 37 36 124 193 127
-        155 233 83 91 118 86 172 214 151 14 236 220 228 103 130 222
-        213 147 204 138 164 48 86 39 185 168 228 218 149 196 206 56
-        17 91 129 133 81 243 17 88 53 227 180 137 28 114 56 92 122
-        247 170 27 241 177 225 187 24 231 251 171 43 85 241 50 170
-        14 15 36 154 87 109 34 151 27 134 121 167 54 108 225 129 12
-        118 251 82 185 168 151 112 226 129 250 130 194 222 77 30
-        118 120 247 237 140 250 122 215 48 107 54 169 103 169 201
-        224 163 129 188 240 195 138 235 187 203 101 109 50 82 205
-        130 227 143 181 115 71 197 11 55 183 214 228 88 219 17 239
-        224 1 244 162 157 171 57 102 252 68 107 48 54 234 27 24 175
-        68 15 114 49 158 213 166 218 19 37 160 207 38 140 137 120
-        10 220 145 86 198 173 108 227 123 9 130 182 203 218 181 195
-        216 240 59 214 215 70 49 131 73 244 196 91 80 99 248 197 62
-        230 152 193 145 111 145 75 245 24 207 226 147 159 90 109
-        103 31 244 97 158 115 84 140 28 140 40 184 185 117 148 100
-        12 118 173 183 172 143 165 92 48 193 34 39 175 186 149 168
-        14 24 142 49 64 220 201 183 78 157 87 129 225 61 43 84 232
-        196 94 55 155 195 207 134 216 61 168 155 89 101 241 16 108
-        61 232 168 236 220 219 161 11 198 208 223 219 91 173 172
-        157 100 86 32 119 166 109 80 30 201 95 79 166 228 30 245
-        150 187 129 127 18 255 0 101 110 209 23 195 43 246 175 107
-        136 5 253 171 30 119 29 181 54 44 125 209 127 252 28 119
-        147 73 72 230 142 40 215 60 31 122 156 223 199 182 38 200
-        192 3 32 212 119 225 21 138 174 131 12 155 67 115 220 84
-        183 91 141 148 97 89 64 199 32 251 84 228 244 119 67 216
-        175 53 163 38 215 30 25 199 112 213 29 69 63 48 152 73 159
-        65 233 83 13 65 48 37 1 124 167 249 170 55 61 169 40 20 109
-        200 254 90 129 218 4 247 78 190 70 24 83 220 214 80 238 154
-        69 16 176 14 14 87 234 104 11 230 104 238 90 118 5 84 252
-        202 125 190 148 126 152 158 21 202 220 69 135 4 103 13 217
-        215 233 250 215 70 55 226 38 88 187 39 154 13 208 252 34
-        163 33 141 193 243 231 212 251 211 251 121 149 85 1 97 130
-        112 191 90 135 90 206 197 188 64 27 45 201 207 127 214 134
-        215 181 195 98 143 189 138 237 77 203 207 99 70 147 236 131
-        99 174 169 234 43 123 77 62 84 37 70 88 247 53 203 223 20
-        122 138 214 234 127 203 100 102 12 71 7 177 230 180 252 80
-        248 131 123 168 93 92 217 90 92 48 143 126 11 3 85 179 199
-        52 132 72 237 36 140 199 144 125 105 163 26 232 132 230 210
-        164 48 75 217 26 50 178 31 175 216 86 192 177 179 120 114
-        70 67 241 199 223 181 123 78 176 141 158 25 60 57 29 36 94
-        123 112 125 170 77 160 116 237 205 192 152 92 70 3 69 180
-        142 14 72 30 149 94 150 201 70 42 93 246 70 127 3 111 32 5
-        156 28 246 30 245 190 13 46 213 184 24 7 252 106 204 181
-        232 39 188 134 25 214 2 158 110 1 167 211 252 45 149 128
-        217 22 112 6 10 158 230 167 249 25 79 192 83 113 90 218 43
-        149 217 141 188 156 214 187 150 139 38 69 97 207 165 90 154
-        223 195 91 168 237 85 150 18 178 103 7 158 226 163 250 159
-        68 74 152 183 104 138 133 245 230 154 51 108 73 97 165 178
-        2 110 35 93 185 140 228 246 250 214 22 218 145 75 144 79 49
-        169 237 237 76 239 180 139 136 30 225 167 183 116 136 113
-        19 250 19 244 164 87 118 130 221 66 140 239 113 150 255 0
-        84 123 26 210 236 17 199 79 146 58 87 225 47 85 90 20 133
-        99 120 217 252 48 184 7 154 188 44 181 72 110 33 115 28 138
-        189 178 107 243 247 73 212 245 13 34 238 43 139 91 150 86
-        86 224 103 130 43 161 190 21 117 252 218 133 187 199 52 195
-        196 199 42 79 57 169 101 130 173 150 89 37 47 133 243 123
-        62 27 184 205 66 250 153 228 158 87 72 219 242 128 203 31
-        230 250 83 11 125 67 241 86 98 67 184 239 92 140 119 20 179
-        85 146 97 108 214 246 225 124 118 236 237 217 7 169 53 139
-        136 77 210 199 8 240 215 106 142 5 122 9 94 225 177 34 149
-        251 208 119 94 29 164 113 164 108 89 229 206 11 127 16 254
-        111 181 21 167 69 35 196 145 178 183 3 230 247 165 148 171
-        163 166 41 164 130 109 86 72 238 147 99 239 32 246 21 50
-        208 67 51 13 202 70 225 138 143 217 91 1 54 246 198 79 106
-        149 105 49 31 46 210 1 250 210 91 125 141 149 166 135 114
-        167 244 87 221 194 162 96 31 173 115 103 199 23 118 190 241
-        36 82 160 55 148 159 90 234 47 194 238 179 39 25 59 121 246
-        174 109 255 0 40 116 120 110 193 194 99 119 97 84 199 217
-        231 101 232 129 88 15 19 77 12 127 74 223 28 124 80 182 50
-        40 176 133 70 70 70 236 125 40 181 124 40 198 106 216 211
-        226 206 89 109 155 34 93 166 136 112 118 10 12 51 23 28 26
-        222 242 16 170 190 227 251 40 168 180 18 63 170 115 121 30
-        61 233 149 159 238 69 44 213 124 179 41 200 224 209 54 210
-        55 130 49 197 27 163 25 220 166 238 105 102 167 24 91 9 200
-        239 225 63 20 222 94 35 207 189 5 169 47 244 9 255 0 221 61
-        43 70 54 233 208 175 236 235 101 33 79 228 35 103 244 175
-        52 113 171 249 177 244 197 37 178 189 151 240 22 235 26 231
-        108 64 22 250 14 212 76 115 74 236 190 76 156 214 148 120
-        148 135 25 116 137 30 154 114 195 142 115 199 181 103 212 2
-        69 22 211 42 134 41 38 15 181 97 165 135 104 187 109 230
-        137 213 70 52 183 247 83 145 247 160 73 170 154 103 65 124
-        33 150 245 186 106 18 99 120 198 121 199 106 156 223 50 181
-        177 103 80 95 24 21 0 248 17 121 29 215 79 197 27 206 216 7
-        154 178 245 45 63 242 188 72 206 83 28 87 61 118 206 200 63
-        34 5 170 47 149 155 113 35 212 123 82 11 169 21 163 11 24
-        218 71 114 106 73 171 90 72 204 237 27 21 199 124 122 212
-        102 246 53 149 138 188 133 0 61 197 37 89 217 29 136 53 75
-        171 111 21 13 192 196 108 112 91 218 137 211 97 109 58 34
-        151 18 135 183 97 186 25 129 206 207 245 126 212 171 82 145
-        33 117 180 155 5 91 129 159 74 81 38 165 119 166 23 181 185
-        13 36 64 111 140 154 120 107 68 242 77 217 59 186 215 99
-        183 178 109 201 135 81 232 121 199 215 235 84 183 196 238
-        182 55 119 18 90 219 202 225 135 145 142 107 221 79 213 32
-        192 235 24 33 241 140 3 233 239 85 212 183 17 202 254 44
-        222 116 39 42 87 230 253 106 177 77 156 83 157 61 31 45 237
-        237 239 1 102 27 100 118 207 29 137 246 21 186 210 206 226
-        234 117 88 99 32 227 102 0 229 79 210 134 131 114 220 179
-        91 169 147 235 31 106 184 62 29 116 188 215 205 14 160 145
-        168 115 141 216 236 79 184 250 85 23 138 217 40 183 116 197
-        93 13 210 179 94 74 18 230 213 114 14 72 92 240 106 230 233
-        14 149 201 182 205 143 49 182 210 72 249 254 245 48 233 30
-        132 176 210 209 47 24 174 233 57 97 252 167 218 167 186 85
-        149 188 100 34 145 133 57 28 122 212 102 220 186 58 97 20
-        182 200 190 129 210 227 194 72 103 183 201 140 229 192 28
-        17 78 83 165 195 162 4 143 96 7 111 126 245 58 210 108 148
-        90 143 40 231 191 214 137 154 200 237 77 168 54 171 110 34
-        137 185 113 123 101 115 115 210 176 184 101 150 223 113 81
-        198 106 35 212 61 46 204 146 44 118 104 3 38 204 227 176
-        247 251 213 241 45 180 101 119 0 9 35 251 41 14 173 104 170
-        73 101 10 153 224 208 119 240 50 148 89 202 157 87 210 48
-        77 60 202 214 110 145 193 229 140 1 199 222 169 174 161 208
-        175 22 242 86 75 117 218 95 31 252 215 114 106 218 69 181
-        227 52 71 111 57 46 113 223 138 169 250 227 225 231 131 110
-        90 216 198 94 224 22 231 209 126 149 162 223 45 154 81 168
-        156 164 246 105 35 152 164 140 41 67 203 122 15 160 172 244
-        205 66 77 47 82 51 89 54 17 78 55 19 203 125 233 247 94 105
-        223 178 174 22 205 16 237 44 124 64 125 90 162 182 234 136
-        155 102 138 70 62 137 31 173 94 124 90 57 84 156 54 116 39
-        195 190 179 134 247 78 137 124 92 52 99 12 24 250 84 190
-        125 74 222 228 22 13 148 35 12 7 241 125 15 210 185 131 65
-        214 164 211 239 247 12 162 231 205 138 181 180 30 166 140
-        66 173 183 114 133 221 180 251 251 212 163 217 104 57 61
-        217 45 187 183 48 52 154 150 161 34 137 37 242 67 26 246 81
-        232 61 233 182 153 49 100 85 229 112 63 90 138 45 212 147
-        203 251 79 82 37 80 183 229 102 164 26 9 252 67 120 146 72
-        85 91 145 72 227 114 59 160 237 18 88 219 116 161 128 194
-        250 98 164 218 66 175 145 152 176 31 74 141 233 144 188 234
-        35 221 177 148 246 247 169 118 137 110 210 97 23 142 49 73
-        246 131 54 146 29 92 206 230 219 109 190 115 183 140 251 87
-        51 255 0 148 20 183 13 170 120 78 170 124 221 249 174 164
-        185 130 27 123 23 50 76 82 69 143 129 239 92 167 241 178
-        239 241 93 84 144 43 29 170 196 55 214 169 141 83 103 14 94
-        136 60 113 50 75 18 174 79 229 246 52 94 226 2 231 223 154
-        250 84 199 50 150 228 142 7 218 177 118 12 221 171 162 18
-        75 71 56 79 139 25 101 81 243 99 244 172 165 198 194 27 185
-        239 143 74 24 174 210 24 112 43 207 32 216 41 219 179 8 181
-        86 62 48 237 222 143 178 93 208 45 3 170 168 241 215 143 90
-        105 166 46 97 24 246 169 72 198 115 174 16 41 251 208 58
-        145 99 167 93 28 124 176 57 31 217 76 167 70 35 147 64 234
-        8 223 179 47 121 255 0 246 207 255 0 45 82 49 209 133 58
-        116 91 236 237 155 215 195 163 214 53 35 105 60 208 186 71
-        245 59 111 247 99 251 232 167 39 120 199 189 115 61 187 58
-        49 244 62 211 27 106 40 244 11 138 206 245 131 90 52 110
-        112 15 124 250 80 182 59 150 60 230 183 93 131 52 5 27 128
-        123 98 175 195 198 206 121 123 23 111 194 141 25 19 165 163
-        146 25 150 25 163 228 146 123 213 139 166 235 6 72 132 55
-        16 182 244 227 196 61 136 170 231 225 154 76 186 12 22 208
-        179 49 99 134 250 138 156 221 168 180 182 82 216 81 234 125
-        123 87 36 175 164 117 198 187 96 58 228 214 203 59 186 202
-        20 145 242 147 193 53 1 215 181 21 183 159 204 200 184 60
-        224 240 43 87 94 245 125 134 157 20 166 73 17 216 118 25
-        230 168 174 178 235 171 237 81 90 222 215 114 199 158 72
-        239 250 86 132 91 208 207 34 142 209 51 235 190 160 181 86
-        120 81 64 43 192 57 245 168 68 189 85 123 61 177 130 95 57
-        67 149 63 78 212 133 26 107 169 12 183 147 177 200 245 61
-        205 1 113 118 200 204 145 224 15 173 118 67 29 171 100 178
-        229 182 25 125 127 150 37 188 197 251 168 238 15 189 39 185
-        59 88 239 96 227 233 90 204 153 36 243 156 250 214 80 71 44
-        242 42 170 239 102 56 81 158 230 153 164 142 87 119 100 211
-        225 206 159 38 163 172 70 24 180 11 24 192 157 144 149 39
-        254 181 215 159 13 186 114 107 91 40 63 18 33 155 114 143
-        204 72 246 156 125 126 149 76 255 0 147 198 143 171 90 193
-        29 212 150 211 92 187 159 201 137 149 118 238 29 192 231 57
-        31 95 210 186 179 67 253 204 19 79 111 28 23 17 128 94 51
-        243 21 255 0 10 231 148 172 183 14 42 205 194 198 51 182 56
-        212 246 239 76 244 141 60 52 109 25 57 246 62 245 140 23
-        182 18 93 21 158 101 66 237 144 163 184 167 169 60 62 42
-        219 197 177 155 211 111 183 189 78 154 232 101 145 208 77
-        140 91 97 53 181 215 56 86 224 19 201 175 182 255 0 153 207
-        99 244 237 88 207 34 169 11 131 222 155 95 72 74 219 179 99
-        70 54 96 118 28 10 87 127 110 100 144 112 118 47 115 77 147
-        204 156 80 119 141 180 129 42 159 15 233 220 208 119 240
-        104 57 39 178 37 117 96 85 213 147 200 51 198 125 105 102
-        187 166 69 54 157 34 149 46 249 193 30 255 0 74 152 93 203
-        101 248 35 47 136 164 33 198 65 165 111 61 188 182 243 165
-        187 70 230 70 249 143 96 43 36 238 217 105 100 109 81 202
-        255 0 26 122 94 231 240 119 19 36 177 69 30 60 177 32 36
-        177 255 0 189 115 30 160 38 130 83 13 194 52 108 59 6 24 56
-        175 208 63 136 208 223 92 105 207 21 134 158 207 19 103 243
-        21 87 43 199 98 73 239 92 75 241 71 69 212 236 122 138 225
-        174 109 229 104 249 35 198 24 32 125 72 227 251 234 139 100
-        114 69 209 22 180 152 162 121 78 1 245 167 218 70 173 115
-        107 34 186 254 98 142 224 122 138 138 6 100 227 248 79 106
-        221 5 228 177 159 47 98 49 85 171 22 46 145 97 69 213 51 92
-        95 197 248 179 182 5 249 99 61 254 245 105 116 222 187 111
-        113 98 30 50 170 84 236 7 61 207 181 115 221 153 241 206
-        226 88 47 185 244 52 108 26 166 163 165 220 175 225 238 11
-        170 182 229 0 240 77 35 196 213 179 170 57 18 143 103 91
-        244 253 212 110 23 116 170 167 102 50 125 13 77 116 75 168
-        109 109 131 33 103 25 229 147 214 185 131 161 190 34 36 211
-        8 175 36 104 229 7 140 227 7 251 234 246 233 77 90 222 254
-        213 26 9 55 2 61 235 145 220 101 208 202 74 107 178 77 121
-        113 115 170 188 145 70 36 181 135 30 99 47 241 253 171 159
-        62 46 90 90 218 245 34 77 104 193 54 183 0 213 253 169 91
-        200 150 203 113 19 96 168 36 227 218 185 235 226 187 51 106
-        194 86 112 70 227 192 239 84 199 53 100 178 105 82 35 18 57
-        99 90 7 239 43 4 155 33 91 156 123 86 107 203 110 174 142
-        36 101 166 19 130 0 200 199 21 237 170 121 39 154 248 155
-        177 230 32 214 71 129 156 142 105 210 179 8 245 140 248 163
-        138 109 163 200 162 223 130 51 138 85 173 224 74 87 190 61
-        69 29 163 254 235 244 161 40 152 57 183 51 103 6 131 213 8
-        93 58 247 60 127 71 127 249 104 238 62 180 22 177 183 246
-        101 239 127 234 239 255 0 45 20 233 24 85 167 73 26 216 65
-        158 254 18 86 70 100 50 129 159 90 89 104 199 240 86 236
-        199 63 150 63 186 178 133 100 146 225 112 199 147 197 69 37
-        101 99 145 116 137 133 143 154 42 223 50 31 8 149 228 138
-        209 167 127 87 0 247 94 9 162 157 136 78 14 51 222 171 242
-        136 228 246 39 127 8 122 155 193 211 165 220 219 222 54 192
-        218 113 254 52 71 92 124 78 134 206 23 182 242 187 28 252
-        196 228 113 244 170 88 223 220 219 207 44 80 206 241 239
-        239 180 227 38 144 234 211 205 121 49 73 228 101 63 206 79
-        45 244 169 180 145 73 78 162 107 234 29 90 235 92 212 101
-        113 39 229 150 254 34 104 102 133 173 146 56 230 104 163 6
-        61 202 249 206 107 11 155 118 183 143 115 52 123 72 227 117
-        42 184 144 147 183 57 35 142 15 24 167 142 136 115 114 14
-        212 175 140 155 18 48 170 23 212 122 208 18 51 72 219 155
-        143 181 124 141 89 188 217 237 82 45 15 165 239 239 228 64
-        35 220 172 50 60 164 211 60 180 168 122 182 34 182 181 150
-        105 22 52 83 150 56 21 119 124 40 232 61 22 11 120 117 14
-        162 91 71 193 223 137 156 141 163 244 168 207 76 244 169
-        183 63 136 212 18 225 18 57 54 168 100 219 185 135 63 225
-        91 58 183 90 125 107 82 255 0 195 61 62 206 225 188 133 223
-        130 120 244 164 82 82 209 69 162 234 185 248 149 211 250 36
-        150 134 27 173 53 90 60 43 62 205 196 168 237 185 135 124
-        122 30 226 143 31 29 52 104 209 202 95 254 32 5 27 100 36
-        236 45 159 148 10 175 236 62 14 116 119 78 233 49 106 29
-        125 173 188 6 78 209 228 140 254 148 143 173 126 25 244 255
-        0 254 31 184 234 111 135 186 191 237 75 11 33 253 58 212
-        252 240 131 193 111 211 138 203 18 248 105 41 203 127 11 55
-        77 248 167 13 230 169 52 150 247 62 32 50 141 165 57 219
-        192 206 71 176 171 175 165 122 166 5 180 105 218 238 57 174
-        14 11 190 120 198 63 135 233 92 19 209 178 53 191 80 219
-        134 145 158 37 96 36 8 112 28 122 30 61 49 87 123 245 75
-        105 182 99 207 52 183 69 118 195 26 0 16 169 237 74 213 104
-        10 171 71 82 105 125 92 178 27 168 173 231 133 252 12 41 37
-        143 45 235 68 75 172 79 115 181 162 5 128 229 177 233 84
-        103 195 200 167 142 199 241 23 49 151 121 21 93 163 36 242
-        199 230 63 165 90 218 115 72 203 28 109 148 86 95 48 30 130
-        163 46 131 68 134 62 164 146 22 88 78 21 152 231 46 120 197
-        44 126 179 134 226 226 72 124 104 153 146 79 13 129 39 0
-        251 253 170 55 212 64 44 102 54 86 40 36 33 28 158 7 21 76
-        245 62 169 115 211 218 200 159 30 37 165 208 49 206 224 240
-        62 181 88 250 152 177 62 34 245 140 58 102 239 2 121 12 14
-        222 120 80 249 147 237 244 168 54 141 241 163 78 211 141
-        197 165 197 196 110 210 203 184 16 199 40 158 223 78 113
-        222 160 191 17 53 127 196 104 134 75 123 167 145 74 17 20
-        217 230 63 175 255 0 62 245 82 116 190 137 169 117 70 175
-        107 165 233 240 120 183 183 79 225 199 158 199 156 150 111
-        160 28 213 97 20 214 197 201 168 218 58 99 87 248 221 161
-        73 107 36 48 234 16 164 172 70 232 230 77 202 62 162 133
-        213 239 186 63 173 172 13 173 252 186 108 175 26 9 160 13
-        46 213 115 245 3 147 81 85 248 123 240 135 79 184 58 54 177
-        212 210 207 171 96 36 146 110 10 187 253 64 250 103 181 70
-        126 35 124 48 190 232 99 6 191 161 221 181 213 145 243 70
-        249 7 2 179 138 55 41 69 121 116 68 62 34 244 106 232 154
-        139 73 100 209 61 179 246 17 146 66 253 179 80 146 152 39
-        131 199 28 213 195 105 171 105 157 87 161 143 26 59 165 188
-        183 127 13 178 23 185 254 44 14 194 162 250 143 68 106 158
-        61 204 107 110 234 144 30 119 14 228 250 214 186 216 120
-        166 66 226 186 146 33 181 64 42 79 57 166 150 183 81 221 67
-        28 108 18 34 131 27 135 115 75 245 13 58 230 209 218 57 151
-        105 30 148 26 50 169 243 12 143 106 111 201 100 165 221 14
-        110 45 100 30 29 202 108 93 231 201 176 249 179 245 169 239
-        195 46 190 155 65 116 134 233 140 202 14 56 39 138 173 172
-        165 241 167 102 114 65 246 205 29 45 139 162 248 204 228
-        123 82 154 13 217 214 154 111 94 193 127 103 35 13 219 89
-        59 103 214 170 30 176 184 55 250 195 158 200 28 241 237 81
-        14 158 212 46 196 42 137 52 136 163 140 3 222 158 137 55
-        121 155 204 199 185 62 181 62 153 119 177 106 33 86 39 146
-        15 247 81 80 227 28 214 137 102 84 57 35 143 81 91 33 60 96
-        250 242 42 184 246 182 77 236 45 72 53 242 65 229 28 154
-        249 12 110 20 229 189 107 50 141 142 244 244 97 14 171 216
-        100 246 245 166 26 88 99 0 35 218 130 215 35 41 149 62 180
-        126 145 34 139 101 76 115 75 35 4 237 124 253 43 70 167 206
-        153 122 63 254 179 255 0 203 71 73 185 87 191 122 7 80 255
-        0 54 94 255 0 237 223 254 90 41 42 48 158 198 216 61 132 13
-        234 34 76 10 223 4 91 101 25 226 129 180 188 95 192 192 168
-        74 159 13 123 253 40 136 174 55 56 243 115 92 231 71 24 168
-        162 77 103 194 133 29 143 173 23 183 3 142 104 29 53 183 69
-        159 173 28 161 137 32 48 31 122 183 250 156 242 236 132 107
-        158 77 85 199 161 245 165 154 157 228 75 20 143 224 147 38
-        208 160 254 180 95 83 57 138 255 0 123 28 143 97 222 163 23
-        119 6 86 113 187 3 28 3 64 73 118 105 188 158 75 137 188 71
-        96 196 142 62 149 164 43 30 194 155 233 90 68 247 146 69 24
-        134 76 56 200 101 82 71 247 84 150 223 225 254 169 117 125
-        13 172 54 206 217 30 128 228 208 177 150 50 61 211 246 17
-        93 221 197 19 50 151 102 24 78 228 254 149 210 29 55 105 99
-        164 244 220 104 153 154 237 211 1 35 143 5 190 134 190 116
-        95 193 91 125 52 67 53 238 212 144 12 22 9 206 126 149 105
-        216 232 54 58 126 158 27 240 202 229 60 161 207 115 250 84
-        178 100 101 225 138 145 205 127 16 35 235 141 54 194 107
-        169 173 82 194 202 102 43 28 64 121 177 238 126 181 183 252
-        152 180 184 110 186 206 59 139 153 55 120 114 255 0 23 124
-        138 184 254 36 90 166 177 166 141 46 104 35 142 4 39 108
-        140 60 196 227 176 199 115 84 102 142 215 157 3 174 165 245
-        152 155 98 49 145 210 65 182 66 185 239 131 86 197 41 73 81
-        57 175 22 75 126 54 92 222 106 189 105 168 45 206 80 193 62
-        200 131 127 20 127 74 19 225 245 222 151 210 147 38 181 113
-        169 69 121 103 125 101 56 212 44 99 102 221 6 60 168 178
-        103 131 158 249 20 247 171 250 255 0 225 55 87 218 197 168
-        106 38 238 29 67 24 153 33 139 7 31 169 239 80 253 42 199
-        77 234 9 221 244 173 34 120 116 93 223 60 242 238 146 225
-        135 191 176 197 36 63 140 227 147 155 122 59 223 245 28 95
-        218 44 42 62 68 123 167 116 185 33 117 214 20 71 109 12 210
-        51 36 95 197 180 158 0 171 51 165 244 73 181 27 215 191 191
-        183 154 71 150 61 177 2 56 219 239 254 213 35 135 77 93 99
-        94 75 88 99 72 173 161 199 135 10 231 9 138 187 122 35 69
-        184 136 199 113 225 112 23 204 91 181 105 61 158 122 116
-        182 109 183 177 142 215 72 137 99 152 44 139 202 169 238
-        135 220 211 173 10 247 84 145 37 105 49 49 72 240 127 183
-        230 20 195 195 180 216 86 107 115 34 158 225 69 108 183 146
-        21 220 177 126 90 40 200 92 115 82 158 217 76 73 209 23 188
-        188 186 187 184 17 77 43 73 110 173 231 66 57 205 36 235 93
-        26 222 248 180 239 3 92 196 188 182 206 202 49 86 11 61 188
-        190 105 20 200 254 158 80 48 43 69 253 168 184 183 219 28
-        107 27 24 246 133 127 95 236 162 131 61 28 197 173 216 222
-        88 217 13 44 226 43 73 31 242 89 255 0 139 239 65 124 52
-        190 183 232 190 169 212 34 186 137 37 188 186 211 165 252
-        20 241 182 10 183 7 106 159 114 1 171 31 226 39 74 188 150
-        165 68 82 126 72 47 156 241 159 165 66 44 180 219 125 107
-        79 75 123 168 137 187 181 36 199 112 14 10 48 237 131 86
-        134 153 9 78 169 175 217 28 191 211 109 173 111 109 205 190
-        165 6 167 45 196 98 226 89 34 13 152 157 143 40 229 191 136
-        122 213 219 240 252 182 169 240 123 92 211 245 15 204 134
-        221 191 163 153 62 94 59 129 85 78 147 168 244 85 173 233
-        139 172 44 181 29 51 80 138 76 59 194 229 163 155 253 110
-        121 201 246 169 111 88 252 86 233 143 252 53 7 76 244 23
-        143 35 72 140 37 121 34 218 50 125 205 8 97 148 95 43 61 95
-        231 255 0 59 22 124 80 140 35 180 82 80 254 51 75 234 219
-        152 244 185 25 31 199 17 162 17 228 111 191 210 174 222 139
-        139 169 109 103 71 234 59 16 208 73 134 91 132 28 99 218
-        162 191 15 58 89 110 181 4 213 181 39 113 32 199 134 93 114
-        142 255 0 82 43 162 180 147 22 161 107 2 222 219 198 147
-        162 132 64 7 148 175 189 35 200 250 103 18 132 111 179 158
-        126 54 232 182 47 178 234 216 143 12 182 230 34 169 75 216
-        226 86 62 11 7 25 238 43 184 58 167 161 44 181 120 36 73 6
-        204 140 99 195 4 19 238 42 138 248 143 240 98 250 192 126
-        51 78 18 73 30 114 219 87 3 251 40 197 162 83 195 78 202 44
-        103 52 211 78 187 145 54 164 135 122 127 47 168 167 119 125
-        31 117 14 158 39 146 60 72 6 74 169 228 212 106 230 9 109
-        91 44 172 185 28 110 20 233 139 199 137 59 211 30 223 194 6
-        21 216 9 228 123 154 117 19 21 183 101 35 181 68 58 114 224
-        52 41 184 147 232 64 247 169 58 179 120 108 164 130 77 35
-        236 22 8 208 254 98 209 16 202 21 112 8 197 15 63 136 172 6
-        112 125 43 234 35 110 238 0 255 0 173 87 23 65 24 66 236
-        121 193 197 109 144 238 21 170 15 42 121 151 28 214 213 59
-        184 170 24 79 174 144 84 145 216 246 173 250 79 238 135 218
-        133 214 206 213 17 144 115 69 105 35 49 45 99 12 223 228
-        160 245 15 243 101 239 254 217 255 0 229 163 101 24 10 191
-        74 11 81 227 77 189 255 0 219 191 252 181 140 66 237 225
-        152 136 216 103 105 143 138 42 222 57 150 117 57 39 154 107
-        103 110 162 194 219 10 63 171 171 126 167 189 98 177 159 20
-        10 230 67 56 162 65 166 16 176 15 122 57 202 178 141 172
-        115 64 88 198 124 49 205 27 28 101 92 179 114 41 211 177 27
-        43 190 181 38 61 66 76 115 159 127 74 142 91 196 102 157 87
-        146 88 212 151 174 163 111 198 6 254 126 212 171 167 182
-        166 169 24 144 2 50 57 62 156 208 151 236 120 165 106 206
-        132 248 59 209 94 38 135 22 165 116 100 87 219 133 80 70 49
-        138 180 58 43 73 68 189 154 226 52 220 241 182 23 35 56 160
-        58 34 72 173 250 58 47 54 209 225 129 24 247 207 173 79 186
-        31 77 16 218 248 219 67 25 6 226 42 13 203 224 242 236 123
-        167 216 226 13 203 26 128 188 231 57 255 0 26 95 212 86 203
-        14 38 0 224 17 188 125 42 75 20 6 20 41 26 240 252 40 164
-        186 234 187 174 24 60 133 78 89 87 218 149 187 209 148 221
-        236 138 245 22 157 60 140 183 218 74 1 34 249 247 204 160
-        162 241 142 213 79 245 47 72 111 89 117 61 99 84 182 187
-        158 103 33 174 166 206 10 255 0 42 133 245 251 213 175 213
-        218 164 50 217 172 77 44 214 192 54 8 65 153 36 250 40 165
-        235 164 216 95 233 145 223 73 17 140 91 201 143 195 177 220
-        227 244 236 198 173 6 250 55 37 118 206 124 181 232 213 212
-        181 136 196 118 238 246 80 74 54 160 1 90 97 239 159 229
-        171 3 81 179 134 222 91 125 63 77 88 108 247 70 21 97 132
-        238 43 245 53 45 120 119 180 159 135 218 145 202 124 24 230
-        10 1 96 59 138 144 116 239 76 219 104 202 250 174 165 4 101
-        194 238 201 94 91 218 157 201 213 11 26 91 162 47 209 221
-        26 52 117 23 55 18 44 146 183 32 241 146 126 181 97 105 233
-        20 118 239 243 120 107 243 2 121 52 161 18 107 251 179 117
-        35 164 17 70 249 66 107 125 213 247 138 230 59 119 1 148
-        224 149 236 106 118 51 105 187 99 27 235 207 20 237 133 85
-        51 237 90 163 140 144 27 36 55 175 214 176 176 141 3 171 57
-        220 128 242 222 212 213 32 181 101 44 179 99 53 59 41 141
-        241 20 200 230 41 119 134 56 245 197 31 105 121 29 194 42
-        177 193 3 134 254 42 198 107 120 2 16 178 100 251 210 153
-        213 161 184 13 20 228 145 243 173 50 86 9 53 123 50 234 11
-        11 107 132 41 134 60 99 35 4 255 0 125 85 157 71 210 82 232
-        87 15 123 4 237 225 49 203 32 28 15 92 241 86 153 120 245
-        40 4 33 140 12 220 54 239 152 214 173 37 225 148 75 165 223
-        70 178 197 38 80 59 12 213 185 19 139 75 225 77 117 119 76
-        218 117 23 78 199 47 225 99 146 248 121 146 242 54 243 3
-        252 172 191 245 164 29 51 210 246 205 122 209 95 27 104 110
-        162 249 76 132 248 83 143 117 43 87 61 247 76 54 135 118
-        243 89 248 81 68 91 43 159 95 113 205 124 211 116 235 59
-        199 54 23 81 195 110 249 202 133 64 54 122 231 39 248 104
-        114 98 73 236 91 209 125 35 169 105 98 107 75 29 66 7 178
-        150 60 155 57 0 59 121 244 39 154 176 161 130 56 45 161 131
-        240 242 36 164 237 44 221 179 244 168 206 172 145 216 106
-        169 111 43 77 19 68 121 184 135 229 199 250 223 79 168 169
-        93 165 218 234 150 209 172 106 222 64 48 87 215 30 166 167
-        40 219 177 137 5 164 77 225 36 102 48 236 7 36 210 254 160
-        178 221 27 70 208 171 41 249 151 210 159 105 140 205 10 22
-        12 209 109 192 217 232 126 191 90 251 119 110 165 6 236 183
-        213 187 209 72 45 183 217 69 183 75 195 125 121 61 155 100
-        5 30 184 205 115 207 198 174 155 151 68 213 222 32 25 161
-        83 228 98 7 34 186 207 88 181 139 79 234 23 149 155 247 220
-        10 163 255 0 202 41 80 99 115 120 135 178 3 252 67 6 155 28
-        147 208 117 84 202 79 164 121 159 185 198 123 26 153 3 129
-        233 81 14 155 253 250 152 252 188 224 129 233 82 233 50 23
-        235 76 227 178 79 197 31 83 243 62 113 147 239 69 69 10 17
-        207 56 237 66 70 234 20 224 115 68 71 56 0 125 120 167 197
-        209 141 160 49 250 250 86 74 25 125 43 234 28 14 56 205 101
-        147 239 84 48 155 89 82 249 46 54 159 165 109 209 219 49
-        125 171 29 96 150 206 121 226 190 232 192 180 71 21 140 53
-        145 153 136 192 29 168 109 70 54 253 151 120 205 192 54 207
-        255 0 45 18 119 46 57 244 172 117 94 116 59 175 253 179 255
-        0 202 107 24 142 89 51 27 24 6 15 238 146 183 163 13 224
-        100 103 53 170 197 15 224 160 237 251 164 175 174 140 178
-        175 110 245 199 99 146 109 59 247 127 173 22 85 73 60 208
-        90 110 68 32 159 122 34 114 206 190 203 233 142 245 117 29
-        89 39 221 16 158 179 54 177 220 6 150 54 101 29 212 54 9
-        253 107 111 65 52 119 55 208 199 14 159 167 164 123 191 120
-        209 111 147 191 189 1 214 76 222 33 221 130 113 71 252 41
-        88 255 0 104 199 36 165 130 171 100 227 214 150 79 84 58
-        126 71 78 217 170 67 162 91 71 31 38 76 42 17 235 86 191 71
-        218 226 40 183 157 227 104 3 30 245 85 116 252 107 47 224
-        147 147 26 121 176 106 212 209 200 68 130 221 153 131 103
-        118 229 237 138 136 242 236 147 52 74 210 101 92 7 94 113
-        81 206 163 180 146 65 45 212 115 0 66 224 212 170 13 172 85
-        149 148 48 60 230 163 157 92 118 146 241 130 177 200 118 96
-        251 227 63 244 167 125 0 170 250 146 107 143 26 41 174 154
-        105 32 81 183 100 67 37 142 104 141 62 226 225 44 37 156
-        192 167 127 149 93 184 194 251 154 34 85 150 107 205 145
-        176 9 27 121 178 56 175 107 55 45 34 236 114 145 219 47 4
-        142 9 164 10 179 239 79 89 193 97 27 94 77 34 162 47 152 51
-        30 13 9 170 235 147 234 243 24 80 18 177 156 130 61 69 71
-        239 239 159 88 188 88 85 21 45 226 60 5 39 154 51 80 158
-        223 65 182 73 37 184 54 225 70 230 4 14 70 59 81 76 106 190
-        198 23 55 145 91 233 127 141 105 132 48 198 48 238 199 3
-        255 0 154 174 58 155 227 6 147 167 135 139 69 183 123 233
-        84 238 241 230 249 11 85 101 241 47 174 53 30 162 190 154
-        40 100 123 125 56 54 216 237 225 111 46 51 220 253 106 53
-        162 195 249 223 155 143 15 235 70 43 147 7 137 100 15 139
-        93 115 122 210 203 111 115 4 1 223 248 98 193 3 233 91 224
-        235 142 190 159 44 117 201 23 112 254 17 66 244 246 143 9
-        132 58 170 159 165 53 93 29 113 226 5 35 43 144 0 167 81
-        127 161 185 68 15 255 0 212 47 136 86 174 118 234 178 76 23
-        130 28 113 138 249 167 124 105 234 91 59 198 143 87 180 181
-        188 182 99 229 35 190 62 148 116 154 76 126 31 238 219 44
-        57 200 168 119 85 233 118 246 170 74 40 12 79 4 246 20 90
-        111 224 27 139 46 222 152 235 237 19 169 151 109 140 198
-        218 240 156 61 180 237 134 79 246 126 181 34 212 21 229 41
-        26 161 241 147 204 8 244 250 215 29 239 158 206 100 158 41
-        36 142 88 206 229 120 216 130 167 220 123 213 223 240 171
-        175 165 212 172 19 76 214 36 205 194 174 216 238 9 229 135
-        177 164 118 129 73 244 93 58 63 80 195 169 35 105 23 135
-        108 177 46 6 238 198 129 182 183 146 199 89 146 65 27 74
-        210 38 207 15 196 194 129 244 164 122 189 171 181 132 55 80
-        183 134 20 238 18 47 175 222 138 210 117 111 218 67 240 247
-        18 5 184 78 3 10 91 12 83 110 168 207 85 150 225 110 90 222
-        68 144 6 95 202 42 60 195 234 79 173 72 186 125 111 38 252
-        53 180 146 166 118 124 222 189 251 26 213 115 190 234 201 0
-        88 214 88 142 85 241 233 68 116 235 184 34 119 145 222 69
-        109 187 113 253 244 108 220 75 31 72 181 120 160 48 25 4
-        128 12 144 43 116 176 199 248 15 13 99 98 8 230 182 105 222
-        91 96 164 129 43 97 183 30 216 199 106 209 172 188 98 216
-        198 172 195 234 180 91 36 221 58 43 158 186 142 72 46 32
-        154 67 149 13 159 189 85 31 25 237 148 233 226 85 240 156
-        21 220 168 235 184 30 61 69 91 221 94 127 21 104 95 4 140
-        121 126 149 89 245 117 172 87 90 116 126 59 200 27 105 92
-        142 64 21 37 26 118 91 134 172 230 221 62 226 221 53 16 143
-        103 28 110 78 73 133 246 47 255 0 230 164 55 238 134 37 218
-        70 61 57 165 29 89 165 92 104 218 195 188 136 230 34 124
-        178 122 99 222 178 134 224 188 74 172 114 64 239 86 82 100
-        166 188 67 34 108 46 115 69 71 38 229 238 41 100 47 199 122
-        54 221 129 166 140 184 137 45 58 24 219 252 167 62 245 183
-        156 103 210 180 68 234 171 94 150 96 20 14 106 139 34 97 0
-        213 121 25 29 141 124 210 37 111 8 166 59 26 245 243 6 77
-        163 248 123 159 122 195 70 238 212 121 196 195 144 196 247
-        21 163 84 35 246 77 208 245 17 57 63 109 180 65 27 87 60 80
-        154 145 255 0 203 111 127 246 207 254 24 173 206 38 21 233
-        188 216 219 159 254 146 127 133 110 4 9 121 25 161 108 37
-        85 177 183 95 85 140 110 250 226 136 143 243 36 7 208 26
-        228 41 30 199 214 25 240 78 71 173 109 150 64 16 143 95 65
-        239 88 90 16 109 248 227 28 86 139 146 119 231 60 142 213
-        107 124 73 201 121 16 206 172 95 26 80 23 191 175 210 166
-        191 9 186 121 141 170 220 180 51 57 39 129 129 239 222 144
-        217 105 82 234 218 199 131 179 11 184 110 53 209 157 23 211
-        214 182 122 44 81 201 48 241 182 0 61 49 74 24 251 14 122
-        66 214 229 94 48 208 133 80 63 139 189 88 90 72 96 192 54
-        56 236 105 7 78 88 164 31 52 129 163 94 88 231 204 79 181
-        74 32 134 75 123 116 196 68 156 118 110 226 145 143 46 198
-        179 58 65 18 179 74 219 207 112 59 84 115 170 46 217 180
-        249 95 121 44 62 81 237 245 251 209 183 119 81 180 108 184
-        238 42 25 212 90 162 174 228 102 93 157 155 119 96 41 152
-        42 207 186 29 184 107 71 154 87 35 185 99 238 106 35 214 90
-        132 78 5 157 187 22 99 232 41 157 222 169 44 26 83 52 101
-        76 44 48 54 118 53 26 208 109 228 190 214 33 145 162 12 12
-        152 25 246 164 47 12 111 76 155 124 53 233 149 16 45 197
-        218 110 64 114 115 235 84 239 199 221 101 78 177 123 102
-        140 26 56 188 160 102 186 123 67 179 75 123 51 101 8 13 193
-        12 127 147 235 92 107 241 198 27 139 126 176 212 98 152 146
-        230 124 159 246 105 148 28 132 134 68 242 52 200 12 48 44
-        118 198 237 149 195 183 37 15 202 62 213 165 53 63 1 131 60
-        39 195 251 84 155 168 46 180 217 180 109 62 218 212 51 92
-        54 12 161 7 205 247 165 87 82 89 54 159 36 87 22 142 140 62
-        94 59 85 34 168 156 161 110 209 97 124 56 215 45 245 8 28
-        170 12 227 145 237 86 5 215 225 226 75 113 12 108 254 77
-        217 110 56 170 35 225 13 243 91 235 38 53 243 161 111 238
-        171 123 169 245 84 91 139 104 17 137 65 24 17 253 15 181
-        116 66 105 160 113 67 109 70 91 88 173 214 118 0 239 5 72
-        81 218 169 78 186 234 56 127 27 45 154 167 136 55 144 49
-        222 173 110 160 212 29 58 101 228 42 5 202 198 66 12 122
-        123 215 62 233 243 164 250 255 0 141 116 60 92 49 242 142
-        237 247 161 55 72 220 80 93 188 222 50 8 230 132 164 141
-        199 110 5 49 209 255 0 242 221 97 24 23 216 28 40 223 199
-        127 181 107 189 186 73 119 50 219 202 189 176 224 114 121
-        166 125 93 62 159 113 248 25 172 29 213 196 65 164 200 238
-        213 12 177 114 141 153 73 69 209 212 95 8 26 223 168 186 54
-        104 166 219 35 68 72 81 246 21 27 234 77 54 125 23 88 18
-        236 216 132 242 69 51 255 0 37 139 27 166 208 175 174 74
-        150 141 66 149 95 114 123 212 179 226 94 151 227 217 181
-        196 42 36 98 114 19 249 126 149 25 174 40 188 50 46 64 61
-        45 117 107 170 89 51 69 38 14 57 7 189 109 179 111 194 245
-        10 13 196 46 60 195 211 25 168 15 76 222 92 88 234 70 5 5
-        73 60 113 145 82 150 213 51 126 143 112 34 19 99 128 135
-        119 30 249 255 0 165 104 116 52 210 79 69 167 109 119 185
-        17 22 66 87 119 13 235 138 35 83 11 140 198 229 199 166 106
-        45 162 220 120 138 36 207 25 230 164 81 75 226 40 88 227
-        223 143 74 214 115 53 228 70 181 136 157 225 117 141 64 227
-        133 53 93 235 150 179 52 130 23 132 62 14 0 95 191 173 90
-        250 196 56 152 49 219 150 249 75 118 6 161 215 246 48 139
-        215 146 105 24 130 48 71 240 211 36 55 39 209 207 127 20 33
-        179 180 212 101 79 6 102 89 24 46 201 62 82 113 220 84 6 88
-        22 44 52 44 206 159 94 226 174 175 140 58 47 137 104 38 179
-        101 148 71 150 81 184 6 83 244 205 83 54 30 42 72 232 246
-        243 3 159 48 200 110 126 244 64 246 104 220 241 131 186 137
-        182 184 64 57 110 107 102 161 110 172 9 141 65 30 254 212
-        166 104 218 35 156 253 42 148 128 210 100 129 46 99 63 197
-        95 39 148 99 200 115 72 34 149 193 201 99 138 221 248 229
-        67 207 106 87 20 128 208 222 233 129 143 30 222 190 245 142
-        151 235 247 165 175 125 226 2 84 226 143 210 100 5 194 255
-        0 53 40 7 133 191 44 80 90 144 206 153 122 114 127 171 61
-        109 150 224 46 87 219 138 26 250 101 109 34 233 189 225 112
-        126 213 168 70 221 137 52 247 111 194 91 140 28 136 249 166
-        118 114 121 192 160 116 224 166 24 71 111 203 163 173 194
-        248 234 5 98 204 146 89 170 152 115 187 239 66 223 99 5 148
-        225 63 157 62 106 105 99 25 48 42 199 183 39 190 104 203
-        189 29 230 179 1 21 83 112 249 143 111 238 172 37 48 14 133
-        210 188 109 107 241 144 164 50 46 209 151 99 130 13 116 78
-        131 56 158 218 20 150 81 189 80 13 158 131 235 85 223 195
-        94 156 59 143 226 99 12 217 225 135 21 108 90 233 166 36 79
-        10 30 0 239 88 172 152 218 198 23 133 149 225 96 185 238
-        126 148 254 207 12 187 34 137 143 243 63 165 35 182 146 88
-        80 35 67 128 79 239 15 240 253 41 148 55 50 71 3 198 155
-        223 63 59 227 185 250 86 20 246 175 9 49 238 137 75 194 7
-        14 59 26 171 122 185 101 146 252 170 221 70 138 79 57 171
-        19 90 190 184 150 223 207 136 198 60 160 85 91 173 91 79
-        121 123 35 126 42 20 85 57 229 143 253 169 39 236 52 59 21
-        95 71 52 120 85 189 141 19 24 193 61 254 181 38 232 109 62
-        56 84 95 120 139 52 177 12 70 23 208 251 210 8 45 33 102 62
-        35 69 113 183 143 43 28 138 150 244 28 129 53 1 12 177 109
-        133 56 69 30 223 90 89 71 145 87 58 90 44 222 153 135 108
-        45 112 24 137 64 59 200 35 39 138 160 63 202 143 164 236
-        110 35 77 90 16 177 220 71 31 157 207 118 63 203 255 0 95
-        210 186 59 76 240 101 45 113 224 67 10 200 219 34 218 152
-        57 168 199 95 116 226 234 154 109 212 19 66 158 32 207 206
-        14 8 193 237 93 81 141 66 145 199 109 202 217 193 218 38
-        143 125 172 92 206 182 82 120 115 194 3 167 250 199 216 81
-        186 229 182 179 114 195 76 184 142 52 153 64 252 208 57 63
-        83 79 238 108 238 58 51 172 102 142 72 93 32 119 36 100 119
-        25 197 72 174 109 109 245 43 132 213 172 128 119 83 202 159
-        81 83 166 116 173 171 43 142 148 209 167 210 53 87 186 109
-        225 20 130 8 29 254 212 255 0 168 117 88 99 189 18 151 121
-        75 184 112 15 163 10 115 169 205 104 214 160 109 219 47 168
-        3 24 168 70 191 34 35 161 50 198 74 190 79 218 171 23 76 95
-        199 68 203 87 214 37 213 236 26 53 97 28 146 199 220 255 0
-        102 42 186 135 166 111 237 101 123 191 50 170 19 133 35 150
-        251 84 183 68 104 4 177 177 98 112 6 125 170 84 82 27 248
-        197 189 188 97 156 253 56 169 202 77 176 113 118 65 83 78
-        215 58 130 206 36 216 150 214 208 121 188 131 131 250 210
-        254 157 210 219 80 215 226 210 252 97 8 241 48 197 189 106
-        194 214 117 11 77 19 76 125 54 215 30 57 82 9 28 3 79 255 0
-        201 219 162 228 212 181 51 171 222 70 35 241 27 10 204 14
-        59 131 237 70 9 216 217 101 20 182 116 135 194 61 10 223 71
-        233 107 107 59 21 100 11 15 159 61 137 250 208 157 71 12 97
-        154 215 143 1 137 222 171 83 13 26 218 43 88 139 75 108 35
-        139 110 197 57 225 143 189 38 234 185 161 181 211 101 183
-        48 140 177 224 142 226 182 98 56 211 178 137 234 75 3 103
-        126 235 13 210 69 179 144 73 173 130 222 67 20 99 241 145
-        191 102 220 13 27 168 199 28 215 18 77 53 184 93 195 130 79
-        106 16 88 52 155 213 111 32 12 167 182 227 255 0 106 132
-        186 59 155 209 97 116 84 108 85 3 72 36 56 192 34 167 80 70
-        200 128 172 81 179 175 24 61 234 176 232 167 154 223 242
-        154 101 45 191 131 159 165 88 208 95 93 44 106 165 81 128
-        31 50 250 211 199 212 228 105 169 108 211 171 31 16 177 142
-        51 27 145 202 159 74 142 94 195 25 140 200 192 22 94 114 87
-        52 250 250 105 35 117 104 83 45 234 27 185 165 119 214 183
-        19 184 62 25 85 110 227 183 52 76 85 255 0 17 132 154 166
-        147 37 186 248 46 20 21 7 110 222 125 170 129 155 79 252 60
-        230 39 32 182 79 145 107 171 122 135 68 142 75 86 221 25 92
-        100 146 59 26 162 186 143 167 38 135 88 220 138 165 119 28
-        30 107 24 133 203 14 207 44 159 150 79 240 175 99 75 110 45
-        85 216 243 83 62 164 210 229 135 108 166 18 138 125 248 34
-        163 110 129 92 228 86 17 232 71 37 152 0 226 130 158 215
-        239 82 48 136 202 124 190 180 37 197 190 92 129 142 244 105
-        152 143 205 19 33 242 127 109 63 233 213 252 149 242 146
-        217 228 214 155 139 85 10 78 40 189 15 8 59 113 154 120 166
-        96 249 147 50 29 220 26 211 168 68 19 72 186 62 190 11 147
-        246 162 174 15 230 134 247 21 167 84 255 0 50 221 55 24 107
-        119 24 162 97 14 159 36 102 218 32 205 180 248 116 198 213
-        226 87 83 188 147 154 81 107 167 220 53 140 18 7 35 242 249
-        163 44 237 37 105 17 119 28 131 147 82 28 156 233 82 143 18
-        49 232 69 79 180 187 75 121 32 92 220 73 28 184 249 68 69
-        133 65 186 106 197 231 158 36 49 201 38 61 87 210 174 190
-        145 211 94 68 137 95 195 66 171 140 177 231 245 172 97 191
-        72 233 106 109 6 103 93 195 186 142 230 167 58 110 155 149
-        2 36 4 1 146 204 199 138 15 167 44 108 128 241 124 25 230
-        127 226 240 71 203 82 107 123 49 34 172 113 248 241 71 156
-        226 65 131 88 87 42 6 22 110 1 241 219 196 92 121 84 129
-        138 211 5 149 227 238 88 149 84 19 252 93 170 65 111 103
-        146 84 149 104 151 251 65 172 166 82 241 42 66 205 41 31
-        194 220 17 253 148 44 28 209 92 245 109 181 212 113 110 220
-        74 129 192 30 181 84 206 151 127 141 151 198 194 3 192 4
-        213 229 213 154 108 146 218 14 114 49 230 95 229 174 127
-        235 72 166 211 53 41 87 12 242 147 223 39 129 83 156 188
-        139 225 142 218 26 233 208 201 11 157 171 16 82 114 78 78
-        106 95 211 141 17 148 180 69 153 211 137 31 248 84 253 106
-        187 210 229 27 98 154 234 102 10 87 29 253 106 99 211 247
-        50 71 229 137 138 237 243 73 143 226 31 90 220 138 100 73
-        45 23 31 79 177 184 177 104 84 141 225 195 120 141 198 71
-        208 83 253 66 55 75 114 242 175 137 43 240 0 25 207 21 16
-        233 137 18 107 104 217 110 11 55 0 15 166 123 84 230 250
-        120 225 136 200 204 200 137 128 8 25 197 118 65 218 60 188
-        146 119 163 156 190 49 244 36 186 173 171 92 181 143 225
-        228 44 85 153 187 143 94 42 128 158 223 90 233 105 158 56
-        219 198 133 143 215 143 181 117 247 196 9 154 123 217 165
-        105 34 104 200 206 194 249 195 127 241 84 31 89 91 238 184
-        157 99 133 30 82 55 40 29 143 214 169 197 23 199 41 112 162
-        186 185 214 103 186 102 123 219 95 57 239 33 24 3 251 42 61
-        172 120 51 36 69 109 119 3 47 206 61 78 15 21 33 184 142
-        230 221 222 9 70 84 15 54 125 169 116 176 205 24 93 141 132
-        241 6 6 59 26 159 17 249 72 198 214 241 98 108 27 117 4 224
-        149 92 211 111 252 65 168 64 98 75 43 87 17 129 229 44 56
-        199 233 205 3 107 110 99 99 52 152 50 150 56 99 237 154 123
-        211 176 77 38 160 37 101 223 31 177 237 70 43 246 110 82 10
-        232 190 141 212 53 205 71 241 87 143 28 140 88 121 125 43
-        171 254 26 232 50 233 22 137 111 248 16 144 42 133 223 142
-        9 170 163 225 212 126 10 143 13 109 192 115 128 31 230 253
-        42 249 232 235 223 11 77 134 25 36 73 90 110 236 15 57 166
-        215 194 25 174 84 55 189 178 97 21 188 74 235 225 15 54 210
-        121 53 5 235 9 86 234 105 118 131 187 119 150 33 243 84 243
-        168 21 134 153 148 145 35 216 255 0 49 238 56 170 163 172
-        110 246 221 148 183 185 203 147 193 90 134 99 163 9 14 213
-        90 57 49 224 176 111 230 87 226 144 79 4 139 52 147 43 196
-        140 253 129 124 12 209 122 205 212 6 227 198 110 1 242 103
-        63 197 239 81 141 94 238 226 25 194 40 87 70 244 127 81 244
-        174 103 45 29 138 28 145 48 233 15 198 27 192 146 18 27 119
-        163 2 63 76 85 189 164 89 221 73 26 42 185 200 28 131 85
-        191 195 29 42 75 141 146 194 172 24 159 144 255 0 15 30 149
-        113 233 150 55 16 170 135 252 206 60 210 123 85 99 234 114
-        229 146 230 1 29 155 9 135 226 87 9 252 254 162 190 157 54
-        73 150 76 206 179 156 121 119 112 64 253 42 68 34 23 10 4
-        109 226 159 76 208 151 54 110 238 87 196 43 32 237 232 7
-        222 137 62 104 132 107 26 118 99 219 226 136 152 14 121 205
-        86 125 99 167 175 237 5 105 110 23 96 62 102 65 87 101 229
-        188 101 30 59 139 121 159 159 51 70 50 13 67 181 253 46 209
-        204 177 194 198 53 217 156 74 7 6 176 201 217 68 117 172 48
-        8 222 72 228 50 38 223 33 116 108 230 160 19 129 180 62 59
-        174 113 87 71 94 233 47 38 158 234 139 184 43 97 86 169 187
-        184 158 34 241 200 48 85 138 129 236 43 2 74 221 128 250
-        103 222 176 101 39 229 25 53 159 210 179 135 230 170 115 85
-        64 52 201 22 80 150 24 56 161 172 78 217 8 0 119 166 23 142
-        190 27 113 233 75 237 10 155 130 2 253 105 224 237 24 105
-        58 110 10 223 74 18 255 0 63 178 110 193 244 129 218 143
-        149 149 99 11 142 72 160 117 31 243 85 217 61 204 78 15 218
-        131 236 193 186 90 198 116 139 76 50 159 232 201 254 21 240
-        8 214 109 220 18 57 24 165 154 124 231 246 109 170 238 218
-        22 221 20 215 212 185 118 155 195 29 189 234 35 147 62 151
-        185 63 180 227 85 109 196 243 145 232 125 170 240 233 87
-        154 98 130 117 42 224 113 159 90 231 254 159 141 77 220 110
-        210 109 243 14 213 208 95 13 174 45 209 81 90 100 44 23 203
-        187 146 127 178 177 139 91 167 68 45 106 163 233 147 24 238
-        194 164 246 194 223 193 93 177 201 193 236 190 159 122 65
-        161 25 226 95 204 138 16 51 198 79 27 105 254 159 226 186
-        121 152 39 60 39 253 105 146 178 13 219 8 84 102 112 4 112
-        237 246 207 52 108 80 71 23 155 240 209 243 245 175 145 32
-        81 150 82 62 181 181 229 80 128 114 126 212 234 128 38 234
-        59 17 121 1 113 181 118 131 149 240 176 107 157 254 36 105
-        145 172 225 132 94 57 82 119 47 168 174 150 190 241 164 6
-        72 31 195 35 212 142 106 176 235 237 5 174 124 86 101 12
-        216 221 187 24 57 164 156 20 138 96 157 62 69 19 13 184 134
-        214 71 243 120 132 102 52 147 248 105 222 141 61 221 194
-        172 215 18 131 50 12 125 90 134 154 19 103 168 120 18 237
-        96 217 0 125 104 103 241 173 101 252 106 134 27 79 111 74
-        229 105 166 119 57 114 90 45 126 140 184 86 180 102 55 40 8
-        237 205 78 191 31 60 86 95 135 107 229 220 190 111 47 36
-        241 242 213 27 163 234 202 176 41 241 140 81 191 112 123
-        211 185 186 180 219 217 198 209 221 168 144 143 56 99 206
-        43 167 30 95 140 228 201 141 223 67 62 185 190 0 22 88 89
-        78 194 89 166 24 85 62 245 68 234 173 20 200 146 120 151 15
-        39 140 216 192 249 177 223 21 100 234 93 81 167 222 233 242
-        121 135 138 27 206 9 24 97 75 172 109 244 123 201 222 118
-        186 72 146 21 59 6 6 11 55 106 235 82 137 57 41 69 21 69
-        244 107 60 211 93 169 222 178 249 75 55 4 26 2 230 55 93
-        145 140 130 91 129 142 245 120 75 240 222 29 147 220 75 118
-        30 222 100 81 28 157 134 226 70 72 166 215 191 0 76 154 124
-        23 81 107 2 210 70 149 7 157 187 131 233 218 133 196 73 100
-        226 172 231 200 35 12 21 130 144 9 218 51 234 105 173 147
-        53 180 47 106 237 55 154 81 38 213 29 143 181 92 250 183
-        193 155 93 2 226 207 241 55 27 217 230 97 184 158 15 181 0
-        157 15 107 160 194 127 107 93 71 0 157 155 135 97 207 177
-        173 113 30 18 114 86 36 232 155 166 181 212 229 142 20 15
-        143 149 27 248 143 181 95 61 33 125 178 213 99 141 94 2 163
-        115 73 32 242 131 237 84 149 189 254 147 167 202 177 171
-        167 138 174 4 135 0 227 235 82 24 186 206 56 238 36 138 210
-        113 176 227 37 143 31 165 36 164 146 26 172 183 53 139 233
-        37 145 47 13 228 65 72 33 147 61 170 172 234 89 213 239 76
-        97 195 43 49 243 10 217 127 212 139 61 152 48 202 93 149
-        124 192 17 222 162 154 181 244 173 190 4 254 177 41 201 39
-        176 251 87 62 73 166 138 98 139 176 77 70 226 105 110 227
-        128 248 50 89 41 255 0 238 31 106 9 108 115 118 169 36 98
-        88 216 249 95 209 13 31 102 134 210 220 137 35 60 142 239
-        220 83 222 137 209 164 212 174 195 188 108 235 158 0 251
-        215 53 72 232 121 20 116 139 19 225 174 154 190 12 107 17
-        119 219 130 199 244 255 0 10 182 236 213 161 183 40 171 147
-        237 81 142 150 210 174 172 237 217 18 40 227 82 0 5 187 212
-        174 22 216 118 158 113 234 59 26 234 132 93 108 243 231 92
-        172 209 53 180 127 188 240 78 87 156 30 213 161 217 164 25
-        154 48 24 118 49 242 113 76 193 89 99 56 237 67 205 20 120
-        199 202 125 13 55 16 8 111 196 76 140 161 37 39 25 203 14
-        213 1 234 117 1 164 101 229 74 96 55 189 88 23 183 19 70
-        204 138 137 142 217 62 181 21 215 72 134 54 150 70 183 84
-        245 221 158 63 186 183 18 176 119 162 142 235 107 139 179
-        101 112 48 74 131 149 250 213 55 169 21 153 101 109 195 118
-        226 49 87 143 197 11 59 89 172 228 240 238 163 86 11 193 86
-        242 213 7 168 41 183 153 227 13 189 119 119 20 133 31 26 4
-        138 53 225 183 114 56 162 35 249 141 99 16 93 166 190 134
-        10 199 218 177 51 11 207 221 183 218 128 179 230 224 227
-        154 97 117 242 31 181 45 179 202 206 87 215 189 82 14 145
-        135 197 65 136 103 142 40 13 74 48 116 219 220 28 255 0 70
-        122 48 73 249 67 52 22 160 196 88 93 242 60 240 56 20 89
-        132 246 173 33 176 131 211 242 147 181 25 98 164 202 55 122
-        241 90 172 99 38 202 223 63 232 146 141 137 10 48 53 33 195
-        237 36 17 76 55 59 140 28 241 86 191 194 221 82 71 187 85
-        134 86 137 241 229 144 138 169 145 73 66 203 220 28 154 150
-        252 57 214 154 199 83 71 134 72 163 97 235 39 106 198 58
-        223 67 121 30 205 68 246 178 34 103 201 57 60 49 250 84 166
-        202 250 59 114 171 42 153 28 140 2 7 97 80 110 157 214 5
-        238 147 18 27 150 57 60 113 156 126 149 55 208 161 152 66
-        38 143 136 200 198 120 57 63 173 89 164 186 57 199 169 35
-        72 23 119 0 142 213 189 35 81 233 199 181 13 8 118 33 179
-        192 224 209 101 148 32 227 154 6 62 50 174 119 99 129 233
-        74 122 130 205 110 173 152 236 11 246 29 233 163 72 161 114
-        71 21 131 48 145 10 178 239 83 233 237 65 179 45 20 167 88
-        244 52 211 91 27 203 104 80 178 18 119 122 231 218 171 11
-        187 123 200 110 31 78 189 93 162 67 243 123 87 79 107 176
-        53 157 147 186 43 75 17 238 139 232 125 234 136 248 146 177
-        73 114 100 84 96 155 185 13 195 126 181 25 70 203 225 156
-        147 164 35 210 116 152 166 184 16 52 171 42 149 202 236 247
-        170 207 226 54 139 175 105 90 204 242 61 196 190 11 28 198
-        83 149 219 237 83 222 151 214 197 133 218 194 100 240 225
-        249 67 96 114 61 170 196 212 52 152 117 189 17 90 56 209
-        212 12 238 35 56 21 60 77 73 157 83 132 226 185 72 228 251
-        45 112 139 146 26 86 59 20 134 4 156 22 162 52 205 98 226
-        222 203 242 166 62 57 186 18 54 227 193 3 211 237 83 78 185
-        248 112 99 190 184 149 45 13 188 32 231 116 125 152 213 121
-        169 104 183 182 101 130 238 0 252 153 238 5 116 62 206 120
-        228 82 123 39 58 151 88 245 117 197 134 159 165 75 124 86
-        218 24 205 202 70 184 218 7 177 53 60 215 254 43 117 237
-        199 75 232 182 247 182 18 89 199 225 44 214 243 173 187 21
-        184 10 123 130 51 199 189 115 249 107 184 36 221 151 221
-        141 188 156 241 237 82 109 7 226 31 89 104 177 71 109 109
-        172 94 4 130 217 160 129 50 8 138 54 238 160 17 218 154 133
-        88 87 254 139 31 226 175 196 126 181 234 43 13 48 94 88 61
-        132 70 63 26 222 88 247 33 125 191 196 51 233 144 106 29
-        212 157 103 212 58 189 165 140 186 165 244 83 35 32 88 176
-        131 32 47 114 126 181 19 213 186 147 168 117 153 33 159 81
-        212 174 238 154 217 12 80 120 178 110 240 211 249 71 211
-        147 66 44 55 19 90 71 181 75 159 155 25 236 115 90 135 73
-        46 221 140 238 53 67 251 78 238 95 20 178 77 146 50 121 205
-        104 210 245 75 139 217 34 181 134 232 137 3 16 192 3 154 47
-        67 232 251 173 64 201 227 187 71 35 225 148 14 248 207 106
-        185 62 27 244 16 178 195 61 132 105 48 148 18 242 96 22 95
-        214 132 163 171 4 230 170 162 7 208 29 47 125 30 141 53 238
-        172 242 178 203 251 188 30 64 199 253 232 177 103 28 123
-        100 241 137 149 120 84 110 199 239 83 126 177 191 182 208
-        237 37 183 143 116 44 56 85 36 55 24 244 170 238 202 83 123
-        118 94 66 67 19 148 106 228 116 203 168 73 18 94 153 233
-        253 83 95 144 76 202 76 46 112 163 31 227 87 31 73 116 153
-        210 204 49 204 170 14 1 194 210 111 135 23 11 20 34 8 35
-        145 159 56 201 3 21 104 90 90 27 93 175 36 126 35 176 206
-        242 79 31 74 233 199 7 86 206 60 143 97 118 241 133 77 187
-        118 129 233 239 91 90 53 199 28 125 171 21 155 60 50 225
-        171 238 252 119 170 217 42 53 58 136 187 51 42 250 129 65
-        234 23 94 12 69 100 143 35 221 123 138 60 149 151 229 20 27
-        169 71 219 252 62 223 90 1 35 215 115 43 40 113 32 251 55
-        124 84 47 171 100 186 49 179 184 154 201 65 231 124 91 149
-        170 85 173 98 202 233 252 103 42 224 121 152 199 145 223
-        251 170 186 248 147 214 183 90 125 177 91 107 171 105 7 250
-        223 246 53 138 68 162 190 47 107 186 95 138 214 49 248 190
-        48 28 73 25 198 223 211 181 87 209 0 214 161 139 51 100 247
-        110 244 87 94 106 67 88 234 55 186 240 194 31 92 113 154 14
-        73 213 85 87 233 82 4 244 244 124 133 130 190 211 235 68 52
-        89 229 73 52 2 183 155 121 163 109 174 50 160 131 233 88 17
-        102 171 131 149 35 233 75 163 27 110 179 76 238 20 96 210
-        213 254 179 85 198 149 14 54 149 179 26 231 142 61 41 102
-        163 41 252 21 194 142 194 39 166 50 168 48 131 244 165 151
-        202 63 5 63 251 167 162 251 17 183 102 122 48 63 179 160
-        224 254 233 43 126 71 137 143 90 203 72 79 252 174 220 129
-        222 36 197 18 45 198 75 17 81 101 227 217 227 251 146 61 77
-        15 111 122 246 87 65 149 118 227 187 30 213 235 171 133 141
-        128 57 237 90 226 219 121 34 110 71 40 7 56 28 154 186 143
-        40 137 47 99 167 126 4 117 157 174 161 167 172 63 153 44
-        136 120 24 171 231 78 212 65 81 225 218 249 118 231 115 28
-        0 107 144 190 28 89 173 188 130 77 54 89 34 32 231 105 56
-        39 237 138 178 180 238 161 234 84 87 102 17 76 136 48 6 9
-        199 215 154 14 60 65 197 51 163 45 102 103 1 100 216 170
-        121 5 78 69 99 169 220 54 192 163 201 236 199 214 170 77 11
-        171 245 39 17 71 112 168 23 28 248 35 183 223 62 181 53 209
-        175 226 185 45 33 153 131 255 0 44 188 98 164 251 19 36 117
-        72 147 192 159 42 72 164 38 120 62 244 112 27 80 5 35 111
-        160 165 118 19 120 142 1 96 223 202 1 230 152 44 168 80 110
-        202 243 142 105 211 64 173 30 154 21 153 25 100 25 82 48 69
-        84 255 0 18 122 82 19 35 155 101 32 179 100 10 183 3 46 56
-        96 104 109 66 202 27 200 240 200 140 222 153 173 40 218 27
-        28 169 232 228 91 238 152 186 91 147 43 63 135 20 71 60 142
-        255 0 74 125 211 93 69 117 98 88 93 200 22 221 92 4 207 160
-        171 91 173 250 76 108 150 72 227 80 51 187 143 106 165 250
-        146 41 68 141 111 29 187 8 213 253 185 205 113 188 124 37
-        103 124 36 178 42 147 44 121 46 108 53 205 177 220 69 249
-        108 155 65 247 250 212 119 170 190 23 217 155 104 37 134
-        225 10 63 203 143 240 164 218 37 252 214 58 188 112 204 228
-        64 202 48 79 189 89 90 93 253 188 177 237 89 214 103 253
-        214 210 123 15 113 245 170 71 43 229 103 52 177 46 52 138
-        27 93 248 99 116 151 210 44 86 251 160 69 196 44 163 211
-        220 84 30 247 64 107 107 182 140 171 56 31 46 7 173 118 133
-        237 180 90 149 144 93 194 54 141 118 57 42 57 250 138 137
-        106 125 33 167 197 120 100 88 86 104 216 96 101 107 174 50
-        199 37 105 28 235 179 155 116 14 140 186 212 193 240 55 51
-        49 206 208 188 226 167 125 55 240 195 54 203 45 210 186 72
-        143 198 70 55 15 122 186 52 46 153 179 177 138 55 182 217
-        20 217 228 99 140 83 173 90 104 225 84 141 97 141 86 49 134
-        36 96 181 53 165 234 138 37 201 144 171 110 135 210 116 79
-        10 226 121 20 205 225 229 4 124 130 107 238 173 212 150 246
-        54 203 105 24 72 156 55 151 216 241 254 53 171 169 181 136
-        109 237 36 219 112 30 68 114 145 166 114 77 87 147 73 121
-        168 91 139 182 87 46 210 121 71 176 174 73 101 116 209 214
-        176 213 51 45 96 106 26 245 227 195 122 216 99 204 45 232 5
-        54 233 30 147 152 202 177 205 147 199 3 20 227 163 244 134
-        213 30 40 228 140 164 138 70 25 187 26 185 250 111 167 99
-        183 132 60 209 70 37 3 154 92 80 79 108 76 217 56 233 25
-        116 63 79 219 217 233 161 221 79 138 125 79 165 74 23 229
-        25 227 28 115 88 194 137 12 33 19 140 119 175 179 58 38 55
-        56 31 90 233 163 142 105 182 99 58 163 46 230 96 160 118
-        165 215 146 52 67 197 102 150 48 222 168 51 69 207 44 126
-        25 60 176 250 14 212 174 246 96 84 171 178 178 5 200 32 240
-        69 103 163 40 114 26 137 15 135 230 81 199 203 187 179 80
-        83 95 73 202 136 33 56 255 0 91 154 134 235 29 68 108 99 48
-        219 9 166 0 124 199 24 63 110 106 11 172 117 110 189 53 203
-        197 225 196 233 140 169 112 114 181 135 88 210 44 46 168
-        215 33 143 79 157 228 73 85 84 16 222 249 250 87 37 124 96
-        235 11 91 205 78 75 11 75 153 21 131 19 137 70 56 171 39 86
-        212 53 237 70 57 32 188 185 82 161 14 28 13 187 87 254 188
-        213 69 213 58 29 188 241 201 42 67 113 123 118 92 225 136 0
-        99 251 107 112 79 232 106 136 45 172 37 228 105 14 112 123
-        31 122 33 161 221 231 60 55 108 125 40 217 99 104 81 97 112
-        145 183 177 239 65 22 96 73 244 237 74 218 163 27 60 53 9
-        206 43 43 104 195 112 57 172 21 183 33 251 215 212 98 157
-        142 13 32 12 175 65 7 145 74 155 137 197 57 148 111 83 187
-        154 73 38 127 24 71 165 60 69 147 25 187 226 49 142 120 165
-        247 103 117 189 217 247 183 113 250 209 172 165 163 31 106
-        22 244 40 211 231 199 205 225 62 105 133 25 233 30 109 42
-        213 113 140 198 159 225 154 57 216 44 44 48 59 119 160 52
-        103 85 211 44 148 142 76 8 127 93 180 85 196 171 225 242 42
-        71 74 116 70 181 2 242 94 14 113 199 97 247 169 87 65 219
-        36 215 177 195 40 220 8 228 47 113 253 180 141 109 252 107
-        213 37 60 184 239 237 83 174 143 211 149 39 87 0 110 35 200
-        195 131 138 180 102 170 137 190 236 187 58 103 166 236 35
-        48 52 114 32 24 221 133 249 170 91 107 165 194 210 5 148 4
-        24 192 56 168 247 77 204 176 89 68 222 55 138 83 229 76 14
-        126 149 52 209 238 55 145 226 76 129 217 126 87 3 129 90 82
-        85 70 74 194 44 116 24 227 153 78 119 103 182 208 48 71 214
-        155 92 104 236 214 174 17 76 111 252 203 220 211 109 38 72
-        100 140 6 240 164 218 118 249 123 230 152 203 11 109 9 28
-        140 152 244 32 100 84 69 110 136 158 149 251 66 218 111 194
-        218 184 47 158 78 114 5 72 45 159 86 128 156 172 114 40 93
-        204 199 57 253 41 93 196 81 199 127 137 15 131 38 120 34
-        155 219 106 64 58 195 28 121 80 57 111 115 72 60 23 137 178
-        29 74 89 38 86 154 45 171 252 195 176 251 209 173 121 8 5
-        150 64 9 249 72 245 173 55 48 174 4 182 234 178 49 30 104
-        207 111 191 222 180 189 188 19 219 238 145 124 39 95 238
-        166 78 76 87 75 160 203 219 113 121 98 20 190 254 57 35 214
-        161 183 93 11 13 220 146 220 54 84 224 236 80 7 38 165 58
-        35 53 189 185 93 199 104 244 166 73 134 1 135 108 230 179
-        175 160 230 215 69 41 170 244 5 221 179 37 204 176 248 171
-        17 59 84 14 231 235 81 248 244 109 67 78 159 196 11 34 144
-        251 184 245 174 141 101 220 140 49 201 239 154 73 168 104
-        208 238 105 240 173 207 153 113 72 240 193 236 172 103 162
-        162 147 168 46 237 252 56 132 78 217 143 156 131 205 101
-        107 212 23 37 89 165 134 70 77 222 78 15 53 53 189 211 108
-        154 225 166 107 120 194 42 144 191 65 65 219 221 104 214 54
-        107 248 235 88 252 36 82 219 206 125 234 111 148 53 101 249
-        127 194 40 122 138 227 204 86 41 3 231 142 15 106 211 125
-        123 169 234 176 162 109 146 54 3 146 163 189 74 236 166 211
-        53 75 176 109 97 70 129 135 151 138 145 105 90 109 177 111
-        195 248 9 145 242 253 41 146 151 105 153 78 190 21 78 149
-        210 55 151 72 200 33 98 31 141 199 146 15 189 75 116 79 135
-        114 8 209 111 35 196 123 118 140 119 31 90 179 52 205 54 27
-        24 246 140 125 168 227 207 113 84 73 62 200 203 249 18 122
-        100 95 167 186 102 29 46 97 225 64 133 23 213 187 231 222
-        164 83 203 28 108 25 164 31 111 122 251 43 108 224 71 147
-        239 154 80 109 218 109 77 228 152 17 30 121 25 239 77 72
-        156 83 126 193 247 23 107 26 144 60 205 232 40 24 111 174
-        166 111 14 8 145 142 78 75 103 138 222 87 50 5 130 208 2 59
-        190 79 21 153 11 103 110 207 18 6 62 173 236 105 28 218 10
-        236 85 123 38 178 45 252 88 165 81 144 67 32 30 148 134 222
-        198 235 80 184 114 210 22 10 249 108 30 62 195 233 79 46 46
-        86 123 98 100 102 137 7 30 94 228 214 26 28 69 220 52 56 95
-        109 180 109 181 108 51 175 245 23 221 104 208 203 25 13 31
-        229 129 194 251 210 27 221 6 56 84 182 239 46 120 12 163 2
-        172 115 20 110 160 110 19 183 169 110 21 62 216 168 230 179
-        52 101 156 43 64 138 157 234 170 104 69 127 74 251 80 209
-        225 184 180 144 51 194 168 14 15 166 106 191 234 221 39 75
-        179 211 165 184 146 21 154 112 126 84 98 23 245 171 39 87
-        185 202 186 49 71 82 114 25 71 106 174 122 230 37 156 40 50
-        77 55 180 64 0 15 246 86 228 53 20 87 81 74 130 251 153 35
-        67 39 101 143 36 99 238 104 9 50 234 54 142 213 35 235 13
-        19 195 45 36 96 65 27 252 170 57 231 245 168 229 186 201 20
-        4 73 195 103 24 247 20 128 122 116 122 47 148 253 235 9 178
-        172 72 247 172 226 32 3 159 122 215 63 53 128 213 133 195
-        34 136 200 60 253 233 61 209 254 151 156 12 102 155 69 26
-        176 198 222 244 166 249 130 92 5 250 211 196 70 168 105 11
-        47 131 230 224 80 87 255 0 212 238 63 221 191 248 86 208
-        219 160 3 210 133 190 99 248 41 249 255 0 210 122 167 17 92
-        141 118 127 137 253 159 1 207 30 18 86 196 51 186 156 182
-        87 212 211 13 50 12 216 64 27 31 186 76 140 246 162 217 225
-        136 120 123 80 41 224 115 206 106 40 232 98 43 123 241 111
-        55 242 128 113 147 235 86 7 70 235 76 246 230 31 197 68 140
-        195 200 164 237 96 62 135 214 163 182 90 28 218 158 99 130
-        221 164 59 178 0 198 15 235 239 83 110 151 232 9 102 141 45
-        238 237 102 138 39 28 156 252 191 98 41 210 160 39 68 255 0
-        165 250 138 212 58 193 170 73 178 233 134 228 73 134 1 30
-        245 97 104 186 198 154 206 169 103 118 214 236 71 158 25
-        198 232 228 63 70 244 168 62 133 208 169 21 164 118 179 70
-        211 148 27 99 71 200 199 234 65 53 34 178 233 77 74 194 47
-        232 114 58 143 68 151 133 31 99 89 171 11 157 178 203 176
-        99 185 30 56 210 54 198 74 171 102 50 61 193 247 166 203
-        120 56 63 32 61 188 78 23 244 53 94 105 26 213 214 151 34
-        65 172 88 220 66 190 147 198 165 215 63 92 122 84 202 206
-        234 75 168 188 68 219 34 158 79 151 1 190 191 74 70 19 118
-        187 11 222 67 44 177 177 18 6 220 184 239 75 186 90 250 71
-        102 183 153 124 225 176 64 244 250 211 153 97 142 226 50
-        193 164 82 7 96 188 138 91 106 39 134 247 250 138 202 231
-        141 231 130 71 181 35 84 131 21 240 154 167 49 34 238 13
-        199 24 160 103 45 29 214 214 82 84 247 241 56 81 69 217 110
-        49 40 48 52 89 28 140 19 254 21 246 250 214 73 151 104 141
-        217 125 8 28 212 219 108 77 38 107 71 120 216 109 66 69 16
-        38 82 128 134 28 156 80 86 73 58 66 99 117 124 158 57 70
-        255 0 181 100 201 60 78 89 81 153 49 200 8 114 63 186 130
-        116 48 99 44 138 63 45 178 123 226 132 186 185 120 226 220
-        97 102 63 196 69 97 52 178 170 171 68 178 242 57 204 109
-        255 0 106 85 169 92 92 179 21 69 112 185 231 32 138 22 195
-        24 41 50 63 213 151 154 140 182 87 118 246 208 73 27 225
-        138 101 126 149 203 122 183 93 117 30 165 38 161 167 94 204
-        208 248 19 164 109 30 48 78 61 8 174 179 185 188 189 92 25
-        97 105 87 248 252 157 197 85 223 17 250 3 72 234 125 66 13
-        98 214 217 180 157 71 112 23 37 99 32 78 61 73 24 239 79 39
-        25 157 120 230 177 233 171 1 248 55 105 213 17 233 144 222
-        220 248 50 217 52 132 194 7 204 23 255 0 154 187 244 141 66
-        229 131 52 208 177 193 218 131 28 154 143 104 115 197 97
-        103 13 142 159 96 237 28 40 168 143 225 156 240 63 252 52
-        217 46 47 152 134 48 50 182 253 196 178 145 71 81 68 114 91
-        118 137 97 184 157 190 85 49 159 102 172 252 67 180 110 96
-        88 154 77 109 119 50 219 170 24 228 45 252 71 109 24 101
-        102 64 162 57 11 247 225 73 197 73 79 147 209 37 141 160
-        167 186 40 14 197 220 115 130 7 165 7 113 54 223 48 243 159
-        85 126 194 182 71 11 42 110 109 229 255 0 216 108 127 133
-        105 72 101 150 243 196 145 88 133 236 2 54 15 247 83 59 176
-        85 5 105 241 55 134 93 243 188 118 52 46 171 34 67 3 185
-        145 93 199 101 3 36 83 68 142 84 92 172 100 125 233 38 189
-        36 203 4 135 240 108 231 30 163 138 165 94 128 145 12 135
-        241 90 158 160 99 86 111 12 54 91 105 201 21 39 134 85 183
-        137 98 82 177 198 6 60 79 251 82 189 46 217 152 134 104 12
-        1 142 78 208 114 104 235 213 217 228 142 57 60 188 6 101
-        237 246 166 173 81 154 62 94 77 44 150 225 83 42 23 213 199
-        155 244 21 29 213 174 34 181 133 247 220 69 1 3 45 52 190
-        103 31 65 255 0 106 47 91 215 45 44 81 252 95 21 220 29 171
-        26 33 44 199 219 21 16 190 126 161 214 8 240 109 13 165 190
-        237 202 146 99 113 250 241 154 41 1 161 62 179 175 104 240
-        69 36 239 49 42 23 205 52 173 134 99 238 61 170 187 215 53
-        233 37 34 230 214 241 150 215 186 60 131 195 76 125 9 239
-        86 14 163 209 114 73 40 146 238 54 109 195 45 189 72 254
-        193 138 135 117 47 195 150 190 148 93 78 178 76 35 253 216
-        201 217 143 246 79 21 130 138 135 172 58 169 217 198 39 142
-        64 252 43 3 197 34 211 238 191 16 134 70 238 220 131 232 69
-        75 117 206 133 188 138 228 205 37 140 174 15 206 242 112
-        168 61 197 71 36 129 44 93 193 85 69 221 181 85 152 3 143
-        240 166 143 96 146 189 131 187 237 63 74 196 29 195 53 186
-        102 73 6 236 167 232 192 255 0 133 106 85 227 140 99 239 79
-        45 128 38 30 212 162 251 139 174 120 230 156 64 8 250 15
-        189 1 168 70 11 124 188 147 223 35 20 189 9 35 116 37 90
-        223 5 128 29 243 65 234 18 255 0 67 184 255 0 116 244 90 41
-        16 1 142 195 222 151 106 24 252 61 194 110 27 188 54 227 61
-        179 78 165 162 110 34 139 47 220 55 251 165 160 238 251 175
-        251 85 234 245 73 118 116 190 131 109 63 174 219 83 53 253
-        234 126 181 234 245 80 80 139 143 222 15 189 122 95 221 143
-        189 122 189 88 198 235 207 234 95 253 163 252 107 86 155
-        251 179 246 175 87 169 31 209 144 77 191 121 255 0 217 173
-        49 127 90 95 246 133 122 189 74 198 143 99 214 236 104 22
-        253 243 125 235 213 234 148 69 126 198 211 251 197 175 79
-        251 179 94 175 80 8 60 191 187 95 181 100 191 184 74 245
-        122 153 244 62 46 204 26 180 183 239 79 218 189 94 166 47
-        30 205 144 126 248 81 147 250 215 171 213 136 100 236 244
-        63 45 125 184 253 239 255 0 109 122 189 80 143 177 51 91
-        252 181 157 167 205 94 175 85 95 208 154 161 175 147 126
-        234 111 246 63 235 94 175 83 46 204 129 173 191 131 237 91
-        117 15 221 138 245 122 156 192 58 215 249 246 111 247 149
-        242 127 221 39 251 85 234 245 17 88 116 223 212 135 218 148
-        220 254 224 87 171 212 16 77 109 253 105 105 76 159 214 222
-        189 94 162 140 205 87 255 0 50 255 0 179 88 71 242 10 245
-        122 156 64 133 253 217 161 174 254 85 255 0 106 189 94 165
-        125 139 35 47 253 58 105 99 253 68 255 0 186 175 87 168 174
-        133 63 255 217 13 10 45 45 45 45 45 45 87 101 98 75 105 116
-        70 111 114 109 66 111 117 110 100 97 114 121 74 57 98 119
-        65 87 115 51 121 110 112 113 115 72 53 75 13 10 67 111 110
-        116 101 110 116 45 68 105 115 112 111 115 105 116 105 111
-        110 58 32 102 111 114 109 45 100 97 116 97 59 32 110 97 109
-        101 61 34 102 105 108 101 50 34 59 32 102 105 108 101 110
-        97 109 101 61 34 116 101 115 116 46 116 120 116 34 13 10 67
-        111 110 116 101 110 116 45 84 121 112 101 58 32 116 101 120
-        116 47 112 108 97 105 110 13 10 13 10 116 101 115 116 10 13
-        10 45 45 45 45 45 45 87 101 98 75 105 116 70 111 114 109 66
-        111 117 110 100 97 114 121 74 57 98 119 65 87 115 51 121
-        110 112 113 115 72 53 75 13 10 67 111 110 116 101 110 116
-        45 68 105 115 112 111 115 105 116 105 111 110 58 32 102 111
-        114 109 45 100 97 116 97 59 32 110 97 109 101 61 34 102 105
-        108 101 51 34 59 32 102 105 108 101 110 97 109 101 61 34 34
-        13 10 13 10 13 10 45 45 45 45 45 45 87 101 98 75 105 116 70
-        111 114 109 66 111 117 110 100 97 114 121 74 57 98 119 65
-        87 115 51 121 110 112 113 115 72 53 75 45 45 13 10
-    } ;
-
-: dog-test-empty-bytes-firefox ( -- bytes )
-    B{
-        45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
-        45 45 45 45 45 45 45 45 45 49 49 51 55 53 50 50 53 48 51 49
-        52 52 49 50 56 50 51 50 55 49 54 53 51 49 55 50 57 13 10 67
-        111 110 116 101 110 116 45 68 105 115 112 111 115 105 116
-        105 111 110 58 32 102 111 114 109 45 100 97 116 97 59 32
-        110 97 109 101 61 34 102 105 108 101 49 34 59 32 102 105
-        108 101 110 97 109 101 61 34 100 111 103 46 106 112 103 34
-        13 10 67 111 110 116 101 110 116 45 84 121 112 101 58 32
-        105 109 97 103 101 47 106 112 101 103 13 10 13 10 255 216
-        255 224 0 16 74 70 73 70 0 1 1 0 0 1 0 1 0 0 255 219 0 67 0
-        5 3 4 4 4 3 5 4 4 4 5 5 5 6 7 12 8 7 7 7 7 15 11 11 9 12 17
-        15 18 18 17 15 17 17 19 22 28 23 19 20 26 21 17 17 24 33 24
-        26 29 29 31 31 31 19 23 34 36 34 30 36 28 30 31 30 255 219
-        0 67 1 5 5 5 7 6 7 14 8 8 14 30 20 17 20 30 30 30 30 30 30
-        30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
-        30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
-        30 30 30 30 255 192 0 17 8 1 49 1 64 3 1 34 0 2 17 1 3 17 1
-        255 196 0 29 0 0 2 2 3 1 1 1 0 0 0 0 0 0 0 0 0 4 5 6 7 2 3
-        8 0 1 9 255 196 0 74 16 0 2 1 3 3 2 4 4 3 4 5 10 5 3 5 1 1
-        2 3 0 4 17 5 18 33 6 49 19 34 65 81 7 50 97 113 20 35 129
-        21 51 66 82 36 52 145 161 177 8 53 83 98 114 115 147 178
-        193 209 22 37 67 116 241 99 130 240 23 68 84 100 146 225
-        255 196 0 25 1 0 3 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 2 3 0 4 5
-        255 196 0 39 17 0 2 2 2 2 3 0 2 1 5 1 0 0 0 0 0 0 1 2 17 3
-        33 18 49 34 50 65 19 81 4 5 20 35 66 97 82 255 218 0 12 3 1
-        0 2 17 3 17 0 63 0 228 200 149 136 219 131 200 207 233 68
-        196 145 112 60 21 45 234 91 181 57 177 178 138 75 56 95 111
-        152 196 51 250 209 11 167 198 14 118 138 22 138 153 104 150
-        118 82 46 217 45 161 98 79 242 102 157 38 151 98 174 64 211
-        237 72 247 49 46 104 11 8 140 111 229 247 166 194 70 137 12
-        146 112 61 235 57 36 172 31 82 7 154 199 78 244 176 178 255
-        0 132 41 100 195 76 15 183 240 118 60 31 244 85 237 126 241
-        237 237 157 213 176 113 197 66 158 254 234 82 74 49 45 187
-        144 42 49 155 158 217 108 152 99 21 68 214 88 116 217 83 17
-        218 218 171 250 109 138 180 254 6 221 83 205 109 1 199 115
-        225 10 141 90 106 23 106 187 95 59 73 239 237 77 44 111 89
-        79 136 24 186 250 131 235 86 199 166 71 143 20 52 181 211
-        237 24 143 232 150 236 61 140 66 155 65 167 233 251 64 252
-        5 158 127 221 45 3 99 42 220 42 186 240 79 247 83 139 38 86
-        92 21 57 20 76 246 140 78 155 98 88 31 217 246 125 191 209
-        45 108 253 159 97 255 0 240 44 255 0 225 45 22 216 200 199
-        181 99 88 74 98 77 99 78 178 69 111 14 194 213 23 28 226 48
-        15 246 212 30 242 21 252 105 8 145 170 103 178 213 137 172
-        121 162 127 181 87 151 141 182 247 31 235 210 180 216 209
-        28 88 217 219 120 99 250 52 100 255 0 172 155 168 248 108
-        109 11 103 240 208 127 194 173 118 82 71 225 47 148 246 163
-        11 169 30 74 81 140 102 182 178 35 203 97 104 62 162 46 104
-        41 45 109 119 127 86 131 254 21 48 144 225 9 198 104 105
-        198 24 118 53 76 77 81 141 73 105 109 143 234 176 127 193
-        21 146 89 219 110 63 209 97 255 0 131 69 65 183 110 15 39
-        218 182 144 160 159 41 6 169 102 5 22 54 138 114 109 45 216
-        123 24 184 53 177 45 44 137 231 79 179 237 254 138 179 118
-        101 112 167 159 181 102 131 140 212 35 236 99 95 224 172
-        119 143 252 190 207 254 21 18 186 125 129 92 254 2 207 254
-        16 172 15 148 230 182 71 46 225 198 106 178 78 204 40 213
-        237 109 83 33 45 224 237 223 195 199 247 214 189 30 222 222
-        69 45 37 165 187 156 227 12 161 177 245 230 143 214 212 8
-        75 123 138 15 69 96 7 220 214 159 169 135 31 129 177 192
-        198 159 102 120 255 0 68 181 240 216 217 12 15 217 214 156
-        246 252 165 230 137 139 205 235 128 7 204 123 80 183 154
-        148 118 202 66 225 156 118 62 148 169 174 38 91 55 193 167
-        233 191 60 214 22 96 14 249 137 107 84 199 69 137 246 174
-        157 100 255 0 65 18 210 43 237 82 105 148 188 108 64 254 31
-        102 164 243 223 204 146 249 155 39 233 73 38 50 84 137 156
-        112 233 19 200 4 118 54 201 238 22 33 68 54 153 166 52 96
-        173 149 163 15 115 16 205 66 244 189 77 141 226 40 115 143
-        90 155 91 73 192 116 245 29 141 77 233 140 177 169 46 64
-        109 167 88 45 203 31 217 246 92 127 244 171 19 97 99 226 16
-        218 125 152 227 63 186 20 100 204 56 247 245 175 66 84 145
-        191 147 235 246 174 140 125 18 180 125 183 211 108 72 7 246
-        125 158 63 221 45 109 151 77 177 219 254 111 179 255 0 132
-        180 68 76 163 133 206 51 197 103 43 0 184 166 158 144 72
-        133 244 54 113 220 5 91 120 50 59 254 77 7 120 109 188 48
-        22 8 1 207 242 98 152 106 170 191 137 45 239 218 149 93 41
-        97 129 239 73 97 143 96 19 172 103 204 161 23 232 181 164
-        71 152 93 143 173 110 117 101 67 90 142 239 195 55 165 97
-        229 251 37 122 124 138 182 48 118 253 210 81 66 116 250 82
-        123 2 205 103 108 55 30 99 31 221 218 140 134 63 56 221 200
-        169 147 26 90 229 159 56 20 109 242 171 89 16 217 251 80
-        214 190 80 49 197 110 212 63 168 147 234 107 74 62 44 166
-        36 156 209 17 234 235 140 193 26 170 182 230 227 21 40 248
-        113 208 240 234 214 169 53 194 224 63 166 57 168 167 85 55
-        136 34 5 87 126 124 170 123 26 233 15 129 214 42 221 59 108
-        123 112 51 27 14 223 90 142 61 68 233 206 227 249 58 35 7
-        224 252 57 252 133 141 91 25 82 71 24 255 0 189 44 212 254
-        21 222 99 16 171 120 139 234 160 97 171 165 99 81 143 5 145
-        74 142 199 29 171 239 225 99 121 138 149 80 127 133 241 205
-        22 229 96 121 19 84 145 199 250 231 77 106 61 62 210 25 35
-        114 189 212 1 198 43 237 133 210 72 71 24 56 228 125 107
-        167 186 179 163 236 245 93 61 149 35 76 148 42 43 154 186
-        195 167 175 58 123 85 149 9 37 67 103 63 74 117 39 123 37
-        151 26 110 226 20 14 64 53 246 132 211 174 22 234 21 216
-        217 111 83 69 22 80 72 197 89 245 103 61 238 128 117 60 155
-        121 15 174 218 174 239 8 23 141 158 251 170 192 213 36 219
-        11 175 169 28 85 123 169 237 93 64 240 57 52 99 32 142 45
-        89 191 15 229 231 154 46 201 155 60 214 141 48 43 69 141
-        163 24 162 109 227 61 199 21 57 118 96 244 57 92 227 52 43
-        198 219 143 126 244 68 18 3 88 202 172 141 134 108 147 205
-        8 107 64 62 65 223 145 131 239 91 25 188 199 39 38 181 163
-        99 191 122 250 112 199 118 59 213 83 160 114 54 59 46 211
-        239 89 39 203 90 93 89 88 115 197 110 64 74 113 83 138 169
-        5 59 62 183 35 214 189 16 193 197 124 109 202 123 154 251
-        19 13 199 35 38 170 242 69 62 194 105 214 255 0 171 138 85
-        166 169 82 204 164 237 60 103 235 77 181 129 226 66 184 98
-        163 220 82 155 73 24 202 45 34 81 201 239 75 44 138 141 7
-        114 72 110 146 203 36 73 12 42 207 150 193 197 73 52 191
-        135 215 186 168 241 220 180 113 177 206 49 200 90 153 124
-        40 248 122 110 151 241 183 65 66 12 48 207 191 189 94 54
-        186 61 165 156 94 28 123 10 149 10 78 59 138 231 109 252 58
-        163 8 163 159 236 254 19 73 53 176 86 80 176 175 171 1 197
-        107 185 248 77 101 105 103 51 204 187 36 199 24 25 39 255 0
-        249 93 18 176 195 18 157 177 168 30 212 191 85 132 201 109
-        39 134 138 204 227 110 8 160 175 232 210 227 196 226 14 170
-        210 27 66 215 60 46 54 110 5 72 31 227 82 141 57 214 72 145
-        137 198 64 237 70 127 148 13 146 219 107 208 145 150 5 240
-        91 211 245 165 58 75 237 130 48 72 36 47 117 237 71 39 113
-        4 23 248 216 202 224 96 100 114 107 24 148 183 126 62 213
-        182 101 57 231 145 89 70 6 7 2 174 221 35 133 71 102 248 84
-        40 245 172 110 57 38 182 175 3 140 86 19 1 142 194 145 182
-        199 34 250 129 197 226 100 241 154 211 52 121 77 194 182
-        234 67 117 238 223 236 162 150 17 248 81 218 138 116 52 72
-        228 225 183 246 21 241 148 126 30 79 76 46 234 62 234 16 27
-        181 7 34 55 135 55 63 250 116 232 210 118 168 117 167 172
-        127 132 183 220 224 15 13 127 187 189 16 10 135 194 144 69
-        43 176 144 155 88 23 212 71 70 32 110 251 129 165 170 25 99
-        99 139 78 127 182 179 213 220 199 167 141 190 86 35 191 189
-        42 241 228 132 174 50 65 246 162 53 9 89 172 227 221 158
-        212 178 151 139 54 61 100 68 118 241 86 227 89 182 132 121
-        247 72 1 2 186 187 225 157 184 131 70 182 143 28 162 128
-        203 234 167 235 92 181 211 246 87 23 221 92 145 198 173 133
-        144 121 192 249 107 170 250 103 242 236 35 241 147 194 157
-        84 6 99 252 85 36 169 34 249 98 229 34 100 89 89 139 43 6
-        97 192 35 211 233 95 94 86 17 2 199 56 238 105 119 226 188
-        171 223 183 39 222 190 27 172 16 95 113 79 95 173 16 199 30
-        134 246 242 11 133 60 242 59 212 75 226 103 77 91 235 58
-        101 204 138 159 154 145 147 145 235 78 97 152 171 248 145
-        200 10 31 65 222 138 155 100 200 21 178 222 167 29 171 5 87
-        211 144 110 214 109 31 80 240 36 111 32 39 57 244 57 237 77
-        224 152 92 69 226 174 49 142 126 149 105 124 86 232 27 125
-        70 22 187 178 132 9 2 229 177 247 53 76 66 38 209 181 65
-        109 48 111 8 156 18 123 81 229 20 170 201 101 196 253 163
-        208 94 161 14 251 105 27 217 106 189 213 20 11 226 125 51
-        138 177 181 70 205 153 104 249 87 28 85 117 117 253 117 247
-        251 241 84 87 240 231 26 233 108 192 5 3 131 77 145 78 243
-        74 180 213 193 7 138 115 18 229 137 172 227 33 27 48 183 64
-        24 26 202 126 13 108 140 169 242 142 9 236 79 106 26 92 150
-        228 250 209 140 93 140 124 254 48 107 34 195 39 154 215 255
-        0 231 122 247 191 253 234 188 65 196 223 27 151 24 144 101
-        253 40 152 179 130 49 233 90 109 85 29 124 217 163 226 218
-        19 28 98 163 123 176 165 64 46 219 13 122 22 223 39 28 147
-        216 86 219 133 4 19 90 1 240 161 50 28 131 252 52 91 131
-        219 55 144 62 189 56 91 68 133 88 110 245 30 213 37 248 49
-        210 178 106 58 188 51 73 144 138 119 19 233 140 208 189 61
-        210 211 245 12 232 193 79 204 57 32 226 186 51 161 250 90
-        195 65 211 161 138 8 255 0 51 104 46 125 106 115 146 78 145
-        124 17 113 143 146 37 26 85 188 122 109 132 113 68 184 96
-        49 159 165 125 185 185 85 59 90 64 119 124 198 180 205 43 5
-        43 156 31 79 181 10 178 36 44 26 70 222 205 223 30 148 165
-        210 177 139 150 149 10 227 98 142 192 250 214 155 147 253
-        28 199 177 88 122 238 244 250 208 171 52 155 134 88 98 133
-        150 237 164 36 46 112 15 53 129 56 190 145 65 255 0 148 77
-        158 235 69 153 118 182 199 218 54 118 239 154 175 116 73 72
-        181 129 135 204 203 218 174 31 142 22 18 234 26 36 203 2 72
-        21 60 229 64 253 225 207 106 165 244 67 38 194 37 36 178
-        240 51 90 91 175 248 104 234 13 18 169 228 221 230 127 46
-        43 5 151 196 228 214 55 127 186 221 238 43 85 187 100 227
-        158 213 94 71 20 180 232 103 23 43 197 125 145 84 168 201
-        230 176 135 182 43 100 156 40 165 9 22 212 144 45 249 247
-        163 161 254 174 40 93 79 157 67 62 153 166 22 234 166 1 197
-        96 53 98 235 149 12 167 222 147 234 3 242 102 81 220 71 82
-        41 99 12 59 129 74 117 91 114 45 167 117 31 250 103 251 169
-        148 140 129 45 55 44 17 99 253 29 23 12 204 28 6 3 20 20 19
-        127 71 139 159 253 42 223 28 129 136 7 156 154 103 208 255
-        0 153 177 205 170 120 204 3 12 12 240 69 111 213 199 134
-        145 66 163 36 143 90 246 154 141 148 231 143 74 203 89 138
-        67 123 11 6 57 199 21 63 134 139 243 68 211 224 110 159 102
-        218 140 243 189 188 178 60 152 249 192 192 171 213 173 128
-        140 176 141 15 25 193 244 168 39 193 43 63 15 79 19 76 7
-        140 199 206 184 171 30 250 50 146 43 42 228 48 193 168 219
-        163 177 55 200 71 226 254 97 228 140 28 99 210 183 69 117
-        30 226 31 105 30 222 148 46 161 152 75 141 229 148 156 226
-        149 60 140 70 248 137 80 189 241 75 143 34 186 101 158 54
-        201 25 102 241 55 70 35 3 216 118 162 108 39 87 144 66 242
-        108 61 243 239 244 168 180 119 82 49 253 233 136 123 10 206
-        207 82 89 36 88 174 150 38 195 121 37 76 247 250 213 123 36
-        224 214 201 204 169 20 145 60 61 148 240 72 245 170 127 227
-        23 70 172 150 134 226 214 223 107 103 141 130 173 155 70 86
-        183 66 28 179 3 250 26 58 242 194 43 232 66 92 66 187 79
-        189 115 201 108 56 230 163 105 156 115 105 60 208 196 214
-        23 80 148 145 71 5 135 122 132 235 145 201 29 249 42 188 22
-        245 174 164 248 151 240 207 198 70 212 45 21 81 145 142 204
-        10 160 186 163 71 154 222 77 183 49 8 157 84 246 254 35 239
-        93 112 206 180 145 203 60 93 201 116 37 211 39 10 0 126 41
-        220 119 81 1 144 213 22 120 174 35 92 237 226 135 146 250
-        234 33 235 143 65 87 228 217 13 50 87 226 199 254 144 126
-        149 245 166 141 200 243 10 133 46 162 232 115 146 72 172
-        206 175 41 238 191 223 67 147 9 51 12 132 227 114 214 82
-        120 106 56 113 80 209 170 72 88 5 76 31 189 20 215 178 152
-        212 149 201 197 50 102 37 118 211 195 242 150 227 222 140
-        18 71 129 181 137 168 84 119 151 1 73 197 49 180 191 153
-        148 110 200 199 106 231 250 104 246 74 29 148 174 230 227
-        29 177 89 232 58 77 246 183 172 195 20 112 177 141 125 135
-        6 153 244 151 75 234 157 65 36 113 136 241 9 0 230 186 15
-        162 250 19 79 208 225 79 42 25 145 130 183 31 74 76 146 138
-        71 84 49 211 183 209 143 68 244 245 174 149 167 6 252 56 86
-        28 246 169 45 207 130 182 134 66 222 30 61 187 214 251 192
-        182 235 26 15 40 39 210 144 107 247 22 176 249 46 37 36 124
-        193 127 155 233 83 91 118 86 172 214 151 14 236 220 228 103
-        130 222 213 147 204 138 164 48 86 39 185 168 228 218 149
-        196 206 56 17 91 129 133 81 243 17 88 53 227 180 137 28 114
-        56 92 122 247 170 27 241 177 225 187 24 231 251 171 43 85
-        241 50 170 14 15 36 154 87 109 34 151 27 134 121 167 54 108
-        225 129 12 118 251 82 185 168 151 112 226 129 250 130 194
-        222 77 30 118 120 247 237 140 250 122 215 48 107 54 169 103
-        169 201 224 163 129 188 240 195 138 235 187 203 101 109 50
-        82 205 130 227 143 181 115 71 197 11 55 183 214 228 88 219
-        17 239 224 1 244 162 157 171 57 102 252 68 107 48 54 234 27
-        24 175 68 15 114 49 158 213 166 218 19 37 160 207 38 140
-        137 120 10 220 145 86 198 173 108 227 123 9 130 182 203 218
-        181 195 216 240 59 214 215 70 49 131 73 244 196 91 80 99
-        248 197 62 230 152 193 145 111 145 75 245 24 207 226 147
-        159 90 109 103 31 244 97 158 115 84 140 28 140 40 184 185
-        117 148 100 12 118 173 183 172 143 165 92 48 193 34 39 175
-        186 149 168 14 24 142 49 64 220 201 183 78 157 87 129 225
-        61 43 84 232 196 94 55 155 195 207 134 216 61 168 155 89
-        101 241 16 108 61 232 168 236 220 219 161 11 198 208 223
-        219 91 173 172 157 100 86 32 119 166 109 80 30 201 95 79
-        166 228 30 245 150 187 129 127 18 255 0 101 110 209 23 195
-        43 246 175 107 136 5 253 171 30 119 29 181 54 44 125 209
-        127 252 28 119 147 73 72 230 142 40 215 60 31 122 156 223
-        199 182 38 200 192 3 32 212 119 225 21 138 174 131 12 155
-        67 115 220 84 183 91 141 148 97 89 64 199 32 251 84 228 244
-        119 67 216 175 53 163 38 215 30 25 199 112 213 29 69 63 48
-        152 73 159 65 233 83 13 65 48 37 1 124 167 249 170 55 61
-        169 40 20 109 200 254 90 129 218 4 247 78 190 70 24 83 220
-        214 80 238 154 69 16 176 14 14 87 234 104 11 230 104 238 90
-        118 5 84 252 202 125 190 148 126 152 158 21 202 220 69 135
-        4 103 13 217 215 233 250 215 70 55 226 38 88 187 39 154 13
-        208 252 34 163 33 141 193 243 231 212 251 211 251 121 149
-        85 1 97 130 112 191 90 135 90 206 197 188 64 27 45 201 207
-        127 214 134 215 181 195 98 143 189 138 237 77 203 207 99 70
-        147 236 131 99 174 169 234 43 123 77 62 84 37 70 88 247 53
-        203 223 20 122 138 214 234 127 203 100 102 12 71 7 177 230
-        180 252 80 248 131 123 168 93 92 217 90 92 48 143 126 11 3
-        85 179 199 52 132 72 237 36 140 199 144 125 105 163 26 232
-        132 230 210 164 48 75 217 26 50 178 31 175 216 86 192 177
-        179 120 114 70 67 241 199 223 181 123 78 176 141 158 25 60
-        57 29 36 94 123 112 125 170 77 160 116 237 205 192 152 92
-        70 3 69 180 142 14 72 30 149 94 150 201 70 42 93 246 70 127
-        3 111 32 5 156 28 246 30 245 190 13 46 213 184 24 7 252 106
-        204 181 232 39 188 134 25 214 2 158 110 1 167 211 252 45
-        149 128 217 22 112 6 10 158 230 167 249 25 79 192 83 113 90
-        218 43 149 217 141 188 156 214 187 150 139 38 69 97 207 165
-        90 154 223 195 91 168 237 85 150 18 178 103 7 158 226 163
-        250 159 68 74 152 183 104 138 133 245 230 154 51 108 73 97
-        165 178 2 110 35 93 185 140 228 246 250 214 22 218 145 75
-        144 79 49 169 237 237 76 239 180 139 136 30 225 167 183 116
-        136 113 19 250 19 244 164 87 118 130 221 66 140 239 113 150
-        255 0 84 123 26 210 236 17 199 79 146 58 87 225 47 85 90 20
-        133 99 120 217 252 48 184 7 154 188 44 181 72 110 33 115 28
-        138 189 178 107 243 247 73 212 245 13 34 238 43 139 91 150
-        86 86 224 103 130 43 161 190 21 117 252 218 133 187 199 52
-        195 196 199 42 79 57 169 101 130 173 150 89 37 47 133 243
-        123 62 27 184 205 66 250 153 228 158 87 72 219 242 128 203
-        31 230 250 83 11 125 67 241 86 98 67 184 239 92 140 119 20
-        179 85 146 97 108 214 246 225 124 118 236 237 217 7 169 53
-        139 136 77 210 199 8 240 215 106 142 5 122 9 94 225 177 34
-        149 251 208 119 94 29 164 113 164 108 89 229 206 11 127 16
-        254 111 181 21 167 69 35 196 145 178 183 3 230 247 165 148
-        171 163 166 41 164 130 109 86 72 238 147 99 239 32 246 21
-        50 208 67 51 13 202 70 225 138 143 217 91 1 54 246 198 79
-        106 149 105 49 31 46 210 1 250 210 91 125 141 149 166 135
-        114 167 244 87 221 194 162 96 31 173 115 103 199 23 118 190
-        241 36 82 160 55 148 159 90 234 47 194 238 179 39 25 59 121
-        246 174 109 255 0 40 116 120 110 193 194 99 119 97 84 199
-        217 231 101 232 129 88 15 19 77 12 127 74 223 28 124 80 182
-        50 40 176 133 70 70 70 236 125 40 181 124 40 198 106 216
-        211 226 206 89 109 155 34 93 166 136 112 118 10 12 51 23 28
-        26 222 242 16 170 190 227 251 40 168 180 18 63 170 115 121
-        30 61 233 149 159 238 69 44 213 124 179 41 200 224 209 54
-        210 55 130 49 197 27 163 25 220 166 238 105 102 167 24 91 9
-        200 239 225 63 20 222 94 35 207 189 5 169 47 244 9 255 0
-        221 61 43 70 54 233 208 175 236 235 101 33 79 228 35 103
-        244 175 52 113 171 249 177 244 197 37 178 189 151 240 22
-        235 26 231 108 64 22 250 14 212 76 115 74 236 190 76 156
-        214 148 120 148 135 25 116 137 30 154 114 195 142 115 199
-        181 103 212 2 69 22 211 42 134 41 38 15 181 97 165 135 104
-        187 109 230 137 213 70 52 183 247 83 145 247 160 73 170 154
-        103 65 124 33 150 245 186 106 18 99 120 198 121 199 106 156
-        223 50 181 177 103 80 95 24 21 0 248 17 121 29 215 79 197
-        27 206 216 7 154 178 245 45 63 242 188 72 206 83 28 87 61
-        118 206 200 63 34 5 170 47 149 155 113 35 212 123 82 11 169
-        21 163 11 24 218 71 114 106 73 171 90 72 204 237 27 21 199
-        124 122 212 102 246 53 149 138 188 133 0 61 197 37 89 217
-        29 136 53 75 171 111 21 13 192 196 108 112 91 218 137 211
-        97 109 58 34 151 18 135 183 97 186 25 129 206 207 245 126
-        212 171 82 145 33 117 180 155 5 91 129 159 74 81 38 165 119
-        166 23 181 185 13 36 64 111 140 154 120 107 68 242 77 217
-        59 186 215 99 183 178 109 201 135 81 232 121 199 215 235 84
-        183 196 238 182 55 119 18 90 219 202 225 135 145 142 107
-        221 79 213 32 192 235 24 33 241 140 3 233 239 85 212 183 17
-        202 254 44 222 116 39 42 87 230 253 106 177 77 156 83 157
-        61 31 45 237 237 239 1 102 27 100 118 207 29 137 246 21 186
-        210 206 226 234 117 88 99 32 227 102 0 229 79 210 134 131
-        114 220 179 91 169 147 235 31 106 184 62 29 116 188 215 205
-        14 160 145 168 115 141 216 236 79 184 250 85 23 138 217 40
-        183 116 197 93 13 210 179 94 74 18 230 213 114 14 72 92 240
-        106 230 233 14 149 201 182 205 143 49 182 210 72 249 254
-        245 48 233 30 132 176 210 209 47 24 174 233 57 97 252 167
-        218 167 186 85 149 188 100 34 145 133 57 28 122 212 102 220
-        186 58 97 20 182 200 190 129 210 227 194 72 103 183 201 140
-        229 192 28 17 78 83 165 195 162 4 143 96 7 111 126 245 58
-        210 108 148 90 143 40 231 191 214 137 154 200 237 77 168 54
-        171 110 34 137 185 113 123 101 115 115 210 176 184 101 150
-        223 113 81 198 106 35 212 61 46 204 146 44 118 104 3 38 204
-        227 176 247 251 213 241 45 180 101 119 0 9 35 251 41 14 173
-        104 170 73 101 10 153 224 208 119 240 50 148 89 202 157 87
-        210 48 77 60 202 214 110 145 193 229 140 1 199 222 169 174
-        161 208 175 22 242 86 75 117 218 95 31 252 215 114 106 218
-        69 181 227 52 71 111 57 46 113 223 138 169 250 227 225 231
-        131 110 90 216 198 94 224 22 231 209 126 149 162 223 45 154
-        81 168 156 164 246 105 35 152 164 140 41 67 203 122 15 160
-        172 244 205 66 77 47 82 51 89 54 17 78 55 19 203 125 233
-        247 94 105 223 178 174 22 205 16 237 44 124 64 125 90 162
-        182 234 136 155 102 138 70 62 137 31 173 94 124 90 57 84
-        156 54 116 39 195 190 179 134 247 78 137 124 92 52 99 12 24
-        250 84 190 125 74 222 228 22 13 148 35 12 7 241 125 15 210
-        185 131 65 214 164 211 239 247 12 162 231 205 138 181 180
-        30 166 140 66 173 183 114 133 221 180 251 251 212 163 217
-        104 57 61 217 45 187 183 48 52 154 150 161 34 137 37 242 67
-        26 246 81 232 61 233 182 153 49 100 85 229 112 63 90 138 45
-        212 147 203 251 79 82 37 80 183 229 102 164 26 9 252 67 120
-        146 72 85 91 145 72 227 114 59 160 237 18 88 219 116 161
-        128 194 250 98 164 218 66 175 145 152 176 31 74 141 233 144
-        188 234 35 221 177 148 246 247 169 118 137 110 210 97 23
-        142 49 73 246 131 54 146 29 92 206 230 219 109 190 115 183
-        140 251 87 51 255 0 148 20 183 13 170 120 78 170 124 221
-        249 174 164 185 130 27 123 23 50 76 82 69 143 129 239 92
-        167 241 178 239 241 93 84 144 43 29 170 196 55 214 169 141
-        83 103 14 94 136 60 113 50 75 18 174 79 229 246 52 94 226 2
-        231 223 154 250 84 199 50 150 228 142 7 218 177 118 12 221
-        171 162 18 75 71 56 79 139 25 101 81 243 99 244 172 165 198
-        194 27 185 239 143 74 24 174 210 24 112 43 207 32 216 41
-        219 179 8 181 86 62 48 237 222 143 178 93 208 45 3 170 168
-        241 215 143 90 105 166 46 97 24 246 169 72 198 115 174 16
-        41 251 208 58 145 99 167 93 28 124 176 57 31 217 76 167 70
-        35 147 64 234 8 223 179 47 121 255 0 246 207 255 0 45 82 49
-        209 133 58 116 91 236 237 155 215 195 163 214 53 35 105 60
-        208 186 71 245 59 111 247 99 251 232 167 39 120 199 189 115
-        61 187 58 49 244 62 211 27 106 40 244 11 138 206 245 131 90
-        52 110 112 15 124 250 80 182 59 150 60 230 183 93 131 52 5
-        27 128 123 98 175 195 198 206 121 123 23 111 194 141 25 19
-        165 163 146 25 150 25 163 228 146 123 213 139 166 235 6 72
-        132 55 16 182 244 227 196 61 136 170 231 225 154 76 186 12
-        22 208 179 49 99 134 250 138 156 221 168 180 182 82 216 81
-        234 125 123 87 36 175 164 117 198 187 96 58 228 214 203 59
-        186 202 20 145 242 147 193 53 1 215 181 21 183 159 204 200
-        184 60 224 240 43 87 94 245 125 134 157 20 166 73 17 216
-        118 25 230 168 174 178 235 171 237 81 90 222 215 114 199
-        158 72 239 250 86 132 91 208 207 34 142 209 51 235 190 160
-        181 86 120 81 64 43 192 57 245 168 68 189 85 123 61 177 130
-        95 57 67 149 63 78 212 133 26 107 169 12 183 147 177 200
-        245 61 205 1 113 118 200 204 145 224 15 173 118 67 29 171
-        100 178 229 182 25 125 127 150 37 188 197 251 168 238 15
-        189 39 185 59 88 239 96 227 233 90 204 153 36 243 156 250
-        214 80 71 44 242 42 170 239 102 56 81 158 230 153 164 142
-        87 119 100 211 225 206 159 38 163 172 70 24 180 11 24 192
-        157 144 149 39 254 181 215 159 13 186 114 107 91 40 63 18
-        33 155 114 143 204 72 246 156 125 126 149 76 255 0 147 198
-        143 171 90 193 29 212 150 211 92 187 159 201 137 149 118
-        238 29 192 231 57 31 95 210 186 179 67 253 204 19 79 111 28
-        23 17 128 94 51 243 21 255 0 10 231 148 172 183 14 42 205
-        194 198 51 182 56 212 246 239 76 244 141 60 52 109 25 57
-        246 62 245 140 23 182 18 93 21 158 101 66 237 144 163 184
-        167 169 60 62 42 219 197 177 155 211 111 183 189 78 154 232
-        101 145 208 77 140 91 97 53 181 215 56 86 224 19 201 175
-        182 255 0 153 207 99 244 237 88 207 34 169 11 131 222 155
-        95 72 74 219 179 99 70 54 96 118 28 10 87 127 110 100 144
-        112 118 47 115 77 147 204 156 80 119 141 180 129 42 159 15
-        233 220 208 119 240 104 57 39 178 37 117 96 85 213 147 200
-        51 198 125 105 102 187 166 69 54 157 34 149 46 249 193 30
-        255 0 74 152 93 203 101 248 35 47 136 164 33 198 65 165 111
-        61 188 182 243 165 187 70 230 70 249 143 96 43 36 238 217
-        105 100 109 81 202 255 0 26 122 94 231 240 119 19 36 177 69
-        30 60 177 32 36 177 255 0 189 115 30 160 38 130 83 13 194
-        52 108 59 6 24 56 175 208 63 136 208 223 92 105 207 21 134
-        158 207 19 103 243 21 87 43 199 98 73 239 92 75 241 71 69
-        212 236 122 138 225 174 109 229 104 249 35 198 24 32 125 72
-        227 251 234 139 100 114 69 209 22 180 152 162 121 78 1 245
-        167 218 70 173 115 107 34 186 254 98 142 224 122 138 138 6
-        100 227 248 79 106 221 5 228 177 159 47 98 49 85 171 22 46
-        145 97 69 213 51 92 95 197 248 179 182 5 249 99 61 254 245
-        105 116 222 187 111 113 98 30 50 170 84 236 7 61 207 181
-        115 221 153 241 206 226 88 47 185 244 52 108 26 166 163 165
-        220 175 225 238 11 170 182 229 0 240 77 35 196 213 179 170
-        57 18 143 103 91 244 253 212 110 23 116 170 167 102 50 125
-        13 77 116 75 168 109 109 131 33 103 25 229 147 214 185 131
-        161 190 34 36 211 8 175 36 104 229 7 140 227 7 251 234 246
-        233 77 90 222 254 213 26 9 55 2 61 235 145 220 101 208 202
-        74 107 178 77 121 113 115 170 188 145 70 36 181 135 30 99
-        47 241 253 171 159 62 46 90 90 218 245 34 77 104 193 54 183
-        0 213 253 169 91 200 150 203 113 19 96 168 36 227 218 185
-        235 226 187 51 106 194 86 112 70 227 192 239 84 199 53 100
-        178 105 82 35 18 57 99 90 7 239 43 4 155 33 91 156 123 86
-        107 203 110 174 142 36 101 166 19 130 0 200 199 21 237 170
-        121 39 154 248 155 177 230 32 214 71 129 156 142 105 210
-        179 8 245 140 248 163 138 109 163 200 162 223 130 51 138 85
-        173 224 74 87 190 61 69 29 163 254 235 244 161 40 152 57
-        183 51 103 6 131 213 8 93 58 247 60 127 71 127 249 104 238
-        62 180 22 177 183 246 101 239 127 234 239 255 0 45 20 233
-        24 85 167 73 26 216 65 158 254 18 86 70 100 50 129 159 90
-        89 104 199 240 86 236 199 63 150 63 186 178 133 100 146 225
-        112 199 147 197 69 37 101 99 145 116 137 133 143 154 42 223
-        50 31 8 149 228 138 209 167 127 87 0 247 94 9 162 157 136
-        78 14 51 222 171 242 136 228 246 39 127 8 122 155 193 211
-        165 220 219 222 54 192 218 113 254 52 71 92 124 78 134 206
-        23 182 242 187 28 252 196 228 113 244 170 88 223 220 219
-        207 44 80 206 241 239 239 180 227 38 144 234 211 205 121 49
-        73 228 101 63 206 79 45 244 169 180 145 73 78 162 107 234
-        29 90 235 92 212 101 113 39 229 150 254 34 104 102 133 173
-        146 56 230 104 163 6 61 202 249 206 107 11 155 118 183 143
-        115 52 123 72 227 117 42 184 144 147 183 57 35 142 15 24
-        167 142 136 115 114 14 212 175 140 155 18 48 170 23 212 122
-        208 18 51 72 219 155 143 181 124 141 89 188 217 237 82 45
-        15 165 239 239 228 64 35 220 172 50 60 164 211 60 180 168
-        122 182 34 182 181 150 105 22 52 83 150 56 21 119 124 40
-        232 61 22 11 120 117 14 162 91 71 193 223 137 156 141 163
-        244 168 207 76 244 169 183 63 136 212 18 225 18 57 54 168
-        100 219 185 135 63 225 91 58 183 90 125 107 82 255 0 195 61
-        62 206 225 188 133 223 130 120 244 164 82 82 209 69 162 234
-        185 248 149 211 250 36 150 134 27 173 53 90 60 43 62 205
-        196 168 237 185 135 124 122 30 226 143 31 29 52 104 209 202
-        95 254 32 5 27 100 36 236 45 159 148 10 175 236 62 14 116
-        119 78 233 49 106 29 125 173 188 6 78 209 228 140 254 148
-        143 173 126 25 244 255 0 254 31 184 234 111 135 186 191 237
-        75 11 33 253 58 212 252 240 131 193 111 211 138 203 18 248
-        105 41 203 127 11 55 77 248 167 13 230 169 52 150 247 62 32
-        50 141 165 57 219 192 206 71 176 171 175 165 122 166 5 180
-        105 218 238 57 174 14 11 190 120 198 63 135 233 92 19 209
-        178 53 191 80 219 134 145 158 37 96 36 8 112 28 122 30 61
-        49 87 123 245 75 105 182 99 207 52 183 69 118 195 26 0 16
-        169 237 74 213 104 10 171 71 82 105 125 92 178 27 168 173
-        231 133 252 12 41 37 143 45 235 68 75 172 79 115 181 162 5
-        128 229 177 233 84 103 195 200 167 142 199 241 23 49 151
-        121 21 93 163 36 242 199 230 63 165 90 218 115 72 203 28
-        109 148 86 95 48 30 130 163 46 131 68 134 62 164 146 22 88
-        78 21 152 231 46 120 197 44 126 179 134 226 226 72 124 104
-        153 146 79 13 129 39 0 251 253 170 55 212 64 44 102 54 86
-        40 36 33 28 158 7 21 76 245 62 169 115 211 218 200 159 30
-        37 165 208 49 206 224 240 62 181 88 250 152 177 62 34 245
-        140 58 102 239 2 121 12 14 222 120 80 249 147 237 244 168
-        54 141 241 163 78 211 141 197 165 197 196 110 210 203 184
-        16 199 40 158 223 78 113 222 160 191 17 53 127 196 104 134
-        75 123 167 145 74 17 20 217 230 63 175 255 0 62 245 82 116
-        190 137 169 117 70 175 107 165 233 240 120 183 183 79 225
-        199 158 199 156 150 111 160 28 213 97 20 214 197 201 168
-        218 58 99 87 248 221 161 73 107 36 48 234 16 164 172 70 232
-        230 77 202 62 162 133 213 239 186 63 173 172 13 173 252 186
-        108 175 26 9 160 13 46 213 115 245 3 147 81 85 248 123 240
-        135 79 184 58 54 177 212 210 207 171 96 36 146 110 10 187
-        253 64 250 103 181 70 126 35 124 48 190 232 99 6 191 161
-        221 181 213 145 243 70 249 7 2 179 138 55 41 69 121 116 68
-        62 34 244 106 232 154 139 73 100 209 61 179 246 17 146 66
-        253 179 80 146 152 39 131 199 28 213 195 105 171 105 157 87
-        161 143 26 59 165 188 183 127 13 178 23 185 254 44 14 194
-        162 250 143 68 106 158 61 204 107 110 234 144 30 119 14 228
-        250 214 186 216 120 166 66 226 186 146 33 181 64 42 79 57
-        166 150 183 81 221 67 28 108 18 34 131 27 135 115 75 245 13
-        58 230 209 218 57 151 105 30 148 26 50 169 243 12 143 106
-        111 201 100 165 221 14 110 45 100 30 29 202 108 93 231 201
-        176 249 179 245 169 239 195 46 190 155 65 116 134 233 140
-        202 14 56 39 138 173 172 165 241 167 102 114 65 246 205 29
-        45 139 162 248 204 228 123 82 154 13 217 214 154 111 94 193
-        127 103 35 13 219 89 59 103 214 170 30 176 184 55 250 195
-        158 200 28 241 237 81 14 158 212 46 196 42 137 52 136 163
-        140 3 222 158 137 55 121 155 204 199 185 62 181 62 153 119
-        177 106 33 86 39 146 15 247 81 80 227 28 214 137 102 84 57
-        35 143 81 91 33 60 96 250 242 42 184 246 182 77 236 45 72
-        53 242 65 229 28 154 249 12 110 20 229 189 107 50 141 142
-        244 244 97 14 171 216 100 246 245 166 26 88 99 0 35 218 130
-        215 35 41 149 62 180 126 145 34 139 101 76 115 75 35 4 237
-        124 253 43 70 167 206 153 122 63 254 179 255 0 203 71 73
-        185 87 191 122 7 80 255 0 54 94 255 0 237 223 254 90 41 42
-        48 158 198 216 61 132 13 234 34 76 10 223 4 91 101 25 226
-        129 180 188 95 192 192 168 74 159 13 123 253 40 136 174 55
-        56 243 115 92 231 71 24 168 162 77 103 194 133 29 143 173
-        23 183 3 142 104 29 53 183 69 159 173 28 161 137 32 48 31
-        122 183 250 156 242 236 132 107 158 77 85 199 161 245 165
-        154 157 228 75 20 143 224 147 38 208 160 254 180 95 83 57
-        138 255 0 123 28 143 97 222 163 23 119 6 86 113 187 3 28 3
-        64 73 118 105 188 158 75 137 188 71 96 196 142 62 149 164
-        43 30 194 155 233 90 68 247 146 69 24 134 76 56 200 101 82
-        71 247 84 150 223 225 254 169 117 125 13 172 54 206 217 30
-        128 228 208 177 150 50 61 211 246 17 93 221 197 19 50 151
-        102 24 78 228 254 149 210 29 55 105 99 164 244 220 104 153
-        154 237 211 1 35 143 5 190 134 190 116 95 193 91 125 52 67
-        53 238 212 144 12 22 9 206 126 149 105 216 232 54 58 126
-        158 27 240 202 229 60 161 207 115 250 84 178 100 101 225
-        138 145 205 127 16 35 235 141 54 194 107 169 173 82 194 202
-        102 43 28 64 121 177 238 126 181 183 252 152 180 184 110
-        186 206 59 139 153 55 120 114 255 0 23 124 138 184 254 36
-        90 166 177 166 141 46 104 35 142 4 39 108 140 60 196 227
-        176 199 115 84 102 142 215 157 3 174 165 245 152 155 98 49
-        145 210 65 182 66 185 239 131 86 197 41 73 81 57 175 22 75
-        126 54 92 222 106 189 105 168 45 206 80 193 62 200 131 127
-        20 127 74 19 225 245 222 151 210 147 38 181 113 169 69 121
-        103 125 101 56 212 44 99 102 221 6 60 168 178 103 131 158
-        249 20 247 171 250 255 0 225 55 87 218 197 168 106 38 238
-        29 67 24 153 33 139 7 31 169 239 80 253 42 199 77 234 9 221
-        244 173 34 120 116 93 223 60 242 238 146 225 135 191 176
-        197 36 63 140 227 147 155 122 59 223 245 28 95 218 44 42 62
-        68 123 167 116 185 33 117 214 20 71 109 12 210 51 36 95 197
-        180 158 0 171 51 165 244 73 181 27 215 191 191 183 154 71
-        150 61 177 2 56 219 239 254 213 35 135 77 93 99 94 75 88 99
-        72 173 161 199 135 10 231 9 138 187 122 35 69 184 136 199
-        113 225 112 23 204 91 181 105 61 158 122 116 182 109 183
-        177 142 215 72 137 99 152 44 139 202 169 238 135 220 211
-        173 10 247 84 145 37 105 49 49 72 240 127 183 230 20 195
-        195 180 216 86 107 115 34 158 225 69 108 183 146 21 220 177
-        126 90 40 200 92 115 82 158 217 76 73 209 23 188 188 186
-        187 184 17 77 43 73 110 173 231 66 57 205 36 235 93 26 222
-        248 180 239 3 92 196 188 182 206 202 49 86 11 61 188 190
-        105 20 200 254 158 80 48 43 69 253 168 184 183 219 28 107
-        27 24 246 133 127 95 236 162 131 61 28 197 173 216 222 88
-        217 13 44 226 43 73 31 242 89 255 0 139 239 65 124 52 190
-        183 232 190 169 212 34 186 137 37 188 186 211 165 252 20
-        241 182 10 183 7 106 159 114 1 171 31 226 39 74 188 150 165
-        68 82 126 72 47 156 241 159 165 66 44 180 219 125 107 79 75
-        123 168 137 187 181 36 199 112 14 10 48 237 131 86 134 153
-        9 78 169 175 217 28 191 211 109 173 111 109 205 190 165 6
-        167 45 196 98 226 89 34 13 152 157 143 40 229 191 136 122
-        213 219 240 252 182 169 240 123 92 211 245 15 204 134 221
-        191 163 153 62 94 59 129 85 78 147 168 244 85 173 233 139
-        172 44 181 29 51 80 138 76 59 194 229 163 155 253 110 121
-        201 246 169 111 88 252 86 233 143 252 53 7 76 244 23 143 35
-        72 140 37 121 34 218 50 125 205 8 97 148 95 43 61 95 231
-        255 0 59 22 124 80 140 35 180 82 80 254 51 75 234 219 152
-        244 185 25 31 199 17 162 17 228 111 191 210 174 222 139 139
-        169 109 103 71 234 59 16 208 73 134 91 132 28 99 218 162
-        191 15 58 89 110 181 4 213 181 39 113 32 199 134 93 114 142
-        255 0 82 43 162 180 147 22 161 107 2 222 219 198 147 162
-        132 64 7 148 175 189 35 200 250 103 18 132 111 179 158 126
-        54 232 182 47 178 234 216 143 12 182 230 34 169 75 216 226
-        86 62 11 7 25 238 43 184 58 167 161 44 181 120 36 73 6 204
-        140 99 195 4 19 238 42 138 248 143 240 98 250 192 126 51 78
-        18 73 30 114 219 87 3 251 40 197 162 83 195 78 202 44 103
-        52 211 78 187 145 54 164 135 122 127 47 168 167 119 125 31
-        117 14 158 39 146 60 72 6 74 169 228 212 106 230 9 109 91
-        44 172 185 28 110 20 233 139 199 137 59 211 30 223 194 6 21
-        216 9 228 123 154 117 19 21 183 101 35 181 68 58 114 224 52
-        41 184 147 232 64 247 169 58 179 120 108 164 130 77 35 236
-        22 8 208 254 98 209 16 202 21 112 8 197 15 63 136 172 6 112
-        125 43 234 35 110 238 0 255 0 173 87 23 65 24 66 236 121
-        193 197 109 144 238 21 170 15 42 121 151 28 214 213 59 184
-        170 24 79 174 144 84 145 216 246 173 250 79 238 135 218 133
-        214 206 213 17 144 115 69 105 35 49 45 99 12 223 228 160
-        245 15 243 101 239 254 217 255 0 229 163 101 24 10 191 74
-        11 81 227 77 189 255 0 219 191 252 181 140 66 237 225 152
-        136 216 103 105 143 138 42 222 57 150 117 57 39 154 107 103
-        110 162 194 219 10 63 171 171 126 167 189 98 177 159 20 10
-        230 67 56 162 65 166 16 176 15 122 57 202 178 141 172 115
-        64 88 198 124 49 205 27 28 101 92 179 114 41 211 177 27 43
-        190 181 38 61 66 76 115 159 127 74 142 91 196 102 157 87
-        146 88 212 151 174 163 111 198 6 254 126 212 171 167 182
-        166 169 24 144 2 50 57 62 156 208 151 236 120 165 106 206
-        132 248 59 209 94 38 135 22 165 116 100 87 219 133 80 70 49
-        138 180 58 43 73 68 189 154 226 52 220 241 182 23 35 56 160
-        58 34 72 173 250 58 47 54 209 225 129 24 247 207 173 79 186
-        31 77 16 218 248 219 67 25 6 226 42 13 203 224 242 236 123
-        167 216 226 13 203 26 128 188 231 57 255 0 26 95 212 86 203
-        14 38 0 224 17 188 125 42 75 20 6 20 41 26 240 252 40 164
-        186 234 187 174 24 60 133 78 89 87 218 149 187 209 148 221
-        236 138 245 22 157 60 140 183 218 74 1 34 249 247 204 160
-        162 241 142 213 79 245 47 72 111 89 117 61 99 84 182 187
-        158 103 33 174 166 206 10 255 0 42 133 245 251 213 175 213
-        218 164 50 217 172 77 44 214 192 54 8 65 153 36 250 40 165
-        235 164 216 95 233 145 223 73 17 140 91 201 143 195 177 220
-        227 244 236 198 173 6 250 55 37 118 206 124 181 232 213 212
-        181 136 196 118 238 246 80 74 54 160 1 90 97 239 159 229
-        171 3 81 179 134 222 91 125 63 77 88 108 247 70 21 97 132
-        238 43 245 53 45 120 119 180 159 135 218 145 202 124 24 230
-        10 1 96 59 138 144 116 239 76 219 104 202 250 174 165 4 101
-        194 238 201 94 91 218 157 201 213 11 26 91 162 47 209 221
-        26 52 117 23 55 18 44 146 183 32 241 146 126 181 97 105 233
-        20 118 239 243 120 107 243 2 121 52 161 18 107 251 179 117
-        35 164 17 70 249 66 107 125 213 247 138 230 59 119 1 148
-        224 149 236 106 118 51 105 187 99 27 235 207 20 237 133 85
-        51 237 90 163 140 144 27 36 55 175 214 176 176 141 3 171 57
-        220 128 242 222 212 213 32 181 101 44 179 99 53 59 41 141
-        241 20 200 230 41 119 134 56 245 197 31 105 121 29 194 42
-        177 193 3 134 254 42 198 107 120 2 16 178 100 251 210 153
-        213 161 184 13 20 228 145 243 173 50 86 9 53 123 50 234 11
-        11 107 132 41 134 60 99 35 4 255 0 125 85 157 71 210 82 232
-        87 15 123 4 237 225 49 203 32 28 15 92 241 86 153 120 245
-        40 4 33 140 12 220 54 239 152 214 173 37 225 148 75 165 223
-        70 178 197 38 80 59 12 213 185 19 139 75 225 77 117 119 76
-        218 117 23 78 199 47 225 99 146 248 121 146 242 54 243 3
-        252 172 191 245 164 29 51 210 246 205 122 209 95 27 104 110
-        162 249 76 132 248 83 143 117 43 87 61 247 76 54 135 118
-        243 89 248 81 68 91 43 159 95 113 205 124 211 116 235 59
-        199 54 23 81 195 110 249 202 133 64 54 122 231 39 248 104
-        114 98 73 236 91 209 125 35 169 105 98 107 75 29 66 7 178
-        150 60 155 57 0 59 121 244 39 154 176 161 130 56 45 161 131
-        240 242 36 164 237 44 221 179 244 168 206 172 145 216 106
-        169 111 43 77 19 68 121 184 135 229 199 250 223 79 168 169
-        93 165 218 234 150 209 172 106 222 64 48 87 215 30 166 167
-        40 219 177 137 5 164 77 225 36 102 48 236 7 36 210 254 160
-        178 221 27 70 208 171 41 249 151 210 159 105 140 205 10 22
-        12 209 109 192 217 232 126 191 90 251 119 110 165 6 236 183
-        213 187 209 72 45 183 217 69 183 75 195 125 121 61 155 100
-        5 30 184 205 115 207 198 174 155 151 68 213 222 32 25 161
-        83 228 98 7 34 186 207 88 181 139 79 234 23 149 155 247 220
-        10 163 255 0 202 41 80 99 115 120 135 178 3 252 67 6 155 28
-        147 208 117 84 202 79 164 121 159 185 198 123 26 153 3 129
-        233 81 14 155 253 250 152 252 188 224 129 233 82 233 50 23
-        235 76 227 178 79 197 31 83 243 62 113 147 239 69 69 10 17
-        207 56 237 66 70 234 20 224 115 68 71 56 0 125 120 167 197
-        209 141 160 49 250 250 86 74 25 125 43 234 28 14 56 205 101
-        147 239 84 48 155 89 82 249 46 54 159 165 109 209 219 49
-        125 171 29 96 150 206 121 226 190 232 192 180 71 21 140 53
-        145 153 136 192 29 168 109 70 54 253 151 120 205 192 54 207
-        255 0 45 18 119 46 57 244 172 117 94 116 59 175 253 179 255
-        0 202 107 24 142 89 51 27 24 6 15 238 146 183 163 13 224
-        100 103 53 170 197 15 224 160 237 251 164 175 174 140 178
-        175 110 245 199 99 146 109 59 247 127 173 22 85 73 60 208
-        90 110 68 32 159 122 34 114 206 190 203 233 142 245 117 29
-        89 39 221 16 158 179 54 177 220 6 150 54 101 29 212 54 9
-        253 107 111 65 52 119 55 208 199 14 159 167 164 123 191 120
-        209 111 147 191 189 1 214 76 222 33 221 130 113 71 252 41
-        88 255 0 104 199 36 165 130 171 100 227 214 150 79 84 58
-        126 71 78 217 170 67 162 91 71 31 38 76 42 17 235 86 191 71
-        218 226 40 183 157 227 104 3 30 245 85 116 252 107 47 224
-        147 147 26 121 176 106 212 209 200 68 130 221 153 131 103
-        118 229 237 138 136 242 236 147 52 74 210 101 92 7 94 113
-        81 206 163 180 146 65 45 212 115 0 66 224 212 170 13 172 85
-        149 148 48 60 230 163 157 92 118 146 241 130 177 200 118 96
-        251 227 63 244 167 125 0 170 250 146 107 143 26 41 174 154
-        105 32 81 183 100 67 37 142 104 141 62 226 225 44 37 156
-        192 167 127 149 93 184 194 251 154 34 85 150 107 205 145
-        176 9 27 121 178 56 175 107 55 45 34 236 114 145 219 47 4
-        142 9 164 10 179 239 79 89 193 97 27 94 77 34 162 47 152 51
-        30 13 9 170 235 147 234 243 24 80 18 177 156 130 61 69 71
-        239 239 159 88 188 88 85 21 45 226 60 5 39 154 51 80 158
-        223 65 182 73 37 184 54 225 70 230 4 14 70 59 81 76 106 190
-        198 23 55 145 91 233 127 141 105 132 48 198 48 238 199 3
-        255 0 154 174 58 155 227 6 147 167 135 139 69 183 123 233
-        84 238 241 230 249 11 85 101 241 47 174 53 30 162 190 154
-        40 100 123 125 56 54 216 237 225 111 46 51 220 253 106 53
-        162 195 249 223 155 143 15 235 70 43 147 7 137 100 15 139
-        93 115 122 210 203 111 115 4 1 223 248 98 193 3 233 91 224
-        235 142 190 159 44 117 201 23 112 254 17 66 244 246 143 9
-        132 58 170 159 165 53 93 29 113 226 5 35 43 144 0 167 81
-        127 161 185 68 15 255 0 212 47 136 86 174 118 234 178 76 23
-        130 28 113 138 249 167 124 105 234 91 59 198 143 87 180 181
-        188 182 99 229 35 190 62 148 116 154 76 126 31 238 219 44
-        57 200 168 119 85 233 118 246 170 74 40 12 79 4 246 20 90
-        111 224 27 139 46 222 152 235 237 19 169 151 109 140 198
-        218 240 156 61 180 237 134 79 246 126 181 34 212 21 229 41
-        26 161 241 147 204 8 244 250 215 29 239 158 206 100 158 41
-        36 142 88 206 229 120 216 130 167 220 123 213 223 240 171
-        175 165 212 172 19 76 214 36 205 194 174 216 238 9 229 135
-        177 164 118 129 73 244 93 58 63 80 195 169 35 105 23 135
-        108 177 46 6 238 198 129 182 183 146 199 89 146 65 27 74
-        210 38 207 15 196 194 129 244 164 122 189 171 181 132 55 80
-        183 134 20 238 18 47 175 222 138 210 117 111 218 67 240 247
-        18 5 184 78 3 10 91 12 83 110 168 207 85 150 225 110 90 222
-        68 144 6 95 202 42 60 195 234 79 173 72 186 125 111 38 252
-        53 180 146 166 118 124 222 189 251 26 213 115 190 234 201 0
-        88 214 88 142 85 241 233 68 116 235 184 34 119 145 222 69
-        109 187 113 253 244 108 220 75 31 72 181 120 160 48 25 4
-        128 12 144 43 116 176 199 248 15 13 99 98 8 230 182 105 222
-        91 96 164 129 43 97 183 30 216 199 106 209 172 188 98 216
-        198 172 195 234 180 91 36 221 58 43 158 186 142 72 46 32
-        154 67 149 13 159 189 85 31 25 237 148 233 226 85 240 156
-        21 220 168 235 184 30 61 69 91 221 94 127 21 104 95 4 140
-        121 126 149 89 245 117 172 87 90 116 126 59 200 27 105 92
-        142 64 21 37 26 118 91 134 172 230 221 62 226 221 53 16 143
-        103 28 110 78 73 133 246 47 255 0 230 164 55 238 134 37 218
-        70 61 57 165 29 89 165 92 104 218 195 188 136 230 34 124
-        178 122 99 222 178 134 224 188 74 172 114 64 239 86 82 100
-        166 188 67 34 108 46 115 69 71 38 229 238 41 100 47 199 122
-        54 221 129 166 140 184 137 45 58 24 219 252 167 62 245 183
-        156 103 210 180 68 234 171 94 150 96 20 14 106 139 34 97 0
-        213 121 25 29 141 124 210 37 111 8 166 59 26 245 243 6 77
-        163 248 123 159 122 195 70 238 212 121 196 195 144 196 247
-        21 163 84 35 246 77 208 245 17 57 63 109 180 65 27 87 60 80
-        154 145 255 0 203 111 127 246 207 254 24 173 206 38 21 233
-        188 216 219 159 254 146 127 133 110 4 9 121 25 161 108 37
-        85 177 183 95 85 140 110 250 226 136 143 243 36 7 208 26
-        228 41 30 199 214 25 240 78 71 173 109 150 64 16 143 95 65
-        239 88 90 16 109 248 227 28 86 139 146 119 231 60 142 213
-        107 124 73 201 121 16 206 172 95 26 80 23 191 175 210 166
-        191 9 186 121 141 170 220 180 51 57 39 129 129 239 222 144
-        217 105 82 234 218 199 131 179 11 184 110 53 209 157 23 211
-        214 182 122 44 81 201 48 241 182 0 61 49 74 24 251 14 122
-        66 214 229 94 48 208 133 80 63 139 189 88 90 72 96 192 54
-        56 236 105 7 78 88 164 31 52 129 163 94 88 231 204 79 181
-        74 32 134 75 123 116 196 68 156 118 110 226 145 143 46 198
-        179 58 65 18 179 74 219 207 112 59 84 115 170 46 217 180
-        249 95 121 44 62 81 237 245 251 209 183 119 81 180 108 184
-        238 42 25 212 90 162 174 228 102 93 157 155 119 96 41 152
-        42 207 186 29 184 107 71 154 87 35 185 99 238 106 35 214 90
-        132 78 5 157 187 22 99 232 41 157 222 169 44 26 83 52 101
-        76 44 48 54 118 53 26 208 109 228 190 214 33 145 162 12 12
-        152 25 246 164 47 12 111 76 155 124 53 233 149 16 45 197
-        218 110 64 114 115 235 84 239 199 221 101 78 177 123 102
-        140 26 56 188 160 102 186 123 67 179 75 123 51 101 8 13 193
-        12 127 147 235 92 107 241 198 27 139 126 176 212 98 152 146
-        230 124 159 246 105 148 28 132 134 68 242 52 200 12 48 44
-        118 198 237 149 195 183 37 15 202 62 213 165 53 63 1 131 60
-        39 195 251 84 155 168 46 180 217 180 109 62 218 212 51 92
-        54 12 161 7 205 247 165 87 82 89 54 159 36 87 22 142 140 62
-        94 59 85 34 168 156 161 110 209 97 124 56 215 45 245 8 28
-        170 12 227 145 237 86 5 215 225 226 75 113 12 108 254 77
-        217 110 56 170 35 225 13 243 91 235 38 53 243 161 111 238
-        171 123 169 245 84 91 139 104 17 137 65 24 17 253 15 181
-        116 66 105 160 113 67 109 70 91 88 173 214 118 0 239 5 72
-        81 218 169 78 186 234 56 127 27 45 154 167 136 55 144 49
-        222 173 110 160 212 29 58 101 228 42 5 202 198 66 12 122
-        123 215 62 233 243 164 250 255 0 141 116 60 92 49 242 142
-        237 247 161 55 72 220 80 93 188 222 50 8 230 132 164 141
-        199 110 5 49 209 255 0 242 221 97 24 23 216 28 40 223 199
-        127 181 107 189 186 73 119 50 219 202 189 176 224 114 121
-        166 125 93 62 159 113 248 25 172 29 213 196 65 164 200 238
-        213 12 177 114 141 153 73 69 209 212 95 8 26 223 168 186 54
-        104 166 219 35 68 72 81 246 21 27 234 77 54 125 23 88 18
-        236 216 132 242 69 51 255 0 37 139 27 166 208 175 174 74
-        150 141 66 149 95 114 123 212 179 226 94 151 227 217 181
-        196 42 36 98 114 19 249 126 149 25 174 40 188 50 46 64 61
-        45 117 107 170 89 51 69 38 14 57 7 189 109 179 111 194 245
-        10 13 196 46 60 195 211 25 168 15 76 222 92 88 234 70 5 5
-        73 60 113 145 82 150 213 51 126 143 112 34 19 99 128 135
-        119 30 249 255 0 165 104 116 52 210 79 69 167 109 119 185
-        17 22 66 87 119 13 235 138 35 83 11 140 198 229 199 166 106
-        45 162 220 120 138 36 207 25 230 164 81 75 226 40 88 227
-        223 143 74 214 115 53 228 70 181 136 157 225 117 141 64 227
-        133 53 93 235 150 179 52 130 23 132 62 14 0 95 191 173 90
-        250 196 56 152 49 219 150 249 75 118 6 161 215 246 48 139
-        215 146 105 24 130 48 71 240 211 36 55 39 209 207 127 20 33
-        179 180 212 101 79 6 102 89 24 46 201 62 82 113 220 84 6 88
-        22 44 52 44 206 159 94 226 174 175 140 58 47 137 104 38 179
-        101 148 71 150 81 184 6 83 244 205 83 54 30 42 72 232 246
-        243 3 159 48 200 110 126 244 64 246 104 220 241 131 186 137
-        182 184 64 57 110 107 102 161 110 172 9 141 65 30 254 212
-        166 104 218 35 156 253 42 148 128 210 100 129 46 99 63 197
-        95 39 148 99 200 115 72 34 149 193 201 99 138 221 248 229
-        67 207 106 87 20 128 208 222 233 129 143 30 222 190 245 142
-        151 235 247 165 175 125 226 2 84 226 143 210 100 5 194 255
-        0 53 40 7 133 191 44 80 90 144 206 153 122 114 127 171 61
-        109 150 224 46 87 219 138 26 250 101 109 34 233 189 225 112
-        126 213 168 70 221 137 52 247 111 194 91 140 28 136 249 166
-        118 114 121 192 160 116 224 166 24 71 111 203 163 173 194
-        248 234 5 98 204 146 89 170 152 115 187 239 66 223 99 5 148
-        225 63 157 62 106 105 99 25 48 42 199 183 39 190 104 203
-        189 29 230 179 1 21 83 112 249 143 111 238 172 37 48 14 133
-        210 188 109 107 241 144 164 50 46 209 151 99 130 13 116 78
-        131 56 158 218 20 150 81 189 80 13 158 131 235 85 223 195
-        94 156 59 143 226 99 12 217 225 135 21 108 90 233 166 36 79
-        10 30 0 239 88 172 152 218 198 23 133 149 225 96 185 238
-        126 148 254 207 12 187 34 137 143 243 63 165 35 182 146 88
-        80 35 67 128 79 239 15 240 253 41 148 55 50 71 3 198 155
-        223 63 59 227 185 250 86 20 246 175 9 49 238 137 75 194 7
-        14 59 26 171 122 185 101 146 252 170 221 70 138 79 57 171
-        19 90 190 184 150 223 207 136 198 60 160 85 91 173 91 79
-        121 123 35 126 42 20 85 57 229 143 253 169 39 236 52 59 21
-        95 71 52 120 85 189 141 19 24 193 61 254 181 38 232 109 62
-        56 84 95 120 139 52 177 12 70 23 208 251 210 8 45 33 102 62
-        35 69 113 183 143 43 28 138 150 244 28 129 53 1 12 177 109
-        133 56 69 30 223 90 89 71 145 87 58 90 44 222 153 135 108
-        45 112 24 137 64 59 200 35 39 138 160 63 202 143 164 236
-        110 35 77 90 16 177 220 71 31 157 207 118 63 203 255 0 95
-        210 186 59 76 240 101 45 113 224 67 10 200 219 34 218 152
-        57 168 199 95 116 226 234 154 109 212 19 66 158 32 207 206
-        14 8 193 237 93 81 141 66 145 199 109 202 217 193 218 38
-        143 125 172 92 206 182 82 120 115 194 3 167 250 199 216 81
-        186 229 182 179 114 195 76 184 142 52 153 64 252 208 57 63
-        83 79 238 108 238 58 51 172 102 142 72 93 32 119 36 100 119
-        25 197 72 174 109 109 245 43 132 213 172 128 119 83 202 159
-        81 83 166 116 173 171 43 142 148 209 167 210 53 87 186 109
-        225 20 130 8 29 254 212 255 0 168 117 88 99 189 18 151 121
-        75 184 112 15 163 10 115 169 205 104 214 160 109 219 47 168
-        3 24 168 70 191 34 35 161 50 198 74 190 79 218 171 23 76 95
-        199 68 203 87 214 37 213 236 26 53 97 28 146 199 220 255 0
-        102 42 186 135 166 111 237 101 123 191 50 170 19 133 35 150
-        251 84 183 68 104 4 177 177 98 112 6 125 170 84 82 27 248
-        197 189 188 97 156 253 56 169 202 77 176 113 118 65 83 78
-        215 58 130 206 36 216 150 214 208 121 188 131 131 250 210
-        254 157 210 219 80 215 226 210 252 97 8 241 48 197 189 106
-        194 214 117 11 77 19 76 125 54 215 30 57 82 9 28 3 79 255 0
-        201 219 162 228 212 181 51 171 222 70 35 241 27 10 204 14
-        59 131 237 70 9 216 217 101 20 182 116 135 194 61 10 223 71
-        233 107 107 59 21 100 11 15 159 61 137 250 208 157 71 12 97
-        154 215 143 1 137 222 171 83 13 26 218 43 88 139 75 108 35
-        139 110 197 57 225 143 189 38 234 185 161 181 211 101 183
-        48 140 177 224 142 226 182 98 56 211 178 137 234 75 3 103
-        126 235 13 210 69 179 144 73 173 130 222 67 20 99 241 145
-        191 102 220 13 27 168 199 28 215 18 77 53 184 93 195 130 79
-        106 16 88 52 155 213 111 32 12 167 182 227 255 0 106 132
-        186 59 155 209 97 116 84 108 85 3 72 36 56 192 34 167 80 70
-        200 128 172 81 179 175 24 61 234 176 232 167 154 223 242
-        154 101 45 191 131 159 165 88 208 95 93 44 106 165 81 128
-        31 50 250 211 199 212 228 105 169 108 211 171 31 16 177 142
-        51 27 145 202 159 74 142 94 195 25 140 200 192 22 94 114 87
-        52 250 250 105 35 117 104 83 45 234 27 185 165 119 214 183
-        19 184 62 25 85 110 227 183 52 76 85 255 0 17 132 154 166
-        147 37 186 248 46 20 21 7 110 222 125 170 129 155 79 252 60
-        230 39 32 182 79 145 107 171 122 135 68 142 75 86 221 25 92
-        100 146 59 26 162 186 143 167 38 135 88 220 138 165 119 28
-        30 107 24 133 203 14 207 44 159 150 79 240 175 99 75 110 45
-        85 216 243 83 62 164 210 229 135 108 166 18 138 125 248 34
-        163 110 129 92 228 86 17 232 71 37 152 0 226 130 158 215
-        239 82 48 136 202 124 190 180 37 197 190 92 129 142 244 105
-        152 143 205 19 33 242 127 109 63 233 213 252 149 242 146
-        217 228 214 155 139 85 10 78 40 189 15 8 59 113 154 120 166
-        96 249 147 50 29 220 26 211 168 68 19 72 186 62 190 11 147
-        246 162 174 15 230 134 247 21 167 84 255 0 50 221 55 24 107
-        119 24 162 97 14 159 36 102 218 32 205 180 248 116 198 213
-        226 87 83 188 147 154 81 107 167 220 53 140 18 7 35 242 249
-        163 44 237 37 105 17 119 28 131 147 82 28 156 233 82 143 18
-        49 232 69 79 180 187 75 121 32 92 220 73 28 184 249 68 69
-        133 65 186 106 197 231 158 36 49 201 38 61 87 210 174 190
-        145 211 94 68 137 95 195 66 171 140 177 231 245 172 97 191
-        72 233 106 109 6 103 93 195 186 142 230 167 58 110 155 149
-        2 36 4 1 146 204 199 138 15 167 44 108 128 241 124 25 230
-        127 226 240 71 203 82 107 123 49 34 172 113 248 241 71 156
-        226 65 131 88 87 42 6 22 110 1 241 219 196 92 121 84 129
-        138 211 5 149 227 238 88 149 84 19 252 93 170 65 111 103
-        146 84 149 104 151 251 65 172 166 82 241 42 66 205 41 31
-        194 220 17 253 148 44 28 209 92 245 109 181 212 113 110 220
-        74 129 192 30 181 84 206 151 127 141 151 198 194 3 192 4
-        213 229 213 154 108 146 218 14 114 49 230 95 229 174 127
-        235 72 166 211 53 41 87 12 242 147 223 39 129 83 156 188
-        139 225 142 218 26 233 208 201 11 157 171 16 82 114 78 78
-        106 95 211 141 17 148 180 69 153 211 137 31 248 84 253 106
-        187 210 229 27 98 154 234 102 10 87 29 253 106 99 211 247
-        50 71 229 137 138 237 243 73 143 226 31 90 220 138 100 73
-        45 23 31 79 177 184 177 104 84 141 225 195 120 141 198 71
-        208 83 253 66 55 75 114 242 175 137 43 240 0 25 207 21 16
-        233 137 18 107 104 217 110 11 55 0 15 166 123 84 230 250
-        120 225 136 200 204 200 137 128 8 25 197 118 65 218 60 188
-        146 119 163 156 190 49 244 36 186 173 171 92 181 143 225
-        228 44 85 153 187 143 94 42 128 158 223 90 233 105 158 56
-        219 198 133 143 215 143 181 117 247 196 9 154 123 217 165
-        105 34 104 200 206 194 249 195 127 241 84 31 89 91 238 184
-        157 99 133 30 82 55 40 29 143 214 169 197 23 199 41 112 162
-        186 185 214 103 186 102 123 219 95 57 239 33 24 3 251 42 61
-        172 120 51 36 69 109 119 3 47 206 61 78 15 21 33 184 142
-        230 221 222 9 70 84 15 54 125 169 116 176 205 24 93 141 132
-        241 6 6 59 26 159 17 249 72 198 214 241 98 108 27 117 4 224
-        149 92 211 111 252 65 168 64 98 75 43 87 17 129 229 44 56
-        199 233 205 3 107 110 99 99 52 152 50 150 56 99 237 154 123
-        211 176 77 38 160 37 101 223 31 177 237 70 43 246 110 82 10
-        232 190 141 212 53 205 71 241 87 143 28 140 88 121 125 43
-        171 254 26 232 50 233 22 137 111 248 16 144 42 133 223 142
-        9 170 163 225 212 126 10 143 13 109 192 115 128 31 230 253
-        42 249 232 235 223 11 77 134 25 36 73 90 110 236 15 57 166
-        215 194 25 174 84 55 189 178 97 21 188 74 235 225 15 54 210
-        121 53 5 235 9 86 234 105 118 131 187 119 150 33 243 84 243
-        168 21 134 153 148 145 35 216 255 0 49 238 56 170 163 172
-        110 246 221 148 183 185 203 147 193 90 134 99 163 9 14 213
-        90 57 49 224 176 111 230 87 226 144 79 4 139 52 147 43 196
-        140 253 129 124 12 209 122 205 212 6 227 198 110 1 242 103
-        63 197 239 81 141 94 238 226 25 194 40 87 70 244 127 81 244
-        174 103 45 29 138 28 145 48 233 15 198 27 192 146 18 27 119
-        163 2 63 76 85 189 164 89 221 73 26 42 185 200 28 131 85
-        191 195 29 42 75 141 146 194 172 24 159 144 255 0 15 30 149
-        113 233 150 55 16 170 135 252 206 60 210 123 85 99 234 114
-        229 146 230 1 29 155 9 135 226 87 9 252 254 162 190 157 54
-        73 150 76 206 179 156 121 119 112 64 253 42 68 34 23 10 4
-        109 226 159 76 208 151 54 110 238 87 196 43 32 237 232 7
-        222 137 62 104 132 107 26 118 99 219 226 136 152 14 121 205
-        86 125 99 167 175 237 5 105 110 23 96 62 102 65 87 101 229
-        188 101 30 59 139 121 159 159 51 70 50 13 67 181 253 46 209
-        204 177 194 198 53 217 156 74 7 6 176 201 217 68 117 172 48
-        8 222 72 228 50 38 223 33 116 108 230 160 19 129 180 62 59
-        174 113 87 71 94 233 47 38 158 234 139 184 43 97 86 169 187
-        184 158 34 241 200 48 85 138 129 236 43 2 74 221 128 250
-        103 222 176 101 39 229 25 53 159 210 179 135 230 170 115 85
-        64 52 201 22 80 150 24 56 161 172 78 217 8 0 119 166 23 142
-        190 27 113 233 75 237 10 155 130 2 253 105 224 237 24 105
-        58 110 10 223 74 18 255 0 63 178 110 193 244 129 218 143
-        149 149 99 11 142 72 160 117 31 243 85 217 61 204 78 15 218
-        131 236 193 186 90 198 116 139 76 50 159 232 201 254 21 240
-        8 214 109 220 18 57 24 165 154 124 231 246 109 170 238 218
-        22 221 20 215 212 185 118 155 195 29 189 234 35 147 62 151
-        185 63 180 227 85 109 196 243 145 232 125 170 240 233 87
-        154 98 130 117 42 224 113 159 90 231 254 159 141 77 220 110
-        210 109 243 14 213 208 95 13 174 45 209 81 90 100 44 23 203
-        187 146 127 178 177 139 91 167 68 45 106 163 233 147 24 238
-        194 164 246 194 223 193 93 177 201 193 236 190 159 122 65
-        161 25 226 95 204 138 16 51 198 79 27 105 254 159 226 186
-        121 152 39 60 39 253 105 146 178 13 219 8 84 102 112 4 112
-        237 246 207 52 108 80 71 23 155 240 209 243 245 175 145 32
-        81 150 82 62 181 181 229 80 128 114 126 212 234 128 38 234
-        59 17 121 1 113 181 118 131 149 240 176 107 157 254 36 105
-        145 172 225 132 94 57 82 119 47 168 174 150 190 241 164 6
-        72 31 195 35 212 142 106 176 235 237 5 174 124 86 101 12
-        216 221 187 24 57 164 156 20 138 96 157 62 69 19 13 184 134
-        214 71 243 120 132 102 52 147 248 105 222 141 61 221 194
-        172 215 18 131 50 12 125 90 134 154 19 103 168 120 18 237
-        96 217 0 125 104 103 241 173 101 252 106 134 27 79 111 74
-        229 105 166 119 57 114 90 45 126 140 184 86 180 102 55 40 8
-        237 205 78 191 31 60 86 95 135 107 229 220 190 111 47 36
-        241 242 213 27 163 234 202 176 41 241 140 81 191 112 123
-        211 185 186 180 219 217 198 209 221 168 144 143 56 99 206
-        43 167 30 95 140 228 201 141 223 67 62 185 190 0 22 88 89
-        78 194 89 166 24 85 62 245 68 234 173 20 200 146 120 151 15
-        39 140 216 192 249 177 223 21 100 234 93 81 167 222 233 242
-        121 135 138 27 206 9 24 97 75 172 109 244 123 201 222 118
-        186 72 146 21 59 6 6 11 55 106 235 82 137 57 41 69 21 69
-        244 107 60 211 93 169 222 178 249 75 55 4 26 2 230 55 93
-        145 140 130 91 129 142 245 120 75 240 222 29 147 220 75 118
-        30 222 100 81 28 157 134 226 70 72 166 215 191 0 76 154 124
-        23 81 107 2 210 70 149 7 157 187 131 233 218 133 196 73 100
-        226 172 231 200 35 12 21 130 144 9 218 51 234 105 173 147
-        53 180 47 106 237 55 154 81 38 213 29 143 181 92 250 183
-        193 155 93 2 226 207 241 55 27 217 230 97 184 158 15 181 0
-        157 15 107 160 194 127 107 93 71 0 157 155 135 97 207 177
-        173 113 30 18 114 86 36 232 155 166 181 212 229 142 20 15
-        143 149 27 248 143 181 95 61 33 125 178 213 99 141 94 2 163
-        115 73 32 242 131 237 84 149 189 254 147 167 202 177 171
-        167 138 174 4 135 0 227 235 82 24 186 206 56 238 36 138 210
-        113 176 227 37 143 31 165 36 164 146 26 172 183 53 139 233
-        37 145 47 13 228 65 72 33 147 61 170 172 234 89 213 239 76
-        97 195 43 49 243 10 217 127 212 139 61 152 48 202 93 149
-        124 192 17 222 162 154 181 244 173 190 4 254 177 41 201 39
-        176 251 87 62 73 166 138 98 139 176 77 70 226 105 110 227
-        128 248 50 89 41 255 0 238 31 106 9 108 115 118 169 36 98
-        88 216 249 95 209 13 31 102 134 210 220 137 35 60 142 239
-        220 83 222 137 209 164 212 174 195 188 108 235 158 0 251
-        215 53 72 232 121 20 116 139 19 225 174 154 190 12 107 17
-        119 219 130 199 244 255 0 10 182 236 213 161 183 40 171 147
-        237 81 142 150 210 174 172 237 217 18 40 227 82 0 5 187 212
-        174 22 216 118 158 113 234 59 26 234 132 93 108 243 231 92
-        172 209 53 180 127 188 240 78 87 156 30 213 161 217 164 25
-        154 48 24 118 49 242 113 76 193 89 99 56 237 67 205 20 120
-        199 202 125 13 55 16 8 111 196 76 140 161 37 39 25 203 14
-        213 1 234 117 1 164 101 229 74 96 55 189 88 23 183 19 70
-        204 138 137 142 217 62 181 21 215 72 134 54 150 70 183 84
-        245 221 158 63 186 183 18 176 119 162 142 235 107 139 179
-        101 112 48 74 131 149 250 213 55 169 21 153 101 109 195 118
-        226 49 87 143 197 11 59 89 172 228 240 238 163 86 11 193 86
-        242 213 7 168 41 183 153 227 13 189 119 119 20 133 31 26 4
-        138 53 225 183 114 56 162 35 249 141 99 16 93 166 190 134
-        10 199 218 177 51 11 207 221 183 218 128 179 230 224 227
-        154 97 117 242 31 181 45 179 202 206 87 215 189 82 14 145
-        135 197 65 136 103 142 40 13 74 48 116 219 220 28 255 0 70
-        122 48 73 249 67 52 22 160 196 88 93 242 60 240 56 20 89
-        132 246 173 33 176 131 211 242 147 181 25 98 164 202 55 122
-        241 90 172 99 38 202 223 63 232 146 141 137 10 48 53 33 195
-        237 36 17 76 55 59 140 28 241 86 191 194 221 82 71 187 85
-        134 86 137 241 229 144 138 169 145 73 66 203 220 28 154 150
-        252 57 214 154 199 83 71 134 72 163 97 235 39 106 198 58
-        223 67 121 30 205 68 246 178 34 103 201 57 60 49 250 84 166
-        202 250 59 114 171 42 153 28 140 2 7 97 80 110 157 214 5
-        238 147 18 27 150 57 60 113 156 126 149 55 208 161 152 66
-        38 143 136 200 198 120 57 63 173 89 164 186 57 199 169 35
-        72 23 119 0 142 213 189 35 81 233 199 181 13 8 118 33 179
-        192 224 209 101 148 32 227 154 6 62 50 174 119 99 129 233
-        74 122 130 205 110 173 152 236 11 246 29 233 163 72 161 114
-        71 21 131 48 145 10 178 239 83 233 237 65 179 45 20 167 88
-        244 52 211 91 27 203 104 80 178 18 119 122 231 218 171 11
-        187 123 200 110 31 78 189 93 162 67 243 123 87 79 107 176
-        53 157 147 186 43 75 17 238 139 232 125 234 136 248 146 177
-        73 114 100 84 96 155 185 13 195 126 181 25 70 203 225 156
-        147 164 35 210 116 152 166 184 16 52 171 42 149 202 236 247
-        170 207 226 54 139 175 105 90 204 242 61 196 190 11 28 198
-        83 149 219 237 83 222 151 214 197 133 218 194 100 240 225
-        249 67 96 114 61 170 196 212 52 152 117 189 17 90 56 209
-        212 12 238 35 56 21 60 77 73 157 83 132 226 185 72 228 251
-        45 112 139 146 26 86 59 20 134 4 156 22 162 52 205 98 226
-        222 203 242 166 62 57 186 18 54 227 193 3 211 237 83 78 185
-        248 112 99 190 184 149 45 13 188 32 231 116 125 152 213 121
-        169 104 183 182 101 130 238 0 252 153 238 5 116 62 206 120
-        228 82 123 39 58 151 88 245 117 197 134 159 165 75 124 86
-        218 24 205 202 70 184 218 7 177 53 60 215 254 43 117 237
-        199 75 232 182 247 182 18 89 199 225 44 214 243 173 187 21
-        184 10 123 130 51 199 189 115 249 107 184 36 221 151 221
-        141 188 156 241 237 82 109 7 226 31 89 104 177 71 109 109
-        172 94 4 130 217 160 129 50 8 138 54 238 160 17 218 154 133
-        88 87 254 139 31 226 175 196 126 181 234 43 13 48 94 88 61
-        132 70 63 26 222 88 247 33 125 191 196 51 233 144 106 29
-        212 157 103 212 58 189 165 140 186 165 244 83 35 32 88 176
-        131 32 47 114 126 181 19 213 186 147 168 117 153 33 159 81
-        212 174 238 154 217 12 80 120 178 110 240 211 249 71 211
-        147 66 44 55 19 90 71 181 75 159 155 25 236 115 90 135 73
-        46 221 140 238 53 67 251 78 238 95 20 178 77 146 50 121 205
-        104 210 245 75 139 217 34 181 134 232 137 3 16 192 3 154 47
-        67 232 251 173 64 201 227 187 71 35 225 148 14 248 207 106
-        185 62 27 244 16 178 195 61 132 105 48 148 18 242 96 22 95
-        214 132 163 171 4 230 170 162 7 208 29 47 125 30 141 53 238
-        172 242 178 203 251 188 30 64 199 253 232 177 103 28 123
-        100 241 137 149 120 84 110 199 239 83 126 177 191 182 208
-        237 37 183 143 116 44 56 85 36 55 24 244 170 238 202 83 123
-        118 94 66 67 19 148 106 228 116 203 168 73 18 94 153 233
-        253 83 95 144 76 202 76 46 112 163 31 227 87 31 73 116 153
-        210 204 49 204 170 14 1 194 210 111 135 23 11 20 34 8 35
-        145 159 56 201 3 21 104 90 90 27 93 175 36 126 35 176 206
-        242 79 31 74 233 199 7 86 206 60 143 97 118 241 133 77 187
-        118 129 233 239 91 90 53 199 28 125 171 21 155 60 50 225
-        171 238 252 119 170 217 42 53 58 136 187 51 42 250 129 65
-        234 23 94 12 69 100 143 35 221 123 138 60 149 151 229 20 27
-        169 71 219 252 62 223 90 1 35 215 115 43 40 113 32 251 55
-        124 84 47 171 100 186 49 179 184 154 201 65 231 124 91 149
-        170 85 173 98 202 233 252 103 42 224 121 152 199 145 223
-        251 170 186 248 147 214 183 90 125 177 91 107 171 105 7 250
-        223 246 53 138 68 162 190 47 107 186 95 138 214 49 248 190
-        48 28 73 25 198 223 211 181 87 209 0 214 161 139 51 100 247
-        110 244 87 94 106 67 88 234 55 186 240 194 31 92 113 154 14
-        73 213 85 87 233 82 4 244 244 124 133 130 190 211 235 68 52
-        89 229 73 52 2 183 155 121 163 109 174 50 160 131 233 88 17
-        102 171 131 149 35 233 75 163 27 110 179 76 238 20 96 210
-        213 254 179 85 198 149 14 54 149 179 26 231 142 61 41 102
-        163 41 252 21 194 142 194 39 166 50 168 48 131 244 165 151
-        202 63 5 63 251 167 162 251 17 183 102 122 48 63 179 160
-        224 254 233 43 126 71 137 143 90 203 72 79 252 174 220 129
-        222 36 197 18 45 198 75 17 81 101 227 217 227 251 146 61 77
-        15 111 122 246 87 65 149 118 227 187 30 213 235 171 133 141
-        128 57 237 90 226 219 121 34 110 71 40 7 56 28 154 186 143
-        40 137 47 99 167 126 4 117 157 174 161 167 172 63 153 44
-        136 120 24 171 231 78 212 65 81 225 218 249 118 231 115 28
-        0 107 144 190 28 89 173 188 130 77 54 89 34 32 231 105 56
-        39 237 138 178 180 238 161 234 84 87 102 17 76 136 48 6 9
-        199 215 154 14 60 65 197 51 163 45 102 103 1 100 216 170
-        121 5 78 69 99 169 220 54 192 163 201 236 199 214 170 77 11
-        171 245 39 17 71 112 168 23 28 248 35 183 223 62 181 53 209
-        175 226 185 45 33 153 131 255 0 44 188 98 164 251 19 36 117
-        72 147 192 159 42 72 164 38 120 62 244 112 27 80 5 35 111
-        160 165 118 19 120 142 1 96 223 202 1 230 152 44 168 80 110
-        202 243 142 105 211 64 173 30 154 21 153 25 100 25 82 48 69
-        84 255 0 18 122 82 19 35 155 101 32 179 100 10 183 3 46 56
-        96 104 109 66 202 27 200 240 200 140 222 153 173 40 218 27
-        28 169 232 228 91 238 152 186 91 147 43 63 135 20 71 60 142
-        255 0 74 125 211 93 69 117 98 88 93 200 22 221 92 4 207 160
-        171 91 173 250 76 108 150 72 227 80 51 187 143 106 165 250
-        146 41 68 141 111 29 187 8 213 253 185 205 113 188 124 37
-        103 124 36 178 42 147 44 121 46 108 53 205 177 220 69 249
-        108 155 65 247 250 212 119 170 190 23 217 155 104 37 134
-        225 10 63 203 143 240 164 218 37 252 214 58 188 112 204 228
-        64 202 48 79 189 89 90 93 253 188 177 237 89 214 103 253
-        214 210 123 15 113 245 170 71 43 229 103 52 177 46 52 138
-        27 93 248 99 116 151 210 44 86 251 160 69 196 44 163 211
-        220 84 30 247 64 107 107 182 140 171 56 31 46 7 173 118 133
-        237 180 90 149 144 93 194 54 141 118 57 42 57 250 138 137
-        106 125 33 167 197 120 100 88 86 104 216 96 101 107 174 50
-        199 37 105 28 235 179 155 116 14 140 186 212 193 240 55 51
-        49 206 208 188 226 167 125 55 240 195 54 203 45 210 186 72
-        143 198 70 55 15 122 186 52 46 153 179 177 138 55 182 217
-        20 217 228 99 140 83 173 90 104 225 84 141 97 141 86 49 134
-        36 96 181 53 165 234 138 37 201 144 171 110 135 210 116 79
-        10 226 121 20 205 225 229 4 124 130 107 238 173 212 150 246
-        54 203 105 24 72 156 55 151 216 241 254 53 171 169 181 136
-        109 237 36 219 112 30 68 114 145 166 114 77 87 147 73 121
-        168 91 139 182 87 46 210 121 71 176 174 73 101 116 209 214
-        176 213 51 45 96 106 26 245 227 195 122 216 99 204 45 232 5
-        54 233 30 147 152 202 177 205 147 199 3 20 227 163 244 134
-        213 30 40 228 140 164 138 70 25 187 26 185 250 111 167 99
-        183 132 60 209 70 37 3 154 92 80 79 108 76 217 56 233 25
-        116 63 79 219 217 233 161 221 79 138 125 79 165 74 23 229
-        25 227 28 115 88 194 137 12 33 19 140 119 175 179 58 38 55
-        56 31 90 233 163 142 105 182 99 58 163 46 230 96 160 118
-        165 215 146 52 67 197 102 150 48 222 168 51 69 207 44 126
-        25 60 176 250 14 212 174 246 96 84 171 178 178 5 200 32 240
-        69 103 163 40 114 26 137 15 135 230 81 199 203 187 179 80
-        83 95 73 202 136 33 56 255 0 91 154 134 235 29 68 108 99 48
-        219 9 166 0 124 199 24 63 110 106 11 172 117 110 189 53 203
-        197 225 196 233 140 169 112 114 181 135 88 210 44 46 168
-        215 33 143 79 157 228 73 85 84 16 222 249 250 87 37 124 96
-        235 11 91 205 78 75 11 75 153 21 131 19 137 70 56 171 39 86
-        212 53 237 70 57 32 188 185 82 161 14 28 13 187 87 254 188
-        213 69 213 58 29 188 241 201 42 67 113 123 118 92 225 136 0
-        99 251 107 112 79 232 106 136 45 172 37 228 105 14 112 123
-        31 122 33 161 221 231 60 55 108 125 40 217 99 104 81 97 112
-        145 183 177 239 65 22 96 73 244 237 74 218 163 27 60 53 9
-        206 43 43 104 195 112 57 172 21 183 33 251 215 212 98 157
-        142 13 32 12 175 65 7 145 74 155 137 197 57 148 111 83 187
-        154 73 38 127 24 71 165 60 69 147 25 187 226 49 142 120 165
-        247 103 117 189 217 247 183 113 250 209 172 165 163 31 106
-        22 244 40 211 231 199 205 225 62 105 133 25 233 30 109 42
-        213 113 140 198 159 225 154 57 216 44 44 48 59 119 160 52
-        103 85 211 44 148 142 76 8 127 93 180 85 196 171 225 242 42
-        71 74 116 70 181 2 242 94 14 113 199 97 247 169 87 65 219
-        36 215 177 195 40 220 8 228 47 113 253 180 141 109 252 107
-        213 37 60 184 239 237 83 174 143 211 149 39 87 0 110 35 200
-        195 131 138 180 102 170 137 190 236 187 58 103 166 236 35
-        48 52 114 32 24 221 133 249 170 91 107 165 194 210 5 148 4
-        24 192 56 168 247 77 204 176 89 68 222 55 138 83 229 76 14
-        126 149 52 209 238 55 145 226 76 129 217 126 87 3 129 90 82
-        85 70 74 194 44 116 24 227 153 78 119 103 182 208 48 71 214
-        155 92 104 236 214 174 17 76 111 252 203 220 211 109 38 72
-        100 140 6 240 164 218 118 249 123 230 152 203 11 109 9 28
-        140 152 244 32 100 84 69 110 136 158 149 251 66 218 111 194
-        218 184 47 158 78 114 5 72 45 159 86 128 156 172 114 40 93
-        204 199 57 253 41 93 196 81 199 127 137 15 131 38 120 34
-        155 219 106 64 58 195 28 121 80 57 111 115 72 60 23 137 178
-        29 74 89 38 86 154 45 171 252 195 176 251 209 173 121 8 5
-        150 64 9 249 72 245 173 55 48 174 4 182 234 178 49 30 104
-        207 111 191 222 180 189 188 19 219 238 145 124 39 95 238
-        166 78 76 87 75 160 203 219 113 121 98 20 190 254 57 35 214
-        161 183 93 11 13 220 146 220 54 84 224 236 80 7 38 165 58
-        35 53 189 185 93 199 104 244 166 73 134 1 135 108 230 179
-        175 160 230 215 69 41 170 244 5 221 179 37 204 176 248 171
-        17 59 84 14 231 235 81 248 244 109 67 78 159 196 11 34 144
-        251 184 245 174 141 101 220 140 49 201 239 154 73 168 104
-        208 238 105 240 173 207 153 113 72 240 193 236 172 103 162
-        162 147 168 46 237 252 56 132 78 217 143 156 131 205 101
-        107 212 23 37 89 165 134 70 77 222 78 15 53 53 189 211 108
-        154 225 166 107 120 194 42 144 191 65 65 219 221 104 214 54
-        107 248 235 88 252 36 82 219 206 125 234 111 148 53 101 249
-        127 194 40 122 138 227 204 86 41 3 231 142 15 106 211 125
-        123 169 234 176 162 109 146 54 3 146 163 189 74 236 166 211
-        53 75 176 109 97 70 129 135 151 138 145 105 90 109 177 111
-        195 248 9 145 242 253 41 146 151 105 153 78 190 21 78 149
-        210 55 151 72 200 33 98 31 141 199 146 15 189 75 116 79 135
-        114 8 209 111 35 196 123 118 140 119 31 90 179 52 205 54 27
-        24 246 140 125 168 227 207 113 84 73 62 200 203 249 18 122
-        100 95 167 186 102 29 46 97 225 64 133 23 213 187 231 222
-        164 83 203 28 108 25 164 31 111 122 251 43 108 224 71 147
-        239 154 80 109 218 109 77 228 152 17 30 121 25 239 77 72
-        156 83 126 193 247 23 107 26 144 60 205 232 40 24 111 174
-        166 111 14 8 145 142 78 75 103 138 222 87 50 5 130 208 2 59
-        190 79 21 153 11 103 110 207 18 6 62 173 236 105 28 218 10
-        236 85 123 38 178 45 252 88 165 81 144 67 32 30 148 134 222
-        198 235 80 184 114 210 22 10 249 108 30 62 195 233 79 46 46
-        86 123 98 100 102 137 7 30 94 228 214 26 28 69 220 52 56 95
-        109 180 109 181 108 51 175 245 23 221 104 208 203 25 13 31
-        229 129 194 251 210 27 221 6 56 84 182 239 46 120 12 163 2
-        172 115 20 110 160 110 19 183 169 110 21 62 216 168 230 179
-        52 101 156 43 64 138 157 234 170 104 69 127 74 251 80 209
-        225 184 180 144 51 194 168 14 15 166 106 191 234 221 39 75
-        179 211 165 184 146 21 154 112 126 84 98 23 245 171 39 87
-        185 202 186 49 71 82 114 25 71 106 174 122 230 37 156 40 50
-        77 55 180 64 0 15 246 86 228 53 20 87 81 74 130 251 153 35
-        67 39 101 143 36 99 238 104 9 50 234 54 142 213 35 235 13
-        19 195 45 36 96 65 27 252 170 57 231 245 168 229 186 201 20
-        4 73 195 103 24 247 20 128 122 116 122 47 148 253 235 9 178
-        172 72 247 172 226 32 3 159 122 215 63 53 128 213 133 195
-        34 136 200 60 253 233 61 209 254 151 156 12 102 155 69 26
-        176 198 222 244 166 249 130 92 5 250 211 196 70 168 105 11
-        47 131 230 224 80 87 255 0 212 238 63 221 191 248 86 208
-        219 160 3 210 133 190 99 248 41 249 255 0 210 122 167 17 92
-        141 118 127 137 253 159 1 207 30 18 86 196 51 186 156 182
-        87 212 211 13 50 12 216 64 27 31 186 76 140 246 162 217 225
-        136 120 123 80 41 224 115 206 106 40 232 98 43 123 241 111
-        55 242 128 113 147 235 86 7 70 235 76 246 230 31 197 68 140
-        195 200 164 237 96 62 135 214 163 182 90 28 218 158 99 130
-        221 164 59 178 0 198 15 235 239 83 110 151 232 9 102 141 45
-        238 237 102 138 39 28 156 252 191 98 41 210 160 39 68 255 0
-        165 250 138 212 58 193 170 73 178 233 134 228 73 134 1 30
-        245 97 104 186 198 154 206 169 103 118 214 236 71 158 25
-        198 232 228 63 70 244 168 62 133 208 169 21 164 118 179 70
-        211 148 27 99 71 200 199 234 65 53 34 178 233 77 74 194 47
-        232 114 58 143 68 151 133 31 99 89 171 11 157 178 203 176
-        99 185 30 56 210 54 198 74 171 102 50 61 193 247 166 203
-        120 56 63 32 61 188 78 23 244 53 94 105 26 213 214 151 34
-        65 172 88 220 66 190 147 198 165 215 63 92 122 84 202 206
-        234 75 168 188 68 219 34 158 79 151 1 190 191 74 70 19 118
-        187 11 222 67 44 177 177 18 6 220 184 239 75 186 90 250 71
-        102 183 153 124 225 176 64 244 250 211 153 97 142 226 50
-        193 164 82 7 96 188 138 91 106 39 134 247 250 138 202 231
-        141 231 130 71 181 35 84 131 21 240 154 167 49 34 238 13
-        199 24 160 103 45 29 214 214 82 84 247 241 56 81 69 217 110
-        49 40 48 52 89 28 140 19 254 21 246 250 214 73 151 104 141
-        217 125 8 28 212 219 108 77 38 107 71 120 216 109 66 69 16
-        38 82 128 134 28 156 80 86 73 58 66 99 117 124 158 57 70
-        255 0 181 100 201 60 78 89 81 153 49 200 8 114 63 186 130
-        116 48 99 44 138 63 45 178 123 226 132 186 185 120 226 220
-        97 102 63 196 69 97 52 178 170 171 68 178 242 57 204 109
-        255 0 106 85 169 92 92 179 21 69 112 185 231 32 138 22 195
-        24 41 50 63 213 151 154 140 182 87 118 246 208 73 27 225
-        138 101 126 149 203 122 183 93 117 30 165 38 161 167 94 204
-        208 248 19 164 109 30 48 78 61 8 174 179 185 188 189 92 25
-        97 105 87 248 252 157 197 85 223 17 250 3 72 234 125 66 13
-        98 214 217 180 157 71 112 23 37 99 32 78 61 73 24 239 79 39
-        25 157 120 230 177 233 171 1 248 55 105 213 17 233 144 222
-        220 248 50 217 52 132 194 7 204 23 255 0 154 187 244 141 66
-        229 131 52 208 177 193 218 131 28 154 143 104 115 197 97
-        103 13 142 159 96 237 28 40 168 143 225 156 240 63 252 52
-        217 46 47 152 134 48 50 182 253 196 178 145 71 81 68 114 91
-        118 137 97 184 157 190 85 49 159 102 172 252 67 180 110 96
-        88 154 77 109 119 50 219 170 24 228 45 252 71 109 24 101
-        102 64 162 57 11 247 225 73 197 73 79 147 209 37 141 160
-        167 186 40 14 197 220 115 130 7 165 7 113 54 223 48 243 159
-        85 126 194 182 71 11 42 110 109 229 255 0 216 108 127 133
-        105 72 101 150 243 196 145 88 133 236 2 54 15 247 83 59 176
-        85 5 105 241 55 134 93 243 188 118 52 46 171 34 67 3 185
-        145 93 199 101 3 36 83 68 142 84 92 172 100 125 233 38 189
-        36 203 4 135 240 108 231 30 163 138 165 94 128 145 12 135
-        241 90 158 160 99 86 111 12 54 91 105 201 21 39 134 85 183
-        137 98 82 177 198 6 60 79 251 82 189 46 217 152 134 104 12
-        1 142 78 208 114 104 235 213 217 228 142 57 60 188 6 101
-        237 246 166 173 81 154 62 94 77 44 150 225 83 42 23 213 199
-        155 244 21 29 213 174 34 181 133 247 220 69 1 3 45 52 190
-        103 31 65 255 0 106 47 91 215 45 44 81 252 95 21 220 29 171
-        26 33 44 199 219 21 16 190 126 161 214 8 240 109 13 165 190
-        237 202 146 99 113 250 241 154 41 1 161 62 179 175 104 240
-        69 36 239 49 42 23 205 52 173 134 99 238 61 170 187 215 53
-        233 37 34 230 214 241 150 215 186 60 131 195 76 125 9 239
-        86 14 163 209 114 73 40 146 238 54 109 195 45 189 72 254
-        193 138 135 117 47 195 150 190 148 93 78 178 76 35 253 216
-        201 217 143 246 79 21 130 138 135 172 58 169 217 198 39 142
-        64 252 43 3 197 34 211 238 191 16 134 70 238 220 131 232 69
-        75 117 206 133 188 138 228 205 37 140 174 15 206 242 112
-        168 61 197 71 36 129 44 93 193 85 69 221 181 85 152 3 143
-        240 166 143 96 146 189 131 187 237 63 74 196 29 195 53 186
-        102 73 6 236 167 232 192 255 0 133 106 85 227 140 99 239 79
-        45 128 38 30 212 162 251 139 174 120 230 156 64 8 250 15
-        189 1 168 70 11 124 188 147 223 35 20 189 9 35 116 37 90
-        223 5 128 29 243 65 234 18 255 0 67 184 255 0 116 244 90 41
-        16 1 142 195 222 151 106 24 252 61 194 110 27 188 54 227 61
-        179 78 165 162 110 34 139 47 220 55 251 165 160 238 251 175
-        251 85 234 245 73 118 116 190 131 109 63 174 219 83 53 253
-        234 126 181 234 245 80 80 139 143 222 15 189 122 95 221 143
-        189 122 189 88 198 235 207 234 95 253 163 252 107 86 155
-        251 179 246 175 87 169 31 209 144 77 191 121 255 0 217 173
-        49 127 90 95 246 133 122 189 74 198 143 99 214 236 104 22
-        253 243 125 235 213 234 148 69 126 198 211 251 197 175 79
-        251 179 94 175 80 8 60 191 187 95 181 100 191 184 74 245
-        122 153 244 62 46 204 26 180 183 239 79 218 189 94 166 47
-        30 205 144 126 248 81 147 250 215 171 213 136 100 236 244
-        63 45 125 184 253 239 255 0 109 122 189 80 143 177 51 91
-        252 181 157 167 205 94 175 85 95 208 154 161 175 147 126
-        234 111 246 63 235 94 175 83 46 204 129 173 191 131 237 91
-        117 15 221 138 245 122 156 192 58 215 249 246 111 247 149
-        242 127 221 39 251 85 234 245 17 88 116 223 212 135 218 148
-        220 254 224 87 171 212 16 77 109 253 105 105 76 159 214 222
-        189 94 162 140 205 87 255 0 50 255 0 179 88 71 242 10 245
-        122 156 64 133 253 217 161 174 254 85 255 0 106 189 94 165
-        125 139 35 47 253 58 105 99 253 68 255 0 186 175 87 168 174
-        133 63 255 217 13 10 45 45 45 45 45 45 45 45 45 45 45 45 45
-        45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 49 49 51 55
-        53 50 50 53 48 51 49 52 52 49 50 56 50 51 50 55 49 54 53 51
-        49 55 50 57 13 10 67 111 110 116 101 110 116 45 68 105 115
-        112 111 115 105 116 105 111 110 58 32 102 111 114 109 45
-        100 97 116 97 59 32 110 97 109 101 61 34 102 105 108 101 50
-        34 59 32 102 105 108 101 110 97 109 101 61 34 116 101 115
-        116 46 116 120 116 34 13 10 67 111 110 116 101 110 116 45
-        84 121 112 101 58 32 116 101 120 116 47 112 108 97 105 110
-        13 10 13 10 116 101 115 116 10 13 10 45 45 45 45 45 45 45
-        45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
-        45 45 49 49 51 55 53 50 50 53 48 51 49 52 52 49 50 56 50 51
-        50 55 49 54 53 51 49 55 50 57 13 10 67 111 110 116 101 110
-        116 45 68 105 115 112 111 115 105 116 105 111 110 58 32 102
-        111 114 109 45 100 97 116 97 59 32 110 97 109 101 61 34 102
-        105 108 101 51 34 59 32 102 105 108 101 110 97 109 101 61
-        34 34 13 10 67 111 110 116 101 110 116 45 84 121 112 101 58
-        32 97 112 112 108 105 99 97 116 105 111 110 47 111 99 116
-        101 116 45 115 116 114 101 97 109 13 10 13 10 13 10 45 45
-        45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
-        45 45 45 45 45 45 45 49 49 51 55 53 50 50 53 48 51 49 52 52
-        49 50 56 50 51 50 55 49 54 53 51 49 55 50 57 45 45 13 10
-    } ;
-
-: test-file ( bytes -- seq )
-    binary <byte-reader> parse-multipart ;
-
-: test-file1 ( bytes -- ? )
-    test-file
-    first [ filename>> "dog.jpg" = ] [ name>> "file1" = ]
-    [ path>> md5 checksum-file B{ 172 192 179 2 18 210 155 156 115 186 169 30 147 51 91 82 } = ] tri and and ;
-
-: test-file2 ( bytes -- ? )
-    test-file
-    second [ filename>> "test.txt" = ] [ name>> "file2" = ]
-    [ path>> ascii file-contents "test\n" = ] tri and and ;
-
-: test-file3 ( bytes -- ? )
-    test-file
-    third [ filename>> "" = ]
-    [ name>> "file3" = ]
-    [ path>> file-info size>> 0 = ] tri and and ;
-
-[ t ] [ dog-test-empty-bytes-firefox test-file1 ] unit-test
-[ t ] [ dog-test-empty-bytes-firefox test-file2 ] unit-test
-[ t ] [ dog-test-empty-bytes-firefox test-file3 ] unit-test
-
-[ t ] [ dog-test-empty-bytes-safari test-file1 ] unit-test
-[ t ] [ dog-test-empty-bytes-safari test-file2 ] unit-test
-[ t ] [ dog-test-empty-bytes-safari test-file3 ] unit-test
old mode 100644 (file)
new mode 100755 (executable)
index 3e44f16..10ddb92
-! Copyright (C) 2008 Doug Coleman.
+! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators io kernel locals math multiline
-sequences splitting prettyprint namespaces http.parsers
-ascii assocs unicode.case io.files.unique io.files io.encodings.binary
-byte-arrays io.encodings make fry ;
+USING: multiline kernel sequences io splitting fry namespaces
+http.parsers hashtables assocs combinators ascii io.files.unique
+accessors io.encodings.binary io.files byte-arrays math
+io.streams.string combinators.short-circuit strings ;
 IN: mime.multipart
 
-TUPLE: multipart-stream stream n leftover separator ;
+CONSTANT: buffer-size 65536
+CONSTANT: separator-prefix "\r\n--"
 
-: <multipart-stream> ( stream separator -- multipart-stream )
-    multipart-stream new
-        swap >>separator
-        swap >>stream
-        16 2^ >>n ;
+TUPLE: multipart
+end-of-stream?
+current-separator mime-separator
+header
+content-disposition bytes
+filename temp-file
+name name-content
+uploaded-files
+form-variables ;
 
-<PRIVATE
+TUPLE: mime-file headers filename temporary-path ;
+TUPLE: mime-variable headers key value ;
 
-: ?append ( seq1 seq2 -- newseq/seq2 )
-    over [ append ] [ nip ] if ;
+: <multipart> ( mime-separator -- multipart )
+    multipart new
+        swap >>mime-separator
+        H{ } clone >>uploaded-files
+        H{ } clone >>form-variables ;
 
-: ?cut* ( seq n -- before after )
-    over length over <= [ drop f swap ] [ cut* ] if ;
-    
-: read-n ( stream -- bytes end-stream? )
-    [ f ] change-leftover
-    [ n>> ] [ stream>> ] bi stream-read [ ?append ] keep not ;
+ERROR: bad-header bytes ;
 
-: multipart-split ( bytes separator -- before after seq=? )
-    2dup sequence= [ 2drop f f t ] [ split1 f ] if ;
+: mime-write ( sequence -- )
+    >byte-array write ;
 
-:: multipart-step-found ( bytes stream quot: ( bytes -- ) -- ? )
-    bytes [ quot unless-empty ]
-    [ stream (>>leftover) quot unless-empty ] if-empty f ; inline
+: parse-headers ( string -- hashtable )
+    string-lines harvest [ parse-header-line ] map >hashtable ;
 
-:: multipart-step-not-found ( bytes stream end-stream? separator quot: ( bytes -- ) -- ? )
-    bytes end-stream? [
-        quot unless-empty f
-    ] [
-        separator length 1- ?cut* stream (>>leftover)
-        quot unless-empty t
-    ] if ; inline
+ERROR: end-of-stream multipart ;
 
-:: multipart-step ( stream bytes end-stream? separator quot: ( bytes -- ) -- ? end-stream? )
-    #! return t to loop again
-    bytes separator multipart-split
-    [ 2drop f ]
-    [
-        [ stream quot multipart-step-found ]
-        [ stream end-stream? separator quot multipart-step-not-found ] if*
-    ] if stream leftover>> end-stream? not or >boolean ;
+: fill-bytes ( multipart -- multipart )
+    buffer-size read
+    [ '[ _ append ] change-bytes ]
+    [ t >>end-of-stream? ] if* ;
 
+: maybe-fill-bytes ( multipart -- multipart )
+    dup bytes>> [ fill-bytes ] unless  ;
 
-:: multipart-step-loop ( stream quot1: ( bytes -- ) -- ? )
-    stream dup [ read-n ] [ separator>> ] bi quot1 multipart-step
-    swap [ drop stream quot1 multipart-step-loop ] when ; inline recursive
+: split-bytes ( bytes separator -- leftover-bytes safe-to-dump )
+    2dup [ length ] [ length 1- ] bi* < [
+        drop f
+    ] [
+        length 1- cut-slice swap
+    ] if ;
 
-SYMBOL: header
-SYMBOL: parsed-header
-SYMBOL: magic-separator
+: dump-until-separator ( multipart -- multipart )
+    dup [ current-separator>> ] [ bytes>> ] bi tuck start [
+        cut-slice
+        [ mime-write ]
+        [ over current-separator>> length tail-slice >>bytes ] bi*
+    ] [
+        drop
+        dup [ bytes>> ] [ current-separator>> ] bi split-bytes
+        [ mime-write ] when*
+        >>bytes fill-bytes dup end-of-stream?>> [ dump-until-separator ] unless
+    ] if* ;
+
+: dump-string ( multipart separator -- multipart string )
+    >>current-separator
+    [ dump-until-separator ] with-string-writer ;
+
+: read-header ( multipart -- multipart )
+    "\r\n\r\n" dump-string dup "--\r" = [
+        drop
+    ] [
+        parse-headers >>header
+    ] if ;
 
-: trim-blanks ( str -- str' ) [ blank? ] trim ;
+: empty-name? ( string -- ? )
+    { "''" "\"\"" "" f } member? ;
 
-: trim-quotes ( str -- str' )
-    [ [ CHAR: " = ] [ CHAR: ' = ] bi or ] trim ;
+: save-uploaded-file ( multipart -- )
+    dup filename>> empty-name? [
+        drop
+    ] [
+        [ [ header>> ] [ filename>> ] [ temp-file>> ] tri mime-file boa ]
+        [ filename>> ]
+        [ uploaded-files>> set-at ] tri
+    ] if ;
 
-: parse-content-disposition ( str -- content-disposition hash )
-    ";" split [ first ] [ rest-slice ] bi [ "=" split ] map
-    [ [ trim-blanks ] [ trim-quotes ] bi* ] H{ } assoc-map-as ;
+: save-form-variable ( multipart -- )
+    dup name>> empty-name? [
+        drop
+    ] [
+        [ [ header>> ] [ name>> ] [ name-content>> ] tri mime-variable boa ]
+        [ name>> ]
+        [ form-variables>> set-at ] tri
+    ] if ;
 
-: parse-multipart-header ( string -- headers )
-    "\r\n" split harvest
-    [ parse-header-line first2 ] H{ } map>assoc ;
+: dump-mime-file ( multipart filename -- multipart )
+    binary <file-writer> [
+        dup mime-separator>> >>current-separator dump-until-separator
+    ] with-output-stream ;
 
-ERROR: expected-file ;
+: dump-file ( multipart -- multipart )
+    "factor-" "-upload" make-unique-file
+    [ >>temp-file ] [ dump-mime-file ] bi ;
 
-TUPLE: uploaded-file path filename name ;
+: parse-content-disposition-form-data ( string -- hashtable )
+    ";" split
+    [ "=" split1 [ [ blank? ] trim ] bi@ ] H{ } map>assoc ;
 
-: (parse-multipart) ( stream -- ? )
-    "\r\n\r\n" >>separator
-    header off
-    dup [ header [ prepend ] change ] multipart-step-loop drop
-    header get dup magic-separator get [ length ] bi@ < [
-        2drop f
-    ] [
-        parse-multipart-header
-        parsed-header set
-        "\r\n" magic-separator get append >>separator
-        "factor-upload" "httpd" make-unique-file tuck
-        binary [ [ write ] multipart-step-loop ] with-file-writer swap
-        "content-disposition" parsed-header get at parse-content-disposition
-        nip [ "filename" swap at ] [ "name" swap at ] bi
-        uploaded-file boa ,
-    ] if ;
+: lookup-disposition ( multipart string -- multipart value/f )
+    over content-disposition>> at ;
 
-PRIVATE>
+ERROR: unknown-content-disposition multipart ;
 
-: parse-multipart ( stream -- array )
-    [
-        "\r\n" <multipart-stream>
-        magic-separator off
-        dup [ magic-separator [ prepend ] change ]
-            multipart-step-loop drop
-        '[ [ _ (parse-multipart) ] loop ] { } make
-    ] with-scope ;
+: parse-form-data ( multipart -- multipart )
+    "filename" lookup-disposition [
+        >>filename
+        [ dump-file ] [ save-uploaded-file ] bi
+    ] [
+        "name" lookup-disposition [
+            [ dup mime-separator>> dump-string >>name-content ] dip
+            >>name dup save-form-variable
+        ] [
+             unknown-content-disposition
+        ] if*
+    ] if* ;
+
+ERROR: no-content-disposition multipart ;
+
+: process-header ( multipart -- multipart )
+    "content-disposition" over header>> at ";" split1 swap {
+        { "form-data" [
+            parse-content-disposition-form-data >>content-disposition
+            parse-form-data
+        ] }
+        [ no-content-disposition ]
+    } case ;
+
+: assert-sequence= ( a b -- )
+    2dup sequence= [ 2drop ] [ assert ] if ;
+
+: read-assert-sequence= ( sequence -- )
+    [ length read ] keep assert-sequence= ;
+
+: parse-beginning ( multipart -- multipart )
+    "--" read-assert-sequence=
+    dup mime-separator>>
+    [ read-assert-sequence= ]
+    [ separator-prefix prepend >>mime-separator ] bi ;
+
+: parse-multipart-loop ( multipart -- multipart )
+    read-header
+    dup end-of-stream?>> [ process-header parse-multipart-loop ] unless ;
+
+: parse-multipart ( separator -- form-variables uploaded-files )
+    <multipart> parse-beginning parse-multipart-loop
+    [ form-variables>> ] [ uploaded-files>> ] bi ;
index 357fd2cb6c15069100bd4e1b10169d764ae540da..153b6cedbe7b3709bd0c999bfb535725b7915e18 100644 (file)
@@ -14,3 +14,8 @@ bar
 
 [ "hello\nworld" ] [ <" hello
 world"> ] unit-test
+
+[ "hello" "world" ] [ <" hello"> <" world"> ] unit-test
+
+[ "\nhi" ] [ <"
+hi"> ] unit-test
index 930e5b9f1ce63936d40298c39eca1cbec1247dd5..53c2789c50b669eb8355c5a30eebfb48a9b2b015 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2007 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
 USING: namespaces make parser lexer kernel sequences words
-quotations math accessors ;
+quotations math accessors locals ;
 IN: multiline
 
 <PRIVATE
@@ -26,22 +26,38 @@ PRIVATE>
     (( -- string )) define-inline ; parsing
 
 <PRIVATE
-: (parse-multiline-string) ( start-index end-text -- end-index )
-    lexer get line-text>> [
-        2dup start
-        [ rot dupd [ swap subseq % ] 2dip length + ] [
-            rot tail % "\n" % 0
-            lexer get next-line swap (parse-multiline-string)
+
+:: (parse-multiline-string) ( i end -- j )
+    lexer get line-text>> :> text
+    text [
+        end text i start* [| j |
+            i j text subseq % j end length +
+        ] [
+            text i short tail % CHAR: \n ,
+            lexer get next-line
+            0 end (parse-multiline-string)
         ] if*
-    ] [ nip unexpected-eof ] if* ;
+    ] [ end unexpected-eof ] if ;
+        
 PRIVATE>
 
 : parse-multiline-string ( end-text -- str )
     [
-        lexer get [ swap (parse-multiline-string) ] change-column drop
-    ] "" make rest ;
+        lexer get
+        [ 1+ swap (parse-multiline-string) ]
+        change-column drop
+    ] "" make ;
 
 : <"
     "\">" parse-multiline-string parsed ; parsing
 
+: <'
+    "'>" parse-multiline-string parsed ; parsing
+
+: {'
+    "'}" parse-multiline-string parsed ; parsing
+
+: {"
+    "\"}" parse-multiline-string parsed ; parsing
+
 : /* "*/" parse-multiline-string drop ; parsing
index 0034b7e566df7be2462f36053b2eb0464dd1c540..b6f222cce98c6062f8f1da3d2c2b5f43fd729f4e 100644 (file)
@@ -14,7 +14,7 @@ ARTICLE: "refs" "References to assoc entries"
 "References to values:"
 { $subsection value-ref }
 { $subsection <value-ref> }
-"References are used by the inspector." ;
+"References are used by the UI inspector." ;
 
 ABOUT: "refs"
 
index dd116f3d7a807303f8b7d7f21ead4e14f4f0b337..537c85c2d3b20acfd305a3903bab4b27a3a08667 100644 (file)
@@ -9,6 +9,8 @@ regexp.transition-tables words sets regexp.classes unicode.case.private ;
 ! before processing starts
 IN: regexp.nfa
 
+ERROR: feature-is-broken feature ;
+
 SYMBOL: negation-mode
 : negated? ( -- ? ) negation-mode get 0 or odd? ; 
 
@@ -181,6 +183,7 @@ M: character-class-range nfa-node ( node -- )
     ] if ;
 
 M: capture-group nfa-node ( node -- )
+    "capture-groups" feature-is-broken
     eps literal-transition add-simple-entry
     capture-group-on add-traversal-flag
     term>> nfa-node
@@ -201,6 +204,7 @@ M: negation nfa-node ( node -- )
     negation-mode dec ;
 
 M: lookahead nfa-node ( node -- )
+    "lookahead" feature-is-broken
     eps literal-transition add-simple-entry
     lookahead-on add-traversal-flag
     term>> nfa-node
@@ -209,6 +213,7 @@ M: lookahead nfa-node ( node -- )
     2 [ concatenate-nodes ] times ;
 
 M: lookbehind nfa-node ( node -- )
+    "lookbehind" feature-is-broken
     eps literal-transition add-simple-entry
     lookbehind-on add-traversal-flag
     term>> nfa-node
index 74f06ed65be1ef7daa9ba96058dbc1db088b033c..6fc21be19cb8fa39a035539e24e73f37f6a03eda 100644 (file)
@@ -1,5 +1,5 @@
 USING: regexp tools.test kernel sequences regexp.parser
-regexp.traversal eval strings ;
+regexp.traversal eval strings multiline ;
 IN: regexp-tests
 
 \ <regexp> must-infer
@@ -76,6 +76,8 @@ IN: regexp-tests
 [ t ] [ "bar" "foo|bar" <regexp> matches? ] unit-test
 [ f ] [ "foobar" "foo|bar" <regexp> matches? ] unit-test
 
+/*
+! FIXME
 [ f ] [ "" "(a)" <regexp> matches? ] unit-test
 [ t ] [ "a" "(a)" <regexp> matches? ] unit-test
 [ f ] [ "aa" "(a)" <regexp> matches? ] unit-test
@@ -83,6 +85,7 @@ IN: regexp-tests
 
 [ f ] [ "aababaaabbac" "(a|b)+" <regexp> matches? ] unit-test
 [ t ] [ "ababaaabba" "(a|b)+" <regexp> matches? ] unit-test
+*/
 
 [ f ] [ "" "a{1}" <regexp> matches? ] unit-test
 [ t ] [ "a" "a{1}" <regexp> matches? ] unit-test
@@ -165,9 +168,12 @@ IN: regexp-tests
 [ f ] [ "0" "[^\\d]" <regexp> matches? ] unit-test
 [ t ] [ "a" "[^\\d]" <regexp> matches? ] unit-test
 
+/*
+! FIXME
 [ t ] [ "a" "[a-z]{1,}|[A-Z]{2,4}|b*|c|(f|g)*" <regexp> matches? ] unit-test
 [ t ] [ "a" "[a-z]{1,2}|[A-Z]{3,3}|b*|c|(f|g)*" <regexp> matches? ] unit-test
 [ t ] [ "a" "[a-z]{1,2}|[A-Z]{3,3}" <regexp> matches? ] unit-test
+*/
 
 [ t ] [ "1000" "\\d{4,6}" <regexp> matches? ] unit-test
 [ t ] [ "1000" "[0-9]{4,6}" <regexp> matches? ] unit-test
@@ -238,7 +244,7 @@ IN: regexp-tests
 
 [ t ] [ "abc" <reversed> R/ abc/r matches? ] unit-test
 [ t ] [ "abc" <reversed> R/ a[bB][cC]/r matches? ] unit-test
-[ t ] [ "adcbe" R/ a(?r)(bcd)(?-r)e/ matches? ] unit-test
+! [ t ] [ "adcbe" R/ a(?r)(bcd)(?-r)e/ matches? ] unit-test ! FIXME
 
 [ t ] [ "s@f" "[a-z.-]@[a-z]" <regexp> matches? ] unit-test
 [ f ] [ "a" "[a-z.-]@[a-z]" <regexp> matches? ] unit-test
@@ -247,6 +253,8 @@ IN: regexp-tests
 [ t ] [ "abc*" "[^\\*]*\\*" <regexp> matches? ] unit-test
 [ t ] [ "bca" "[^a]*a" <regexp> matches? ] unit-test
 
+/*
+! FIXME
 [ ] [
     "(0[lL]?|[1-9]\\d{0,9}(\\d{0,9}[lL])?|0[xX]\\p{XDigit}{1,8}(\\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))"
     <regexp> drop
@@ -270,6 +278,7 @@ IN: regexp-tests
 [ "abc" ] [ "abc" "(ab|a)(bc)?" <regexp> first-match >string ] unit-test
 
 [ "b" ] [ "aaaaaaaaaaaaaaaaaaaaaaab" "((a*)*b)*b" <regexp> first-match >string ] unit-test
+*/
 
 ! [ t ] [ "a:b" ".+:?" <regexp> matches? ] unit-test
 
@@ -293,6 +302,8 @@ IN: regexp-tests
 [ "1.2.3.4" ]
 [ "1ABC2DEF3GHI4JK" R/ [A-Z]+/ "." re-replace ] unit-test
 
+/*
+! FIXME
 [ f ] [ "ab" "a(?!b)" <regexp> first-match ] unit-test
 [ "a" ] [ "ac" "a(?!b)" <regexp> first-match >string ] unit-test
 ! [ t ] [ "fxxbar" "(?!foo).{3}bar" <regexp> matches? ] unit-test
@@ -303,6 +314,7 @@ IN: regexp-tests
 
 [ 3 ] [ "foobar" "foo(?=bar)" <regexp> match-head ] unit-test
 [ f ] [ "foobxr" "foo(?=bar)" <regexp> match-head ] unit-test
+*/
 
 ! Bug in parsing word
 [ t ] [ "a" R' a' matches?  ] unit-test
diff --git a/basis/state-parser/authors.txt b/basis/state-parser/authors.txt
deleted file mode 100644 (file)
index f990dd0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Daniel Ehrenberg
diff --git a/basis/state-parser/state-parser-docs.factor b/basis/state-parser/state-parser-docs.factor
deleted file mode 100644 (file)
index 3027c01..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-USING: help.markup help.syntax ;
-IN: state-parser
-
-ABOUT: { "state-parser" "main" }
-
-ARTICLE: { "state-parser" "main" } "State-based parsing"
-    "This module defines a state-based parsing mechanism. It was originally created for libs/xml, but is also used in libs/csv and can be easily used in new libraries or applications."
-    { $subsection spot }
-    { $subsection skip-until }
-    { $subsection take-until }
-    { $subsection take-char }
-    { $subsection take-string }
-    { $subsection next }
-    { $subsection state-parse }
-    { $subsection get-char }
-    { $subsection take-rest }
-    { $subsection string-parse }
-    { $subsection expect }
-    { $subsection expect-string }
-    { $subsection parsing-error } ;
-
-HELP: get-char
-{ $values { "char" "the current character" } }
-{ $description "Accesses the current character of the stream that is being parsed" } ;
-
-HELP: take-rest
-{ $values { "string" "the rest of the parser input" } }
-{ $description "Exausts the stream of the parser input and returns a string representing the rest of the input" } ;
-
-HELP: string-parse
-{ $values { "input" "a string" } { "quot" "a quotation ( -- )" } }
-{ $description "Calls the given quotation using the given string as parser input" }
-{ $see-also state-parse } ;
-
-HELP: expect
-{ $values { "ch" "a number representing a character" } }
-{ $description "Asserts that the current character is the given ch, and moves to the next spot" }
-{ $see-also expect-string } ;
-
-HELP: expect-string
-{ $values { "string" "a string" } }
-{ $description "Asserts that the current parsing spot is followed by the given string, and skips the parser past that string" }
-{ $see-also expect } ;
-
-HELP: spot
-{ $var-description "This variable represents the location in the program. It is a tuple T{ spot f char column line next } where char is the current character, line is the line number, column is the column number, and line-str is the full contents of the line, as a string. The contents shouldn't be accessed directly but rather with the proxy words get-char set-char get-line etc." } ;
-
-HELP: skip-until
-{ $values { "quot" "a quotation ( -- ? )" } }
-{ $description "executes " { $link next } " until the quotation yields false. Usually, the quotation will call " { $link get-char } " in its test, but not always." }
-{ $see-also take-until } ;
-
-HELP: take-until
-{ $values { "quot" "a quotation ( -- ? )" } { "string" "a string" } }
-{ $description "like " { $link skip-until } " but records what it passes over and outputs the string." }
-{ $see-also skip-until take-char take-string } ;
-
-HELP: take-char
-{ $values { "ch" "a character" } { "string" "a string" } }
-{ $description "records the document from the current spot to the first instance of the given character. Outputs the content between those two points." }
-{ $see-also take-until take-string } ;
-
-HELP: take-string
-{ $values { "match" "a string to match" } { "string" "the portion of the XML document" } }
-{ $description "records the document from the current spot to the first instance of the given character. Outputs the content between those two points." }
-{ $notes "match may not contain a newline" } ;
-
-HELP: next
-{ $description "originally written as " { $code "spot inc" } ", code that would no longer run, this word moves the state of the XML parser to the next place in the source file, keeping track of appropriate debugging information." } ;
-
-HELP: parsing-error
-{ $class-description "class from which parsing errors inherit, containing information about which line and column the error occured on, and what the line was. Contains three slots, line, an integer, column, another integer, and line-str, a string" } ;
diff --git a/basis/state-parser/state-parser-tests.factor b/basis/state-parser/state-parser-tests.factor
deleted file mode 100644 (file)
index e0b274b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-USING: tools.test state-parser kernel io strings ascii ;
-
-[ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test
-[ 2 4 ] [ "12\n123" [ take-rest drop get-line get-column ] string-parse ] unit-test
-[ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until take-rest ] string-parse ] unit-test
-[ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test
-[ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test
-[ "baz" ] [ " \n\t baz" [ pass-blank take-rest ] string-parse ] unit-test
diff --git a/basis/state-parser/state-parser.factor b/basis/state-parser/state-parser.factor
deleted file mode 100644 (file)
index 9341f39..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-! Copyright (C) 2005, 2006 Daniel Ehrenberg\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: io io.streams.string kernel math namespaces sequences\r
-strings circular prettyprint debugger ascii sbufs fry summary\r
-accessors ;\r
-IN: state-parser\r
-\r
-! * Basic underlying words\r
-! Code stored in stdio\r
-! Spot is composite so it won't be lost in sub-scopes\r
-TUPLE: spot char line column next ;\r
-\r
-C: <spot> spot\r
-\r
-: get-char ( -- char ) spot get char>> ;\r
-: set-char ( char -- ) spot get swap >>char drop ;\r
-: get-line ( -- line ) spot get line>> ;\r
-: set-line ( line -- ) spot get swap >>line drop ;\r
-: get-column ( -- column ) spot get column>> ;\r
-: set-column ( column -- ) spot get swap >>column drop ;\r
-: get-next ( -- char ) spot get next>> ;\r
-: set-next ( char -- ) spot get swap >>next drop ;\r
-\r
-! * Errors\r
-TUPLE: parsing-error line column ;\r
-\r
-: parsing-error ( class -- obj )\r
-    new\r
-        get-line >>line\r
-        get-column >>column ;\r
-M: parsing-error summary ( obj -- str )\r
-    [\r
-        "Parsing error" print\r
-        "Line: " write dup line>> .\r
-        "Column: " write column>> .\r
-    ] with-string-writer ;\r
-\r
-TUPLE: expected < parsing-error should-be was ;\r
-: expected ( should-be was -- * )\r
-    \ expected parsing-error\r
-        swap >>was\r
-        swap >>should-be throw ;\r
-M: expected summary ( obj -- str )\r
-    [\r
-        dup call-next-method write\r
-        "Token expected: " write dup should-be>> print\r
-        "Token present: " write was>> print\r
-    ] with-string-writer ;\r
-\r
-TUPLE: unexpected-end < parsing-error ;\r
-: unexpected-end ( -- * ) \ unexpected-end parsing-error throw ;\r
-M: unexpected-end summary ( obj -- str )\r
-    [\r
-        call-next-method write\r
-        "File unexpectedly ended." print\r
-    ] with-string-writer ;\r
-\r
-TUPLE: missing-close < parsing-error ;\r
-: missing-close ( -- * ) \ missing-close parsing-error throw ;\r
-M: missing-close summary ( obj -- str )\r
-    [\r
-        call-next-method write\r
-        "Missing closing token." print\r
-    ] with-string-writer ;\r
-\r
-SYMBOL: prolog-data\r
-\r
-! * Basic utility words\r
-\r
-: record ( char -- )\r
-    CHAR: \n =\r
-    [ 0 get-line 1+ set-line ] [ get-column 1+ ] if\r
-    set-column ;\r
-\r
-! (next) normalizes \r\n and \r\r
-: (next) ( -- char )\r
-    get-next read1\r
-    2dup swap CHAR: \r = [\r
-        CHAR: \n =\r
-        [ nip read1 ] [ nip CHAR: \n swap ] if\r
-    ] [ drop ] if\r
-    set-next dup set-char ;\r
-\r
-: next ( -- )\r
-    #! Increment spot.\r
-    get-char [ unexpected-end ] unless (next) record ;\r
-\r
-: next* ( -- )\r
-    get-char [ (next) record ] when ;\r
-\r
-: skip-until ( quot: ( -- ? ) -- )\r
-    get-char [\r
-        [ call ] keep swap [ drop ] [\r
-            next skip-until\r
-        ] if\r
-    ] [ drop ] if ; inline recursive\r
-\r
-: take-until ( quot -- string )\r
-    #! Take the substring of a string starting at spot\r
-    #! from code until the quotation given is true and\r
-    #! advance spot to after the substring.\r
-    10 <sbuf> [\r
-        '[ @ [ t ] [ get-char _ push f ] if ] skip-until\r
-    ] keep >string ; inline\r
-\r
-: take-rest ( -- string )\r
-    [ f ] take-until ;\r
-\r
-: take-char ( ch -- string )\r
-    [ dup get-char = ] take-until nip ;\r
-\r
-TUPLE: not-enough-characters < parsing-error ;\r
-: not-enough-characters ( -- * )\r
-    \ not-enough-characters parsing-error throw ;\r
-M: not-enough-characters summary ( obj -- str )\r
-    [\r
-        call-next-method write\r
-        "Not enough characters" print\r
-    ] with-string-writer ;\r
-\r
-: take ( n -- string )\r
-    [ 1- ] [ <sbuf> ] bi [\r
-        '[ drop get-char [ next _ push f ] [ t ] if* ] contains? drop\r
-    ] keep get-char [ over push ] when* >string ;\r
-\r
-: pass-blank ( -- )\r
-    #! Advance code past any whitespace, including newlines\r
-    [ get-char blank? not ] skip-until ;\r
-\r
-: string-matches? ( string circular -- ? )\r
-    get-char over push-circular\r
-    sequence= ;\r
-\r
-: take-string ( match -- string )\r
-    dup length <circular-string>\r
-    [ 2dup string-matches? ] take-until nip\r
-    dup length rot length 1- - head\r
-    get-char [ missing-close ] unless next ;\r
-\r
-: expect ( ch -- )\r
-    get-char 2dup = [ 2drop ] [\r
-        [ 1string ] bi@ expected\r
-    ] if next ;\r
-\r
-: expect-string ( string -- )\r
-    dup [ get-char next ] replicate 2dup =\r
-    [ 2drop ] [ expected ] if ;\r
-\r
-: init-parser ( -- )\r
-    0 1 0 f <spot> spot set\r
-    read1 set-next next ;\r
-\r
-: state-parse ( stream quot -- )\r
-    ! with-input-stream implicitly creates a new scope which we use\r
-    swap [ init-parser call ] with-input-stream ; inline\r
-\r
-: string-parse ( input quot -- )\r
-    [ <string-reader> ] dip state-parse ; inline\r
diff --git a/basis/state-parser/summary.txt b/basis/state-parser/summary.txt
deleted file mode 100644 (file)
index 5d14290..0000000
+++ /dev/null
@@ -1 +0,0 @@
-State-machined based text parsing framework
index 555a39ac888876a8aa538510100251d11fdded09..7566138e11f34057fa4f808bbbe3217083c42338 100644 (file)
@@ -8,8 +8,6 @@ QUALIFIED: ascii
 IN: unicode.case
 
 <PRIVATE
-: at-default ( key assoc -- value/key ) [ at ] [ drop ] 2bi or ; inline
-
 : ch>lower ( ch -- lower ) simple-lower at-default ; inline
 : ch>upper ( ch -- upper ) simple-upper at-default ; inline
 : ch>title ( ch -- title ) simple-title at-default ; inline
index e49f608e946c0c679efc0c6039ebb27c266a10dc..eaf8056c451028ec1da1c46fde4a038519239c28 100644 (file)
@@ -65,7 +65,7 @@ IN: validators
     v-regexp ;
 
 : v-url ( str -- str )
-    "URL" R' (ftp|http|https)://\S+' v-regexp ;
+    "URL" R' (?:ftp|http|https)://\S+' v-regexp ;
 
 : v-captcha ( str -- str )
     dup empty? [ "must remain blank" throw ] unless ;
diff --git a/basis/xml/autoencoding/authors.txt b/basis/xml/autoencoding/authors.txt
new file mode 100644 (file)
index 0000000..f990dd0
--- /dev/null
@@ -0,0 +1 @@
+Daniel Ehrenberg
diff --git a/basis/xml/autoencoding/autoencoding.factor b/basis/xml/autoencoding/autoencoding.factor
new file mode 100644 (file)
index 0000000..5d7e460
--- /dev/null
@@ -0,0 +1,64 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel namespaces xml.name io.encodings.utf8 xml.elements
+io.encodings.utf16 xml.tokenize xml.state math ascii sequences
+io.encodings.string io.encodings combinators ;
+IN: xml.autoencoding
+
+: continue-make-tag ( str -- tag )
+    parse-name-starting middle-tag end-tag ;
+
+: start-utf16le ( -- tag )
+    utf16le decode-input-if
+    CHAR: ? expect
+    0 expect check instruct ;
+
+: 10xxxxxx? ( ch -- ? )
+    -6 shift 3 bitand 2 = ;
+          
+: start<name ( ch -- tag )
+    ascii?
+    [ utf8 decode-input-if next make-tag ] [
+        next
+        [ get-next 10xxxxxx? not ] take-until
+        get-char suffix utf8 decode
+        utf8 decode-input-if next
+        continue-make-tag
+    ] if ;
+          
+: start< ( -- tag )
+    get-next {
+        { 0 [ next next start-utf16le ] }
+        { CHAR: ? [ check next next instruct ] } ! XML prolog parsing sets the encoding
+        { CHAR: ! [ check utf8 decode-input next next direct ] }
+        [ check start<name ]
+    } case ;
+
+: skip-utf8-bom ( -- tag )
+    "\u0000bb\u0000bf" expect utf8 decode-input
+    CHAR: < expect check make-tag ;
+
+: decode-expecting ( encoding string -- tag )
+    [ decode-input-if next ] [ expect-string ] bi* check make-tag ;
+
+: start-utf16be ( -- tag )
+    utf16be "<" decode-expecting ;
+
+: skip-utf16le-bom ( -- tag )
+    utf16le "\u0000fe<" decode-expecting ;
+
+: skip-utf16be-bom ( -- tag )
+    utf16be "\u0000ff<" decode-expecting ;
+
+: start-document ( -- tag )
+    get-char {
+        { CHAR: < [ start< ] }
+        { 0 [ start-utf16be ] }
+        { HEX: EF [ skip-utf8-bom ] }
+        { HEX: FF [ skip-utf16le-bom ] }
+        { HEX: FE [ skip-utf16be-bom ] }
+        { f [ "" ] }
+        [ drop utf8 decode-input-if f ]
+        ! Same problem as with <e`>, in the case of XML chunks?
+    } case check ;
+
index 4688e20767d3ed4f21f9276dbb2ba2d7f1660d16..03e85e3ea3ebc308225e10f0267e523bc9e37b54 100644 (file)
@@ -1,21 +1,33 @@
 ! Copyright (C) 2005, 2007 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences unicode.syntax math math.order ;
+USING: kernel sequences unicode.syntax math math.order combinators ;
 IN: xml.char-classes
 
-CATEGORY: 1.0name-start* Ll Lu Lo Lt Nl \u000559\u0006E5\u0006E6_ ;
+CATEGORY: 1.0name-start* Ll Lu Lo Lt Nl \u000559\u0006E5\u0006E6_: ;
 : 1.0name-start? ( char -- ? )
     dup 1.0name-start*? [ drop t ] 
     [ HEX: 2BB HEX: 2C1 between? ] if ;
 
-CATEGORY: 1.0name-char Ll Lu Lo Lt Nl Mc Me Mn Lm Nd _-.\u000387 ;
+CATEGORY: 1.0name-char Ll Lu Lo Lt Nl Mc Me Mn Lm Nd _-.\u000387: ;
 
-CATEGORY: 1.1name-start Ll Lu Lo Lm Ln Nl _ ;
+CATEGORY: 1.1name-start Ll Lu Lo Lm Ln Nl _: ;
 
-CATEGORY: 1.1name-char Ll Lu Lo Lm Ln Nl Mc Mn Nd Pc Cf _-.\u0000b7 ;
+CATEGORY: 1.1name-char Ll Lu Lo Lm Ln Nl Mc Mn Nd Pc Cf _-.\u0000b7: ;
 
 : name-start? ( 1.0? char -- ? )
     swap [ 1.0name-start? ] [ 1.1name-start? ] if ;
 
 : name-char? ( 1.0? char -- ? )
     swap [ 1.0name-char? ] [ 1.1name-char? ] if ;
+
+: text? ( 1.0? char -- ? )
+    ! 1.0:
+    ! #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+    ! 1.1:
+    ! [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+    {
+        { [ dup HEX: 20 < ] [ "\t\r\n" member? and ] }
+        { [ nip dup HEX: D800 < ] [ drop t ] }
+        { [ dup HEX: E000 < ] [ drop f ] }
+        [ { HEX: FFFE HEX: FFFF } member? not ]
+    } cond ;
diff --git a/basis/xml/data/data-docs.factor b/basis/xml/data/data-docs.factor
new file mode 100644 (file)
index 0000000..c5f4f6d
--- /dev/null
@@ -0,0 +1,152 @@
+USING: help.markup help.syntax sequences strings ;
+IN: xml.data
+
+ABOUT: "xml.data"
+
+ARTICLE: "xml.data" "XML data types"
+{ $vocab-link "xml.data" } " defines a simple document object model for XML. Everything is simply a tuple and can be manipulated as such."
+{ $subsection { "xml.data" "classes" } }
+{ $subsection { "xml.data" "constructors" } }
+"Simple words for manipulating names:"
+    { $subsection names-match? }
+    { $subsection assure-name }
+"For high-level tools for manipulating XML, see " { $vocab-link "xml.utilities" } ;
+
+ARTICLE: { "xml.data" "classes" } "XML data classes"
+    "Data types that XML documents are made of:"
+    { $subsection name }
+    { $subsection tag }
+    { $subsection contained-tag }
+    { $subsection open-tag }
+    { $subsection xml }
+    { $subsection prolog }
+    { $subsection comment }
+    { $subsection instruction }
+    { $subsection element-decl }
+    { $subsection attlist-decl }
+    { $subsection entity-decl }
+    { $subsection system-id }
+    { $subsection public-id }
+    { $subsection doctype-decl }
+    { $subsection notation-decl } ;
+
+ARTICLE: { "xml.data" "constructors" } "XML data constructors"
+    "These data types are constructed with:"
+    { $subsection <name> }
+    { $subsection <tag> }
+    { $subsection <contained-tag> }
+    { $subsection <xml> }
+    { $subsection <prolog> }
+    { $subsection <comment> }
+    { $subsection <instruction> }
+    { $subsection <simple-name> }
+    { $subsection <element-decl> }
+    { $subsection <attlist-decl> }
+    { $subsection <entity-decl> }
+    { $subsection <system-id> }
+    { $subsection <public-id> }
+    { $subsection <doctype-decl> }
+    { $subsection <notation-decl> } ;
+
+HELP: tag
+{ $class-description "tuple representing an XML tag, delegating to a " { $link
+name } ", containing the slots attrs (an alist of names to strings) and children (a sequence). Tags implement the sequence protocol by acting like a sequence of its chidren, and the assoc protocol by acting like its attributes." }
+{ $see-also <tag> name contained-tag xml } ;
+
+HELP: <tag>
+{ $values { "name" "an XML tag name" }
+    { "attrs" "an alist of names to strings" }
+    { "children" sequence }
+    { "tag" tag } }
+{ $description "constructs an XML " { $link tag } " with the name (not a string) and tag attributes specified in attrs and children specified" }
+{ $see-also tag <contained-tag> } ;
+
+HELP: name
+{ $class-description "represents an XML name, with the fields space (a string representing the namespace, as written in the document, tag (a string of the actual name of the tag) and url (a string of the URL that the namespace points to)" }
+{ $see-also <name> tag } ;
+
+HELP: <name>
+{ $values { "space" "a string" } { "main" "a string" } { "url" "a string" }
+    { "name" "an XML tag name" } }
+{ $description "creates a name tuple with the name-space space and the tag-name tag and the tag-url url." }
+{ $see-also name <tag> } ;
+
+HELP: contained-tag
+{ $class-description "delegates to tag representing a tag like <a/> with no contents. The tag attributes are accessed with tag-attrs" }
+{ $see-also tag <contained-tag> } ;
+
+HELP: <contained-tag>
+{ $values { "name" "an XML tag name" }
+    { "attrs" "an alist from names to strings" }
+    { "tag" tag } }
+{ $description "creates an empty tag (like <a/>) with the specified name and tag attributes. This delegates to tag" }
+{ $see-also contained-tag <tag> } ;
+
+HELP: xml
+{ $class-description "tuple representing an XML document, delegating to the main tag, containing the fields prolog (the header <?xml...?>), before (whatever comes between the prolog and the main tag) and after (whatever comes after the main tag)" }
+{ $see-also <xml> tag prolog } ;
+
+HELP: <xml>
+{ $values { "prolog" "an XML prolog" } { "before" "a sequence of XML elements" }
+{ "body" tag } { "after" "a sequence of XML elements" } { "xml" "an XML document" } }
+{ $description "creates an XML document, delegating to the main tag, with the specified prolog, before, and after" }
+{ $see-also xml <tag> } ;
+
+HELP: prolog
+{ $class-description "represents an XML prolog, with the tuple fields version (containing \"1.0\" or \"1.1\"), encoding (a string representing the encoding type), and standalone (t or f, whether the document is standalone without external entities)" }
+{ $see-also <prolog> xml } ;
+
+HELP: <prolog>
+{ $values { "version" "a string, 1.0 or 1.1" }
+{ "encoding" "a string" } { "standalone" "a boolean" } { "prolog" "an XML prolog" } }
+{ $description "creates an XML prolog tuple" }
+{ $see-also prolog <xml> } ;
+
+HELP: comment
+{ $class-description "represents a comment in XML. Has one slot, text, which contains the string of the comment" }
+{ $see-also <comment> } ;
+
+HELP: <comment>
+{ $values { "text" "a string" } { "comment" "a comment" } }
+{ $description "creates an XML comment tuple" }
+{ $see-also comment } ;
+
+HELP: instruction
+{ $class-description "represents an XML instruction, such as <?xsl stylesheet='foo.xml'?>. Contains one slot, text, which contains the string between the question marks." }
+{ $see-also <instruction> } ;
+
+HELP: <instruction>
+{ $values { "text" "a string" } { "instruction" "an XML instruction" } }
+{ $description "creates an XML parsing instruction, such as <?xsl stylesheet='foo.xml'?>." }
+{ $see-also instruction } ;
+
+HELP: opener
+{ $class-description "describes an opening tag, like <a>. Contains two slots, name and attrs containing, respectively, the name of the tag and its attributes. Usually, the name-url will be f." }
+{ $see-also closer contained } ;
+
+HELP: closer
+{ $class-description "describes a closing tag, like </a>. Contains one slot, name, containing the tag's name. Usually, the name-url will be f." }
+{ $see-also opener contained } ;
+
+HELP: contained
+{ $class-description "represents a self-closing tag, like <a/>. Contains two slots, name and attrs containing, respectively, the name of the tag and its attributes. Usually, the name-url will be f." }
+{ $see-also opener closer } ;
+
+HELP: open-tag
+{ $class-description "represents a tag that does have children, ie is not a contained tag" }
+{ $notes "the constructor used for this class is simply " { $link <tag> } "." }
+{ $see-also tag contained-tag } ;
+
+HELP: names-match?
+{ $values { "name1" "a name" } { "name2" "a name" } { "?" "t or f" } }
+{ $description "checks to see if the two names match, that is, if all fields are equal, ignoring fields whose value is f in either name." }
+{ $example "USING: prettyprint xml.data ;" "T{ name f \"rpc\" \"methodCall\" f } T{ name f f \"methodCall\" \"http://www.xmlrpc.org/\" } names-match? ." "t" }
+{ $see-also name } ;
+
+HELP: assure-name
+{ $values { "string/name" "a string or a name" } { "name" "a name" } }
+{ $description "Converts a string into an XML name, if it is not already a name." } ;
+
+HELP: <simple-name>
+{ $values { "string" string } { "name" name } }
+{ $description "Converts a string into an XML name with an empty prefix and URL." } ;
index bf4e2047a7990df29e275f8082f8e60e405423d3..68e91743d3eac084e1687580f5a721fecccebccb 100644 (file)
@@ -17,10 +17,13 @@ C: <name> name
     [ [ main>> ] bi@ ?= ] 2tri and and ;
 
 : <simple-name> ( string -- name )
+    "" swap f <name> ;
+
+: <null-name> ( string -- name )
     f swap f <name> ;
 
 : assure-name ( string/name -- name )
-    dup name? [ <simple-name> ] unless ;
+    dup name? [ <null-name> ] unless ;
 
 TUPLE: opener name attrs ;
 C: <opener> opener
@@ -42,7 +45,7 @@ C: <element-decl> element-decl
 TUPLE: attlist-decl < directive name att-defs ;
 C: <attlist-decl> attlist-decl
 
-TUPLE: entity-decl < directive name def ;
+TUPLE: entity-decl < directive name def pe? ;
 C: <entity-decl> entity-decl
 
 TUPLE: system-id system-literal ;
@@ -54,6 +57,9 @@ C: <public-id> public-id
 TUPLE: doctype-decl < directive name external-id internal-subset ;
 C: <doctype-decl> doctype-decl
 
+TUPLE: notation-decl < directive name id ;
+C: <notation-decl> notation-decl
+
 TUPLE: instruction text ;
 C: <instruction> instruction
 
diff --git a/basis/xml/dtd/authors.txt b/basis/xml/dtd/authors.txt
new file mode 100644 (file)
index 0000000..f990dd0
--- /dev/null
@@ -0,0 +1 @@
+Daniel Ehrenberg
diff --git a/basis/xml/dtd/dtd.factor b/basis/xml/dtd/dtd.factor
new file mode 100644 (file)
index 0000000..a1b90a6
--- /dev/null
@@ -0,0 +1,61 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg, Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: xml.tokenize xml.data xml.state kernel sequences ascii
+fry xml.errors combinators hashtables namespaces xml.entities
+strings ;
+IN: xml.dtd
+
+: take-word ( -- string )
+    [ get-char blank? ] take-until ;
+
+: take-decl-contents ( -- first second )
+    pass-blank take-word pass-blank ">" take-string ;
+
+: take-element-decl ( -- element-decl )
+    take-decl-contents <element-decl> ;
+
+: take-attlist-decl ( -- attlist-decl )
+    take-decl-contents <attlist-decl> ;
+
+: take-notation-decl ( -- notation-decl )
+    take-decl-contents <notation-decl> ; 
+
+: take-until-one-of ( seps -- str sep )
+    '[ get-char _ member? ] take-until get-char ;
+
+: take-system-id ( -- system-id )
+    parse-quote <system-id> close ;
+
+: take-public-id ( -- public-id )
+    parse-quote parse-quote <public-id> close ;
+
+UNION: dtd-acceptable
+    directive comment instruction ;
+
+: (take-external-id) ( token -- external-id )
+    pass-blank {
+        { "SYSTEM" [ take-system-id ] }
+        { "PUBLIC" [ take-public-id ] }
+        [ bad-external-id ]
+    } case ;
+
+: take-external-id ( -- external-id )
+    take-word (take-external-id) ;
+
+: only-blanks ( str -- )
+    [ blank? ] all? [ bad-decl ] unless ;
+: take-entity-def ( var -- entity-name entity-def )
+    [
+        take-word pass-blank get-char {
+            { CHAR: ' [ parse-quote ] }
+            { CHAR: " [ parse-quote ] }
+            [ drop take-external-id ]
+        } case
+   ] dip '[ swap _ [ ?set-at ] change ] 2keep ;
+
+: take-entity-decl ( -- entity-decl )
+    pass-blank get-char {
+        { CHAR: % [ next pass-blank pe-table take-entity-def t ] }
+        [ drop extra-entities take-entity-def f ]
+    } case
+    close <entity-decl> ;
diff --git a/basis/xml/elements/authors.txt b/basis/xml/elements/authors.txt
new file mode 100644 (file)
index 0000000..f990dd0
--- /dev/null
@@ -0,0 +1 @@
+Daniel Ehrenberg
diff --git a/basis/xml/elements/elements.factor b/basis/xml/elements/elements.factor
new file mode 100644 (file)
index 0000000..65b8b66
--- /dev/null
@@ -0,0 +1,165 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel namespaces xml.tokenize xml.state xml.name
+xml.data accessors arrays make xml.char-classes fry assocs sequences
+math xml.errors sets combinators io.encodings io.encodings.iana
+unicode.case xml.dtd strings ;
+IN: xml.elements
+
+: parse-attr ( -- )
+    parse-name pass-blank CHAR: = expect pass-blank
+    t parse-quote* 2array , ;
+
+: start-tag ( -- name ? )
+    #! Outputs the name and whether this is a closing tag
+    get-char CHAR: / = dup [ next ] when
+    parse-name swap ;
+
+: (middle-tag) ( -- )
+    pass-blank version=1.0? get-char name-start?
+    [ parse-attr (middle-tag) ] when ;
+
+: assure-no-duplicates ( attrs-alist -- attrs-alist )
+    H{ } clone 2dup '[ swap _ push-at ] assoc-each
+    [ nip length 2 >= ] assoc-filter >alist
+    [ first first2 duplicate-attr ] unless-empty ;
+
+: middle-tag ( -- attrs-alist )
+    ! f make will make a vector if it has any elements
+    [ (middle-tag) ] f make pass-blank
+    assure-no-duplicates ;
+
+: end-tag ( name attrs-alist -- tag )
+    tag-ns pass-blank get-char CHAR: / =
+    [ pop-ns <contained> next CHAR: > expect ]
+    [ depth inc <opener> close ] if ;
+
+: take-comment ( -- comment )
+    "--" expect-string
+    "--" take-string
+    <comment>
+    CHAR: > expect ;
+
+: assure-no-extra ( seq -- )
+    [ first ] map {
+        T{ name f "" "version" f }
+        T{ name f "" "encoding" f }
+        T{ name f "" "standalone" f }
+    } diff
+    [ extra-attrs ] unless-empty ; 
+
+: good-version ( version -- version )
+    dup { "1.0" "1.1" } member? [ bad-version ] unless ;
+
+: prolog-version ( alist -- version )
+    T{ name f "" "version" f } swap at
+    [ good-version ] [ versionless-prolog ] if* ;
+
+: prolog-encoding ( alist -- encoding )
+    T{ name f "" "encoding" f } swap at "UTF-8" or ;
+
+: yes/no>bool ( string -- t/f )
+    {
+        { "yes" [ t ] }
+        { "no" [ f ] }
+        [ not-yes/no ]
+    } case ;
+
+: prolog-standalone ( alist -- version )
+    T{ name f "" "standalone" f } swap at
+    [ yes/no>bool ] [ f ] if* ;
+
+: prolog-attrs ( alist -- prolog )
+    [ prolog-version ]
+    [ prolog-encoding ]
+    [ prolog-standalone ]
+    tri <prolog> ;
+
+SYMBOL: string-input?
+: decode-input-if ( encoding -- )
+    string-input? get [ drop ] [ decode-input ] if ;
+
+: parse-prolog ( -- prolog )
+    pass-blank middle-tag "?>" expect-string
+    dup assure-no-extra prolog-attrs
+    dup encoding>> dup "UTF-16" =
+    [ drop ] [ name>encoding [ decode-input-if ] when* ] if
+    dup prolog-data set ;
+
+: instruct ( -- instruction )
+    take-name {
+        { [ dup "xml" = ] [ drop parse-prolog ] }
+        { [ dup >lower "xml" = ] [ capitalized-prolog ] }
+        { [ dup valid-name? not ] [ bad-name ] }
+        [ "?>" take-string append <instruction> ]
+    } cond ;
+
+: take-cdata ( -- string )
+    depth get zero? [ bad-cdata ] when
+    "[CDATA[" expect-string "]]>" take-string ;
+
+DEFER: make-tag ! Is this unavoidable?
+
+: expand-pe ( -- ) ; ! Make this run the contents of the pe within a DOCTYPE
+
+: (take-internal-subset) ( -- )
+    pass-blank get-char {
+        { CHAR: ] [ next ] }
+        { CHAR: % [ expand-pe ] }
+        { CHAR: < [
+            next make-tag dup dtd-acceptable?
+            [ bad-doctype ] unless , (take-internal-subset)
+        ] }
+        [ 1string bad-doctype ]
+    } case ;
+
+: take-internal-subset ( -- seq )
+    [
+        H{ } pe-table set
+        t in-dtd? set
+        (take-internal-subset)
+    ] { } make ;
+
+: nontrivial-doctype ( -- external-id internal-subset )
+    pass-blank get-char CHAR: [ = [
+        next take-internal-subset f swap close
+    ] [
+        " >" take-until-one-of {
+            { CHAR: \s [ (take-external-id) ] }
+            { CHAR: > [ only-blanks f ] }
+        } case f
+    ] if ;
+
+: take-doctype-decl ( -- doctype-decl )
+    pass-blank " >" take-until-one-of {
+        { CHAR: \s [ nontrivial-doctype ] }
+        { CHAR: > [ f f ] }
+    } case <doctype-decl> ;
+
+
+: take-directive ( -- directive )
+    take-name {
+        { "ELEMENT" [ take-element-decl ] }
+        { "ATTLIST" [ take-attlist-decl ] }
+        { "DOCTYPE" [ take-doctype-decl ] }
+        { "ENTITY" [ take-entity-decl ] }
+        { "NOTATION" [ take-notation-decl ] }
+        [ bad-directive ]
+    } case ;
+
+: direct ( -- object )
+    get-char {
+        { CHAR: - [ take-comment ] }
+        { CHAR: [ [ take-cdata ] }
+        [ drop take-directive ]
+    } case ;
+
+: make-tag ( -- tag )
+    {
+        { [ get-char dup CHAR: ! = ] [ drop next direct ] }
+        { [ CHAR: ? = ] [ next instruct ] }
+        [
+            start-tag [ dup add-ns pop-ns <closer> depth dec close ]
+            [ middle-tag end-tag ] if
+        ]
+    } cond ;
diff --git a/basis/xml/entities/entities-docs.factor b/basis/xml/entities/entities-docs.factor
new file mode 100644 (file)
index 0000000..ab10530
--- /dev/null
@@ -0,0 +1,22 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: xml.entities
+
+ABOUT: "xml.entities"
+
+ARTICLE: "xml.entities" "XML entities"
+    "When XML is parsed, entities like &foo; are replaced with the characters they represent. A few entities like &amp; and &lt; are defined by default, but more are available, and the set of entities can be customized. Below are some words involved in XML entities, defined in the vocabulary 'entities':"
+    { $subsection entities }
+    { $subsection with-entities }
+"For entities used in HTML/XHTML, see " { $vocab-link "xml.entities.html" } ;
+
+HELP: entities
+{ $description "a hash table from default XML entity names (like &amp; and &lt;) to the characters they represent. This is automatically included when parsing any XML document." }
+{ $see-also with-entities } ;
+
+HELP: with-entities
+{ $values { "entities" "a hash table of strings to chars" }
+    { "quot" "a quotation ( -- )" } }
+{ $description "calls the quotation using the given table of entity values (symbolizing, eg, that &foo; represents CHAR: a) on top of the default XML entities" } ;
+
diff --git a/basis/xml/entities/html/html-docs.factor b/basis/xml/entities/html/html-docs.factor
new file mode 100644 (file)
index 0000000..2e1b67a
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax xml.entities ;
+IN: xml.entities.html
+
+ARTICLE: "xml.entities.html" "HTML entities"
+{ $vocab-link "xml.entities.html" } " defines words for using entities defined in HTML/XHTML."
+    { $subsection html-entities }
+    { $subsection with-html-entities } ;
+
+HELP: html-entities
+{ $description "a hash table from HTML entity names to their character values" }
+{ $see-also entities with-html-entities } ;
+
+HELP: with-html-entities
+{ $values { "quot" "a quotation ( -- )" } }
+{ $description "calls the given quotation using HTML entity values" }
+{ $see-also html-entities with-entities } ;
index 6f2732f1d9407fdb6ec3f61cbd6c72d8520c24fc..601b95a5967ed17a3bb7d65470fac4ea856a7aaf 100644 (file)
@@ -7,8 +7,10 @@ IN: xml.entities.html
 VALUE: html-entities
 
 : read-entities-file ( file -- table )
-    f swap binary <file-reader>
-    [ 2drop extra-entities get ] sax ;
+    H{ } clone [ extra-entities [
+        binary <file-reader>
+        [ drop ] sax
+    ] with-variable ] keep ;
 
 : get-html ( -- table )
     { "lat1" "special" "symbol" } [
diff --git a/basis/xml/errors/errors-docs.factor b/basis/xml/errors/errors-docs.factor
new file mode 100644 (file)
index 0000000..b95aecc
--- /dev/null
@@ -0,0 +1,68 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: xml.errors
+
+HELP: multitags
+{ $class-description "XML parsing error describing the case where there is more than one main tag in a document. Contains no slots" } ;
+
+HELP: notags
+{ $class-description "XML parsing error describing the case where an XML document contains no main tag, or any tags at all" } ;
+
+HELP: extra-attrs
+{ $class-description "XML parsing error describing the case where the XML prolog (<?xml ...?>) contains attributes other than the three allowed ones, standalone, version and encoding. Contains one slot, attrs, which is a hashtable of all the extra attributes' names. Delegates to " { $link parsing-error } "." } ;
+
+HELP: nonexist-ns
+{ $class-description "XML parsing error describing the case where a namespace doesn't exist but it is used in a tag. Contains one slot, name, which contains the name of the undeclared namespace, and delegates to " { $link parsing-error } "." } ;
+
+HELP: not-yes/no
+{ $class-description "XML parsing error used to describe the case where standalone is set in the XML prolog to something other than 'yes' or 'no'. Delegates to " { $link parsing-error } " and contains one slot, text, which contains offending value." } ;
+
+HELP: unclosed
+{ $class-description "XML parsing error used to describe the case where the XML document contains classes which are not closed by the end of the document. Contains one slot, tags, a sequence of names." } ;
+
+HELP: mismatched
+{ $class-description "XML parsing error describing mismatched tags, eg <a></c>. Contains two slots: open is the name of the opening tag and close is the name of the closing tag. Delegates to " { $link parsing-error } " showing the location of the closing tag" } ;
+
+HELP: expected
+{ $class-description "XML parsing error describing when an expected token was not present. Delegates to " { $link parsing-error } ". Contains two slots, should-be, which has the expected string, and was, which has the actual string." } ;
+
+HELP: no-entity
+{ $class-description "XML parsing error describing the use of an undefined entity in a case where standalone is marked yes. Delegates to " { $link parsing-error } ". Contains one slot, thing, containing a string representing the entity." } ;
+
+
+HELP: pre/post-content
+{ $class-description "describes the error where a non-whitespace string is used before or after the main tag in an XML document. Contains two slots: string contains the offending string, and pre? is t if it occured before the main tag and f if it occured after" } ;
+
+HELP: unclosed-quote
+{ $class-description "describes the error where a quotation for an attribute value is opened but not closed before the end of the document." } ;
+
+HELP: bad-name
+{ $class-description "describes the error where a name is used, for example in an XML tag or attribute key, which is invalid." } ;
+
+HELP: quoteless-attr
+{ $class-description "describes the error where an attribute of an XML tag is missing quotes around a value." } ;
+
+HELP: xml-parse-error
+{ $class-description "the exception class that all parsing errors in XML documents are in." } ;
+
+ARTICLE: "xml.errors" "XML parsing errors"
+    { $vocab-link "xml.errors" } " provides a rich and highly inspectable set of parsing errors. All XML errors are described by the union class " { $link xml-parse-error } " but there are many classes contained in that:"
+    { $subsection multitags }
+    { $subsection notags }
+    { $subsection extra-attrs }
+    { $subsection nonexist-ns }
+    { $subsection not-yes/no }
+    { $subsection unclosed }
+    { $subsection mismatched }
+    { $subsection expected }
+    { $subsection no-entity }
+    { $subsection pre/post-content }
+    { $subsection unclosed-quote }
+    { $subsection bad-name }
+    { $subsection quoteless-attr }
+    "Additionally, most of these errors are a kind of " { $link parsing-error } " which provides more information"
+    $nl
+    "Note that, in parsing an XML document, only the first error is reported." ;
+
+ABOUT: "xml.errors"
index 426ef577360c83e1ad34ce7d1d6fa44d8207d9b3..bf02f4b6ca7d614b157edfd4878db4631e57ec12 100644 (file)
@@ -1,5 +1,5 @@
 USING: continuations xml xml.errors tools.test kernel arrays
-xml.data state-parser quotations fry ;
+xml.data quotations fry ;
 IN: xml.errors.tests
 
 : xml-error-test ( expected-error xml-string -- )
@@ -25,8 +25,14 @@ T{ capitalized-prolog f 1 6 "XmL" } "<?XmL version='1.0'?><x/>"
     xml-error-test
 T{ pre/post-content f "x" t } "x<y/>" xml-error-test
 T{ versionless-prolog f 1 8 } "<?xml?><x/>" xml-error-test
-T{ bad-instruction f 1 11 T{ instruction f "xsl" } }
-    "<x><?xsl?></x>" xml-error-test
 T{ unclosed-quote f 1 13 } "<x value='/>" xml-error-test
 T{ bad-name f 1 3 "-" } "<-/>" xml-error-test
-T{ quoteless-attr f 1 10 } "<x value=3/>" xml-error-test
\ No newline at end of file
+T{ quoteless-attr f 1 10 } "<x value=3/>" xml-error-test
+T{ attr-w/< f 1 11 } "<x value='<'/>" xml-error-test
+T{ text-w/]]> f 1 6 } "<x>]]></x>" xml-error-test
+T{ duplicate-attr f 1 21 T{ name { space "" } { main "this" } } V{ "a" "b" } } "<x this='a' this='b'/>" xml-error-test
+T{ bad-cdata f 1 3 } "<![CDATA[]]><x/>" xml-error-test
+T{ bad-cdata f 1 7 } "<x/><![CDATA[]]>" xml-error-test
+T{ pre/post-content f "&" t } "&32;<x/>" xml-error-test
+T{ bad-doctype f 1 17 "a" } "<!DOCTYPE foo [ a ]><x/>" xml-error-test
+T{ bad-doctype f 1 22 T{ opener { name T{ name f "" "foo" "" } } { attrs T{ attrs } } } } "<!DOCTYPE foo [ <foo> ]><x/>" xml-error-test
index 9d3d8a6bb0f0b311ad4ea0f60e0fabdef245d34d..ea6eb5141508f4d1ec81a08d18c7a4106f54e4e0 100644 (file)
@@ -1,10 +1,61 @@
 ! Copyright (C) 2005, 2006 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
 USING: xml.data xml.writer kernel generic io prettyprint math 
-debugger sequences state-parser accessors summary
-namespaces io.streams.string xml.backend ;
+debugger sequences xml.state accessors summary
+namespaces io.streams.string xml.backend xml.writer.private ;
 IN: xml.errors
 
+TUPLE: parsing-error line column ;
+
+: parsing-error ( class -- obj )
+    new
+        get-line >>line
+        get-column >>column ;
+M: parsing-error summary ( obj -- str )
+    [
+        "Parsing error" print
+        "Line: " write dup line>> .
+        "Column: " write column>> .
+    ] with-string-writer ;
+
+TUPLE: expected < parsing-error should-be was ;
+: expected ( should-be was -- * )
+    \ expected parsing-error
+        swap >>was
+        swap >>should-be throw ;
+M: expected summary ( obj -- str )
+    [
+        dup call-next-method write
+        "Token expected: " write dup should-be>> print
+        "Token present: " write was>> print
+    ] with-string-writer ;
+
+TUPLE: unexpected-end < parsing-error ;
+: unexpected-end ( -- * ) \ unexpected-end parsing-error throw ;
+M: unexpected-end summary ( obj -- str )
+    [
+        call-next-method write
+        "File unexpectedly ended." print
+    ] with-string-writer ;
+
+TUPLE: missing-close < parsing-error ;
+: missing-close ( -- * ) \ missing-close parsing-error throw ;
+M: missing-close summary ( obj -- str )
+    [
+        call-next-method write
+        "Missing closing token." print
+    ] with-string-writer ;
+
+TUPLE: disallowed-char < parsing-error char ;
+
+: disallowed-char ( char -- * )
+    \ disallowed-char parsing-error swap >>char throw ;
+
+M: disallowed-char summary
+    [ call-next-method ]
+    [ char>> "Disallowed character in XML document: " swap suffix ] bi
+    append ;
+
 ERROR: multitags ;
 
 M: multitags summary ( obj -- str )
@@ -170,18 +221,6 @@ M: versionless-prolog summary ( obj -- str )
         "XML prolog lacks a version declaration" print
     ] with-string-writer ;
 
-TUPLE: bad-instruction < parsing-error instruction ;
-
-: bad-instruction ( instruction -- * )
-    \ bad-instruction parsing-error swap >>instruction throw ;
-
-M: bad-instruction summary ( obj -- str )
-    [
-        dup call-next-method write
-        "Misplaced processor instruction:" print
-        instruction>> write-xml-chunk nl
-    ] with-string-writer ;
-
 TUPLE: bad-directive < parsing-error dir ;
 
 : bad-directive ( directive -- * )
@@ -194,13 +233,13 @@ M: bad-directive summary ( obj -- str )
         dir>> write
     ] with-string-writer ;
 
-TUPLE: bad-doctype-decl < parsing-error ;
+TUPLE: bad-decl < parsing-error ;
 
-: bad-doctype-decl ( -- * )
-    \ bad-doctype-decl parsing-error throw ;
+: bad-decl ( -- * )
+    \ bad-decl parsing-error throw ;
 
-M: bad-doctype-decl summary ( obj -- str )
-    call-next-method "\nBad DOCTYPE" append ;
+M: bad-decl summary ( obj -- str )
+    call-next-method "\nExtra content in directive" append ;
 
 TUPLE: bad-external-id < parsing-error ;
 
@@ -249,7 +288,59 @@ TUPLE: quoteless-attr < parsing-error ;
 M: quoteless-attr summary
     call-next-method "Attribute lacks quotes around value\n" append ;
 
-UNION: xml-parse-error multitags notags extra-attrs nonexist-ns
-       not-yes/no unclosed mismatched expected no-entity
-       bad-prolog versionless-prolog capitalized-prolog bad-instruction
-       bad-directive bad-name unclosed-quote quoteless-attr ;
+TUPLE: attr-w/< < parsing-error ;
+
+: attr-w/< ( value -- * )
+    \ attr-w/< parsing-error throw ;
+
+M: attr-w/< summary
+    call-next-method
+    "Attribute value contains literal <" append ;
+
+TUPLE: text-w/]]> < parsing-error ;
+
+: text-w/]]> ( text -- * )
+    \ text-w/]]> parsing-error throw ;
+
+M: text-w/]]> summary
+    call-next-method
+    "Text node contains ']]>'" append ;
+
+TUPLE: duplicate-attr < parsing-error key values ;
+
+: duplicate-attr ( key values -- * )
+    \ duplicate-attr parsing-error
+    swap >>values swap >>key throw ;
+
+M: duplicate-attr summary
+    call-next-method "\nDuplicate attribute" append ;
+
+TUPLE: bad-cdata < parsing-error ;
+
+: bad-cdata ( -- * )
+    \ bad-cdata parsing-error throw ;
+
+M: bad-cdata summary
+    call-next-method "\nCDATA occurs before or after main tag" append ;
+
+TUPLE: not-enough-characters < parsing-error ;
+: not-enough-characters ( -- * )
+    \ not-enough-characters parsing-error throw ;
+M: not-enough-characters summary ( obj -- str )
+    [
+        call-next-method write
+        "Not enough characters" print
+    ] with-string-writer ;
+
+TUPLE: bad-doctype < parsing-error contents ;
+: bad-doctype ( contents -- * )
+    \ bad-doctype parsing-error swap >>contents throw ;
+M: bad-doctype summary
+    call-next-method "\nDTD contains invalid object" append ;
+
+UNION: xml-parse-error
+    multitags notags extra-attrs nonexist-ns bad-decl
+    not-yes/no unclosed mismatched expected no-entity
+    bad-prolog versionless-prolog capitalized-prolog
+    bad-directive bad-name unclosed-quote quoteless-attr
+    attr-w/< text-w/]]> duplicate-attr ;
diff --git a/basis/xml/interpolate/authors.txt b/basis/xml/interpolate/authors.txt
new file mode 100644 (file)
index 0000000..29e7963
--- /dev/null
@@ -0,0 +1 @@
+Daniel Ehrenberg
\ No newline at end of file
diff --git a/basis/xml/interpolate/interpolate-tests.factor b/basis/xml/interpolate/interpolate-tests.factor
new file mode 100644 (file)
index 0000000..0adcb51
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Daniel Ehrenberg.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test xml.interpolate ;
+IN: xml.interpolate.tests
diff --git a/basis/xml/interpolate/interpolate.factor b/basis/xml/interpolate/interpolate.factor
new file mode 100644 (file)
index 0000000..262d0e1
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Daniel Ehrenberg.
+! See http://factorcode.org/license.txt for BSD license.
+USING: ;
+IN: xml.interpolate
diff --git a/basis/xml/name/name.factor b/basis/xml/name/name.factor
new file mode 100644 (file)
index 0000000..32053b1
--- /dev/null
@@ -0,0 +1,76 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel namespaces accessors xml.tokenize xml.data assocs
+xml.errors xml.char-classes combinators.short-circuit splitting
+fry xml.state sequences ;
+IN: xml.name
+
+! XML namespace processing: ns = namespace
+
+! A stack of hashtables
+SYMBOL: ns-stack
+
+: attrs>ns ( attrs-alist -- hash )
+    ! this should check to make sure URIs are valid
+    [
+        [
+            swap dup space>> "xmlns" =
+            [ main>> set ]
+            [
+                T{ name f "" "xmlns" f } names-match?
+                [ "" set ] [ drop ] if
+            ] if
+        ] assoc-each
+    ] { } make-assoc f like ;
+
+: add-ns ( name -- )
+    dup space>> dup ns-stack get assoc-stack
+    [ nip ] [ nonexist-ns ] if* >>url drop ;
+
+: push-ns ( hash -- )
+    ns-stack get push ;
+
+: pop-ns ( -- )
+    ns-stack get pop* ;
+
+: init-ns-stack ( -- )
+    V{ H{
+        { "xml" "http://www.w3.org/XML/1998/namespace" }
+        { "xmlns" "http://www.w3.org/2000/xmlns" }
+        { "" "" }
+    } } clone
+    ns-stack set ;
+
+: tag-ns ( name attrs-alist -- name attrs )
+    dup attrs>ns push-ns
+    [ dup add-ns ] dip dup [ drop add-ns ] assoc-each <attrs> ;
+
+: valid-name? ( str -- ? )
+    [ f ] [
+        version=1.0? swap {
+            [ first name-start? ]
+            [ rest-slice [ name-char? ] with all? ]
+        } 2&&
+    ] if-empty ;
+
+: prefixed-name ( str -- name/f )
+    ":" split dup length 2 = [
+        [ [ valid-name? ] all? ]
+        [ first2 f <name> ] bi and
+    ] [ drop f ] if ;
+
+: interpret-name ( str -- name )
+    dup prefixed-name [ ] [
+        dup valid-name?
+        [ <simple-name> ] [ bad-name ] if
+    ] ?if ;
+
+: take-name ( -- string )
+    version=1.0? '[ _ get-char name-char? not ] take-until ;
+
+: parse-name ( -- name )
+    take-name interpret-name ;
+
+: parse-name-starting ( string -- name )
+    take-name append interpret-name ;
+
diff --git a/basis/xml/state/authors.txt b/basis/xml/state/authors.txt
new file mode 100644 (file)
index 0000000..f990dd0
--- /dev/null
@@ -0,0 +1 @@
+Daniel Ehrenberg
diff --git a/basis/xml/state/state.factor b/basis/xml/state/state.factor
new file mode 100644 (file)
index 0000000..80fb6be
--- /dev/null
@@ -0,0 +1,19 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel namespaces io ;
+IN: xml.state
+
+TUPLE: spot char line column next check ;
+
+C: <spot> spot
+
+: get-char ( -- char ) spot get char>> ;
+: set-char ( char -- ) spot get swap >>char drop ;
+: get-line ( -- line ) spot get line>> ;
+: set-line ( line -- ) spot get swap >>line drop ;
+: get-column ( -- column ) spot get column>> ;
+: set-column ( column -- ) spot get swap >>column drop ;
+: get-next ( -- char ) spot get next>> ;
+: set-next ( char -- ) spot get swap >>next drop ;
+: get-check ( -- ? ) spot get check>> ;
+: check ( -- ) spot get t >>check drop ;
index 063090b5f4049a757fec0b372c3d8119fd29832e..a8093442ca29508059973f9906d8f4f1dc8b3312 100644 (file)
@@ -25,9 +25,9 @@
 <directoryTitle xsi:type="xsd:string"></directoryTitle>
 <hostName xsi:type="xsd:string"></hostName>
 <relatedInformationPresent xsi:type="xsd:boolean">true</relatedInformationPresent>
-<snippet xsi:type="xsd:string">The O\e$-1òùReilly &lt;b&gt;Factor&lt;/b&gt; with Bill OòùReilly on FOXNews.com. Bill OòùReilly hosts The &lt;br&gt;  OòùReilly &lt;b&gt;Factor&lt;/b&gt;, the most-watched program on cable news.</snippet>
+<snippet xsi:type="xsd:string">The O$-1òùReilly &lt;b&gt;Factor&lt;/b&gt; with Bill OòùReilly on FOXNews.com. Bill OòùReilly hosts The &lt;br&gt;  OòùReilly &lt;b&gt;Factor&lt;/b&gt;, the most-watched program on cable news.</snippet>
 <summary xsi:type="xsd:string"></summary>
-<title xsi:type="xsd:string">Bill O\e$-1òùReilly | The OòùReilly &lt;b&gt;Factor&lt;/b&gt; - FOXNews.com</title>
+<title xsi:type="xsd:string">Bill O$-1òùReilly | The OòùReilly &lt;b&gt;Factor&lt;/b&gt; - FOXNews.com</title>
 </item>
 <item xsi:type="ns1:ResultElement">
 <URL xsi:type="xsd:string">http://www.factor.ca/</URL>
diff --git a/basis/xml/tests/state-parser-tests.factor b/basis/xml/tests/state-parser-tests.factor
new file mode 100644 (file)
index 0000000..31d4a03
--- /dev/null
@@ -0,0 +1,15 @@
+USING: tools.test xml.tokenize xml.state io.streams.string kernel io strings ascii ;
+IN: xml.test.state
+
+: string-parse ( str quot -- )
+    [ <string-reader> ] dip with-state ;
+
+: take-rest ( -- string )
+    [ f ] take-until ;
+
+[ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test
+[ 2 4 ] [ "12\n123" [ take-rest drop get-line get-column ] string-parse ] unit-test
+[ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until take-rest ] string-parse ] unit-test
+[ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test
+[ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test
+[ "baz" ] [ " \n\t baz" [ pass-blank take-rest ] string-parse ] unit-test
index 7a826756b6f71221254debd6321861abad7ff094..61873d85bffed0357f731f79db902f28f3183d75 100644 (file)
@@ -3,11 +3,13 @@
 IN: xml.tests
 USING: kernel xml tools.test io namespaces make sequences
 xml.errors xml.entities.html parser strings xml.data io.files
-xml.writer xml.utilities state-parser continuations assocs
+xml.utilities continuations assocs
 sequences.deep accessors io.streams.string ;
 
 ! This is insufficient
 \ read-xml must-infer
+[ [ drop ] sax ] must-infer
+\ string>xml must-infer
 
 SYMBOL: xml-file
 [ ] [ "resource:basis/xml/tests/test.xml"
@@ -29,8 +31,6 @@ SYMBOL: xml-file
 ] unit-test
 [ V{ "fa&g" } ] [ xml-file get "x" get-id children>> ] unit-test
 [ "that" ] [ xml-file get "this" swap at ] unit-test
-[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a b=\"c\"/>" ]
-    [ "<a b='c'/>" string>xml xml>string ] unit-test
 [ "abcd" ] [
     "<main>a<sub>bc</sub>d<nothing/></main>" string>xml
     [ [ dup string? [ % ] [ drop ] if ] deep-each ] "" make
@@ -47,10 +47,6 @@ SYMBOL: xml-file
     at swap "z" [ tuck ] dip swap set-at
     T{ name f "blah" "z" f } swap at ] unit-test
 [ "foo" ] [ "<boo><![CDATA[foo]]></boo>" string>xml children>string ] unit-test
-[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>bar baz</foo>" ]
-[ "<foo>bar</foo>" string>xml [ " baz" append ] map xml>string ] unit-test
-[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<foo>\n  bar\n</foo>" ]
-[ "<foo>         bar            </foo>" string>xml pprint-xml>string ] unit-test
 [ "<!-- B+, B, or B--->" string>xml ] must-fail
 [ ] [ "<?xml version='1.0'?><!-- declarations for <head> & <body> --><foo/>" string>xml drop ] unit-test
 [ T{ element-decl f "br" "EMPTY" } ] [ "<!ELEMENT br EMPTY>" string>xml-chunk first ] unit-test
@@ -61,7 +57,5 @@ SYMBOL: xml-file
 [ T{ doctype-decl f "foo" } ] [ "<!DOCTYPE foo >" string>xml-chunk first ] unit-test
 [ T{ doctype-decl f "foo" T{ system-id f "blah.dtd" } } ] [ "<!DOCTYPE foo SYSTEM 'blah.dtd'>" string>xml-chunk first ] unit-test
 [ T{ doctype-decl f "foo" T{ system-id f "blah.dtd" } } ] [ "<!DOCTYPE foo   SYSTEM \"blah.dtd\"   >" string>xml-chunk first ] unit-test
-[ t ] [ "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' >" dup string>xml-chunk [ write-xml-chunk ] with-string-writer = ] unit-test
-[ "foo" ] [ "<!ENTITY bar 'foo'><x>&bar;</x>" string>xml children>string ] unit-test
-[ V{ "hello" } ] [ "hello" string>xml-chunk ] unit-test
-[ 958 ] [ [ "&xi;" string>xml-chunk ] with-html-entities first first ] unit-test
\ No newline at end of file
+[ 958 ] [ [ "&xi;" string>xml-chunk ] with-html-entities first first ] unit-test
+[ "x" "<" ] [ "<x value='&lt;'/>" string>xml [ name>> main>> ] [ "value" swap at ] bi ] unit-test
diff --git a/basis/xml/tests/xmltest.factor b/basis/xml/tests/xmltest.factor
new file mode 100644 (file)
index 0000000..8caa5e8
--- /dev/null
@@ -0,0 +1,53 @@
+USING: accessors assocs combinators continuations fry generalizations
+io.pathnames kernel macros sequences stack-checker tools.test xml
+xml.utilities xml.writer arrays ;
+IN: xml.tests.suite
+
+TUPLE: xml-test id uri sections description type ;
+
+: >xml-test ( tag -- test )
+    xml-test new swap {
+        [ "TYPE" swap at >>type ]
+        [ "ID" swap at >>id ]
+        [ "URI" swap at >>uri ]
+        [ "SECTIONS" swap at >>sections ]
+        [ children>> xml-chunk>string >>description ]
+    } cleave ;
+
+: parse-tests ( xml -- tests )
+    "TEST" tags-named [ >xml-test ] map ;
+
+: base "resource:basis/xml/tests/xmltest/" ;
+
+MACRO: drop-output ( quot -- newquot )
+    dup infer out>> '[ @ _ ndrop ] ;
+
+MACRO: drop-input ( quot -- newquot )
+    infer in>> '[ _ ndrop ] ;
+
+: fails? ( quot -- ? )
+    [ '[ _ drop-output f ] ]
+    [ '[ drop _ drop-input t ] ] bi recover ; inline
+
+: well-formed? ( uri -- answer )
+    [ file>xml ] fails? "not-wf" "valid" ? ;
+
+: test-quots ( test -- result quot )
+    [ type>> '[ _ ] ]
+    [ '[ _ uri>> base swap append-path well-formed? ] ] bi ;
+
+: xml-tests ( -- tests )
+    base "xmltest.xml" append-path file>xml
+    parse-tests [ test-quots 2array ] map ;
+
+: run-xml-tests ( -- )
+    xml-tests [ unit-test ] assoc-each ;
+
+: works? ( result quot -- ? )
+    [ first ] [ call ] bi* = ;
+
+: partition-xml-tests ( -- successes failures )
+    xml-tests [ first2 works? ] partition ;
+
+: failing-valids ( -- tests )
+    partition-xml-tests nip [ second first ] map [ type>> "valid" = ] filter ;
diff --git a/basis/xml/tests/xmltest/canonxml.html b/basis/xml/tests/xmltest/canonxml.html
new file mode 100755 (executable)
index 0000000..2ba0edf
--- /dev/null
@@ -0,0 +1,44 @@
+<HTML>\r
+<TITLE>Canonical XML</TITLE>\r
+<BODY>\r
+<H1>Canonical XML</H1>\r
+<P>\r
+This document defines a subset of XML called canonical XML.\r
+The intended use of canonical XML is in testing XML processors,\r
+as a representation of the result of parsing an XML document.\r
+<P>\r
+Every well-formed XML document has a unique structurally equivalent\r
+canonical XML document.  Two structurally equivalent XML\r
+documents have a byte-for-byte identical canonical XML document.\r
+Canonicalizing an XML document requires only information that an XML\r
+processor is required to make available to an application.\r
+<P>\r
+A canonical XML document conforms to the following grammar:\r
+<PRE>\r
+CanonXML    ::= Pi* element Pi*\r
+element     ::= Stag (Datachar | Pi | element)* Etag\r
+Stag        ::= '&lt;'  Name Atts '&gt;'\r
+Etag        ::= '&lt;/' Name '&gt;'\r
+Pi          ::= '&lt;?' Name ' ' (((Char - S) Char*)? - (Char* '?&gt;' Char*)) '?&gt;'\r
+Atts        ::= (' ' Name '=' '"' Datachar* '"')*\r
+Datachar    ::= '&amp;amp;' | '&amp;lt;' | '&amp;gt;' | '&amp;quot;'\r
+                 | '&amp;#9;'| '&amp;#10;'| '&amp;#13;'\r
+                 | (Char - ('&amp;' | '&lt;' | '&gt;' | '"' | #x9 | #xA | #xD))\r
+Name        ::= (see XML spec)\r
+Char        ::= (see XML spec)\r
+S           ::= (see XML spec)\r
+</PRE>\r
+<P>\r
+Attributes are in lexicographical order (in Unicode bit order).\r
+<P>\r
+A canonical XML document is encoded in UTF-8.\r
+<P>\r
+Ignorable white space is considered significant and is treated equivalently\r
+to data.\r
+<P>\r
+<ADDRESS>\r
+<A HREF="mailto:jjc@jclark.com">James Clark</A>\r
+</ADDRESS>\r
+\r
+</BODY>\r
+</HTML>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/invalid/002.ent b/basis/xml/tests/xmltest/invalid/002.ent
new file mode 100755 (executable)
index 0000000..4cb848b
--- /dev/null
@@ -0,0 +1,2 @@
+<!ENTITY % e "(#PCDATA">\r
+<!ELEMENT doc %e;)>\r
diff --git a/basis/xml/tests/xmltest/invalid/002.xml b/basis/xml/tests/xmltest/invalid/002.xml
new file mode 100755 (executable)
index 0000000..5a3a96d
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "002.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/invalid/005.ent b/basis/xml/tests/xmltest/invalid/005.ent
new file mode 100755 (executable)
index 0000000..85e1647
--- /dev/null
@@ -0,0 +1,2 @@
+<!ENTITY % e ">">\r
+<!ELEMENT doc (#PCDATA) %e;\r
diff --git a/basis/xml/tests/xmltest/invalid/005.xml b/basis/xml/tests/xmltest/invalid/005.xml
new file mode 100755 (executable)
index 0000000..383553d
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "005.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/invalid/006.ent b/basis/xml/tests/xmltest/invalid/006.ent
new file mode 100755 (executable)
index 0000000..116ca79
--- /dev/null
@@ -0,0 +1,2 @@
+<!ENTITY % e "(#PCDATA)>">\r
+<!ELEMENT doc %e;\r
diff --git a/basis/xml/tests/xmltest/invalid/006.xml b/basis/xml/tests/xmltest/invalid/006.xml
new file mode 100755 (executable)
index 0000000..2f14e83
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "006.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/invalid/not-sa/022.ent b/basis/xml/tests/xmltest/invalid/not-sa/022.ent
new file mode 100644 (file)
index 0000000..26f2d8b
--- /dev/null
@@ -0,0 +1,3 @@
+<!ENTITY % e "INCLUDE[">\r
+<!ELEMENT doc (#PCDATA)>\r
+<![ %e; <!ATTLIST doc a1 CDATA "v1"> ]]>\r
diff --git a/basis/xml/tests/xmltest/invalid/not-sa/022.xml b/basis/xml/tests/xmltest/invalid/not-sa/022.xml
new file mode 100644 (file)
index 0000000..b639f25
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "022.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/invalid/not-sa/out/022.xml b/basis/xml/tests/xmltest/invalid/not-sa/out/022.xml
new file mode 100644 (file)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/ext-sa/001.ent b/basis/xml/tests/xmltest/not-wf/ext-sa/001.ent
new file mode 100755 (executable)
index 0000000..378a207
--- /dev/null
@@ -0,0 +1 @@
+&e;
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/ext-sa/001.xml b/basis/xml/tests/xmltest/not-wf/ext-sa/001.xml
new file mode 100755 (executable)
index 0000000..aa624cb
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e SYSTEM "001.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/ext-sa/002.ent b/basis/xml/tests/xmltest/not-wf/ext-sa/002.ent
new file mode 100755 (executable)
index 0000000..2cd184a
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" standalone="yes"?>\r
+data\r
+\r
diff --git a/basis/xml/tests/xmltest/not-wf/ext-sa/002.xml b/basis/xml/tests/xmltest/not-wf/ext-sa/002.xml
new file mode 100755 (executable)
index 0000000..9eaf917
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "002.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/ext-sa/003.ent b/basis/xml/tests/xmltest/not-wf/ext-sa/003.ent
new file mode 100755 (executable)
index 0000000..ac292ee
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?><?xml version="1.0" encoding="UTF-8"?>\r
+data\r
diff --git a/basis/xml/tests/xmltest/not-wf/ext-sa/003.xml b/basis/xml/tests/xmltest/not-wf/ext-sa/003.xml
new file mode 100755 (executable)
index 0000000..bb60b66
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "003.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/001.ent b/basis/xml/tests/xmltest/not-wf/not-sa/001.ent
new file mode 100755 (executable)
index 0000000..00096e5
--- /dev/null
@@ -0,0 +1,3 @@
+<![ INCLUDE [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/001.xml b/basis/xml/tests/xmltest/not-wf/not-sa/001.xml
new file mode 100755 (executable)
index 0000000..3618845
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "001.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/002.xml b/basis/xml/tests/xmltest/not-wf/not-sa/002.xml
new file mode 100755 (executable)
index 0000000..dd73174
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "<?xml version='1.0' encoding='UTF-8'?>">\r
+%e;\r
+]>\r
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/003.ent b/basis/xml/tests/xmltest/not-wf/not-sa/003.ent
new file mode 100755 (executable)
index 0000000..abf1b1a
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![ IGNORE [\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/003.xml b/basis/xml/tests/xmltest/not-wf/not-sa/003.xml
new file mode 100755 (executable)
index 0000000..dd01f41
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "003.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/004.ent b/basis/xml/tests/xmltest/not-wf/not-sa/004.ent
new file mode 100755 (executable)
index 0000000..552e4f5
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![ INCLUDE [\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/004.xml b/basis/xml/tests/xmltest/not-wf/not-sa/004.xml
new file mode 100755 (executable)
index 0000000..20cdf6d
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "004.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/005.ent b/basis/xml/tests/xmltest/not-wf/not-sa/005.ent
new file mode 100755 (executable)
index 0000000..9a369ce
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+%e;\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/005.xml b/basis/xml/tests/xmltest/not-wf/not-sa/005.xml
new file mode 100755 (executable)
index 0000000..383553d
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "005.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/006.ent b/basis/xml/tests/xmltest/not-wf/not-sa/006.ent
new file mode 100755 (executable)
index 0000000..771daf1
--- /dev/null
@@ -0,0 +1,3 @@
+<![INCLUDE\r
+<!ELEMENT doc (#PCDATA)>\r
+]]>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/006.xml b/basis/xml/tests/xmltest/not-wf/not-sa/006.xml
new file mode 100755 (executable)
index 0000000..2f14e83
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "006.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/007.ent b/basis/xml/tests/xmltest/not-wf/not-sa/007.ent
new file mode 100755 (executable)
index 0000000..9e9866d
--- /dev/null
@@ -0,0 +1,3 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/007.xml b/basis/xml/tests/xmltest/not-wf/not-sa/007.xml
new file mode 100755 (executable)
index 0000000..38897e3
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "007.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/008.ent b/basis/xml/tests/xmltest/not-wf/not-sa/008.ent
new file mode 100755 (executable)
index 0000000..f8b1cd3
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc ANY>\r
+<!ENTITY e "100%">\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/008.xml b/basis/xml/tests/xmltest/not-wf/not-sa/008.xml
new file mode 100755 (executable)
index 0000000..5435100
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "008.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/009.ent b/basis/xml/tests/xmltest/not-wf/not-sa/009.ent
new file mode 100644 (file)
index 0000000..f70eaea
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc EMPTY>\r
+<!ENTITY % e "<!--">\r
+%e; -->\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/009.xml b/basis/xml/tests/xmltest/not-wf/not-sa/009.xml
new file mode 100644 (file)
index 0000000..9aa7289
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "009.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/010.ent b/basis/xml/tests/xmltest/not-wf/not-sa/010.ent
new file mode 100644 (file)
index 0000000..54f3c82
--- /dev/null
@@ -0,0 +1,2 @@
+<!ENTITY % e "<!ELEMENT ">\r
+%e; doc (#PCDATA)>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/010.xml b/basis/xml/tests/xmltest/not-wf/not-sa/010.xml
new file mode 100644 (file)
index 0000000..963e4c2
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "010.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/011.ent b/basis/xml/tests/xmltest/not-wf/not-sa/011.ent
new file mode 100644 (file)
index 0000000..aae4cc2
--- /dev/null
@@ -0,0 +1,3 @@
+<!ENTITY % e1 "<!ELEMENT ">\r
+<!ENTITY % e2 ">">\r
+%e1; doc (#PCDATA) %e2;\r
diff --git a/basis/xml/tests/xmltest/not-wf/not-sa/011.xml b/basis/xml/tests/xmltest/not-wf/not-sa/011.xml
new file mode 100644 (file)
index 0000000..dd40c95
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "011.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/001.xml b/basis/xml/tests/xmltest/not-wf/sa/001.xml
new file mode 100755 (executable)
index 0000000..d33ec68
--- /dev/null
@@ -0,0 +1,5 @@
+<doc>\r
+<doc\r
+?\r
+<a</a>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/002.xml b/basis/xml/tests/xmltest/not-wf/sa/002.xml
new file mode 100755 (executable)
index 0000000..0a64d52
--- /dev/null
@@ -0,0 +1,4 @@
+<doc>\r
+<.doc></.doc>\r
+</doc>\r
+\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/003.xml b/basis/xml/tests/xmltest/not-wf/sa/003.xml
new file mode 100755 (executable)
index 0000000..e0b8bae
--- /dev/null
@@ -0,0 +1 @@
+<doc><? ?></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/004.xml b/basis/xml/tests/xmltest/not-wf/sa/004.xml
new file mode 100755 (executable)
index 0000000..e85bc96
--- /dev/null
@@ -0,0 +1 @@
+<doc><?target some data></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/005.xml b/basis/xml/tests/xmltest/not-wf/sa/005.xml
new file mode 100755 (executable)
index 0000000..7cd44ef
--- /dev/null
@@ -0,0 +1 @@
+<doc><?target some data?</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/006.xml b/basis/xml/tests/xmltest/not-wf/sa/006.xml
new file mode 100755 (executable)
index 0000000..8594c35
--- /dev/null
@@ -0,0 +1 @@
+<doc><!-- a comment -- another --></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/007.xml b/basis/xml/tests/xmltest/not-wf/sa/007.xml
new file mode 100755 (executable)
index 0000000..286756f
--- /dev/null
@@ -0,0 +1 @@
+<doc>&amp no refc</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/008.xml b/basis/xml/tests/xmltest/not-wf/sa/008.xml
new file mode 100755 (executable)
index 0000000..29ef403
--- /dev/null
@@ -0,0 +1 @@
+<doc>&.entity;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/009.xml b/basis/xml/tests/xmltest/not-wf/sa/009.xml
new file mode 100755 (executable)
index 0000000..8e3ff7d
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#RE;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/010.xml b/basis/xml/tests/xmltest/not-wf/sa/010.xml
new file mode 100755 (executable)
index 0000000..a679084
--- /dev/null
@@ -0,0 +1 @@
+<doc>A & B</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/011.xml b/basis/xml/tests/xmltest/not-wf/sa/011.xml
new file mode 100755 (executable)
index 0000000..57eaf9f
--- /dev/null
@@ -0,0 +1 @@
+<doc a1></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/012.xml b/basis/xml/tests/xmltest/not-wf/sa/012.xml
new file mode 100755 (executable)
index 0000000..1b2539f
--- /dev/null
@@ -0,0 +1 @@
+<doc a1=v1></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/013.xml b/basis/xml/tests/xmltest/not-wf/sa/013.xml
new file mode 100755 (executable)
index 0000000..3540df9
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1'></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/014.xml b/basis/xml/tests/xmltest/not-wf/sa/014.xml
new file mode 100755 (executable)
index 0000000..a613115
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="<foo>"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/015.xml b/basis/xml/tests/xmltest/not-wf/sa/015.xml
new file mode 100755 (executable)
index 0000000..f2baf94
--- /dev/null
@@ -0,0 +1 @@
+<doc a1=></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/016.xml b/basis/xml/tests/xmltest/not-wf/sa/016.xml
new file mode 100755 (executable)
index 0000000..22d4b2e
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1" "v2"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/017.xml b/basis/xml/tests/xmltest/not-wf/sa/017.xml
new file mode 100755 (executable)
index 0000000..a76f592
--- /dev/null
@@ -0,0 +1 @@
+<doc><![CDATA[</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/018.xml b/basis/xml/tests/xmltest/not-wf/sa/018.xml
new file mode 100755 (executable)
index 0000000..66e204a
--- /dev/null
@@ -0,0 +1 @@
+<doc><![CDATA [ stuff]]></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/019.xml b/basis/xml/tests/xmltest/not-wf/sa/019.xml
new file mode 100755 (executable)
index 0000000..b835c2d
--- /dev/null
@@ -0,0 +1 @@
+<doc></>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/020.xml b/basis/xml/tests/xmltest/not-wf/sa/020.xml
new file mode 100755 (executable)
index 0000000..b30cfcf
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="A & B"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/021.xml b/basis/xml/tests/xmltest/not-wf/sa/021.xml
new file mode 100755 (executable)
index 0000000..1bfa84a
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="a&b"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/022.xml b/basis/xml/tests/xmltest/not-wf/sa/022.xml
new file mode 100755 (executable)
index 0000000..44c803b
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="&#123:"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/023.xml b/basis/xml/tests/xmltest/not-wf/sa/023.xml
new file mode 100755 (executable)
index 0000000..b877ae2
--- /dev/null
@@ -0,0 +1 @@
+<doc 12="34"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/024.xml b/basis/xml/tests/xmltest/not-wf/sa/024.xml
new file mode 100755 (executable)
index 0000000..cf68f2c
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<123></123>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/025.xml b/basis/xml/tests/xmltest/not-wf/sa/025.xml
new file mode 100755 (executable)
index 0000000..6cba95c
--- /dev/null
@@ -0,0 +1 @@
+<doc>]]></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/026.xml b/basis/xml/tests/xmltest/not-wf/sa/026.xml
new file mode 100755 (executable)
index 0000000..347984f
--- /dev/null
@@ -0,0 +1 @@
+<doc>]]]></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/027.xml b/basis/xml/tests/xmltest/not-wf/sa/027.xml
new file mode 100755 (executable)
index 0000000..cfafaf0
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<!-- abc\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/028.xml b/basis/xml/tests/xmltest/not-wf/sa/028.xml
new file mode 100755 (executable)
index 0000000..5227149
--- /dev/null
@@ -0,0 +1,4 @@
+<doc>\r
+<?a pi that is not closed\r
+</doc>\r
+\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/029.xml b/basis/xml/tests/xmltest/not-wf/sa/029.xml
new file mode 100755 (executable)
index 0000000..9a8008b
--- /dev/null
@@ -0,0 +1 @@
+<doc>abc]]]>def</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/030.xml b/basis/xml/tests/xmltest/not-wf/sa/030.xml
new file mode 100755 (executable)
index 0000000..25861fa
--- /dev/null
@@ -0,0 +1 @@
+<doc>A form feed (\f) is not legal in data</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/031.xml b/basis/xml/tests/xmltest/not-wf/sa/031.xml
new file mode 100755 (executable)
index 0000000..f946536
--- /dev/null
@@ -0,0 +1 @@
+<doc><?pi a form feed (\f) is not allowed in a pi?></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/032.xml b/basis/xml/tests/xmltest/not-wf/sa/032.xml
new file mode 100755 (executable)
index 0000000..7595201
--- /dev/null
@@ -0,0 +1 @@
+<doc><!-- a form feed (\f) is not allowed in a comment --></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/033.xml b/basis/xml/tests/xmltest/not-wf/sa/033.xml
new file mode 100755 (executable)
index 0000000..afd2328
--- /dev/null
@@ -0,0 +1 @@
+<doc>abc\edef</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/034.xml b/basis/xml/tests/xmltest/not-wf/sa/034.xml
new file mode 100755 (executable)
index 0000000..d74a777
--- /dev/null
@@ -0,0 +1 @@
+<doc\f>A form-feed is not white space or a name character</doc\f>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/035.xml b/basis/xml/tests/xmltest/not-wf/sa/035.xml
new file mode 100755 (executable)
index 0000000..e1fc920
--- /dev/null
@@ -0,0 +1 @@
+<doc>1 < 2 but not in XML</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/036.xml b/basis/xml/tests/xmltest/not-wf/sa/036.xml
new file mode 100755 (executable)
index 0000000..b8ecb21
--- /dev/null
@@ -0,0 +1,2 @@
+<doc></doc>\r
+Illegal data\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/037.xml b/basis/xml/tests/xmltest/not-wf/sa/037.xml
new file mode 100755 (executable)
index 0000000..2e02662
--- /dev/null
@@ -0,0 +1,2 @@
+<doc></doc>\r
+&#32;\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/038.xml b/basis/xml/tests/xmltest/not-wf/sa/038.xml
new file mode 100755 (executable)
index 0000000..68b2803
--- /dev/null
@@ -0,0 +1 @@
+<doc x="foo" y="bar" x="baz"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/039.xml b/basis/xml/tests/xmltest/not-wf/sa/039.xml
new file mode 100755 (executable)
index 0000000..80429e3
--- /dev/null
@@ -0,0 +1 @@
+<doc><a></aa></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/040.xml b/basis/xml/tests/xmltest/not-wf/sa/040.xml
new file mode 100755 (executable)
index 0000000..dc8ba5a
--- /dev/null
@@ -0,0 +1,2 @@
+<doc></doc>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/041.xml b/basis/xml/tests/xmltest/not-wf/sa/041.xml
new file mode 100755 (executable)
index 0000000..30bcdd6
--- /dev/null
@@ -0,0 +1,2 @@
+<doc/>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/042.xml b/basis/xml/tests/xmltest/not-wf/sa/042.xml
new file mode 100755 (executable)
index 0000000..4ae50ef
--- /dev/null
@@ -0,0 +1 @@
+<doc/></doc/>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/043.xml b/basis/xml/tests/xmltest/not-wf/sa/043.xml
new file mode 100755 (executable)
index 0000000..41824ee
--- /dev/null
@@ -0,0 +1,2 @@
+<doc/>\r
+Illegal data\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/044.xml b/basis/xml/tests/xmltest/not-wf/sa/044.xml
new file mode 100755 (executable)
index 0000000..3fc232d
--- /dev/null
@@ -0,0 +1 @@
+<doc/><doc/>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/045.xml b/basis/xml/tests/xmltest/not-wf/sa/045.xml
new file mode 100755 (executable)
index 0000000..00c10f0
--- /dev/null
@@ -0,0 +1,4 @@
+<doc>\r
+<a/\r
+</doc>\r
+\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/046.xml b/basis/xml/tests/xmltest/not-wf/sa/046.xml
new file mode 100755 (executable)
index 0000000..265cb15
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<a/</a>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/047.xml b/basis/xml/tests/xmltest/not-wf/sa/047.xml
new file mode 100755 (executable)
index 0000000..d18a4a4
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<a / >\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/048.xml b/basis/xml/tests/xmltest/not-wf/sa/048.xml
new file mode 100755 (executable)
index 0000000..67419c1
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+</doc>\r
+<![CDATA[]]>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/049.xml b/basis/xml/tests/xmltest/not-wf/sa/049.xml
new file mode 100755 (executable)
index 0000000..3cf0e79
--- /dev/null
@@ -0,0 +1,4 @@
+<doc>\r
+<a><![CDATA[xyz]]]></a>\r
+<![CDATA[]]></a>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/050.xml b/basis/xml/tests/xmltest/not-wf/sa/050.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/basis/xml/tests/xmltest/not-wf/sa/051.xml b/basis/xml/tests/xmltest/not-wf/sa/051.xml
new file mode 100755 (executable)
index 0000000..b52df12
--- /dev/null
@@ -0,0 +1,3 @@
+<!-- a comment -->\r
+<![CDATA[]]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/052.xml b/basis/xml/tests/xmltest/not-wf/sa/052.xml
new file mode 100755 (executable)
index 0000000..8283895
--- /dev/null
@@ -0,0 +1,3 @@
+<!-- a comment -->\r
+&#32;\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/053.xml b/basis/xml/tests/xmltest/not-wf/sa/053.xml
new file mode 100755 (executable)
index 0000000..9d7f369
--- /dev/null
@@ -0,0 +1 @@
+<doc></DOC>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/054.xml b/basis/xml/tests/xmltest/not-wf/sa/054.xml
new file mode 100755 (executable)
index 0000000..eda553c
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY foo PUBLIC "some public id">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/055.xml b/basis/xml/tests/xmltest/not-wf/sa/055.xml
new file mode 100755 (executable)
index 0000000..cbb3683
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc [\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/056.xml b/basis/xml/tests/xmltest/not-wf/sa/056.xml
new file mode 100755 (executable)
index 0000000..a681684
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc -- a comment -- []>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/057.xml b/basis/xml/tests/xmltest/not-wf/sa/057.xml
new file mode 100755 (executable)
index 0000000..848d347
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "whatever" -- a comment -->\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/058.xml b/basis/xml/tests/xmltest/not-wf/sa/058.xml
new file mode 100755 (executable)
index 0000000..daba266
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 (foo,bar) #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/059.xml b/basis/xml/tests/xmltest/not-wf/sa/059.xml
new file mode 100755 (executable)
index 0000000..316083d
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 NMTOKEN v1>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/060.xml b/basis/xml/tests/xmltest/not-wf/sa/060.xml
new file mode 100755 (executable)
index 0000000..9a610fd
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 NAME #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/061.xml b/basis/xml/tests/xmltest/not-wf/sa/061.xml
new file mode 100755 (executable)
index 0000000..59181e7
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e PUBLIC "whatever""e.ent">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/062.xml b/basis/xml/tests/xmltest/not-wf/sa/062.xml
new file mode 100755 (executable)
index 0000000..e62e9cd
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY foo"some text">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/063.xml b/basis/xml/tests/xmltest/not-wf/sa/063.xml
new file mode 100755 (executable)
index 0000000..98675b9
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<![INCLUDE[ ]]>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/064.xml b/basis/xml/tests/xmltest/not-wf/sa/064.xml
new file mode 100755 (executable)
index 0000000..3888c46
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST e a1 CDATA"foo">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/065.xml b/basis/xml/tests/xmltest/not-wf/sa/065.xml
new file mode 100755 (executable)
index 0000000..da9cafd
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1(foo|bar) #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/066.xml b/basis/xml/tests/xmltest/not-wf/sa/066.xml
new file mode 100755 (executable)
index 0000000..9c09eb4
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 (foo|bar)#IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/067.xml b/basis/xml/tests/xmltest/not-wf/sa/067.xml
new file mode 100755 (executable)
index 0000000..7e0809b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 (foo)"foo">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/068.xml b/basis/xml/tests/xmltest/not-wf/sa/068.xml
new file mode 100755 (executable)
index 0000000..53a80a8
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 NOTATION(foo) #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/069.xml b/basis/xml/tests/xmltest/not-wf/sa/069.xml
new file mode 100755 (executable)
index 0000000..6f891dd
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!NOTATION eps SYSTEM "eps.exe">\r
+<!-- missing space before NDATA -->\r
+<!ENTITY foo SYSTEM "foo.eps"NDATA eps>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/070.xml b/basis/xml/tests/xmltest/not-wf/sa/070.xml
new file mode 100755 (executable)
index 0000000..faf4b0a
--- /dev/null
@@ -0,0 +1,2 @@
+<!-- a comment ending with three dashes --->\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/071.xml b/basis/xml/tests/xmltest/not-wf/sa/071.xml
new file mode 100755 (executable)
index 0000000..5bd3908
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e1 "&e2;">\r
+<!ENTITY e2 "&e3;">\r
+<!ENTITY e3 "&e1;">\r
+]>\r
+<doc>&e1;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/072.xml b/basis/xml/tests/xmltest/not-wf/sa/072.xml
new file mode 100755 (executable)
index 0000000..743ba79
--- /dev/null
@@ -0,0 +1 @@
+<doc>&foo;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/073.xml b/basis/xml/tests/xmltest/not-wf/sa/073.xml
new file mode 100755 (executable)
index 0000000..2578af4
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "whatever">\r
+]>\r
+<doc>&f;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/074.xml b/basis/xml/tests/xmltest/not-wf/sa/074.xml
new file mode 100755 (executable)
index 0000000..f8abaeb
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "</foo><foo>">\r
+]>\r
+<doc>\r
+<foo>&e;</foo>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/075.xml b/basis/xml/tests/xmltest/not-wf/sa/075.xml
new file mode 100755 (executable)
index 0000000..d3dbf50
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ENTITY e1 "&e2;">\r
+<!ENTITY e2 "&e3;">\r
+<!ENTITY e3 "&e1;">\r
+]>\r
+<doc a="&e1;"></doc>\r
+\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/076.xml b/basis/xml/tests/xmltest/not-wf/sa/076.xml
new file mode 100755 (executable)
index 0000000..6054672
--- /dev/null
@@ -0,0 +1 @@
+<doc a="&foo;"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/077.xml b/basis/xml/tests/xmltest/not-wf/sa/077.xml
new file mode 100755 (executable)
index 0000000..f8ac23a
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY foo "&bar;">\r
+]>\r
+<doc a="&foo;"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/078.xml b/basis/xml/tests/xmltest/not-wf/sa/078.xml
new file mode 100755 (executable)
index 0000000..446cd85
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA "&foo;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/079.xml b/basis/xml/tests/xmltest/not-wf/sa/079.xml
new file mode 100755 (executable)
index 0000000..da016fd
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [\r
+<!ENTITY e1 "&e2;">\r
+<!ENTITY e2 "&e3;">\r
+<!ENTITY e3 "&e1;">\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA "&e1;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/080.xml b/basis/xml/tests/xmltest/not-wf/sa/080.xml
new file mode 100755 (executable)
index 0000000..fa4b9e4
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [\r
+<!ENTITY e1 "&e2;">\r
+<!ENTITY e2 "&e3;">\r
+<!ENTITY e3 "&e1;">\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #FIXED "&e1;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/081.xml b/basis/xml/tests/xmltest/not-wf/sa/081.xml
new file mode 100755 (executable)
index 0000000..d676100
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e SYSTEM "nul">\r
+]>\r
+<doc a="&e;"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/082.xml b/basis/xml/tests/xmltest/not-wf/sa/082.xml
new file mode 100755 (executable)
index 0000000..3217d6f
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e SYSTEM "nul">\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA "&e;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/083.xml b/basis/xml/tests/xmltest/not-wf/sa/083.xml
new file mode 100755 (executable)
index 0000000..469d43f
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e SYSTEM "nul" NDATA n>\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/084.xml b/basis/xml/tests/xmltest/not-wf/sa/084.xml
new file mode 100755 (executable)
index 0000000..abbbcde
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e SYSTEM "nul" NDATA n>\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA "&e;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/085.xml b/basis/xml/tests/xmltest/not-wf/sa/085.xml
new file mode 100755 (executable)
index 0000000..ac0aeca
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc PUBLIC "[" "null.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/086.xml b/basis/xml/tests/xmltest/not-wf/sa/086.xml
new file mode 100755 (executable)
index 0000000..df6adfd
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY foo PUBLIC "[" "null.xml">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/087.xml b/basis/xml/tests/xmltest/not-wf/sa/087.xml
new file mode 100755 (executable)
index 0000000..ed49492
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!NOTATION foo PUBLIC "[" "null.ent">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/088.xml b/basis/xml/tests/xmltest/not-wf/sa/088.xml
new file mode 100755 (executable)
index 0000000..da0a68c
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+<!ENTITY e '"'>\r
+]>\r
+<doc a="&e;></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/089.xml b/basis/xml/tests/xmltest/not-wf/sa/089.xml
new file mode 100755 (executable)
index 0000000..0c6cf40
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY % foo SYSTEM "foo.xml" NDATA bar>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/090.xml b/basis/xml/tests/xmltest/not-wf/sa/090.xml
new file mode 100755 (executable)
index 0000000..3fb72f3
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<foo a='&#60;'></foo>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/091.xml b/basis/xml/tests/xmltest/not-wf/sa/091.xml
new file mode 100755 (executable)
index 0000000..a61d091
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!NOTATION n SYSTEM "n">\r
+<!ENTITY % foo SYSTEM "foo.xml" NDATA n>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/092.xml b/basis/xml/tests/xmltest/not-wf/sa/092.xml
new file mode 100755 (executable)
index 0000000..be5266d
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<foo a='&#38;'></foo>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/093.xml b/basis/xml/tests/xmltest/not-wf/sa/093.xml
new file mode 100755 (executable)
index 0000000..4af61bc
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#X58;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/094.xml b/basis/xml/tests/xmltest/not-wf/sa/094.xml
new file mode 100755 (executable)
index 0000000..bdec7a4
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml VERSION="1.0"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/095.xml b/basis/xml/tests/xmltest/not-wf/sa/095.xml
new file mode 100755 (executable)
index 0000000..090b8b4
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml encoding="UTF-8" version="1.0"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/096.xml b/basis/xml/tests/xmltest/not-wf/sa/096.xml
new file mode 100755 (executable)
index 0000000..d806c3b
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"encoding="UTF-8" ?>\r
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/sa/097.xml b/basis/xml/tests/xmltest/not-wf/sa/097.xml
new file mode 100755 (executable)
index 0000000..d4def54
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0' encoding="UTF-8" ?>\r
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/sa/098.xml b/basis/xml/tests/xmltest/not-wf/sa/098.xml
new file mode 100755 (executable)
index 0000000..9798496
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" version="1.0"?>\r
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/sa/099.xml b/basis/xml/tests/xmltest/not-wf/sa/099.xml
new file mode 100755 (executable)
index 0000000..d5be08e
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" valid="no" ?>\r
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/not-wf/sa/100.xml b/basis/xml/tests/xmltest/not-wf/sa/100.xml
new file mode 100755 (executable)
index 0000000..51e0623
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="YES" ?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/101.xml b/basis/xml/tests/xmltest/not-wf/sa/101.xml
new file mode 100755 (executable)
index 0000000..afa5a45
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding=" UTF-8"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/102.xml b/basis/xml/tests/xmltest/not-wf/sa/102.xml
new file mode 100755 (executable)
index 0000000..8734ada
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0 " ?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/103.xml b/basis/xml/tests/xmltest/not-wf/sa/103.xml
new file mode 100755 (executable)
index 0000000..6c47167
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#60;foo>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/104.xml b/basis/xml/tests/xmltest/not-wf/sa/104.xml
new file mode 100755 (executable)
index 0000000..dd57396
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<foo>">\r
+]>\r
+<doc>&e;</foo></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/105.xml b/basis/xml/tests/xmltest/not-wf/sa/105.xml
new file mode 100755 (executable)
index 0000000..809e705
--- /dev/null
@@ -0,0 +1,4 @@
+<?pi stuff?>\r
+<![CDATA[]]>\r
+<doc>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/106.xml b/basis/xml/tests/xmltest/not-wf/sa/106.xml
new file mode 100755 (executable)
index 0000000..d32319e
--- /dev/null
@@ -0,0 +1,2 @@
+<?pi data?>\r
+&#32;<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/107.xml b/basis/xml/tests/xmltest/not-wf/sa/107.xml
new file mode 100755 (executable)
index 0000000..3dfd820
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<![CDATA[]]>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/108.xml b/basis/xml/tests/xmltest/not-wf/sa/108.xml
new file mode 100755 (executable)
index 0000000..af5cf50
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<![CDATA [  ]]>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/109.xml b/basis/xml/tests/xmltest/not-wf/sa/109.xml
new file mode 100755 (executable)
index 0000000..5afc03e
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<doc></doc>">\r
+]>\r
+&e;\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/110.xml b/basis/xml/tests/xmltest/not-wf/sa/110.xml
new file mode 100755 (executable)
index 0000000..cf54ebe
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "">\r
+]>\r
+<doc></doc>\r
+&e;\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/111.xml b/basis/xml/tests/xmltest/not-wf/sa/111.xml
new file mode 100755 (executable)
index 0000000..84a469f
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "foo='bar'">\r
+]>\r
+<doc &e;></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/112.xml b/basis/xml/tests/xmltest/not-wf/sa/112.xml
new file mode 100755 (executable)
index 0000000..0c5c1a4
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<![cdata[data]]>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/113.xml b/basis/xml/tests/xmltest/not-wf/sa/113.xml
new file mode 100755 (executable)
index 0000000..04fc9d2
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY % foo "&">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/114.xml b/basis/xml/tests/xmltest/not-wf/sa/114.xml
new file mode 100755 (executable)
index 0000000..1261ee4
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY foo "&">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/115.xml b/basis/xml/tests/xmltest/not-wf/sa/115.xml
new file mode 100755 (executable)
index 0000000..f111dbe
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#38;">\r
+]>\r
+<doc a="&e;"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/116.xml b/basis/xml/tests/xmltest/not-wf/sa/116.xml
new file mode 100755 (executable)
index 0000000..84bb762
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#38;#9">\r
+]>\r
+<doc>&e;7;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/117.xml b/basis/xml/tests/xmltest/not-wf/sa/117.xml
new file mode 100755 (executable)
index 0000000..e4a5e57
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#38;">\r
+]>\r
+<doc>&e;#97;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/118.xml b/basis/xml/tests/xmltest/not-wf/sa/118.xml
new file mode 100755 (executable)
index 0000000..494d53d
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "#">\r
+]>\r
+<doc>&&e;97;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/119.xml b/basis/xml/tests/xmltest/not-wf/sa/119.xml
new file mode 100755 (executable)
index 0000000..aefaa44
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#38;">\r
+]>\r
+<doc>\r
+&e;#38;\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/120.xml b/basis/xml/tests/xmltest/not-wf/sa/120.xml
new file mode 100755 (executable)
index 0000000..b7d6ff9
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#38;">\r
+]>\r
+<doc>\r
+&e;\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/121.xml b/basis/xml/tests/xmltest/not-wf/sa/121.xml
new file mode 100755 (executable)
index 0000000..2b4adcc
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY #DEFAULT "default">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/122.xml b/basis/xml/tests/xmltest/not-wf/sa/122.xml
new file mode 100755 (executable)
index 0000000..ef0b057
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a, (b) | c)?>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/123.xml b/basis/xml/tests/xmltest/not-wf/sa/123.xml
new file mode 100755 (executable)
index 0000000..06d65f0
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc ((doc?)))>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/124.xml b/basis/xml/tests/xmltest/not-wf/sa/124.xml
new file mode 100755 (executable)
index 0000000..3bbe0f9
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (doc|#PCDATA)*>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/125.xml b/basis/xml/tests/xmltest/not-wf/sa/125.xml
new file mode 100755 (executable)
index 0000000..5f9c22c
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc ((#PCDATA))>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/126.xml b/basis/xml/tests/xmltest/not-wf/sa/126.xml
new file mode 100755 (executable)
index 0000000..13e74d6
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)+>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/127.xml b/basis/xml/tests/xmltest/not-wf/sa/127.xml
new file mode 100755 (executable)
index 0000000..a379b9e
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)?>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/128.xml b/basis/xml/tests/xmltest/not-wf/sa/128.xml
new file mode 100755 (executable)
index 0000000..dd706bb
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc CDATA>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/129.xml b/basis/xml/tests/xmltest/not-wf/sa/129.xml
new file mode 100755 (executable)
index 0000000..d4e4461
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc - - (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/130.xml b/basis/xml/tests/xmltest/not-wf/sa/130.xml
new file mode 100755 (executable)
index 0000000..fa7be64
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (doc?) +(foo)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/131.xml b/basis/xml/tests/xmltest/not-wf/sa/131.xml
new file mode 100755 (executable)
index 0000000..f34ed45
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (doc?) -(foo)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/132.xml b/basis/xml/tests/xmltest/not-wf/sa/132.xml
new file mode 100755 (executable)
index 0000000..ab6cc41
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a, (b, c), (d, (e, f) | g))?>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/133.xml b/basis/xml/tests/xmltest/not-wf/sa/133.xml
new file mode 100755 (executable)
index 0000000..d2aa604
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a *)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/134.xml b/basis/xml/tests/xmltest/not-wf/sa/134.xml
new file mode 100755 (executable)
index 0000000..c8919c5
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a) *>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/135.xml b/basis/xml/tests/xmltest/not-wf/sa/135.xml
new file mode 100755 (executable)
index 0000000..e639e8b
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a & b)?>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/136.xml b/basis/xml/tests/xmltest/not-wf/sa/136.xml
new file mode 100755 (executable)
index 0000000..499e68b
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc O O (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/137.xml b/basis/xml/tests/xmltest/not-wf/sa/137.xml
new file mode 100755 (executable)
index 0000000..723b77f
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc(#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/138.xml b/basis/xml/tests/xmltest/not-wf/sa/138.xml
new file mode 100755 (executable)
index 0000000..16934cc
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (doc*?)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/139.xml b/basis/xml/tests/xmltest/not-wf/sa/139.xml
new file mode 100755 (executable)
index 0000000..34df52e
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc ()>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/140.xml b/basis/xml/tests/xmltest/not-wf/sa/140.xml
new file mode 100755 (executable)
index 0000000..467d5ed
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<&#x309a;></&#x309a;>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/141.xml b/basis/xml/tests/xmltest/not-wf/sa/141.xml
new file mode 100755 (executable)
index 0000000..409d0a7
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<X&#xe5c;></X&#xe5c;>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/142.xml b/basis/xml/tests/xmltest/not-wf/sa/142.xml
new file mode 100755 (executable)
index 0000000..20e88f8
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#0;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/143.xml b/basis/xml/tests/xmltest/not-wf/sa/143.xml
new file mode 100755 (executable)
index 0000000..0ee1c61
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#31;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/144.xml b/basis/xml/tests/xmltest/not-wf/sa/144.xml
new file mode 100755 (executable)
index 0000000..437548c
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#xFFFF;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/145.xml b/basis/xml/tests/xmltest/not-wf/sa/145.xml
new file mode 100755 (executable)
index 0000000..71b187a
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#xD800;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/146.xml b/basis/xml/tests/xmltest/not-wf/sa/146.xml
new file mode 100755 (executable)
index 0000000..d0bfbca
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#x110000;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/147.xml b/basis/xml/tests/xmltest/not-wf/sa/147.xml
new file mode 100755 (executable)
index 0000000..3b61456
--- /dev/null
@@ -0,0 +1,3 @@
+\r
+<?xml version="1.0"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/148.xml b/basis/xml/tests/xmltest/not-wf/sa/148.xml
new file mode 100755 (executable)
index 0000000..774dce1
--- /dev/null
@@ -0,0 +1,3 @@
+<!-- -->\r
+<?xml version="1.0"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/149.xml b/basis/xml/tests/xmltest/not-wf/sa/149.xml
new file mode 100755 (executable)
index 0000000..725eea0
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<?xml version="1.0"?>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/150.xml b/basis/xml/tests/xmltest/not-wf/sa/150.xml
new file mode 100755 (executable)
index 0000000..44f6b6d
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<?xml version="1.0"?>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/151.xml b/basis/xml/tests/xmltest/not-wf/sa/151.xml
new file mode 100755 (executable)
index 0000000..fecc4f2
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+</doc>\r
+<?xml version="1.0"?>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/152.xml b/basis/xml/tests/xmltest/not-wf/sa/152.xml
new file mode 100755 (executable)
index 0000000..b5c5cb2
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml encoding="UTF-8"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/153.xml b/basis/xml/tests/xmltest/not-wf/sa/153.xml
new file mode 100755 (executable)
index 0000000..5e29737
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "<?xml encoding='UTF-8'?>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/154.xml b/basis/xml/tests/xmltest/not-wf/sa/154.xml
new file mode 100755 (executable)
index 0000000..96e01d6
--- /dev/null
@@ -0,0 +1,2 @@
+<?XML version="1.0"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/155.xml b/basis/xml/tests/xmltest/not-wf/sa/155.xml
new file mode 100755 (executable)
index 0000000..4f16d0f
--- /dev/null
@@ -0,0 +1,2 @@
+<?xmL version="1.0"?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/156.xml b/basis/xml/tests/xmltest/not-wf/sa/156.xml
new file mode 100755 (executable)
index 0000000..c6d93fd
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<?xMl version="1.0"?>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/157.xml b/basis/xml/tests/xmltest/not-wf/sa/157.xml
new file mode 100755 (executable)
index 0000000..2f058da
--- /dev/null
@@ -0,0 +1,3 @@
+<doc>\r
+<?xmL?>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/158.xml b/basis/xml/tests/xmltest/not-wf/sa/158.xml
new file mode 100755 (executable)
index 0000000..32b90b7
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!NOTATION gif PUBLIC "image/gif" "">\r
+<!ATTLIST #NOTATION gif a1 CDATA #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/159.xml b/basis/xml/tests/xmltest/not-wf/sa/159.xml
new file mode 100755 (executable)
index 0000000..066244c
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "<![CDATA[Tim & Michael]]>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/160.xml b/basis/xml/tests/xmltest/not-wf/sa/160.xml
new file mode 100755 (executable)
index 0000000..85424ac
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "">\r
+<!ENTITY foo "%e;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/161.xml b/basis/xml/tests/xmltest/not-wf/sa/161.xml
new file mode 100755 (executable)
index 0000000..4f8a5b7
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e "#PCDATA">\r
+<!ELEMENT doc (%e;)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/162.xml b/basis/xml/tests/xmltest/not-wf/sa/162.xml
new file mode 100755 (executable)
index 0000000..efae4b1
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e1 "">\r
+<!ENTITY % e2 "%e1;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/163.xml b/basis/xml/tests/xmltest/not-wf/sa/163.xml
new file mode 100755 (executable)
index 0000000..e14fb76
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "">\r
+]>\r
+%e;\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/164.xml b/basis/xml/tests/xmltest/not-wf/sa/164.xml
new file mode 100755 (executable)
index 0000000..98dd267
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "">\r
+] %e; >\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/165.xml b/basis/xml/tests/xmltest/not-wf/sa/165.xml
new file mode 100755 (executable)
index 0000000..36c0461
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY% e "">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/166.xml b/basis/xml/tests/xmltest/not-wf/sa/166.xml
new file mode 100755 (executable)
index 0000000..ee2ce28
--- /dev/null
@@ -0,0 +1 @@
+<doc>ï¿¿</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/167.xml b/basis/xml/tests/xmltest/not-wf/sa/167.xml
new file mode 100755 (executable)
index 0000000..9bdc6c1
--- /dev/null
@@ -0,0 +1 @@
+<doc>￾</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/168.xml b/basis/xml/tests/xmltest/not-wf/sa/168.xml
new file mode 100755 (executable)
index 0000000..f83221a
--- /dev/null
@@ -0,0 +1 @@
+<doc>í €</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/169.xml b/basis/xml/tests/xmltest/not-wf/sa/169.xml
new file mode 100755 (executable)
index 0000000..310029b
--- /dev/null
@@ -0,0 +1 @@
+<doc>í°€</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/170.xml b/basis/xml/tests/xmltest/not-wf/sa/170.xml
new file mode 100755 (executable)
index 0000000..cfa0aee
--- /dev/null
@@ -0,0 +1 @@
+<doc>÷€€€</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/171.xml b/basis/xml/tests/xmltest/not-wf/sa/171.xml
new file mode 100755 (executable)
index 0000000..48b5c7d
--- /dev/null
@@ -0,0 +1,2 @@
+<!-- ï¿¿ -->\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/172.xml b/basis/xml/tests/xmltest/not-wf/sa/172.xml
new file mode 100755 (executable)
index 0000000..6651d4d
--- /dev/null
@@ -0,0 +1,2 @@
+<?pi ï¿¿?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/173.xml b/basis/xml/tests/xmltest/not-wf/sa/173.xml
new file mode 100755 (executable)
index 0000000..f9f9f42
--- /dev/null
@@ -0,0 +1 @@
+<doc a="ï¿¿"></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/174.xml b/basis/xml/tests/xmltest/not-wf/sa/174.xml
new file mode 100755 (executable)
index 0000000..42bef86
--- /dev/null
@@ -0,0 +1 @@
+<doc><![CDATA[ï¿¿]]></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/175.xml b/basis/xml/tests/xmltest/not-wf/sa/175.xml
new file mode 100755 (executable)
index 0000000..69912f3
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "ï¿¿">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/176.xml b/basis/xml/tests/xmltest/not-wf/sa/176.xml
new file mode 100755 (executable)
index 0000000..9c8e2e4
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>
diff --git a/basis/xml/tests/xmltest/not-wf/sa/177.xml b/basis/xml/tests/xmltest/not-wf/sa/177.xml
new file mode 100755 (executable)
index 0000000..6bc8228
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>Aï¿¿</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/178.xml b/basis/xml/tests/xmltest/not-wf/sa/178.xml
new file mode 100755 (executable)
index 0000000..e8f2d18
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="&#34;></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/179.xml b/basis/xml/tests/xmltest/not-wf/sa/179.xml
new file mode 100755 (executable)
index 0000000..e8f1f41
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#34;>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/180.xml b/basis/xml/tests/xmltest/not-wf/sa/180.xml
new file mode 100755 (executable)
index 0000000..569d553
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA "&e;">\r
+<!ENTITY e "v">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/181.xml b/basis/xml/tests/xmltest/not-wf/sa/181.xml
new file mode 100755 (executable)
index 0000000..4341d99
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#60;![CDATA[">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&e;]]></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/182.xml b/basis/xml/tests/xmltest/not-wf/sa/182.xml
new file mode 100755 (executable)
index 0000000..920f431
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#60;!--">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&e;--></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/183.xml b/basis/xml/tests/xmltest/not-wf/sa/183.xml
new file mode 100755 (executable)
index 0000000..7a5677d
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA | foo*)* >\r
+<!ELEMENT foo EMPTY>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/184.xml b/basis/xml/tests/xmltest/not-wf/sa/184.xml
new file mode 100755 (executable)
index 0000000..103384a
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA | (foo))* >\r
+<!ELEMENT foo EMPTY>\r
+]>\r
+<doc></doc>\r
+\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/185.ent b/basis/xml/tests/xmltest/not-wf/sa/185.ent
new file mode 100755 (executable)
index 0000000..e557426
--- /dev/null
@@ -0,0 +1 @@
+<!ELEMENT doc (#PCDATA)>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/185.xml b/basis/xml/tests/xmltest/not-wf/sa/185.xml
new file mode 100755 (executable)
index 0000000..81d5ef4
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" standalone="yes"?>\r
+<!DOCTYPE doc SYSTEM "185.ent">\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/186.xml b/basis/xml/tests/xmltest/not-wf/sa/186.xml
new file mode 100755 (executable)
index 0000000..85b26ec
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE a [\r
+<!ELEMENT a EMPTY>\r
+<!ATTLIST a b CDATA #IMPLIED d CDATA #IMPLIED>\r
+]>\r
+<a b="c"d="e"/>\r
diff --git a/basis/xml/tests/xmltest/not-wf/sa/null.ent b/basis/xml/tests/xmltest/not-wf/sa/null.ent
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/basis/xml/tests/xmltest/readme.html b/basis/xml/tests/xmltest/readme.html
new file mode 100755 (executable)
index 0000000..fc7310c
--- /dev/null
@@ -0,0 +1,60 @@
+<HTML>\r
+<TITLE>XML Test Cases</TITLE>\r
+<BODY>\r
+<H1>XML Test Cases version 1998-11-18</H1>\r
+<P>\r
+Copyright (C) 1998 James Clark.  All rights reserved.  Permission is\r
+granted to copy and modify this collection in any way for internal use\r
+within a company or organization.  Permission is granted to\r
+redistribute the file <code>xmltest.zip</code> containing this\r
+collection to third parties provided that no modifications of any kind\r
+are made to this file.  Note that permission to distribute the\r
+collection in any other form is not granted.\r
+<P>\r
+The collection is structured into three directories:\r
+<DL>\r
+<DT><CODE>not-wf</CODE>\r
+<DD>this contains cases that are not well-formed XML documents\r
+<DT><CODE>valid</CODE>\r
+<DD>this contains cases that are valid XML documents\r
+<DT><CODE>invalid</CODE>\r
+<DD>this contains cases that are well-formed XML documents\r
+but are not valid XML documents\r
+</DL>\r
+<P>\r
+The <CODE>not-wf</CODE> and <CODE>valid</CODE> directories each have\r
+three subdirectories:\r
+<DL>\r
+<DT>\r
+<CODE>sa</CODE>\r
+<DD>\r
+this contains cases that are standalone (as defined in XML) and do not\r
+have references to external general entities\r
+<DT>\r
+<CODE>ext-sa</CODE>\r
+<DD>\r
+this contains case that are standalone and have references to external\r
+general entities\r
+<DT>\r
+<CODE>not-sa</CODE>\r
+<DD>\r
+this contains cases that are not standalone\r
+</DL>\r
+<P>\r
+In each directory, files with a <CODE>.xml</CODE> extension are the\r
+XML document test cases, and files with a <CODE>.ent</CODE> extension\r
+are external entities referenced by the test cases.\r
+<P>\r
+Within the <CODE>valid</CODE> directory, each of these three\r
+subdirectories has an <CODE>out</CODE> subdirectory which contains an\r
+equivalent <A HREF="canonxml.html">canonical XML</A> document for each\r
+of the cases.\r
+<P>\r
+<P>\r
+Bug reports and contributions of new test cases are welcome.\r
+<P>\r
+<ADDRESS>\r
+<A HREF="mailto:jjc@jclark.com">James Clark</A>\r
+</ADDRESS>\r
+</BODY>\r
+</HTML>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/001.ent b/basis/xml/tests/xmltest/valid/ext-sa/001.ent
new file mode 100755 (executable)
index 0000000..1cff3fd
--- /dev/null
@@ -0,0 +1 @@
+Data\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/001.xml b/basis/xml/tests/xmltest/valid/ext-sa/001.xml
new file mode 100755 (executable)
index 0000000..147d70d
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "001.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/002.ent b/basis/xml/tests/xmltest/valid/ext-sa/002.ent
new file mode 100755 (executable)
index 0000000..45f6d8e
--- /dev/null
@@ -0,0 +1 @@
+Data
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/002.xml b/basis/xml/tests/xmltest/valid/ext-sa/002.xml
new file mode 100755 (executable)
index 0000000..9eaf917
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "002.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/003.ent b/basis/xml/tests/xmltest/valid/ext-sa/003.ent
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/003.xml b/basis/xml/tests/xmltest/valid/ext-sa/003.xml
new file mode 100755 (executable)
index 0000000..bb60b66
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "003.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/004.ent b/basis/xml/tests/xmltest/valid/ext-sa/004.ent
new file mode 100755 (executable)
index 0000000..3436f20
--- /dev/null
@@ -0,0 +1 @@
+Data\r
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/004.xml b/basis/xml/tests/xmltest/valid/ext-sa/004.xml
new file mode 100755 (executable)
index 0000000..074498c
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "004.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/005.ent b/basis/xml/tests/xmltest/valid/ext-sa/005.ent
new file mode 100755 (executable)
index 0000000..c6e97f8
--- /dev/null
@@ -0,0 +1 @@
+<e/><e/><e/>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/005.xml b/basis/xml/tests/xmltest/valid/ext-sa/005.xml
new file mode 100755 (executable)
index 0000000..82a6228
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (e*)>\r
+<!ELEMENT e EMPTY>\r
+<!ENTITY e SYSTEM "005.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/006.ent b/basis/xml/tests/xmltest/valid/ext-sa/006.ent
new file mode 100755 (executable)
index 0000000..4df2f0c
--- /dev/null
@@ -0,0 +1,4 @@
+Data\r
+<e/>\r
+More data\r
+<e/>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/006.xml b/basis/xml/tests/xmltest/valid/ext-sa/006.xml
new file mode 100755 (executable)
index 0000000..0b326ca
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA|e)*>\r
+<!ELEMENT e EMPTY>\r
+<!ENTITY e SYSTEM "006.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/007.ent b/basis/xml/tests/xmltest/valid/ext-sa/007.ent
new file mode 100755 (executable)
index 0000000..ab1d696
Binary files /dev/null and b/basis/xml/tests/xmltest/valid/ext-sa/007.ent differ
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/007.xml b/basis/xml/tests/xmltest/valid/ext-sa/007.xml
new file mode 100755 (executable)
index 0000000..825e3b2
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "007.ent">\r
+]>\r
+<doc>X&e;Z</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/008.ent b/basis/xml/tests/xmltest/valid/ext-sa/008.ent
new file mode 100755 (executable)
index 0000000..c6ca61f
Binary files /dev/null and b/basis/xml/tests/xmltest/valid/ext-sa/008.ent differ
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/008.xml b/basis/xml/tests/xmltest/valid/ext-sa/008.xml
new file mode 100755 (executable)
index 0000000..3c001b6
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "008.ent">\r
+]>\r
+<doc>X&e;Z</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/009.ent b/basis/xml/tests/xmltest/valid/ext-sa/009.ent
new file mode 100755 (executable)
index 0000000..67c3297
--- /dev/null
@@ -0,0 +1 @@
+\r
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/009.xml b/basis/xml/tests/xmltest/valid/ext-sa/009.xml
new file mode 100755 (executable)
index 0000000..a5866e5
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "009.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/010.ent b/basis/xml/tests/xmltest/valid/ext-sa/010.ent
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/010.xml b/basis/xml/tests/xmltest/valid/ext-sa/010.xml
new file mode 100755 (executable)
index 0000000..418e9b0
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "010.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/011.ent b/basis/xml/tests/xmltest/valid/ext-sa/011.ent
new file mode 100755 (executable)
index 0000000..b19be3a
--- /dev/null
@@ -0,0 +1 @@
+xyzzy\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/011.xml b/basis/xml/tests/xmltest/valid/ext-sa/011.xml
new file mode 100755 (executable)
index 0000000..2ceefa1
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e PUBLIC "a not very interesting file" "011.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/012.ent b/basis/xml/tests/xmltest/valid/ext-sa/012.ent
new file mode 100755 (executable)
index 0000000..8eb1fb9
--- /dev/null
@@ -0,0 +1 @@
+&e4;
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/012.xml b/basis/xml/tests/xmltest/valid/ext-sa/012.xml
new file mode 100755 (executable)
index 0000000..5a8f009
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE doc [\r
+<!ENTITY e1 "&e2;">\r
+<!ENTITY e2 "&e3;">\r
+<!ENTITY e3 SYSTEM "012.ent">\r
+<!ENTITY e4 "&e5;">\r
+<!ENTITY e5 "(e5)">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&e1;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/013.ent b/basis/xml/tests/xmltest/valid/ext-sa/013.ent
new file mode 100755 (executable)
index 0000000..7f25c50
--- /dev/null
@@ -0,0 +1 @@
+<e/>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/013.xml b/basis/xml/tests/xmltest/valid/ext-sa/013.xml
new file mode 100755 (executable)
index 0000000..7717c97
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (e)>\r
+<!ELEMENT e (#PCDATA)>\r
+<!ATTLIST e\r
+  a1 CDATA "a1 default"\r
+  a2 NMTOKENS "a2 default"\r
+>\r
+<!ENTITY x SYSTEM "013.ent">\r
+]>\r
+<doc>&x;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/014.ent b/basis/xml/tests/xmltest/valid/ext-sa/014.ent
new file mode 100755 (executable)
index 0000000..470fd6f
Binary files /dev/null and b/basis/xml/tests/xmltest/valid/ext-sa/014.ent differ
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/014.xml b/basis/xml/tests/xmltest/valid/ext-sa/014.xml
new file mode 100755 (executable)
index 0000000..816fd1e
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e SYSTEM "014.ent">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/001.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/001.xml
new file mode 100755 (executable)
index 0000000..0a7acf8
--- /dev/null
@@ -0,0 +1 @@
+<doc>Data&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/002.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/002.xml
new file mode 100755 (executable)
index 0000000..d4a445e
--- /dev/null
@@ -0,0 +1 @@
+<doc>Data</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/003.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/003.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/004.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/004.xml
new file mode 100755 (executable)
index 0000000..0a7acf8
--- /dev/null
@@ -0,0 +1 @@
+<doc>Data&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/005.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/005.xml
new file mode 100755 (executable)
index 0000000..6e293aa
--- /dev/null
@@ -0,0 +1 @@
+<doc><e></e><e></e><e></e></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/006.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/006.xml
new file mode 100755 (executable)
index 0000000..04b6fc8
--- /dev/null
@@ -0,0 +1 @@
+<doc>Data&#10;<e></e>&#10;More data&#10;<e></e>&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/007.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/007.xml
new file mode 100755 (executable)
index 0000000..ab2a74c
--- /dev/null
@@ -0,0 +1 @@
+<doc>XYZ</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/008.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/008.xml
new file mode 100755 (executable)
index 0000000..ab2a74c
--- /dev/null
@@ -0,0 +1 @@
+<doc>XYZ</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/009.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/009.xml
new file mode 100755 (executable)
index 0000000..a79dff6
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/010.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/010.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/011.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/011.xml
new file mode 100755 (executable)
index 0000000..bf275ad
--- /dev/null
@@ -0,0 +1 @@
+<doc>xyzzy&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/012.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/012.xml
new file mode 100755 (executable)
index 0000000..81a251c
--- /dev/null
@@ -0,0 +1 @@
+<doc>(e5)</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/013.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/013.xml
new file mode 100755 (executable)
index 0000000..524d94e
--- /dev/null
@@ -0,0 +1 @@
+<doc><e a1="a1 default" a2="a2 default"></e></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/ext-sa/out/014.xml b/basis/xml/tests/xmltest/valid/ext-sa/out/014.xml
new file mode 100755 (executable)
index 0000000..71c6dc3
--- /dev/null
@@ -0,0 +1 @@
+<doc>data</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/001.ent b/basis/xml/tests/xmltest/valid/not-sa/001.ent
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/basis/xml/tests/xmltest/valid/not-sa/001.xml b/basis/xml/tests/xmltest/valid/not-sa/001.xml
new file mode 100755 (executable)
index 0000000..2d6f41a
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "001.ent" [\r
+<!ELEMENT doc EMPTY>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/002.ent b/basis/xml/tests/xmltest/valid/not-sa/002.ent
new file mode 100755 (executable)
index 0000000..67c3297
--- /dev/null
@@ -0,0 +1 @@
+\r
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/002.xml b/basis/xml/tests/xmltest/valid/not-sa/002.xml
new file mode 100755 (executable)
index 0000000..023fce8
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "002.ent" [\r
+<!ELEMENT doc EMPTY>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/003-1.ent b/basis/xml/tests/xmltest/valid/not-sa/003-1.ent
new file mode 100755 (executable)
index 0000000..931f3ad
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc EMPTY>\r
+<!ENTITY % e SYSTEM "003-2.ent">\r
+<!ATTLIST doc a1 CDATA %e; "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/003-2.ent b/basis/xml/tests/xmltest/valid/not-sa/003-2.ent
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/basis/xml/tests/xmltest/valid/not-sa/003.xml b/basis/xml/tests/xmltest/valid/not-sa/003.xml
new file mode 100755 (executable)
index 0000000..63a5e8b
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "003-1.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/004-1.ent b/basis/xml/tests/xmltest/valid/not-sa/004-1.ent
new file mode 100755 (executable)
index 0000000..40f7ff5
--- /dev/null
@@ -0,0 +1,4 @@
+<!ELEMENT doc EMPTY>\r
+<!ENTITY % e1 SYSTEM "004-2.ent">\r
+<!ENTITY % e2 "%e1;">\r
+%e1;\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/004-2.ent b/basis/xml/tests/xmltest/valid/not-sa/004-2.ent
new file mode 100755 (executable)
index 0000000..61def75
--- /dev/null
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "value">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/004.xml b/basis/xml/tests/xmltest/valid/not-sa/004.xml
new file mode 100755 (executable)
index 0000000..adc9201
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "004-1.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/005-1.ent b/basis/xml/tests/xmltest/valid/not-sa/005-1.ent
new file mode 100755 (executable)
index 0000000..ade9599
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc EMPTY>\r
+<!ENTITY % e SYSTEM "005-2.ent">\r
+%e;\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/005-2.ent b/basis/xml/tests/xmltest/valid/not-sa/005-2.ent
new file mode 100755 (executable)
index 0000000..bef50b1
--- /dev/null
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/005.xml b/basis/xml/tests/xmltest/valid/not-sa/005.xml
new file mode 100755 (executable)
index 0000000..6bd44cf
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "005-1.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/006.ent b/basis/xml/tests/xmltest/valid/not-sa/006.ent
new file mode 100755 (executable)
index 0000000..8f305a8
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc EMPTY>\r
+<!ATTLIST doc a1 CDATA "w1" a2 CDATA "w2">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/006.xml b/basis/xml/tests/xmltest/valid/not-sa/006.xml
new file mode 100755 (executable)
index 0000000..eb80bb7
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "006.ent" [\r
+<!ATTLIST doc a1 CDATA "v1">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/007.ent b/basis/xml/tests/xmltest/valid/not-sa/007.ent
new file mode 100755 (executable)
index 0000000..fbf4ca4
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/007.xml b/basis/xml/tests/xmltest/valid/not-sa/007.xml
new file mode 100755 (executable)
index 0000000..38897e3
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "007.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/008.ent b/basis/xml/tests/xmltest/valid/not-sa/008.ent
new file mode 100755 (executable)
index 0000000..fbf4ca4
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/008.xml b/basis/xml/tests/xmltest/valid/not-sa/008.xml
new file mode 100755 (executable)
index 0000000..bf777a7
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc PUBLIC "whatever" "008.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/009.ent b/basis/xml/tests/xmltest/valid/not-sa/009.ent
new file mode 100755 (executable)
index 0000000..fbf4ca4
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/009.xml b/basis/xml/tests/xmltest/valid/not-sa/009.xml
new file mode 100755 (executable)
index 0000000..c17562f
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc PUBLIC "whatever" "009.ent" [\r
+<!ATTLIST doc a2 CDATA "v2">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/010.ent b/basis/xml/tests/xmltest/valid/not-sa/010.ent
new file mode 100755 (executable)
index 0000000..52a28f5
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v2">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/010.xml b/basis/xml/tests/xmltest/valid/not-sa/010.xml
new file mode 100755 (executable)
index 0000000..2786b32
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "010.ent" [\r
+<!ATTLIST doc a1 CDATA "v1">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/011.ent b/basis/xml/tests/xmltest/valid/not-sa/011.ent
new file mode 100755 (executable)
index 0000000..fbf4ca4
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/011.xml b/basis/xml/tests/xmltest/valid/not-sa/011.xml
new file mode 100755 (executable)
index 0000000..03b482b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e SYSTEM "011.ent">\r
+%e;\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/012.ent b/basis/xml/tests/xmltest/valid/not-sa/012.ent
new file mode 100755 (executable)
index 0000000..7e372e6
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/012.xml b/basis/xml/tests/xmltest/valid/not-sa/012.xml
new file mode 100755 (executable)
index 0000000..1967edb
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e SYSTEM "012.ent">\r
+%e;\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/013.ent b/basis/xml/tests/xmltest/valid/not-sa/013.ent
new file mode 100755 (executable)
index 0000000..a3691d9
--- /dev/null
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![ INCLUDE [\r
+<!ATTLIST doc a1 CDATA "v1">\r
+]]>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/013.xml b/basis/xml/tests/xmltest/valid/not-sa/013.xml
new file mode 100755 (executable)
index 0000000..cf44f26
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "013.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/014.ent b/basis/xml/tests/xmltest/valid/not-sa/014.ent
new file mode 100755 (executable)
index 0000000..6eaf779
--- /dev/null
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![ %e; [\r
+<!ATTLIST doc a1 CDATA "v1">\r
+]]>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/014.xml b/basis/xml/tests/xmltest/valid/not-sa/014.xml
new file mode 100755 (executable)
index 0000000..bd08502
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "014.ent" [\r
+<!ENTITY % e "INCLUDE">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/015.ent b/basis/xml/tests/xmltest/valid/not-sa/015.ent
new file mode 100755 (executable)
index 0000000..00d2f30
--- /dev/null
@@ -0,0 +1,5 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![ %e; [\r
+<!ATTLIST doc a1 CDATA "v1">\r
+]]>\r
+<!ATTLIST doc a2 CDATA "v2">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/015.xml b/basis/xml/tests/xmltest/valid/not-sa/015.xml
new file mode 100755 (executable)
index 0000000..e04e75f
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "015.ent" [\r
+<!ENTITY % e "IGNORE">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/016.ent b/basis/xml/tests/xmltest/valid/not-sa/016.ent
new file mode 100755 (executable)
index 0000000..bf77ef8
--- /dev/null
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![%e;[\r
+<!ATTLIST doc a1 CDATA "v1">\r
+]]>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/016.xml b/basis/xml/tests/xmltest/valid/not-sa/016.xml
new file mode 100755 (executable)
index 0000000..4ccf4af
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc SYSTEM "016.ent" [\r
+<!ENTITY % e "INCLUDE">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/017.ent b/basis/xml/tests/xmltest/valid/not-sa/017.ent
new file mode 100755 (executable)
index 0000000..ffd9add
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "<!ATTLIST doc a1 CDATA 'v1'>">\r
+%e;\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/017.xml b/basis/xml/tests/xmltest/valid/not-sa/017.xml
new file mode 100755 (executable)
index 0000000..7fe18f4
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "017.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/018.ent b/basis/xml/tests/xmltest/valid/not-sa/018.ent
new file mode 100755 (executable)
index 0000000..2d46f76
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "'v1'">\r
+<!ATTLIST doc a1 CDATA %e;>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/018.xml b/basis/xml/tests/xmltest/valid/not-sa/018.xml
new file mode 100755 (executable)
index 0000000..31e90f2
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "018.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/019.ent b/basis/xml/tests/xmltest/valid/not-sa/019.ent
new file mode 100755 (executable)
index 0000000..d18201a
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "'v1'">\r
+<!ATTLIST doc a1 CDATA%e;>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/019.xml b/basis/xml/tests/xmltest/valid/not-sa/019.xml
new file mode 100755 (executable)
index 0000000..b7a18fa
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "019.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/020.ent b/basis/xml/tests/xmltest/valid/not-sa/020.ent
new file mode 100755 (executable)
index 0000000..815291c
--- /dev/null
@@ -0,0 +1,3 @@
+<!ENTITY % e "doc">\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST%e;a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/020.xml b/basis/xml/tests/xmltest/valid/not-sa/020.xml
new file mode 100755 (executable)
index 0000000..d70892f
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "020.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/021.ent b/basis/xml/tests/xmltest/valid/not-sa/021.ent
new file mode 100755 (executable)
index 0000000..9f8f2af
--- /dev/null
@@ -0,0 +1,3 @@
+<!ENTITY % e "doc a1 CDATA">\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST %e; "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/021.xml b/basis/xml/tests/xmltest/valid/not-sa/021.xml
new file mode 100755 (executable)
index 0000000..70c2873
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "021.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/023.ent b/basis/xml/tests/xmltest/valid/not-sa/023.ent
new file mode 100755 (executable)
index 0000000..e326881
--- /dev/null
@@ -0,0 +1,5 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e1 "do">\r
+<!ENTITY % e2 "c">\r
+<!ENTITY % e3 "%e1;%e2;">\r
+<!ATTLIST %e3; a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/023.xml b/basis/xml/tests/xmltest/valid/not-sa/023.xml
new file mode 100755 (executable)
index 0000000..1c2484b
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "023.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/024.ent b/basis/xml/tests/xmltest/valid/not-sa/024.ent
new file mode 100755 (executable)
index 0000000..aa6d0ec
--- /dev/null
@@ -0,0 +1,4 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e1 "'v1'">\r
+<!ENTITY % e2 'a1 CDATA %e1;'>\r
+<!ATTLIST doc %e2;>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/024.xml b/basis/xml/tests/xmltest/valid/not-sa/024.xml
new file mode 100755 (executable)
index 0000000..96e1ecb
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "024.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/025.ent b/basis/xml/tests/xmltest/valid/not-sa/025.ent
new file mode 100755 (executable)
index 0000000..389d259
--- /dev/null
@@ -0,0 +1,5 @@
+<!ELEMENT doc EMPTY>\r
+<!ENTITY % e "x">\r
+<!ENTITY % e "y">\r
+<!ENTITY % v "'%e;'">\r
+<!ATTLIST doc a1 CDATA %v;>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/025.xml b/basis/xml/tests/xmltest/valid/not-sa/025.xml
new file mode 100755 (executable)
index 0000000..8fdbc14
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "025.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/026.ent b/basis/xml/tests/xmltest/valid/not-sa/026.ent
new file mode 100755 (executable)
index 0000000..bdc93af
--- /dev/null
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "w1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/026.xml b/basis/xml/tests/xmltest/valid/not-sa/026.xml
new file mode 100755 (executable)
index 0000000..7b109c0
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc ANY>\r
+<!ENTITY % e SYSTEM "026.ent">\r
+%e;\r
+<!ATTLIST doc a1 CDATA "x1" a2 CDATA "x2">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/027.ent b/basis/xml/tests/xmltest/valid/not-sa/027.ent
new file mode 100755 (executable)
index 0000000..712cce3
--- /dev/null
@@ -0,0 +1,2 @@
+<!ENTITY % e "">\r
+<!ELEMENT doc (#PCDATA %e;)>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/027.xml b/basis/xml/tests/xmltest/valid/not-sa/027.xml
new file mode 100755 (executable)
index 0000000..d0c8c7a
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "027.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/028.ent b/basis/xml/tests/xmltest/valid/not-sa/028.ent
new file mode 100755 (executable)
index 0000000..ac249d7
--- /dev/null
@@ -0,0 +1,2 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![INCLUDE[<!ATTLIST doc a1 CDATA "v1">]]>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/028.xml b/basis/xml/tests/xmltest/valid/not-sa/028.xml
new file mode 100755 (executable)
index 0000000..50e5248
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "028.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/029.ent b/basis/xml/tests/xmltest/valid/not-sa/029.ent
new file mode 100755 (executable)
index 0000000..df94df5
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![IGNORE[<!ATTLIST doc a1 CDATA "v1">]]>\r
+<!ATTLIST doc a1 CDATA "v2">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/029.xml b/basis/xml/tests/xmltest/valid/not-sa/029.xml
new file mode 100755 (executable)
index 0000000..07e226c
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "029.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/030.ent b/basis/xml/tests/xmltest/valid/not-sa/030.ent
new file mode 100755 (executable)
index 0000000..e386446
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>\r
+<![IGNORE[]]>\r
+<![INCLUDE[]]>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/030.xml b/basis/xml/tests/xmltest/valid/not-sa/030.xml
new file mode 100755 (executable)
index 0000000..01fc2be
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "030.ent">\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/031-1.ent b/basis/xml/tests/xmltest/valid/not-sa/031-1.ent
new file mode 100755 (executable)
index 0000000..f7f94ab
--- /dev/null
@@ -0,0 +1,3 @@
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e SYSTEM "031-2.ent">\r
+<!ENTITY e "<![CDATA[%e;]]>">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/031-2.ent b/basis/xml/tests/xmltest/valid/not-sa/031-2.ent
new file mode 100755 (executable)
index 0000000..bef50b1
--- /dev/null
@@ -0,0 +1 @@
+<!ATTLIST doc a1 CDATA "v1">\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/031.xml b/basis/xml/tests/xmltest/valid/not-sa/031.xml
new file mode 100755 (executable)
index 0000000..c3fe5fc
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE doc SYSTEM "031-1.ent">\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/001.xml b/basis/xml/tests/xmltest/valid/not-sa/out/001.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/002.xml b/basis/xml/tests/xmltest/valid/not-sa/out/002.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/003.xml b/basis/xml/tests/xmltest/valid/not-sa/out/003.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/004.xml b/basis/xml/tests/xmltest/valid/not-sa/out/004.xml
new file mode 100755 (executable)
index 0000000..bdc39e2
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="value"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/005.xml b/basis/xml/tests/xmltest/valid/not-sa/out/005.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/006.xml b/basis/xml/tests/xmltest/valid/not-sa/out/006.xml
new file mode 100755 (executable)
index 0000000..d07627d
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1" a2="w2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/007.xml b/basis/xml/tests/xmltest/valid/not-sa/out/007.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/008.xml b/basis/xml/tests/xmltest/valid/not-sa/out/008.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/009.xml b/basis/xml/tests/xmltest/valid/not-sa/out/009.xml
new file mode 100755 (executable)
index 0000000..7293fb6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1" a2="v2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/010.xml b/basis/xml/tests/xmltest/valid/not-sa/out/010.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/011.xml b/basis/xml/tests/xmltest/valid/not-sa/out/011.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/012.xml b/basis/xml/tests/xmltest/valid/not-sa/out/012.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/013.xml b/basis/xml/tests/xmltest/valid/not-sa/out/013.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/014.xml b/basis/xml/tests/xmltest/valid/not-sa/out/014.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/015.xml b/basis/xml/tests/xmltest/valid/not-sa/out/015.xml
new file mode 100755 (executable)
index 0000000..131a32f
--- /dev/null
@@ -0,0 +1 @@
+<doc a2="v2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/016.xml b/basis/xml/tests/xmltest/valid/not-sa/out/016.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/017.xml b/basis/xml/tests/xmltest/valid/not-sa/out/017.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/018.xml b/basis/xml/tests/xmltest/valid/not-sa/out/018.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/019.xml b/basis/xml/tests/xmltest/valid/not-sa/out/019.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/020.xml b/basis/xml/tests/xmltest/valid/not-sa/out/020.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/021.xml b/basis/xml/tests/xmltest/valid/not-sa/out/021.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/022.xml b/basis/xml/tests/xmltest/valid/not-sa/out/022.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/023.xml b/basis/xml/tests/xmltest/valid/not-sa/out/023.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/024.xml b/basis/xml/tests/xmltest/valid/not-sa/out/024.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/025.xml b/basis/xml/tests/xmltest/valid/not-sa/out/025.xml
new file mode 100755 (executable)
index 0000000..eb3f967
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="x"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/026.xml b/basis/xml/tests/xmltest/valid/not-sa/out/026.xml
new file mode 100755 (executable)
index 0000000..71c0202
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="w1" a2="x2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/027.xml b/basis/xml/tests/xmltest/valid/not-sa/out/027.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/028.xml b/basis/xml/tests/xmltest/valid/not-sa/out/028.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/029.xml b/basis/xml/tests/xmltest/valid/not-sa/out/029.xml
new file mode 100755 (executable)
index 0000000..7ac8b2b
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/030.xml b/basis/xml/tests/xmltest/valid/not-sa/out/030.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/not-sa/out/031.xml b/basis/xml/tests/xmltest/valid/not-sa/out/031.xml
new file mode 100755 (executable)
index 0000000..03a6c3f
--- /dev/null
@@ -0,0 +1 @@
+<doc>&lt;!ATTLIST doc a1 CDATA &quot;v1&quot;&gt;&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/001.xml b/basis/xml/tests/xmltest/valid/sa/001.xml
new file mode 100755 (executable)
index 0000000..7fbef49
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/002.xml b/basis/xml/tests/xmltest/valid/sa/002.xml
new file mode 100755 (executable)
index 0000000..2e3f1d8
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc ></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/003.xml b/basis/xml/tests/xmltest/valid/sa/003.xml
new file mode 100755 (executable)
index 0000000..c841b81
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc >\r
diff --git a/basis/xml/tests/xmltest/valid/sa/004.xml b/basis/xml/tests/xmltest/valid/sa/004.xml
new file mode 100755 (executable)
index 0000000..a9c5756
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+]>\r
+<doc a1="v1"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/005.xml b/basis/xml/tests/xmltest/valid/sa/005.xml
new file mode 100755 (executable)
index 0000000..b069efe
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+]>\r
+<doc a1 = "v1"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/006.xml b/basis/xml/tests/xmltest/valid/sa/006.xml
new file mode 100755 (executable)
index 0000000..39a3463
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+]>\r
+<doc a1='v1'></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/007.xml b/basis/xml/tests/xmltest/valid/sa/007.xml
new file mode 100755 (executable)
index 0000000..cc3dc53
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#32;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/008.xml b/basis/xml/tests/xmltest/valid/sa/008.xml
new file mode 100755 (executable)
index 0000000..b3370eb
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&amp;&lt;&gt;&quot;&apos;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/009.xml b/basis/xml/tests/xmltest/valid/sa/009.xml
new file mode 100755 (executable)
index 0000000..0fa183e
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#x20;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/010.xml b/basis/xml/tests/xmltest/valid/sa/010.xml
new file mode 100755 (executable)
index 0000000..eb64d18
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+]>\r
+<doc a1="v1" ></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/011.xml b/basis/xml/tests/xmltest/valid/sa/011.xml
new file mode 100755 (executable)
index 0000000..4cac44b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED a2 CDATA #IMPLIED>\r
+]>\r
+<doc a1="v1" a2="v2"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/012.xml b/basis/xml/tests/xmltest/valid/sa/012.xml
new file mode 100755 (executable)
index 0000000..6ce2a3e
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc : CDATA #IMPLIED>\r
+]>\r
+<doc :="v1"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/013.xml b/basis/xml/tests/xmltest/valid/sa/013.xml
new file mode 100755 (executable)
index 0000000..2f4aae4
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc _.-0123456789 CDATA #IMPLIED>\r
+]>\r
+<doc _.-0123456789="v1"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/014.xml b/basis/xml/tests/xmltest/valid/sa/014.xml
new file mode 100755 (executable)
index 0000000..47f1f72
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc abcdefghijklmnopqrstuvwxyz CDATA #IMPLIED>\r
+]>\r
+<doc abcdefghijklmnopqrstuvwxyz="v1"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/015.xml b/basis/xml/tests/xmltest/valid/sa/015.xml
new file mode 100755 (executable)
index 0000000..861df8a
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc ABCDEFGHIJKLMNOPQRSTUVWXYZ CDATA #IMPLIED>\r
+]>\r
+<doc ABCDEFGHIJKLMNOPQRSTUVWXYZ="v1"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/016.xml b/basis/xml/tests/xmltest/valid/sa/016.xml
new file mode 100755 (executable)
index 0000000..66b1973
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><?pi?></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/017.xml b/basis/xml/tests/xmltest/valid/sa/017.xml
new file mode 100755 (executable)
index 0000000..827ba96
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><?pi some data ? > <??></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/018.xml b/basis/xml/tests/xmltest/valid/sa/018.xml
new file mode 100755 (executable)
index 0000000..4570903
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><![CDATA[<foo>]]></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/019.xml b/basis/xml/tests/xmltest/valid/sa/019.xml
new file mode 100755 (executable)
index 0000000..3e6b74c
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><![CDATA[<&]]></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/020.xml b/basis/xml/tests/xmltest/valid/sa/020.xml
new file mode 100755 (executable)
index 0000000..f749551
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><![CDATA[<&]>]]]></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/021.xml b/basis/xml/tests/xmltest/valid/sa/021.xml
new file mode 100755 (executable)
index 0000000..13dda8c
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><!-- a comment --></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/022.xml b/basis/xml/tests/xmltest/valid/sa/022.xml
new file mode 100755 (executable)
index 0000000..41d300e
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><!-- a comment ->--></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/023.xml b/basis/xml/tests/xmltest/valid/sa/023.xml
new file mode 100755 (executable)
index 0000000..3837b83
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/024.xml b/basis/xml/tests/xmltest/valid/sa/024.xml
new file mode 100755 (executable)
index 0000000..b0655c6
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (foo)>\r
+<!ELEMENT foo (#PCDATA)>\r
+<!ENTITY e "&#60;foo></foo>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/025.xml b/basis/xml/tests/xmltest/valid/sa/025.xml
new file mode 100755 (executable)
index 0000000..ed01f36
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (foo*)>\r
+<!ELEMENT foo (#PCDATA)>\r
+]>\r
+<doc><foo/><foo></foo></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/026.xml b/basis/xml/tests/xmltest/valid/sa/026.xml
new file mode 100755 (executable)
index 0000000..1ba033c
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (foo*)>\r
+<!ELEMENT foo EMPTY>\r
+]>\r
+<doc><foo/><foo></foo></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/027.xml b/basis/xml/tests/xmltest/valid/sa/027.xml
new file mode 100755 (executable)
index 0000000..ee02439
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (foo*)>\r
+<!ELEMENT foo ANY>\r
+]>\r
+<doc><foo/><foo></foo></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/028.xml b/basis/xml/tests/xmltest/valid/sa/028.xml
new file mode 100755 (executable)
index 0000000..3d95747
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/029.xml b/basis/xml/tests/xmltest/valid/sa/029.xml
new file mode 100755 (executable)
index 0000000..909f6ff
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/030.xml b/basis/xml/tests/xmltest/valid/sa/030.xml
new file mode 100755 (executable)
index 0000000..3a7ddaa
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version = "1.0"?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/031.xml b/basis/xml/tests/xmltest/valid/sa/031.xml
new file mode 100755 (executable)
index 0000000..a58e058
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding="UTF-8"?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/032.xml b/basis/xml/tests/xmltest/valid/sa/032.xml
new file mode 100755 (executable)
index 0000000..be55c8d
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version='1.0' standalone='yes'?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/033.xml b/basis/xml/tests/xmltest/valid/sa/033.xml
new file mode 100755 (executable)
index 0000000..a3f9053
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding="UTF-8" standalone='yes'?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/034.xml b/basis/xml/tests/xmltest/valid/sa/034.xml
new file mode 100755 (executable)
index 0000000..7d52f31
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc/>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/035.xml b/basis/xml/tests/xmltest/valid/sa/035.xml
new file mode 100755 (executable)
index 0000000..f109a8b
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc />\r
diff --git a/basis/xml/tests/xmltest/valid/sa/036.xml b/basis/xml/tests/xmltest/valid/sa/036.xml
new file mode 100755 (executable)
index 0000000..8ab2b3f
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
+<?pi data?>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/037.xml b/basis/xml/tests/xmltest/valid/sa/037.xml
new file mode 100755 (executable)
index 0000000..f9b2113
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
+<!-- comment -->\r
+\r
diff --git a/basis/xml/tests/xmltest/valid/sa/038.xml b/basis/xml/tests/xmltest/valid/sa/038.xml
new file mode 100755 (executable)
index 0000000..d14f41b
--- /dev/null
@@ -0,0 +1,6 @@
+<!-- comment -->\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
+\r
diff --git a/basis/xml/tests/xmltest/valid/sa/039.xml b/basis/xml/tests/xmltest/valid/sa/039.xml
new file mode 100755 (executable)
index 0000000..0897316
--- /dev/null
@@ -0,0 +1,5 @@
+<?pi data?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/040.xml b/basis/xml/tests/xmltest/valid/sa/040.xml
new file mode 100755 (executable)
index 0000000..12c419b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+]>\r
+<doc a1="&quot;&lt;&amp;&gt;&apos;"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/041.xml b/basis/xml/tests/xmltest/valid/sa/041.xml
new file mode 100755 (executable)
index 0000000..a59f536
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+]>\r
+<doc a1="&#65;"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/042.xml b/basis/xml/tests/xmltest/valid/sa/042.xml
new file mode 100755 (executable)
index 0000000..5d7c650
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#00000000000000000000000000000000065;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/043.xml b/basis/xml/tests/xmltest/valid/sa/043.xml
new file mode 100755 (executable)
index 0000000..a8095df
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc a1="foo\r
+bar"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/044.xml b/basis/xml/tests/xmltest/valid/sa/044.xml
new file mode 100755 (executable)
index 0000000..bee1d23
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (e*)>\r
+<!ELEMENT e EMPTY>\r
+<!ATTLIST e a1 CDATA "v1" a2 CDATA "v2" a3 CDATA #IMPLIED>\r
+]>\r
+<doc>\r
+<e a3="v3"/>\r
+<e a1="w1"/>\r
+<e a2="w2" a3="v3"/>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/045.xml b/basis/xml/tests/xmltest/valid/sa/045.xml
new file mode 100755 (executable)
index 0000000..e2567f5
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
+<!ATTLIST doc a1 CDATA "z1">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/046.xml b/basis/xml/tests/xmltest/valid/sa/046.xml
new file mode 100755 (executable)
index 0000000..c50a284
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "v1">\r
+<!ATTLIST doc a2 CDATA "v2">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/047.xml b/basis/xml/tests/xmltest/valid/sa/047.xml
new file mode 100755 (executable)
index 0000000..a4c688c
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>X\r
+Y</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/048.xml b/basis/xml/tests/xmltest/valid/sa/048.xml
new file mode 100755 (executable)
index 0000000..c6b2ded
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>]</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/049.xml b/basis/xml/tests/xmltest/valid/sa/049.xml
new file mode 100755 (executable)
index 0000000..c3cc797
Binary files /dev/null and b/basis/xml/tests/xmltest/valid/sa/049.xml differ
diff --git a/basis/xml/tests/xmltest/valid/sa/050.xml b/basis/xml/tests/xmltest/valid/sa/050.xml
new file mode 100755 (executable)
index 0000000..12303b1
Binary files /dev/null and b/basis/xml/tests/xmltest/valid/sa/050.xml differ
diff --git a/basis/xml/tests/xmltest/valid/sa/051.xml b/basis/xml/tests/xmltest/valid/sa/051.xml
new file mode 100755 (executable)
index 0000000..7ae8f6c
Binary files /dev/null and b/basis/xml/tests/xmltest/valid/sa/051.xml differ
diff --git a/basis/xml/tests/xmltest/valid/sa/052.xml b/basis/xml/tests/xmltest/valid/sa/052.xml
new file mode 100755 (executable)
index 0000000..3f33a4c
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>ð€€ô¿½</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/053.xml b/basis/xml/tests/xmltest/valid/sa/053.xml
new file mode 100755 (executable)
index 0000000..0d88f28
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<e/>">\r
+<!ELEMENT doc (e)>\r
+<!ELEMENT e EMPTY>\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/054.xml b/basis/xml/tests/xmltest/valid/sa/054.xml
new file mode 100755 (executable)
index 0000000..5d1c88b
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+\r
+\r
+<doc\r
+></doc\r
+>\r
+\r
+\r
diff --git a/basis/xml/tests/xmltest/valid/sa/055.xml b/basis/xml/tests/xmltest/valid/sa/055.xml
new file mode 100755 (executable)
index 0000000..da0292c
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<?pi  data?>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/056.xml b/basis/xml/tests/xmltest/valid/sa/056.xml
new file mode 100755 (executable)
index 0000000..144871b
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#x0000000000000000000000000000000000000041;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/057.xml b/basis/xml/tests/xmltest/valid/sa/057.xml
new file mode 100755 (executable)
index 0000000..c1ac849
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a*)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/058.xml b/basis/xml/tests/xmltest/valid/sa/058.xml
new file mode 100755 (executable)
index 0000000..2ff23b2
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ATTLIST doc a1 NMTOKENS #IMPLIED>\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc a1=" 1    2       "></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/059.xml b/basis/xml/tests/xmltest/valid/sa/059.xml
new file mode 100755 (executable)
index 0000000..2171480
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (e*)>\r
+<!ELEMENT e EMPTY>\r
+<!ATTLIST e a1 CDATA #IMPLIED a2 CDATA #IMPLIED a3 CDATA #IMPLIED>\r
+]>\r
+<doc>\r
+<e a1="v1" a2="v2" a3="v3"/>\r
+<e a1="w1" a2="v2"/>\r
+<e a1="v1" a2="w2" a3="v3"/>\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/060.xml b/basis/xml/tests/xmltest/valid/sa/060.xml
new file mode 100755 (executable)
index 0000000..6cd6b43
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>X&#10;Y</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/061.xml b/basis/xml/tests/xmltest/valid/sa/061.xml
new file mode 100755 (executable)
index 0000000..bbdc152
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#163;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/062.xml b/basis/xml/tests/xmltest/valid/sa/062.xml
new file mode 100755 (executable)
index 0000000..f4ba530
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#xe40;&#xe08;&#xe21;ส์</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/063.xml b/basis/xml/tests/xmltest/valid/sa/063.xml
new file mode 100755 (executable)
index 0000000..9668f2d
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE à¹€à¸ˆà¸¡à¸ªà¹Œ [\r
+<!ELEMENT à¹€à¸ˆà¸¡à¸ªà¹Œ (#PCDATA)>\r
+]>\r
+<เจมส์></เจมส์>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/064.xml b/basis/xml/tests/xmltest/valid/sa/064.xml
new file mode 100755 (executable)
index 0000000..74a97aa
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#x10000;&#x10FFFD;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/065.xml b/basis/xml/tests/xmltest/valid/sa/065.xml
new file mode 100755 (executable)
index 0000000..f708f2b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#60;">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/066.xml b/basis/xml/tests/xmltest/valid/sa/066.xml
new file mode 100755 (executable)
index 0000000..a27340b
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+<!-- 34 is double quote -->\r
+<!ENTITY e1 "&#34;">\r
+]>\r
+<doc a1="&e1;"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/067.xml b/basis/xml/tests/xmltest/valid/sa/067.xml
new file mode 100755 (executable)
index 0000000..a0ccf77
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#13;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/068.xml b/basis/xml/tests/xmltest/valid/sa/068.xml
new file mode 100755 (executable)
index 0000000..8ed806b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "&#13;">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/069.xml b/basis/xml/tests/xmltest/valid/sa/069.xml
new file mode 100755 (executable)
index 0000000..2437f60
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!NOTATION n PUBLIC "whatever">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/070.xml b/basis/xml/tests/xmltest/valid/sa/070.xml
new file mode 100755 (executable)
index 0000000..eef097d
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e "<!ELEMENT doc (#PCDATA)>">\r
+%e;\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/071.xml b/basis/xml/tests/xmltest/valid/sa/071.xml
new file mode 100755 (executable)
index 0000000..ebfba23
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a ID #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/072.xml b/basis/xml/tests/xmltest/valid/sa/072.xml
new file mode 100755 (executable)
index 0000000..6ef39dc
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a IDREF #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/073.xml b/basis/xml/tests/xmltest/valid/sa/073.xml
new file mode 100755 (executable)
index 0000000..217476d
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a IDREFS #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/074.xml b/basis/xml/tests/xmltest/valid/sa/074.xml
new file mode 100755 (executable)
index 0000000..8b2354f
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a ENTITY #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/075.xml b/basis/xml/tests/xmltest/valid/sa/075.xml
new file mode 100755 (executable)
index 0000000..33c0124
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a ENTITIES #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/076.xml b/basis/xml/tests/xmltest/valid/sa/076.xml
new file mode 100755 (executable)
index 0000000..65b731c
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a NOTATION (n1|n2) #IMPLIED>\r
+<!NOTATION n1 SYSTEM "http://www.w3.org/">\r
+<!NOTATION n2 SYSTEM "http://www.w3.org/">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/077.xml b/basis/xml/tests/xmltest/valid/sa/077.xml
new file mode 100755 (executable)
index 0000000..e5f301e
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a (1|2) #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/078.xml b/basis/xml/tests/xmltest/valid/sa/078.xml
new file mode 100755 (executable)
index 0000000..b31f40f
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #REQUIRED>\r
+]>\r
+<doc a="v"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/079.xml b/basis/xml/tests/xmltest/valid/sa/079.xml
new file mode 100755 (executable)
index 0000000..a3290d6
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #FIXED "v">\r
+]>\r
+<doc a="v"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/080.xml b/basis/xml/tests/xmltest/valid/sa/080.xml
new file mode 100755 (executable)
index 0000000..3208fa9
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #FIXED "v">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/081.xml b/basis/xml/tests/xmltest/valid/sa/081.xml
new file mode 100755 (executable)
index 0000000..51ee1a3
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a, b, c)>\r
+<!ELEMENT a (a?)>\r
+<!ELEMENT b (b*)>\r
+<!ELEMENT c (a | b)+>\r
+]>\r
+<doc><a/><b/><c><a/></c></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/082.xml b/basis/xml/tests/xmltest/valid/sa/082.xml
new file mode 100755 (executable)
index 0000000..d5245ac
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e SYSTEM "e.dtd">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/083.xml b/basis/xml/tests/xmltest/valid/sa/083.xml
new file mode 100755 (executable)
index 0000000..937cfc0
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e PUBLIC 'whatever' "e.dtd">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/084.xml b/basis/xml/tests/xmltest/valid/sa/084.xml
new file mode 100755 (executable)
index 0000000..8276076
--- /dev/null
@@ -0,0 +1 @@
+<!DOCTYPE doc [<!ELEMENT doc (#PCDATA)>]><doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/085.xml b/basis/xml/tests/xmltest/valid/sa/085.xml
new file mode 100755 (executable)
index 0000000..cf5834f
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e "<foo>">\r
+<!ENTITY e "">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/086.xml b/basis/xml/tests/xmltest/valid/sa/086.xml
new file mode 100755 (executable)
index 0000000..bbc3080
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "">\r
+<!ENTITY e "<foo>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/087.xml b/basis/xml/tests/xmltest/valid/sa/087.xml
new file mode 100755 (executable)
index 0000000..34797a6
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "<foo/&#62;">\r
+<!ELEMENT doc (foo)>\r
+<!ELEMENT foo EMPTY>\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/088.xml b/basis/xml/tests/xmltest/valid/sa/088.xml
new file mode 100755 (executable)
index 0000000..f97d968
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "&lt;foo>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/089.xml b/basis/xml/tests/xmltest/valid/sa/089.xml
new file mode 100755 (executable)
index 0000000..2d80c8f
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY e "&#x10000;&#x10FFFD;&#x10FFFF;">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/090.xml b/basis/xml/tests/xmltest/valid/sa/090.xml
new file mode 100755 (executable)
index 0000000..c392c96
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ATTLIST e a NOTATION (n) #IMPLIED>\r
+<!ELEMENT doc (e)*>\r
+<!ELEMENT e (#PCDATA)>\r
+<!NOTATION n PUBLIC "whatever">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/091.xml b/basis/xml/tests/xmltest/valid/sa/091.xml
new file mode 100755 (executable)
index 0000000..7343d0f
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!NOTATION n SYSTEM "http://www.w3.org/">\r
+<!ENTITY e SYSTEM "http://www.w3.org/" NDATA n>\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a ENTITY "e">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/092.xml b/basis/xml/tests/xmltest/valid/sa/092.xml
new file mode 100755 (executable)
index 0000000..627b74e
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a)*>\r
+<!ELEMENT a EMPTY>\r
+]>\r
+<doc>\r
+<a/>\r
+    <a/>       <a/>\r
+\r
+\r
+</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/093.xml b/basis/xml/tests/xmltest/valid/sa/093.xml
new file mode 100755 (executable)
index 0000000..300578e
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [
+<!ELEMENT doc (#PCDATA)>
+]>
+<doc>
+
+
+</doc>
diff --git a/basis/xml/tests/xmltest/valid/sa/094.xml b/basis/xml/tests/xmltest/valid/sa/094.xml
new file mode 100755 (executable)
index 0000000..5726e7d
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ENTITY % e "foo">\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a1 CDATA "%e;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/095.xml b/basis/xml/tests/xmltest/valid/sa/095.xml
new file mode 100755 (executable)
index 0000000..1fe6959
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ATTLIST doc a1 CDATA #IMPLIED>\r
+<!ATTLIST doc a1 NMTOKENS #IMPLIED>\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc a1="1  2"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/096.xml b/basis/xml/tests/xmltest/valid/sa/096.xml
new file mode 100755 (executable)
index 0000000..a6f8f43
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ATTLIST doc a1 NMTOKENS " 1          2       ">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/097.ent b/basis/xml/tests/xmltest/valid/sa/097.ent
new file mode 100755 (executable)
index 0000000..e06554a
--- /dev/null
@@ -0,0 +1 @@
+<!ATTLIST doc a2 CDATA #IMPLIED>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/097.xml b/basis/xml/tests/xmltest/valid/sa/097.xml
new file mode 100755 (executable)
index 0000000..c606afa
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY % e SYSTEM "097.ent">\r
+<!ATTLIST doc a1 CDATA "v1">\r
+%e;\r
+<!ATTLIST doc a2 CDATA "v2">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/098.xml b/basis/xml/tests/xmltest/valid/sa/098.xml
new file mode 100755 (executable)
index 0000000..33a64ce
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><?pi x\r
+y?></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/099.xml b/basis/xml/tests/xmltest/valid/sa/099.xml
new file mode 100755 (executable)
index 0000000..1b7214a
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/100.xml b/basis/xml/tests/xmltest/valid/sa/100.xml
new file mode 100755 (executable)
index 0000000..5b839e7
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ENTITY e PUBLIC ";!*#@$_%" "100.xml">\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/101.xml b/basis/xml/tests/xmltest/valid/sa/101.xml
new file mode 100755 (executable)
index 0000000..f464484
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "&#34;">\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/102.xml b/basis/xml/tests/xmltest/valid/sa/102.xml
new file mode 100755 (executable)
index 0000000..f239ff5
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="&#34;"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/103.xml b/basis/xml/tests/xmltest/valid/sa/103.xml
new file mode 100755 (executable)
index 0000000..1dbbd5b
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc>&#60;doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/104.xml b/basis/xml/tests/xmltest/valid/sa/104.xml
new file mode 100755 (executable)
index 0000000..666f43d
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="x      y"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/105.xml b/basis/xml/tests/xmltest/valid/sa/105.xml
new file mode 100755 (executable)
index 0000000..6b3af2b
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="x&#9;y"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/106.xml b/basis/xml/tests/xmltest/valid/sa/106.xml
new file mode 100755 (executable)
index 0000000..8757c0a
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="x&#10;y"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/107.xml b/basis/xml/tests/xmltest/valid/sa/107.xml
new file mode 100755 (executable)
index 0000000..3d2c256
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="x&#13;y"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/108.xml b/basis/xml/tests/xmltest/valid/sa/108.xml
new file mode 100755 (executable)
index 0000000..e919bf2
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "\r
+">\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="x&e;y"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/109.xml b/basis/xml/tests/xmltest/valid/sa/109.xml
new file mode 100755 (executable)
index 0000000..33fa38e
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a=""></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/110.xml b/basis/xml/tests/xmltest/valid/sa/110.xml
new file mode 100755 (executable)
index 0000000..0c61c65
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "&#13;&#10;">\r
+<!ATTLIST doc a CDATA #IMPLIED>\r
+]>\r
+<doc a="x&e;y"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/111.xml b/basis/xml/tests/xmltest/valid/sa/111.xml
new file mode 100755 (executable)
index 0000000..cb56f26
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST doc a NMTOKENS #IMPLIED>\r
+]>\r
+<doc a="&#32;x&#32;&#32;y&#32;"></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/112.xml b/basis/xml/tests/xmltest/valid/sa/112.xml
new file mode 100755 (executable)
index 0000000..27b6a4c
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (a | b)>\r
+<!ELEMENT a (#PCDATA)>\r
+]>\r
+<doc><a></a></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/113.xml b/basis/xml/tests/xmltest/valid/sa/113.xml
new file mode 100755 (executable)
index 0000000..d2edd0f
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ATTLIST e a CDATA #IMPLIED>\r
+]>\r
+<doc></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/114.xml b/basis/xml/tests/xmltest/valid/sa/114.xml
new file mode 100755 (executable)
index 0000000..52e2070
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e "<![CDATA[&foo;]]>">\r
+]>\r
+<doc>&e;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/115.xml b/basis/xml/tests/xmltest/valid/sa/115.xml
new file mode 100755 (executable)
index 0000000..d939a67
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY e1 "&e2;">\r
+<!ENTITY e2 "v">\r
+]>\r
+<doc>&e1;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/116.xml b/basis/xml/tests/xmltest/valid/sa/116.xml
new file mode 100755 (executable)
index 0000000..55ab496
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+]>\r
+<doc><![CDATA[\r
+]]></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/117.xml b/basis/xml/tests/xmltest/valid/sa/117.xml
new file mode 100755 (executable)
index 0000000..e4f02b1
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY rsqb "]">\r
+]>\r
+<doc>&rsqb;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/118.xml b/basis/xml/tests/xmltest/valid/sa/118.xml
new file mode 100755 (executable)
index 0000000..fba6c44
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc (#PCDATA)>\r
+<!ENTITY rsqb "]]">\r
+]>\r
+<doc>&rsqb;</doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/119.xml b/basis/xml/tests/xmltest/valid/sa/119.xml
new file mode 100755 (executable)
index 0000000..876e747
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [\r
+<!ELEMENT doc ANY>\r
+]>\r
+<doc><!-- -á --></doc>\r
diff --git a/basis/xml/tests/xmltest/valid/sa/out/001.xml b/basis/xml/tests/xmltest/valid/sa/out/001.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/002.xml b/basis/xml/tests/xmltest/valid/sa/out/002.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/003.xml b/basis/xml/tests/xmltest/valid/sa/out/003.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/004.xml b/basis/xml/tests/xmltest/valid/sa/out/004.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/005.xml b/basis/xml/tests/xmltest/valid/sa/out/005.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/006.xml b/basis/xml/tests/xmltest/valid/sa/out/006.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/007.xml b/basis/xml/tests/xmltest/valid/sa/out/007.xml
new file mode 100755 (executable)
index 0000000..97cf3e3
--- /dev/null
@@ -0,0 +1 @@
+<doc> </doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/008.xml b/basis/xml/tests/xmltest/valid/sa/out/008.xml
new file mode 100755 (executable)
index 0000000..3ea232c
--- /dev/null
@@ -0,0 +1 @@
+<doc>&amp;&lt;&gt;&quot;'</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/009.xml b/basis/xml/tests/xmltest/valid/sa/out/009.xml
new file mode 100755 (executable)
index 0000000..97cf3e3
--- /dev/null
@@ -0,0 +1 @@
+<doc> </doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/010.xml b/basis/xml/tests/xmltest/valid/sa/out/010.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/011.xml b/basis/xml/tests/xmltest/valid/sa/out/011.xml
new file mode 100755 (executable)
index 0000000..7293fb6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1" a2="v2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/012.xml b/basis/xml/tests/xmltest/valid/sa/out/012.xml
new file mode 100755 (executable)
index 0000000..5a0c983
--- /dev/null
@@ -0,0 +1 @@
+<doc :="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/013.xml b/basis/xml/tests/xmltest/valid/sa/out/013.xml
new file mode 100755 (executable)
index 0000000..c9c7ec5
--- /dev/null
@@ -0,0 +1 @@
+<doc _.-0123456789="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/014.xml b/basis/xml/tests/xmltest/valid/sa/out/014.xml
new file mode 100755 (executable)
index 0000000..ac6b28f
--- /dev/null
@@ -0,0 +1 @@
+<doc abcdefghijklmnopqrstuvwxyz="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/015.xml b/basis/xml/tests/xmltest/valid/sa/out/015.xml
new file mode 100755 (executable)
index 0000000..8e216eb
--- /dev/null
@@ -0,0 +1 @@
+<doc ABCDEFGHIJKLMNOPQRSTUVWXYZ="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/016.xml b/basis/xml/tests/xmltest/valid/sa/out/016.xml
new file mode 100755 (executable)
index 0000000..4fc7692
--- /dev/null
@@ -0,0 +1 @@
+<doc><?pi ?></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/017.xml b/basis/xml/tests/xmltest/valid/sa/out/017.xml
new file mode 100755 (executable)
index 0000000..3b9a2f8
--- /dev/null
@@ -0,0 +1 @@
+<doc><?pi some data ? > <??></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/018.xml b/basis/xml/tests/xmltest/valid/sa/out/018.xml
new file mode 100755 (executable)
index 0000000..a547101
--- /dev/null
@@ -0,0 +1 @@
+<doc>&lt;foo&gt;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/019.xml b/basis/xml/tests/xmltest/valid/sa/out/019.xml
new file mode 100755 (executable)
index 0000000..05d4e2f
--- /dev/null
@@ -0,0 +1 @@
+<doc>&lt;&amp;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/020.xml b/basis/xml/tests/xmltest/valid/sa/out/020.xml
new file mode 100755 (executable)
index 0000000..95ae08a
--- /dev/null
@@ -0,0 +1 @@
+<doc>&lt;&amp;]&gt;]</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/021.xml b/basis/xml/tests/xmltest/valid/sa/out/021.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/022.xml b/basis/xml/tests/xmltest/valid/sa/out/022.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/023.xml b/basis/xml/tests/xmltest/valid/sa/out/023.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/024.xml b/basis/xml/tests/xmltest/valid/sa/out/024.xml
new file mode 100755 (executable)
index 0000000..a9aa207
--- /dev/null
@@ -0,0 +1 @@
+<doc><foo></foo></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/025.xml b/basis/xml/tests/xmltest/valid/sa/out/025.xml
new file mode 100755 (executable)
index 0000000..de0f566
--- /dev/null
@@ -0,0 +1 @@
+<doc><foo></foo><foo></foo></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/026.xml b/basis/xml/tests/xmltest/valid/sa/out/026.xml
new file mode 100755 (executable)
index 0000000..de0f566
--- /dev/null
@@ -0,0 +1 @@
+<doc><foo></foo><foo></foo></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/027.xml b/basis/xml/tests/xmltest/valid/sa/out/027.xml
new file mode 100755 (executable)
index 0000000..de0f566
--- /dev/null
@@ -0,0 +1 @@
+<doc><foo></foo><foo></foo></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/028.xml b/basis/xml/tests/xmltest/valid/sa/out/028.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/029.xml b/basis/xml/tests/xmltest/valid/sa/out/029.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/030.xml b/basis/xml/tests/xmltest/valid/sa/out/030.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/031.xml b/basis/xml/tests/xmltest/valid/sa/out/031.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/032.xml b/basis/xml/tests/xmltest/valid/sa/out/032.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/033.xml b/basis/xml/tests/xmltest/valid/sa/out/033.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/034.xml b/basis/xml/tests/xmltest/valid/sa/out/034.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/035.xml b/basis/xml/tests/xmltest/valid/sa/out/035.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/036.xml b/basis/xml/tests/xmltest/valid/sa/out/036.xml
new file mode 100755 (executable)
index 0000000..2bcfb06
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc><?pi data?>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/037.xml b/basis/xml/tests/xmltest/valid/sa/out/037.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/038.xml b/basis/xml/tests/xmltest/valid/sa/out/038.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/039.xml b/basis/xml/tests/xmltest/valid/sa/out/039.xml
new file mode 100755 (executable)
index 0000000..82d117d
--- /dev/null
@@ -0,0 +1 @@
+<?pi data?><doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/040.xml b/basis/xml/tests/xmltest/valid/sa/out/040.xml
new file mode 100755 (executable)
index 0000000..d79cfe1
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="&quot;&lt;&amp;&gt;'"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/041.xml b/basis/xml/tests/xmltest/valid/sa/out/041.xml
new file mode 100755 (executable)
index 0000000..6f2cd58
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="A"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/042.xml b/basis/xml/tests/xmltest/valid/sa/out/042.xml
new file mode 100755 (executable)
index 0000000..f683039
--- /dev/null
@@ -0,0 +1 @@
+<doc>A</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/043.xml b/basis/xml/tests/xmltest/valid/sa/out/043.xml
new file mode 100755 (executable)
index 0000000..e162b76
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="foo bar"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/044.xml b/basis/xml/tests/xmltest/valid/sa/out/044.xml
new file mode 100755 (executable)
index 0000000..78028b7
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#10;<e a1="v1" a2="v2" a3="v3"></e>&#10;<e a1="w1" a2="v2"></e>&#10;<e a1="v1" a2="w2" a3="v3"></e>&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/045.xml b/basis/xml/tests/xmltest/valid/sa/out/045.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/046.xml b/basis/xml/tests/xmltest/valid/sa/out/046.xml
new file mode 100755 (executable)
index 0000000..7293fb6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1" a2="v2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/047.xml b/basis/xml/tests/xmltest/valid/sa/out/047.xml
new file mode 100755 (executable)
index 0000000..b327ebd
--- /dev/null
@@ -0,0 +1 @@
+<doc>X&#10;Y</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/048.xml b/basis/xml/tests/xmltest/valid/sa/out/048.xml
new file mode 100755 (executable)
index 0000000..ced7d02
--- /dev/null
@@ -0,0 +1 @@
+<doc>]</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/049.xml b/basis/xml/tests/xmltest/valid/sa/out/049.xml
new file mode 100755 (executable)
index 0000000..7cc53f9
--- /dev/null
@@ -0,0 +1 @@
+<doc>£</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/050.xml b/basis/xml/tests/xmltest/valid/sa/out/050.xml
new file mode 100755 (executable)
index 0000000..33703c7
--- /dev/null
@@ -0,0 +1 @@
+<doc>เจมส์</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/051.xml b/basis/xml/tests/xmltest/valid/sa/out/051.xml
new file mode 100755 (executable)
index 0000000..cfeb5a5
--- /dev/null
@@ -0,0 +1 @@
+<เจมส์></เจมส์>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/052.xml b/basis/xml/tests/xmltest/valid/sa/out/052.xml
new file mode 100755 (executable)
index 0000000..f5a0484
--- /dev/null
@@ -0,0 +1 @@
+<doc>ð€€ô¿½</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/053.xml b/basis/xml/tests/xmltest/valid/sa/out/053.xml
new file mode 100755 (executable)
index 0000000..c408384
--- /dev/null
@@ -0,0 +1 @@
+<doc><e></e></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/054.xml b/basis/xml/tests/xmltest/valid/sa/out/054.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/055.xml b/basis/xml/tests/xmltest/valid/sa/out/055.xml
new file mode 100755 (executable)
index 0000000..82d117d
--- /dev/null
@@ -0,0 +1 @@
+<?pi data?><doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/056.xml b/basis/xml/tests/xmltest/valid/sa/out/056.xml
new file mode 100755 (executable)
index 0000000..f683039
--- /dev/null
@@ -0,0 +1 @@
+<doc>A</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/057.xml b/basis/xml/tests/xmltest/valid/sa/out/057.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/058.xml b/basis/xml/tests/xmltest/valid/sa/out/058.xml
new file mode 100755 (executable)
index 0000000..f898cc8
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="1 2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/059.xml b/basis/xml/tests/xmltest/valid/sa/out/059.xml
new file mode 100755 (executable)
index 0000000..78028b7
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#10;<e a1="v1" a2="v2" a3="v3"></e>&#10;<e a1="w1" a2="v2"></e>&#10;<e a1="v1" a2="w2" a3="v3"></e>&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/060.xml b/basis/xml/tests/xmltest/valid/sa/out/060.xml
new file mode 100755 (executable)
index 0000000..b327ebd
--- /dev/null
@@ -0,0 +1 @@
+<doc>X&#10;Y</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/061.xml b/basis/xml/tests/xmltest/valid/sa/out/061.xml
new file mode 100755 (executable)
index 0000000..7cc53f9
--- /dev/null
@@ -0,0 +1 @@
+<doc>£</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/062.xml b/basis/xml/tests/xmltest/valid/sa/out/062.xml
new file mode 100755 (executable)
index 0000000..33703c7
--- /dev/null
@@ -0,0 +1 @@
+<doc>เจมส์</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/063.xml b/basis/xml/tests/xmltest/valid/sa/out/063.xml
new file mode 100755 (executable)
index 0000000..cfeb5a5
--- /dev/null
@@ -0,0 +1 @@
+<เจมส์></เจมส์>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/064.xml b/basis/xml/tests/xmltest/valid/sa/out/064.xml
new file mode 100755 (executable)
index 0000000..f5a0484
--- /dev/null
@@ -0,0 +1 @@
+<doc>ð€€ô¿½</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/065.xml b/basis/xml/tests/xmltest/valid/sa/out/065.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/066.xml b/basis/xml/tests/xmltest/valid/sa/out/066.xml
new file mode 100755 (executable)
index 0000000..7597d31
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="&quot;"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/067.xml b/basis/xml/tests/xmltest/valid/sa/out/067.xml
new file mode 100755 (executable)
index 0000000..4bbdad4
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#13;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/068.xml b/basis/xml/tests/xmltest/valid/sa/out/068.xml
new file mode 100755 (executable)
index 0000000..4bbdad4
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#13;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/069.xml b/basis/xml/tests/xmltest/valid/sa/out/069.xml
new file mode 100755 (executable)
index 0000000..41eed46
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!NOTATION n PUBLIC 'whatever'>
+]>
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/070.xml b/basis/xml/tests/xmltest/valid/sa/out/070.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/071.xml b/basis/xml/tests/xmltest/valid/sa/out/071.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/072.xml b/basis/xml/tests/xmltest/valid/sa/out/072.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/073.xml b/basis/xml/tests/xmltest/valid/sa/out/073.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/074.xml b/basis/xml/tests/xmltest/valid/sa/out/074.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/075.xml b/basis/xml/tests/xmltest/valid/sa/out/075.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/076.xml b/basis/xml/tests/xmltest/valid/sa/out/076.xml
new file mode 100755 (executable)
index 0000000..b07019e
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE doc [
+<!NOTATION n1 SYSTEM 'http://www.w3.org/'>
+<!NOTATION n2 SYSTEM 'http://www.w3.org/'>
+]>
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/077.xml b/basis/xml/tests/xmltest/valid/sa/out/077.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/078.xml b/basis/xml/tests/xmltest/valid/sa/out/078.xml
new file mode 100755 (executable)
index 0000000..fcab0cd
--- /dev/null
@@ -0,0 +1 @@
+<doc a="v"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/079.xml b/basis/xml/tests/xmltest/valid/sa/out/079.xml
new file mode 100755 (executable)
index 0000000..fcab0cd
--- /dev/null
@@ -0,0 +1 @@
+<doc a="v"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/080.xml b/basis/xml/tests/xmltest/valid/sa/out/080.xml
new file mode 100755 (executable)
index 0000000..fcab0cd
--- /dev/null
@@ -0,0 +1 @@
+<doc a="v"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/081.xml b/basis/xml/tests/xmltest/valid/sa/out/081.xml
new file mode 100755 (executable)
index 0000000..e356e7e
--- /dev/null
@@ -0,0 +1 @@
+<doc><a></a><b></b><c><a></a></c></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/082.xml b/basis/xml/tests/xmltest/valid/sa/out/082.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/083.xml b/basis/xml/tests/xmltest/valid/sa/out/083.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/084.xml b/basis/xml/tests/xmltest/valid/sa/out/084.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/085.xml b/basis/xml/tests/xmltest/valid/sa/out/085.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/086.xml b/basis/xml/tests/xmltest/valid/sa/out/086.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/087.xml b/basis/xml/tests/xmltest/valid/sa/out/087.xml
new file mode 100755 (executable)
index 0000000..a9aa207
--- /dev/null
@@ -0,0 +1 @@
+<doc><foo></foo></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/088.xml b/basis/xml/tests/xmltest/valid/sa/out/088.xml
new file mode 100755 (executable)
index 0000000..a547101
--- /dev/null
@@ -0,0 +1 @@
+<doc>&lt;foo&gt;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/089.xml b/basis/xml/tests/xmltest/valid/sa/out/089.xml
new file mode 100755 (executable)
index 0000000..e01d86e
--- /dev/null
@@ -0,0 +1 @@
+<doc>ð€€ô¿½ô¿¿</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/090.xml b/basis/xml/tests/xmltest/valid/sa/out/090.xml
new file mode 100755 (executable)
index 0000000..41eed46
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!NOTATION n PUBLIC 'whatever'>
+]>
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/091.xml b/basis/xml/tests/xmltest/valid/sa/out/091.xml
new file mode 100755 (executable)
index 0000000..c55a698
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+<!NOTATION n SYSTEM 'http://www.w3.org/'>
+]>
+<doc a="e"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/092.xml b/basis/xml/tests/xmltest/valid/sa/out/092.xml
new file mode 100755 (executable)
index 0000000..87269f7
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#10;<a></a>&#10;    <a></a>&#9;<a></a>&#10;&#10;&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/093.xml b/basis/xml/tests/xmltest/valid/sa/out/093.xml
new file mode 100755 (executable)
index 0000000..631bfde
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#10;&#10;&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/094.xml b/basis/xml/tests/xmltest/valid/sa/out/094.xml
new file mode 100755 (executable)
index 0000000..636ab47
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="%e;"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/095.xml b/basis/xml/tests/xmltest/valid/sa/out/095.xml
new file mode 100755 (executable)
index 0000000..a20706e
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="1  2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/096.xml b/basis/xml/tests/xmltest/valid/sa/out/096.xml
new file mode 100755 (executable)
index 0000000..f898cc8
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="1 2"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/097.xml b/basis/xml/tests/xmltest/valid/sa/out/097.xml
new file mode 100755 (executable)
index 0000000..e05cfe6
--- /dev/null
@@ -0,0 +1 @@
+<doc a1="v1"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/098.xml b/basis/xml/tests/xmltest/valid/sa/out/098.xml
new file mode 100755 (executable)
index 0000000..f6408de
--- /dev/null
@@ -0,0 +1,2 @@
+<doc><?pi x
+y?></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/099.xml b/basis/xml/tests/xmltest/valid/sa/out/099.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/100.xml b/basis/xml/tests/xmltest/valid/sa/out/100.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/101.xml b/basis/xml/tests/xmltest/valid/sa/out/101.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/102.xml b/basis/xml/tests/xmltest/valid/sa/out/102.xml
new file mode 100755 (executable)
index 0000000..6e66b8d
--- /dev/null
@@ -0,0 +1 @@
+<doc a="&quot;"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/103.xml b/basis/xml/tests/xmltest/valid/sa/out/103.xml
new file mode 100755 (executable)
index 0000000..96495d4
--- /dev/null
@@ -0,0 +1 @@
+<doc>&lt;doc&gt;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/104.xml b/basis/xml/tests/xmltest/valid/sa/out/104.xml
new file mode 100755 (executable)
index 0000000..cc3def3
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/105.xml b/basis/xml/tests/xmltest/valid/sa/out/105.xml
new file mode 100755 (executable)
index 0000000..5aed3d6
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x&#9;y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/106.xml b/basis/xml/tests/xmltest/valid/sa/out/106.xml
new file mode 100755 (executable)
index 0000000..1197d2f
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x&#10;y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/107.xml b/basis/xml/tests/xmltest/valid/sa/out/107.xml
new file mode 100755 (executable)
index 0000000..288f23c
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x&#13;y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/108.xml b/basis/xml/tests/xmltest/valid/sa/out/108.xml
new file mode 100755 (executable)
index 0000000..cc3def3
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/109.xml b/basis/xml/tests/xmltest/valid/sa/out/109.xml
new file mode 100755 (executable)
index 0000000..c43bdf9
--- /dev/null
@@ -0,0 +1 @@
+<doc a=""></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/110.xml b/basis/xml/tests/xmltest/valid/sa/out/110.xml
new file mode 100755 (executable)
index 0000000..a92237b
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x  y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/111.xml b/basis/xml/tests/xmltest/valid/sa/out/111.xml
new file mode 100755 (executable)
index 0000000..cc3def3
--- /dev/null
@@ -0,0 +1 @@
+<doc a="x y"></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/112.xml b/basis/xml/tests/xmltest/valid/sa/out/112.xml
new file mode 100755 (executable)
index 0000000..c82f47b
--- /dev/null
@@ -0,0 +1 @@
+<doc><a></a></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/113.xml b/basis/xml/tests/xmltest/valid/sa/out/113.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/114.xml b/basis/xml/tests/xmltest/valid/sa/out/114.xml
new file mode 100755 (executable)
index 0000000..8e0722a
--- /dev/null
@@ -0,0 +1 @@
+<doc>&amp;foo;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/115.xml b/basis/xml/tests/xmltest/valid/sa/out/115.xml
new file mode 100755 (executable)
index 0000000..682b814
--- /dev/null
@@ -0,0 +1 @@
+<doc>v</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/116.xml b/basis/xml/tests/xmltest/valid/sa/out/116.xml
new file mode 100755 (executable)
index 0000000..a79dff6
--- /dev/null
@@ -0,0 +1 @@
+<doc>&#10;</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/117.xml b/basis/xml/tests/xmltest/valid/sa/out/117.xml
new file mode 100755 (executable)
index 0000000..ced7d02
--- /dev/null
@@ -0,0 +1 @@
+<doc>]</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/118.xml b/basis/xml/tests/xmltest/valid/sa/out/118.xml
new file mode 100755 (executable)
index 0000000..31e37a9
--- /dev/null
@@ -0,0 +1 @@
+<doc>]]</doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/valid/sa/out/119.xml b/basis/xml/tests/xmltest/valid/sa/out/119.xml
new file mode 100755 (executable)
index 0000000..7e8f183
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
\ No newline at end of file
diff --git a/basis/xml/tests/xmltest/xmltest.xml b/basis/xml/tests/xmltest/xmltest.xml
new file mode 100755 (executable)
index 0000000..733523b
--- /dev/null
@@ -0,0 +1,1435 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    @(#)xmltest.xml    1.12 99/02/12
+    Copyright 1998-1999 by Sun Microsystems, Inc.
+    All Rights Reserved.
+-->
+
+<TESTCASES PROFILE="James Clark XMLTEST cases, 18-Nov-1998">
+
+<!-- Start:  not-wf/sa -->
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-001"
+       URI="not-wf/sa/001.xml" SECTIONS="3.1 [41]">
+    Attribute values must start with attribute names, not "?". </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-002"
+       URI="not-wf/sa/002.xml" SECTIONS="2.3 [4]">
+    Names may not start with "."; it's not a Letter. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-003"
+       URI="not-wf/sa/003.xml" SECTIONS="2.6 [16]">
+    Processing Instruction target name is required.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-004"
+       URI="not-wf/sa/004.xml" SECTIONS="2.6 [16]">
+    SGML-ism:  processing instructions end in '?&gt;' not '&gt;'. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-005"
+       URI="not-wf/sa/005.xml" SECTIONS="2.6 [16]">
+    Processing instructions end in '?&gt;' not '?'. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-006"
+       URI="not-wf/sa/006.xml" SECTIONS="2.5 [16]">
+    XML comments may not contain "--" </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-007"
+       URI="not-wf/sa/007.xml" SECTIONS="4.1 [68]">
+    General entity references have no whitespace after the
+    entity name and before the semicolon. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-008"
+       URI="not-wf/sa/008.xml" SECTIONS="2.3 [5]">
+    Entity references must include names, which don't begin
+    with '.' (it's not a Letter or other name start character). </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-009"
+       URI="not-wf/sa/009.xml" SECTIONS="4.1 [66]">
+    Character references may have only decimal or numeric strings.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-010"
+       URI="not-wf/sa/010.xml" SECTIONS="4.1 [68]">
+    Ampersand may only appear as part of a general entity reference.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-011"
+       URI="not-wf/sa/011.xml" SECTIONS="3.1 [41]">
+    SGML-ism:  attribute values must be explicitly assigned a
+    value, it can't act as a boolean toggle. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-012"
+       URI="not-wf/sa/012.xml" SECTIONS="2.3 [10]">
+    SGML-ism:  attribute values must be quoted in all cases. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-013"
+       URI="not-wf/sa/013.xml" SECTIONS="2.3 [10]">
+    The quotes on both ends of an attribute value must match. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-014"
+       URI="not-wf/sa/014.xml" SECTIONS="2.3 [10]">
+    Attribute values may not contain literal '&lt;' characters. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-015"
+       URI="not-wf/sa/015.xml" SECTIONS="3.1 [41]">
+    Attribute values need a value, not just an equals sign. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-016"
+       URI="not-wf/sa/016.xml" SECTIONS="3.1 [41]">
+    Attribute values need an associated name.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-017"
+       URI="not-wf/sa/017.xml" SECTIONS="2.7 [18]">
+    CDATA sections need a terminating ']]&gt;'. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-018"
+       URI="not-wf/sa/018.xml" SECTIONS="2.7 [19]">
+    CDATA sections begin with a literal '&lt;![CDATA[', no space.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-019"
+       URI="not-wf/sa/019.xml" SECTIONS="3.1 [42]">
+    End tags may not be abbreviated as '&lt;/&gt;'.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-020"
+       URI="not-wf/sa/020.xml" SECTIONS="2.3 [10]">
+    Attribute values may not contain literal '&amp;'
+    characters except as part of an entity reference. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-021"
+       URI="not-wf/sa/021.xml" SECTIONS="2.3 [10]">
+    Attribute values may not contain literal '&amp;'
+    characters except as part of an entity reference. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-022"
+       URI="not-wf/sa/022.xml" SECTIONS="4.1 [66]">
+    Character references end with semicolons, always!</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-023"
+       URI="not-wf/sa/023.xml" SECTIONS="2.3 [5]">
+    Digits are not valid name start characters. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-024"
+       URI="not-wf/sa/024.xml" SECTIONS="2.3 [5]">
+    Digits are not valid name start characters. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-025"
+       URI="not-wf/sa/025.xml" SECTIONS="2.4 [14]">
+    Text may not contain a literal ']]&gt;' sequence. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-026"
+       URI="not-wf/sa/026.xml" SECTIONS="2.4 [14]">
+    Text may not contain a literal ']]&gt;' sequence. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-027"
+       URI="not-wf/sa/027.xml" SECTIONS="2.5 [15]">
+    Comments must be terminated with "--&gt;".</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-028"
+       URI="not-wf/sa/028.xml" SECTIONS="2.6 [16]">
+    Processing instructions must end with '?&gt;'. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-029"
+       URI="not-wf/sa/029.xml" SECTIONS="2.4 [14]">
+    Text may not contain a literal ']]&gt;' sequence. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-030"
+       URI="not-wf/sa/030.xml" SECTIONS="2.2 [2]">
+    A form feed is not a legal XML character. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-031"
+       URI="not-wf/sa/031.xml" SECTIONS="2.2 [2]">
+    A form feed is not a legal XML character. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-032"
+       URI="not-wf/sa/032.xml" SECTIONS="2.2 [2]">
+    A form feed is not a legal XML character. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-033"
+       URI="not-wf/sa/033.xml" SECTIONS="2.2 [2]">
+    An ESC (octal 033) is not a legal XML character. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-034"
+       URI="not-wf/sa/034.xml" SECTIONS="2.2 [2]">
+    A form feed is not a legal XML character. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-035"
+       URI="not-wf/sa/035.xml" SECTIONS="3.1 [43]">
+    The '&lt;' character is a markup delimiter and must
+    start an element, CDATA section, PI, or comment. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-036"
+       URI="not-wf/sa/036.xml" SECTIONS="2.8 [27]">
+    Text may not appear after the root element. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-037"
+       URI="not-wf/sa/037.xml" SECTIONS="2.8 [27]">
+    Character references may not appear after the root element. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-038"
+       URI="not-wf/sa/038.xml" SECTIONS="3.1">
+    Tests the "Unique Att Spec" WF constraint by providing
+    multiple values for an attribute.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-039"
+       URI="not-wf/sa/039.xml" SECTIONS="3">
+    Tests the Element Type Match WFC - end tag name must
+    match start tag name.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-040"
+       URI="not-wf/sa/040.xml" SECTIONS="2.8 [27]">
+    Provides two document elements.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-041"
+       URI="not-wf/sa/041.xml" SECTIONS="2.8 [27]">
+    Provides two document elements.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-042"
+       URI="not-wf/sa/042.xml" SECTIONS="3.1 [42]">
+     Invalid End Tag </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-043"
+       URI="not-wf/sa/043.xml" SECTIONS="2.8 [27]">
+    Provides #PCDATA text after the document element. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-044"
+       URI="not-wf/sa/044.xml" SECTIONS="2.8 [27]">
+    Provides two document elements.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-045"
+       URI="not-wf/sa/045.xml" SECTIONS="3.1 [44]">
+    Invalid Empty Element Tag </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-046"
+       URI="not-wf/sa/046.xml" SECTIONS="3.1 [40]">
+    This start (or empty element) tag was not terminated correctly. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-047"
+       URI="not-wf/sa/047.xml" SECTIONS="3.1 [44]">
+    Invalid empty element tag invalid whitespace </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-048"
+       URI="not-wf/sa/048.xml" SECTIONS="2.8 [27]">
+    Provides a CDATA section after the root element.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-049"
+       URI="not-wf/sa/049.xml" SECTIONS="3.1 [40]">
+    Missing start tag </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-050"
+       URI="not-wf/sa/050.xml" SECTIONS="2.1 [1]">
+    Empty document, with no root element. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-051"
+       URI="not-wf/sa/051.xml" SECTIONS="2.7 [18]">
+     CDATA is invalid at top level of document.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-052"
+       URI="not-wf/sa/052.xml" SECTIONS="4.1 [66]">
+    Invalid character reference. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-053"
+       URI="not-wf/sa/053.xml" SECTIONS="3.1 [42]">
+    End tag does not match start tag. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-054"
+       URI="not-wf/sa/054.xml" SECTIONS="4.2.2 [75]">
+     PUBLIC requires two literals.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-055"
+       URI="not-wf/sa/055.xml" SECTIONS="2.8 [28]">
+    Invalid Document Type Definition format. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-056"
+       URI="not-wf/sa/056.xml" SECTIONS="2.8 [28]">
+    Invalid Document Type Definition format - misplaced comment. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-057"
+       URI="not-wf/sa/057.xml" SECTIONS="3.2 [45]">
+    This isn't SGML; comments can't exist in declarations. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-058"
+       URI="not-wf/sa/058.xml" SECTIONS="3.3.1 [54]">
+    Invalid character , in ATTLIST enumeration </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-059"
+       URI="not-wf/sa/059.xml" SECTIONS="3.3.1 [59]">
+    String literal must be in quotes. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-060"
+       URI="not-wf/sa/060.xml" SECTIONS="3.3.1 [56]">
+     Invalid type NAME defined in ATTLIST.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-061"
+       URI="not-wf/sa/061.xml" SECTIONS="4.2.2 [75]">
+    External entity declarations require whitespace between public
+    and system IDs.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-062"
+       URI="not-wf/sa/062.xml" SECTIONS="4.2 [71]">
+    Entity declarations need space after the entity name. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-063"
+       URI="not-wf/sa/063.xml" SECTIONS="2.8 [29]">
+    Conditional sections may only appear in the external
+    DTD subset. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-064"
+       URI="not-wf/sa/064.xml" SECTIONS="3.3 [53]">
+    Space is required between attribute type and default values
+    in &lt;!ATTLIST...&gt; declarations. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-065"
+       URI="not-wf/sa/065.xml" SECTIONS="3.3 [53]">
+    Space is required between attribute name and type
+    in &lt;!ATTLIST...&gt; declarations. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-066"
+       URI="not-wf/sa/066.xml" SECTIONS="3.3 [52]">
+    Required whitespace is missing. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-067"
+       URI="not-wf/sa/067.xml" SECTIONS="3.3 [53]">
+    Space is required between attribute type and default values
+    in &lt;!ATTLIST...&gt; declarations. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-068"
+       URI="not-wf/sa/068.xml" SECTIONS="3.3.1 [58]">
+    Space is required between NOTATION keyword and list of
+    enumerated choices in &lt;!ATTLIST...&gt; declarations. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-069"
+       URI="not-wf/sa/069.xml" SECTIONS="4.2.2 [76]">
+    Space is required before an NDATA entity annotation.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-070"
+       URI="not-wf/sa/070.xml" SECTIONS="2.5 [16]">
+    XML comments may not contain "--" </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-071"
+       URI="not-wf/sa/071.xml" SECTIONS="4.1 [68]">
+     ENTITY can't reference itself directly or indirectly.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-072"
+       URI="not-wf/sa/072.xml" SECTIONS="4.1 [68]">
+    Undefined ENTITY foo. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-073"
+       URI="not-wf/sa/073.xml" SECTIONS="4.1 [68]">
+    Undefined ENTITY f. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-074"
+       URI="not-wf/sa/074.xml" SECTIONS="4.3.2">
+    Internal general parsed entities are only well formed if
+    they match the "content" production. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-075"
+       URI="not-wf/sa/075.xml" SECTIONS="4.1 [68]">
+    ENTITY can't reference itself directly or indirectly. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-076"
+       URI="not-wf/sa/076.xml" SECTIONS="4.1 [68]">
+    Undefined ENTITY foo. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-077"
+       URI="not-wf/sa/077.xml" SECTIONS="41. [68]">
+    Undefined ENTITY bar. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-078"
+       URI="not-wf/sa/078.xml" SECTIONS="4.1 [68]">
+    Undefined ENTITY foo. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-079"
+       URI="not-wf/sa/079.xml" SECTIONS="4.1 [68]">
+    ENTITY can't reference itself directly or indirectly. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-080"
+       URI="not-wf/sa/080.xml" SECTIONS="4.1 [68]">
+    ENTITY can't reference itself directly or indirectly. </TEST>
+<TEST TYPE="not-wf" ENTITIES="general" ID="not-wf-sa-081"
+       URI="not-wf/sa/081.xml" SECTIONS="3.1">
+    This tests the <EM>No External Entity References</EM> WFC,
+    since the entity is referred to within an attribute.  </TEST>
+<TEST TYPE="not-wf" ENTITIES="general" ID="not-wf-sa-082"
+       URI="not-wf/sa/082.xml" SECTIONS="3.1">
+    This tests the <EM>No External Entity References</EM> WFC,
+    since the entity is referred to within an attribute.  </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-083"
+       URI="not-wf/sa/083.xml" SECTIONS="4.2.2 [76]">
+    Undefined NOTATION n. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-084"
+       URI="not-wf/sa/084.xml" SECTIONS="4.1">
+    Tests the <EM>Parsed Entity</EM> WFC by referring to an
+    unparsed entity.  (This precedes the error of not declaring
+    that entity's notation, which may be detected any time before
+    the DTD parsing is completed.) </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-085"
+       URI="not-wf/sa/085.xml" SECTIONS="2.3 [13]">
+    Public IDs may not contain "[". </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-086"
+       URI="not-wf/sa/086.xml" SECTIONS="2.3 [13]">
+    Public IDs may not contain "[". </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-087"
+       URI="not-wf/sa/087.xml" SECTIONS="2.3 [13]">
+    Public IDs may not contain "[". </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-088"
+       URI="not-wf/sa/088.xml" SECTIONS="2.3 [10]">
+    Attribute values are terminated by literal quote characters,
+    and any entity expansion is done afterwards. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-089"
+       URI="not-wf/sa/089.xml" SECTIONS="4.2 [74]">
+    Parameter entities "are" always parsed; NDATA annotations
+    are not permitted.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-090"
+       URI="not-wf/sa/090.xml" SECTIONS="2.3 [10]">
+    Attributes may not contain a literal "&lt;" character;
+    this one has one because of reference expansion. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-091"
+       URI="not-wf/sa/091.xml" SECTIONS="4.2 [74]">
+    Parameter entities "are" always parsed; NDATA annotations
+    are not permitted.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-092"
+       URI="not-wf/sa/092.xml" SECTIONS="4.5">
+    The replacement text of this entity has an illegal reference,
+    because the character reference is expanded immediately. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-093"
+       URI="not-wf/sa/093.xml" SECTIONS="4.1 [66]">
+    Hexadecimal character references may not use the uppercase 'X'.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-094"
+       URI="not-wf/sa/094.xml" SECTIONS="2.8 [24]">
+    Prolog VERSION must be lowercase. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-095"
+       URI="not-wf/sa/095.xml" SECTIONS="2.8 [23]">
+    VersionInfo must come before EncodingDecl. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-096"
+       URI="not-wf/sa/096.xml" SECTIONS="2.9 [32]">
+    Space is required before the standalone declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-097"
+       URI="not-wf/sa/097.xml" SECTIONS="2.8 [24]">
+    Both quotes surrounding VersionNum must be the same. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-098"
+       URI="not-wf/sa/098.xml" SECTIONS="2.8 [23]">
+    Only one "version=..." string may appear in an XML declaration.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-099"
+       URI="not-wf/sa/099.xml" SECTIONS="2.8 [23]">
+    Only three pseudo-attributes are in the XML declaration,
+    and "valid=..." is not one of them. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-100"
+       URI="not-wf/sa/100.xml" SECTIONS="2.9 [32]">
+    Only "yes" and "no" are permitted as values of "standalone". </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-101"
+       URI="not-wf/sa/101.xml" SECTIONS="4.3.3 [81]">
+    Space is not permitted in an encoding name. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-102"
+       URI="not-wf/sa/102.xml" SECTIONS="2.8 [26]">
+    Provides an illegal XML version number; spaces are illegal.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-103"
+       URI="not-wf/sa/103.xml" SECTIONS="4.3.2">
+    End-tag required for element foo. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-104"
+       URI="not-wf/sa/104.xml" SECTIONS="4.3.2">
+    Internal general parsed entities are only well formed if
+    they match the "content" production. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-105"
+       URI="not-wf/sa/105.xml" SECTIONS="2.7 ">
+    Invalid placement of CDATA section. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-106"
+       URI="not-wf/sa/106.xml" SECTIONS="4.2">
+    Invalid placement of entity declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-107"
+       URI="not-wf/sa/107.xml" SECTIONS="2.8 [28]">
+     Invalid document type declaration.  CDATA alone is invalid.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-108"
+       URI="not-wf/sa/108.xml" SECTIONS="2.7 [19]">
+    No space in '&lt;![CDATA['.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-109"
+       URI="not-wf/sa/109.xml" SECTIONS="4.2 [70]">
+    Tags invalid within EntityDecl. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-110"
+       URI="not-wf/sa/110.xml" SECTIONS="4.1 [68]">
+    Entity reference must be in content of element. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-111"
+       URI="not-wf/sa/111.xml" SECTIONS="3.1 [43]">
+    Entiry reference must be in content of element not Start-tag. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-112"
+       URI="not-wf/sa/112.xml" SECTIONS="2.7 [19]">
+    CDATA sections start '&lt;![CDATA[', not '&lt;!cdata['.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-113"
+       URI="not-wf/sa/113.xml" SECTIONS="2.3 [9]">
+    Parameter entity values must use valid reference syntax;
+    this reference is malformed.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-114"
+       URI="not-wf/sa/114.xml" SECTIONS="2.3 [9]">
+    General entity values must use valid reference syntax;
+    this reference is malformed.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-115"
+       URI="not-wf/sa/115.xml" SECTIONS="4.5">
+    The replacement text of this entity is an illegal character
+    reference, which must be rejected when it is parsed in the
+    context of an attribute value.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-116"
+       URI="not-wf/sa/116.xml" SECTIONS="4.3.2">
+    Internal general parsed entities are only well formed if
+    they match the "content" production.  This is a partial
+    character reference, not a full one. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-117"
+       URI="not-wf/sa/117.xml" SECTIONS="4.3.2">
+    Internal general parsed entities are only well formed if
+    they match the "content" production.  This is a partial
+    character reference, not a full one. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-118"
+       URI="not-wf/sa/118.xml" SECTIONS="4.1 [68]">
+    Entity reference expansion is not recursive.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-119"
+       URI="not-wf/sa/119.xml" SECTIONS="4.3.2">
+    Internal general parsed entities are only well formed if
+    they match the "content" production.  This is a partial
+    character reference, not a full one. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-120"
+       URI="not-wf/sa/120.xml" SECTIONS="4.5">
+    Character references are expanded in the replacement text of
+    an internal entity, which is then parsed as usual.  Accordingly,
+    &amp; must be doubly quoted - encoded either as <EM>&amp;amp;</EM>
+    or as <EM>&amp;#38;#38;</EM>. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-121"
+       URI="not-wf/sa/121.xml" SECTIONS="4.1 [68]">
+    A name of an ENTITY was started with an invalid character. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-122"
+       URI="not-wf/sa/122.xml" SECTIONS="3.2.1 [47]">
+    Invalid syntax mixed connectors are used. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-123"
+       URI="not-wf/sa/123.xml" SECTIONS="3.2.1 [48]">
+    Invalid syntax mismatched parenthesis. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-124"
+       URI="not-wf/sa/124.xml" SECTIONS="3.2.2 [51]">
+    Invalid format of Mixed-content declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-125"
+       URI="not-wf/sa/125.xml" SECTIONS="3.2.2 [51]">
+    Invalid syntax extra set of parenthesis not necessary. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-126"
+       URI="not-wf/sa/126.xml" SECTIONS="3.2.2 [51]">
+    Invalid syntax Mixed-content must be defined as zero or more. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-127"
+       URI="not-wf/sa/127.xml" SECTIONS="3.2.2 [51]">
+    Invalid syntax Mixed-content must be defined as zero or more. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-128"
+       URI="not-wf/sa/128.xml" SECTIONS="2.7 [18]">
+    Invalid CDATA syntax. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-129"
+       URI="not-wf/sa/129.xml" SECTIONS="3.2 [45]">
+    Invalid syntax for Element Type Declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-130"
+       URI="not-wf/sa/130.xml" SECTIONS="3.2 [45]">
+    Invalid syntax for Element Type Declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-131"
+       URI="not-wf/sa/131.xml" SECTIONS="3.2 [45]">
+    Invalid syntax for Element Type Declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-132"
+       URI="not-wf/sa/132.xml" SECTIONS="3.2.1 [50]">
+    Invalid syntax mixed connectors used. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-133"
+       URI="not-wf/sa/133.xml" SECTIONS="3.2.1">
+    Illegal whitespace before optional character causes syntax error. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-134"
+       URI="not-wf/sa/134.xml" SECTIONS="3.2.1">
+    Illegal whitespace before optional character causes syntax error. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-135"
+       URI="not-wf/sa/135.xml" SECTIONS="3.2.1 [47]">
+    Invalid character used as connector. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-136"
+       URI="not-wf/sa/136.xml" SECTIONS="3.2 [45]">
+    Tag omission is invalid in XML. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-137"
+       URI="not-wf/sa/137.xml" SECTIONS="3.2 [45]">
+    Space is required before a content model. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-138"
+       URI="not-wf/sa/138.xml" SECTIONS="3.2.1 [48]">
+    Invalid syntax for content particle.  </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-139"
+       URI="not-wf/sa/139.xml" SECTIONS="3.2.1 [46]">
+    The element-content model should not be empty. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-140"
+       URI="not-wf/sa/140.xml" SECTIONS="2.3 [4]"
+        EDITION="1 2 3 4">
+    Character '&amp;#x309a;' is a CombiningChar, not a
+    Letter, and so may not begin a name.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-141"
+       URI="not-wf/sa/141.xml" SECTIONS="2.3 [5]"
+        EDITION="1 2 3 4">
+    Character #x0E5C is not legal in XML names. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-142"
+       URI="not-wf/sa/142.xml" SECTIONS="2.2 [2]">
+    Character #x0000 is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-143"
+       URI="not-wf/sa/143.xml" SECTIONS="2.2 [2]">
+    Character #x001F is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-144"
+       URI="not-wf/sa/144.xml" SECTIONS="2.2 [2]">
+    Character #xFFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-145"
+       URI="not-wf/sa/145.xml" SECTIONS="2.2 [2]">
+    Character #xD800 is not legal anywhere in an XML document.  (If it
+    appeared in a UTF-16 surrogate pair, it'd represent half of a UCS-4
+    character and so wouldn't really be in the document.) </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-146"
+       URI="not-wf/sa/146.xml" SECTIONS="2.2 [2]">
+    Character references must also refer to legal XML characters;
+    #x00110000 is one more than the largest legal character.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-147"
+       URI="not-wf/sa/147.xml" SECTIONS="2.8 [22]">
+    XML Declaration may not be preceded by whitespace.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-148"
+       URI="not-wf/sa/148.xml" SECTIONS="2.8 [22]">
+    XML Declaration may not be preceded by comments or whitespace.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-149"
+       URI="not-wf/sa/149.xml" SECTIONS="2.8 [28]">
+    XML Declaration may not be within a DTD.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-150"
+       URI="not-wf/sa/150.xml" SECTIONS="3.1 [43]">
+    XML declarations may not be within element content. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-151"
+       URI="not-wf/sa/151.xml" SECTIONS="2.8 [27]">
+    XML declarations may not follow document content.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-152"
+       URI="not-wf/sa/152.xml" SECTIONS="2.8 [22]">
+    XML declarations must include the "version=..." string.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-153"
+       URI="not-wf/sa/153.xml" SECTIONS="4.3.2">
+    Text declarations may not begin internal parsed entities;
+    they may only appear at the beginning of external parsed
+    (parameter or general) entities. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-154"
+       URI="not-wf/sa/154.xml" SECTIONS="2.8 2.6 [23, 17]">
+    '&lt;?XML ...?&gt;' is neither an XML declaration
+    nor a legal processing instruction target name. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-155"
+       URI="not-wf/sa/155.xml" SECTIONS="2.8 2.6 [23, 17]">
+    '&lt;?xmL ...?&gt;' is neither an XML declaration
+    nor a legal processing instruction target name. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-156"
+       URI="not-wf/sa/156.xml" SECTIONS="2.8 2.6 [23, 17]">
+    '&lt;?xMl ...?&gt;' is neither an XML declaration
+    nor a legal processing instruction target name. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-157"
+       URI="not-wf/sa/157.xml" SECTIONS="2.6 [17]">
+    '&lt;?xmL ...?&gt;' is not a legal processing instruction
+    target name. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-158"
+       URI="not-wf/sa/158.xml" SECTIONS="3.3 [52]">
+    SGML-ism:  "#NOTATION gif" can't have attributes. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-159"
+       URI="not-wf/sa/159.xml" SECTIONS="2.3 [9]">
+    Uses '&amp;' unquoted in an entity declaration,
+    which is illegal syntax for an entity reference.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-160"
+       URI="not-wf/sa/160.xml" SECTIONS="2.8">
+    Violates the <EM>PEs in Internal Subset</EM> WFC
+    by using a PE reference within a declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-161"
+       URI="not-wf/sa/161.xml" SECTIONS="2.8">
+    Violates the <EM>PEs in Internal Subset</EM> WFC
+    by using a PE reference within a declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-162"
+       URI="not-wf/sa/162.xml" SECTIONS="2.8">
+    Violates the <EM>PEs in Internal Subset</EM> WFC
+    by using a PE reference within a declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-163"
+       URI="not-wf/sa/163.xml" SECTIONS="4.1 [69]">
+    Invalid placement of Parameter entity reference. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-164"
+       URI="not-wf/sa/164.xml" SECTIONS="4.1 [69]">
+    Invalid placement of Parameter entity reference. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-165"
+       URI="not-wf/sa/165.xml" SECTIONS="4.2 [72]">
+    Parameter entity declarations must have a space before
+    the '%'. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-166"
+       URI="not-wf/sa/166.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-167"
+       URI="not-wf/sa/167.xml" SECTIONS="2.2 [2]">
+    Character FFFE is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-168"
+       URI="not-wf/sa/168.xml" SECTIONS="2.2 [2]">
+    An unpaired surrogate (D800) is not legal anywhere
+    in an XML document.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-169"
+       URI="not-wf/sa/169.xml" SECTIONS="2.2 [2]">
+    An unpaired surrogate (DC00) is not legal anywhere
+    in an XML document.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-170"
+       URI="not-wf/sa/170.xml" SECTIONS="2.2 [2]">
+    Four byte UTF-8 encodings can encode UCS-4 characters
+    which are beyond the range of legal XML characters
+    (and can't be expressed in Unicode surrogate pairs).
+    This document holds such a character.  </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-171"
+       URI="not-wf/sa/171.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-172"
+       URI="not-wf/sa/172.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-173"
+       URI="not-wf/sa/173.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-174"
+       URI="not-wf/sa/174.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-175"
+       URI="not-wf/sa/175.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-176"
+       URI="not-wf/sa/176.xml" SECTIONS="3 [39]">
+    Start tags must have matching end tags.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-177"
+       URI="not-wf/sa/177.xml" SECTIONS="2.2 [2]">
+    Character FFFF is not legal anywhere in an XML document. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-178"
+       URI="not-wf/sa/178.xml" SECTIONS="3.1 [41]">
+    Invalid syntax matching double quote is missing. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-179"
+       URI="not-wf/sa/179.xml" SECTIONS="4.1 [66]">
+    Invalid syntax matching double quote is missing. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-180"
+       URI="not-wf/sa/180.xml" SECTIONS="4.1">
+    The <EM>Entity Declared</EM> WFC requires entities to be declared
+    before they are used in an attribute list declaration. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-181"
+       URI="not-wf/sa/181.xml" SECTIONS="4.3.2">
+    Internal parsed entities must match the <EM>content</EM>
+    production to be well formed. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-182"
+       URI="not-wf/sa/182.xml" SECTIONS="4.3.2">
+    Internal parsed entities must match the <EM>content</EM>
+    production to be well formed. </TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-183"
+       URI="not-wf/sa/183.xml" SECTIONS="3.2.2 [51]">
+    Mixed content declarations may not include content particles.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-184"
+       URI="not-wf/sa/184.xml" SECTIONS="3.2.2 [51]">
+    In mixed content models, element names must not be
+    parenthesized. </TEST>
+<TEST TYPE="not-wf" ENTITIES="parameter" ID="not-wf-sa-185"
+       URI="not-wf/sa/185.xml" SECTIONS="4.1">
+    Tests the <EM>Entity Declared</EM> WFC.
+    <EM>Note:</EM>  a nonvalidating parser is permitted not to report
+    this WFC violation, since it would need to read an external
+    parameter entity to distinguish it from a violation of
+    the <EM>Standalone Declaration</EM> VC.</TEST>
+<TEST TYPE="not-wf" ENTITIES="none" ID="not-wf-sa-186"
+       URI="not-wf/sa/186.xml" SECTIONS="3.1 [44]">
+    Whitespace is required between attribute/value pairs. </TEST>
+
+<!-- Start:  not-wf/not-sa -->
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-001"
+       URI="not-wf/not-sa/001.xml" SECTIONS="3.4 [62]">
+    Conditional sections must be properly terminated ("]&gt;" used
+    instead of "]]&gt;"). </TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-002"
+       URI="not-wf/not-sa/002.xml" SECTIONS="2.6 [17]">
+    Processing instruction target names may not be "XML" 
+    in any combination of cases. </TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-003"
+       URI="not-wf/not-sa/003.xml" SECTIONS="3.4 [62]">
+    Conditional sections must be properly terminated ("]]&gt;" omitted). </TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-004"
+       URI="not-wf/not-sa/004.xml" SECTIONS="3.4 [62]">
+    Conditional sections must be properly terminated ("]]&gt;" omitted). </TEST>
+<TEST TYPE="error" ENTITIES="both" ID="not-wf-not-sa-005"
+       URI="not-wf/not-sa/005.xml" SECTIONS="4.1">
+    Tests the <EM>Entity Declared</EM> VC by referring to an
+    undefined parameter entity within an external entity.</TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-006"
+       URI="not-wf/not-sa/006.xml" SECTIONS="3.4 [62]">
+    Conditional sections need a '[' after the INCLUDE or IGNORE. </TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-007"
+       URI="not-wf/not-sa/007.xml" SECTIONS="4.3.2 [79]">
+    A &lt;!DOCTYPE ...&gt; declaration may not begin any external
+    entity; it's only found once, in the document entity.</TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-008"
+       URI="not-wf/not-sa/008.xml" SECTIONS="4.1 [69]">
+    In DTDs, the '%' character must be part of a parameter
+    entity reference.</TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-not-sa-009"
+       URI="not-wf/not-sa/009.xml" SECTIONS="2.8">
+    This test violates WFC:PE Between Declarations in Production 28a.  
+    The last character of a markup declaration is not contained in the same 
+    parameter-entity text replacement.</TEST>
+<!-- Start:  not-wf/ext-sa -->
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-ext-sa-001"
+       URI="not-wf/ext-sa/001.xml" SECTIONS="4.1">
+    Tests the <EM>No Recursion</EM> WFC by having an external general
+    entity be self-recursive.</TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-ext-sa-002"
+       URI="not-wf/ext-sa/002.xml" SECTIONS="4.3.1 4.3.2 [77, 78]">
+    External entities have "text declarations", which do
+    not permit the "standalone=..." attribute that's allowed
+    in XML declarations.</TEST>
+<TEST TYPE="not-wf" ENTITIES="both" ID="not-wf-ext-sa-003"
+       URI="not-wf/ext-sa/003.xml" SECTIONS="2.6 [17]">
+    Only one text declaration is permitted; a second one
+    looks like an illegal processing instruction (target names
+    of "xml" in any case are not allowed). </TEST>
+
+
+<!-- Start:  invalid/ -->
+
+<TEST TYPE="invalid" ENTITIES="both" ID="invalid--002"
+       URI="invalid/002.xml" SECTIONS="3.2.1">
+    Tests the "Proper Group/PE Nesting" validity constraint by
+    fragmenting a content model between two parameter entities.</TEST>
+<TEST TYPE="invalid" ENTITIES="both" ID="invalid--005"
+       URI="invalid/005.xml" SECTIONS="2.8">
+    Tests the "Proper Declaration/PE Nesting" validity constraint by
+    fragmenting an element declaration between two parameter entities.</TEST>
+<TEST TYPE="invalid" ENTITIES="both" ID="invalid--006"
+       URI="invalid/006.xml" SECTIONS="2.8">
+    Tests the "Proper Declaration/PE Nesting" validity constraint by
+    fragmenting an element declaration between two parameter entities.</TEST>
+<TEST TYPE="invalid" ENTITIES="both" ID="invalid-not-sa-022"
+       URI="invalid/not-sa/022.xml" SECTIONS="3.4 [62]"
+       OUTPUT="invalid/not-sa/out/022.xml">
+    Test the "Proper Conditional Section/ PE Nesting" validity constraint. </TEST>
+
+<!-- Start:  valid/sa -->
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-001"
+       URI="valid/sa/001.xml" SECTIONS="3.2.2 [51]"
+       OUTPUT="valid/sa/out/001.xml">
+    Test demonstrates an Element Type Declaration with Mixed Content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-002"
+       URI="valid/sa/002.xml" SECTIONS="3.1 [40]"
+       OUTPUT="valid/sa/out/002.xml">
+    Test demonstrates that whitespace is permitted after the tag name in a Start-tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-003"
+       URI="valid/sa/003.xml" SECTIONS="3.1 [42]"
+       OUTPUT="valid/sa/out/003.xml">
+    Test demonstrates that whitespace is permitted after the tag name in an End-tag.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-004"
+       URI="valid/sa/004.xml" SECTIONS="3.1 [41]"
+       OUTPUT="valid/sa/out/004.xml">
+    Test demonstrates a valid attribute specification within a Start-tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-005"
+       URI="valid/sa/005.xml" SECTIONS="3.1 [40]"
+       OUTPUT="valid/sa/out/005.xml">
+    Test demonstrates a valid attribute specification within a Start-tag that
+contains whitespace on both sides of the equal sign. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-006"
+       URI="valid/sa/006.xml" SECTIONS="3.1 [41]"
+       OUTPUT="valid/sa/out/006.xml">
+    Test demonstrates that the AttValue within a Start-tag can use a single quote as a delimter. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-007"
+       URI="valid/sa/007.xml" SECTIONS="3.1 4.6 [43]"
+       OUTPUT="valid/sa/out/007.xml">
+    Test demonstrates numeric character references can be used for element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-008"
+       URI="valid/sa/008.xml" SECTIONS="2.4 3.1 [43]"
+       OUTPUT="valid/sa/out/008.xml">
+    Test demonstrates character references can be used for element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-009"
+       URI="valid/sa/009.xml" SECTIONS="2.3 3.1 [43]"
+       OUTPUT="valid/sa/out/009.xml">
+    Test demonstrates that PubidChar can be used for element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-010"
+       URI="valid/sa/010.xml" SECTIONS="3.1 [40]"
+       OUTPUT="valid/sa/out/010.xml">
+    Test demonstrates that whitespace is valid after the Attribute in a Start-tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-011"
+       URI="valid/sa/011.xml" SECTIONS="3.1 [40]"
+       OUTPUT="valid/sa/out/011.xml">
+    Test demonstrates mutliple Attibutes within the Start-tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-012"
+       URI="valid/sa/012.xml" SECTIONS="2.3 [4]"
+       OUTPUT="valid/sa/out/012.xml" NAMESPACE="no">
+    Uses a legal XML 1.0 name consisting of a single colon
+    character (disallowed by the latest XML Namespaces draft).</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-013"
+       URI="valid/sa/013.xml" SECTIONS="2.3 3.1 [13] [40]"
+       OUTPUT="valid/sa/out/013.xml">
+    Test demonstrates that the Attribute in a Start-tag can consist of numerals along with special characters. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-014"
+       URI="valid/sa/014.xml" SECTIONS="2.3 3.1 [13] [40]"
+       OUTPUT="valid/sa/out/014.xml">
+    Test demonstrates that all lower case letters are valid for the Attribute in a Start-tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-015"
+       URI="valid/sa/015.xml" SECTIONS="2.3 3.1 [13] [40]"
+       OUTPUT="valid/sa/out/015.xml">
+    Test demonstrates that all upper case letters are valid for the Attribute in a Start-tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-016"
+       URI="valid/sa/016.xml" SECTIONS="2.6 3.1 [16] [43]"
+       OUTPUT="valid/sa/out/016.xml">
+    Test demonstrates that Processing Instructions are valid element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-017"
+       URI="valid/sa/017.xml" SECTIONS="2.6 3.1 [16] [43]"
+       OUTPUT="valid/sa/out/017.xml">
+    Test demonstrates that Processing Instructions are valid element content and there can be more than one. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-018"
+       URI="valid/sa/018.xml" SECTIONS="2.7 3.1 [18] [43]"
+       OUTPUT="valid/sa/out/018.xml">
+    Test demonstrates that CDATA sections are valid element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-019"
+       URI="valid/sa/019.xml" SECTIONS="2.7 3.1 [18] [43]"
+       OUTPUT="valid/sa/out/019.xml">
+    Test demonstrates that CDATA sections are valid element content and that
+ampersands may occur in their literal form. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-020"
+       URI="valid/sa/020.xml" SECTIONS="2.7 3.1 [18] [43]"
+       OUTPUT="valid/sa/out/020.xml">
+   Test demonstractes that CDATA sections are valid element content and that
+everyting between the CDStart and CDEnd is recognized as character data not markup.  </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-021"
+       URI="valid/sa/021.xml" SECTIONS="2.5 3.1 [15] [43]"
+       OUTPUT="valid/sa/out/021.xml">
+    Test demonstrates that comments are valid element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-022"
+       URI="valid/sa/022.xml" SECTIONS="2.5 3.1 [15] [43]"
+       OUTPUT="valid/sa/out/022.xml">
+    Test demonstrates that comments are valid element content and that all characters before the double-hypen right angle combination are considered part of thecomment. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-023"
+       URI="valid/sa/023.xml" SECTIONS="3.1 [43]"
+       OUTPUT="valid/sa/out/023.xml">
+    Test demonstrates that Entity References are valid element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-024"
+       URI="valid/sa/024.xml" SECTIONS="3.1 4.1 [43] [66]"
+       OUTPUT="valid/sa/out/024.xml">
+    Test demonstrates that Entity References are valid element content and also demonstrates a valid Entity Declaration. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-025"
+       URI="valid/sa/025.xml" SECTIONS="3.2 [46]"
+       OUTPUT="valid/sa/out/025.xml">
+    Test demonstrates an Element Type Declaration and that the contentspec can be of mixed content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-026"
+       URI="valid/sa/026.xml" SECTIONS="3.2 [46]"
+       OUTPUT="valid/sa/out/026.xml">
+    Test demonstrates an Element Type Declaration and that EMPTY is a valid contentspec. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-027"
+       URI="valid/sa/027.xml" SECTIONS="3.2 [46]"
+       OUTPUT="valid/sa/out/027.xml">
+    Test demonstrates an Element Type Declaration and that ANY is a valid contenspec. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-028"
+       URI="valid/sa/028.xml" SECTIONS="2.8 [24]"
+       OUTPUT="valid/sa/out/028.xml">
+    Test demonstrates a valid prolog that uses double quotes as delimeters around the VersionNum. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-029"
+       URI="valid/sa/029.xml" SECTIONS="2.8 [24]"
+       OUTPUT="valid/sa/out/029.xml">
+    Test demonstrates a valid prolog that uses single quotes as delimters around the VersionNum. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-030"
+       URI="valid/sa/030.xml" SECTIONS="2.8 [25]"
+       OUTPUT="valid/sa/out/030.xml">
+    Test demonstrates a valid prolog that contains whitespace on both sides of the equal sign in the VersionInfo. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-031"
+       URI="valid/sa/031.xml" SECTIONS="4.3.3 [80]"
+       OUTPUT="valid/sa/out/031.xml">
+    Test demonstrates a valid EncodingDecl within the prolog. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-032"
+       URI="valid/sa/032.xml" SECTIONS="2.9 [32]"
+       OUTPUT="valid/sa/out/032.xml">
+    Test demonstrates a valid SDDecl within the prolog. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-033"
+       URI="valid/sa/033.xml" SECTIONS="2.8 [23]"
+       OUTPUT="valid/sa/out/033.xml">
+    Test demonstrates that both a EncodingDecl and SDDecl are valid within the prolog. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-034"
+       URI="valid/sa/034.xml" SECTIONS="3.1 [44]"
+       OUTPUT="valid/sa/out/034.xml">
+    Test demonstrates the correct syntax for an Empty element tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-035"
+       URI="valid/sa/035.xml" SECTIONS="3.1 [44]"
+       OUTPUT="valid/sa/out/035.xml">
+    Test demonstrates that whitespace is permissible after the name in an Empty element tag. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-036"
+       URI="valid/sa/036.xml" SECTIONS="2.6 [16]"
+       OUTPUT="valid/sa/out/036.xml">
+    Test demonstrates a valid processing instruction. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-037"
+       URI="valid/sa/037.xml" SECTIONS="2.6 [15]"
+       OUTPUT="valid/sa/out/037.xml">
+    Test demonstrates a valid comment and that it may appear anywhere in the document including at the end. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-038"
+       URI="valid/sa/038.xml" SECTIONS="2.6 [15]"
+       OUTPUT="valid/sa/out/038.xml">
+    Test demonstrates a valid comment and that it may appear anywhere in the document including the beginning. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-039"
+       URI="valid/sa/039.xml" SECTIONS="2.6 [16]"
+       OUTPUT="valid/sa/out/039.xml">
+    Test demonstrates a valid processing instruction and that it may appear at the beginning of the document. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-040"
+       URI="valid/sa/040.xml" SECTIONS="3.3 3.3.1 [52] [54]"
+       OUTPUT="valid/sa/out/040.xml">
+    Test demonstrates an Attribute List declaration that uses a StringType as the AttType. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-041"
+       URI="valid/sa/041.xml" SECTIONS="3.3.1 4.1 [54] [66]"
+       OUTPUT="valid/sa/out/041.xml">
+    Test demonstrates an Attribute List declaration that uses a StringType as the AttType and also expands the CDATA attribute with a character reference. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-042"
+       URI="valid/sa/042.xml" SECTIONS="3.3.1 4.1 [54] [66]"
+       OUTPUT="valid/sa/out/042.xml">
+    Test demonstrates an Attribute List declaration that uses a StringType as the AttType and also expands the CDATA attribute with a character reference.  The test also shows that the leading zeros in the character reference are ignored. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-043"
+       URI="valid/sa/043.xml" SECTIONS="3.3"
+       OUTPUT="valid/sa/out/043.xml">
+    An element's attributes may be declared before its content
+    model; and attribute values may contain newlines.  </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-044"
+       URI="valid/sa/044.xml" SECTIONS="3.1 [44]"
+       OUTPUT="valid/sa/out/044.xml">
+    Test demonstrates that the empty-element tag must be use for an elements that are declared EMPTY. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-045"
+       URI="valid/sa/045.xml" SECTIONS="3.3 [52]"
+       OUTPUT="valid/sa/out/045.xml">
+    Tests whether more than one definition can be provided for the same attribute of a given element type with the first declaration being binding. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-046"
+       URI="valid/sa/046.xml" SECTIONS="3.3 [52]"
+       OUTPUT="valid/sa/out/046.xml">
+    Test demonstrates that when more than one AttlistDecl is provided for a given element type, the contents of all those provided are merged. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-047"
+       URI="valid/sa/047.xml" SECTIONS="3.1 [43]"
+       OUTPUT="valid/sa/out/047.xml">
+    Test demonstrates that extra whitespace is normalized into single space character. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-048"
+       URI="valid/sa/048.xml" SECTIONS="2.4 3.1 [14] [43]"
+       OUTPUT="valid/sa/out/048.xml">
+    Test demonstrates that character data is valid element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-049"
+       URI="valid/sa/049.xml" SECTIONS="2.2 [2]"
+       OUTPUT="valid/sa/out/049.xml">
+    Test demonstrates that characters outside of normal ascii range can be used as element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-050"
+       URI="valid/sa/050.xml" SECTIONS="2.2 [2]"
+       OUTPUT="valid/sa/out/050.xml">
+    Test demonstrates that characters outside of normal ascii range can be used as element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-051"
+       URI="valid/sa/051.xml" SECTIONS="2.2 [2]"
+       OUTPUT="valid/sa/out/051.xml">
+    The document is encoded in UTF-16 and uses some name
+    characters well outside of the normal ASCII range.
+    </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-052"
+       URI="valid/sa/052.xml" SECTIONS="2.2 [2]"
+       OUTPUT="valid/sa/out/052.xml">
+    The document is encoded in UTF-8 and the text inside the
+    root element uses two non-ASCII characters, encoded in UTF-8
+    and each of which expands to a Unicode surrogate pair.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-053"
+       URI="valid/sa/053.xml" SECTIONS="4.4.2"
+       OUTPUT="valid/sa/out/053.xml">
+    Tests inclusion of a well-formed internal entity, which
+    holds an element required by the content model.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-054"
+       URI="valid/sa/054.xml" SECTIONS="3.1 [40] [42]"
+       OUTPUT="valid/sa/out/054.xml">
+    Test demonstrates that extra whitespace within Start-tags and End-tags are nomalized into single spaces. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-055"
+       URI="valid/sa/055.xml" SECTIONS="2.6 2.10 [16]"
+       OUTPUT="valid/sa/out/055.xml">
+    Test demonstrates that extra whitespace within a processing instruction willnormalized into s single space character. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-056"
+       URI="valid/sa/056.xml" SECTIONS="3.3.1 4.1 [54] [66]"
+       OUTPUT="valid/sa/out/056.xml">
+    Test demonstrates an Attribute List declaration that uses a StringType as the AttType and also expands the CDATA attribute with a character reference.  The test also shows that the leading zeros in the character reference are ignored. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-057"
+       URI="valid/sa/057.xml" SECTIONS="3.2.1 [47]"
+       OUTPUT="valid/sa/out/057.xml">
+    Test demonstrates an element content model whose element can occur zero or more times. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-058"
+       URI="valid/sa/058.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/058.xml">
+    Test demonstrates that extra whitespace be normalized into a single space character in an attribute of type NMTOKENS. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-059"
+       URI="valid/sa/059.xml" SECTIONS="3.2 3.3 [46] [53]"
+       OUTPUT="valid/sa/out/059.xml">
+    Test demonstrates an Element Type Declaration that uses the contentspec of EMPTY.  The element cannot have any contents and must always appear as an empty element in the document.  The test also shows an Attribute-list declaration with multiple AttDef's. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-060"
+       URI="valid/sa/060.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/060.xml">
+    Test demonstrates the use of decimal Character References within element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-061"
+       URI="valid/sa/061.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/061.xml">
+    Test demonstrates the use of decimal Character References within element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-062"
+       URI="valid/sa/062.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/062.xml">
+    Test demonstrates the use of hexadecimal Character References within element.  </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-063"
+       URI="valid/sa/063.xml" SECTIONS="2.3 [5]"
+       OUTPUT="valid/sa/out/063.xml">
+    The document is encoded in UTF-8 and the name of the
+    root element type uses non-ASCII characters.  </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-064"
+       URI="valid/sa/064.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/064.xml">
+    Tests in-line handling of two legal character references, which
+    each expand to a Unicode surrogate pair.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-065"
+       URI="valid/sa/065.xml" SECTIONS="4.5"
+       OUTPUT="valid/sa/out/065.xml">
+    Tests ability to define an internal entity which can't
+    legally be expanded (contains an unquoted <B>&lt;</B>).</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-066"
+       URI="valid/sa/066.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/066.xml">
+    Expands a CDATA attribute with a character reference.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-067"
+       URI="valid/sa/067.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/067.xml">
+    Test demonstrates the use of decimal character references within element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-068"
+       URI="valid/sa/068.xml" SECTIONS="2.11, 4.5"
+       OUTPUT="valid/sa/out/068.xml">
+    Tests definition of an internal entity holding a carriage return character
+    reference, which must not be normalized before reporting to the application.  Line 
+    break normalization only occurs when parsing external parsed entities.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-069"
+       URI="valid/sa/069.xml" SECTIONS="4.7"
+       OUTPUT="valid/sa/out/069.xml">
+    Verifies that an XML parser will parse a NOTATION
+    declaration; the output phase of this test ensures that
+    it's reported to the application. </TEST>
+<TEST TYPE="valid" ENTITIES="parameter" ID="valid-sa-070"
+       URI="valid/sa/070.xml" SECTIONS="4.4.8"
+       OUTPUT="valid/sa/out/070.xml">
+    Verifies that internal parameter entities are correctly
+    expanded within the internal subset.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-071"
+       URI="valid/sa/071.xml" SECTIONS="3.3 3.3.1 [52] [56]"
+       OUTPUT="valid/sa/out/071.xml">
+    Test demonstrates that an AttlistDecl can use ID as the TokenizedType within the Attribute type.  The test also shows that IMPLIED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-072"
+       URI="valid/sa/072.xml" SECTIONS="3.3 3.3.1 [52] [56]"
+       OUTPUT="valid/sa/out/072.xml">
+    Test demonstrates that an AttlistDecl can use IDREF as the TokenizedType within the Attribute type.  The test also shows that IMPLIED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-073"
+       URI="valid/sa/073.xml" SECTIONS="3.3 3.3.1 [52] [56]"
+       OUTPUT="valid/sa/out/073.xml">
+    Test demonstrates that an AttlistDecl can use IDREFS as the TokenizedType within the Attribute type.  The test also shows that IMPLIED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-074"
+       URI="valid/sa/074.xml" SECTIONS="3.3 3.3.1 [52] [56]"
+       OUTPUT="valid/sa/out/074.xml">
+    Test demonstrates that an AttlistDecl can use ENTITY as the TokenizedType within the Attribute type.  The test also shows that IMPLIED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-075"
+       URI="valid/sa/075.xml" SECTIONS="3.3 3.3.1 [52] [56]"
+       OUTPUT="valid/sa/out/075.xml">
+    Test demonstrates that an AttlistDecl can use ENTITIES as the TokenizedType within the Attribute type.  The test also shows that IMPLIED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-076"
+       URI="valid/sa/076.xml" SECTIONS="3.3.1"
+       OUTPUT="valid/sa/out/076.xml">
+    Verifies that an XML parser will parse a NOTATION
+    attribute; the output phase of this test ensures that
+    both notations are reported to the application. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-077"
+       URI="valid/sa/077.xml" SECTIONS="3.3 3.3.1 [52] [54]"
+       OUTPUT="valid/sa/out/077.xml">
+    Test demonstrates that an AttlistDecl can use an EnumeratedType within the Attribute type.  The test also shows that IMPLIED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-078"
+       URI="valid/sa/078.xml" SECTIONS="3.3 3.3.1 [52] [54]"
+       OUTPUT="valid/sa/out/078.xml">
+    Test demonstrates that an AttlistDecl can use an StringType of CDATA within the Attribute type.  The test also shows that REQUIRED is a valid DefaultDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-079"
+       URI="valid/sa/079.xml" SECTIONS="3.3 3.3.2 [52] [60]"
+       OUTPUT="valid/sa/out/079.xml">
+    Test demonstrates that an AttlistDecl can use an StringType of CDATA within the Attribute type.  The test also shows that FIXED is a valid DefaultDecl and that a value can be given to the attribute in the Start-tag as well as the AttListDecl. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-080"
+       URI="valid/sa/080.xml" SECTIONS="3.3 3.3.2 [52] [60]"
+       OUTPUT="valid/sa/out/080.xml">
+    Test demonstrates that an AttlistDecl can use an StringType of CDATA within the Attribute type.  The test also shows that FIXED is a valid DefaultDecl and that an value can be given to the attribute. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-081"
+       URI="valid/sa/081.xml" SECTIONS="3.2.1 [50]"
+       OUTPUT="valid/sa/out/081.xml">
+    Test demonstrates the use of the optional character following a name or list  to govern the number of times an element or content particles in the list occur. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-082"
+       URI="valid/sa/082.xml" SECTIONS="4.2 [72]"
+       OUTPUT="valid/sa/out/082.xml">
+    Tests that an external PE may be defined (but not referenced).</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-083"
+       URI="valid/sa/083.xml" SECTIONS="4.2 [72]"
+       OUTPUT="valid/sa/out/083.xml">
+    Tests that an external PE may be defined (but not referenced).</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-084"
+       URI="valid/sa/084.xml" SECTIONS="2.10"
+       OUTPUT="valid/sa/out/084.xml">
+    Test demonstrates that although whitespace can be used to set apart markup for greater readability it is not necessary. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-085"
+       URI="valid/sa/085.xml" SECTIONS="4"
+       OUTPUT="valid/sa/out/085.xml">
+    Parameter and General entities use different namespaces,
+    so there can be an entity of each type with a given name.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-086"
+       URI="valid/sa/086.xml" SECTIONS="4.2"
+       OUTPUT="valid/sa/out/086.xml">
+    Tests whether entities may be declared more than once,
+    with the first declaration being the binding one. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-087"
+       URI="valid/sa/087.xml" SECTIONS="4.5"
+       OUTPUT="valid/sa/out/087.xml">
+    Tests whether character references in internal entities are
+    expanded early enough, by relying on correct handling to
+    make the entity be well formed.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-088"
+       URI="valid/sa/088.xml" SECTIONS="4.5"
+       OUTPUT="valid/sa/out/088.xml">
+    Tests whether entity references in internal entities are
+    expanded late enough, by relying on correct handling to
+    make the expanded text be valid.  (If it's expanded too
+    early, the entity will parse as an element that's not
+    valid in that context.)</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-089"
+       URI="valid/sa/089.xml" SECTIONS="4.1 [66]"
+       OUTPUT="valid/sa/out/089.xml">
+    Tests entity expansion of three legal character references,
+    which each expand to a Unicode surrogate pair.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-090"
+       URI="valid/sa/090.xml" SECTIONS="3.3.1"
+       OUTPUT="valid/sa/out/090.xml">
+    Verifies that an XML parser will parse a NOTATION
+    attribute; the output phase of this test ensures that
+    the notation is reported to the application. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-091"
+       URI="valid/sa/091.xml" SECTIONS="3.3.1"
+       OUTPUT="valid/sa/out/091.xml">
+    Verifies that an XML parser will parse an ENTITY
+    attribute; the output phase of this test ensures that
+    the notation is reported to the application, and for
+    validating parsers it further tests that the entity
+    is so reported.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-092"
+       URI="valid/sa/092.xml" SECTIONS="2.3 2.10"
+       OUTPUT="valid/sa/out/092.xml">
+    Test demostrates that extra whitespace is normalized into a single space character. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-093"
+       URI="valid/sa/093.xml" SECTIONS="2.10"
+       OUTPUT="valid/sa/out/093.xml">
+    Test demonstrates that extra whitespace is not intended for inclusion in the delivered version of the document. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-094"
+       OUTPUT="valid/sa/out/094.xml"
+       URI="valid/sa/094.xml" SECTIONS="2.8">
+    Attribute defaults with a DTD have special parsing rules, different
+    from other strings.  That means that characters found there may look
+    like an undefined parameter entity reference "within a markup
+    declaration", but they aren't ... so they can't be violating
+    the <EM>PEs in Internal Subset</EM> WFC. 
+    </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-095"
+       URI="valid/sa/095.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/095.xml">
+    Basically an output test, this requires extra whitespace
+    to be normalized into a single space character in an
+    attribute of type NMTOKENS.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-096"
+       URI="valid/sa/096.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/096.xml">
+    Test demonstrates that extra whitespace is normalized into a single space character in an attribute of type NMTOKENS. </TEST>
+<TEST TYPE="valid" ENTITIES="parameter" ID="valid-sa-097"
+       URI="valid/sa/097.xml" SECTIONS="3.3"
+       OUTPUT="valid/sa/out/097.xml">
+    Basically an output test, this tests whether an externally
+    defined attribute declaration (with a default) takes proper
+    precedence over a subsequent internal declaration.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-098"
+       URI="valid/sa/098.xml" SECTIONS="2.6 2.10 [16]"
+       OUTPUT="valid/sa/out/098.xml">
+    Test demonstrates that extra whitespace within a processing instruction is converted into a single space character.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-099"
+       URI="valid/sa/099.xml" SECTIONS="4.3.3 [81]"
+       OUTPUT="valid/sa/out/099.xml">
+    Test demonstrates the name of the encoding can be composed of lowercase characters. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-100"
+       URI="valid/sa/100.xml" SECTIONS="2.3 [12]"
+       OUTPUT="valid/sa/out/100.xml">
+    Makes sure that PUBLIC identifiers may have some strange
+    characters.  <EM>NOTE:  The XML editors have said that the XML
+    specification errata will specify that parameter entity expansion
+    does not occur in PUBLIC identifiers, so that the '%' character
+    will not flag a malformed parameter entity reference.</EM></TEST> 
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-101"
+       URI="valid/sa/101.xml" SECTIONS="4.5"
+       OUTPUT="valid/sa/out/101.xml">
+    This tests whether entity expansion is (incorrectly) done
+    while processing entity declarations; if it is, the entity
+    value literal will terminate prematurely.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-102"
+       URI="valid/sa/102.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/102.xml">
+    Test demonstrates that a CDATA attribute can pass a double quote as its value. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-103"
+       URI="valid/sa/103.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/103.xml">
+    Test demonstrates that an attribute can pass a less than sign as its value. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-104"
+       URI="valid/sa/104.xml" SECTIONS="3.1 [40]"
+       OUTPUT="valid/sa/out/104.xml">
+    Test demonstrates that extra whitespace within an Attribute of a Start-tag is normalized to a single space character. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-105"
+       URI="valid/sa/105.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/105.xml">
+    Basically an output test, this requires a CDATA attribute
+    with a tab character to be passed through as one space.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-106"
+       URI="valid/sa/106.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/106.xml">
+    Basically an output test, this requires a CDATA attribute
+    with a newline character to be passed through as one space.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-107"
+       URI="valid/sa/107.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/107.xml">
+    Basically an output test, this requires a CDATA attribute
+    with a return character to be passed through as one space.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-108"
+       URI="valid/sa/108.xml" SECTIONS="2.11, 3.3.3"
+       OUTPUT="valid/sa/out/108.xml">
+    This tests normalization of end-of-line characters (CRLF)
+    within entities to LF, primarily as an output test. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-109"
+       URI="valid/sa/109.xml" SECTIONS="2.3 3.1 [10][40][41]"
+       OUTPUT="valid/sa/out/109.xml">
+    Test demonstrates that an attribute can have a null value. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-110"
+       URI="valid/sa/110.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/110.xml">
+    Basically an output test, this requires that a CDATA
+    attribute with a CRLF be normalized to one space.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-111"
+       URI="valid/sa/111.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/111.xml">
+    Character references expanding to spaces doesn't affect
+    treatment of attributes. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-112"
+       URI="valid/sa/112.xml" SECTIONS="3.2.1 [48][49]"
+       OUTPUT="valid/sa/out/112.xml">
+    Test demonstrates shows the use of content particles within the element content. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-113"
+       URI="valid/sa/113.xml" SECTIONS="3.3 [52][53]"
+       OUTPUT="valid/sa/out/113.xml">
+     Test demonstrates that it is not an error to have attributes declared for an element not itself declared.</TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-114"
+       URI="valid/sa/114.xml" SECTIONS="2.7 [20]"
+       OUTPUT="valid/sa/out/114.xml">
+    Test demonstrates that all text within a valid CDATA section is considered text and not recognized as markup. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-115"
+       URI="valid/sa/115.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/sa/out/115.xml">
+    Test demonstrates that an entity reference is processed by recursively processing the replacement text of the entity. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-116"
+       URI="valid/sa/116.xml" SECTIONS="2.11"
+       OUTPUT="valid/sa/out/116.xml">
+    Test demonstrates that a line break within CDATA will be normalized. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-117"
+       URI="valid/sa/117.xml" SECTIONS="4.5"
+       OUTPUT="valid/sa/out/117.xml">
+    Test demonstrates that entity expansion is done while processing entity declarations.  </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-118"
+       URI="valid/sa/118.xml" SECTIONS="4.5"
+       OUTPUT="valid/sa/out/118.xml">
+    Test demonstrates that entity expansion is done while processing entity declarations. </TEST>
+<TEST TYPE="valid" ENTITIES="none" ID="valid-sa-119"
+       URI="valid/sa/119.xml" SECTIONS="2.5"
+       OUTPUT="valid/sa/out/119.xml">
+    Comments may contain any legal XML characters;
+    only the string "--" is disallowed.</TEST>
+
+
+<!-- Start:  valid/not-sa -->
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-001"
+       URI="valid/not-sa/001.xml" SECTIONS="4.2.2 [75]"
+       OUTPUT="valid/not-sa/out/001.xml">
+    Test demonstrates the use of an ExternalID within a document type definition. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-002"
+       URI="valid/not-sa/002.xml" SECTIONS="4.2.2 [75]"
+       OUTPUT="valid/not-sa/out/002.xml">
+    Test demonstrates the use of an ExternalID within a document type definition. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-003"
+       URI="valid/not-sa/003.xml" SECTIONS="4.1 [69]"
+       OUTPUT="valid/not-sa/out/003.xml">
+    Test demonstrates the expansion of an external parameter entity that declares an attribute. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-004"
+       URI="valid/not-sa/004.xml" SECTIONS="4.1 [69]"
+       OUTPUT="valid/not-sa/out/004.xml">
+    Expands an external parameter entity in two different ways,
+    with one of them declaring an attribute.</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-005"
+       URI="valid/not-sa/005.xml" SECTIONS="4.1 [69]"
+       OUTPUT="valid/not-sa/out/005.xml">
+    Test demonstrates the expansion of an external parameter entity that declares an attribute. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-006"
+       URI="valid/not-sa/006.xml" SECTIONS="3.3 [52]"
+       OUTPUT="valid/not-sa/out/006.xml">
+    Test demonstrates that when more than one definition is provided for the same attribute of a given element type only the first declaration is binding. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-007"
+       URI="valid/not-sa/007.xml" SECTIONS="3.3 [52]"
+       OUTPUT="valid/not-sa/out/007.xml">
+    Test demonstrates the use of an Attribute list declaration within an external entity. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-008"
+       URI="valid/not-sa/008.xml" SECTIONS="4.2.2 [75]"
+       OUTPUT="valid/not-sa/out/008.xml">
+    Test demonstrates that an external identifier may include a public identifier. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-009"
+       URI="valid/not-sa/009.xml" SECTIONS="4.2.2 [75]"
+       OUTPUT="valid/not-sa/out/009.xml">
+    Test demonstrates that an external identifier may include a public identifier. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-010"
+       URI="valid/not-sa/010.xml" SECTIONS="3.3 [52]"
+       OUTPUT="valid/not-sa/out/010.xml">
+    Test demonstrates that when more that one definition is provided for the same attribute of a given element type only the first declaration is binding. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-011"
+       URI="valid/not-sa/011.xml" SECTIONS="4.2 4.2.1 [72] [75]"
+       OUTPUT="valid/not-sa/out/011.xml">
+    Test demonstrates a parameter entity declaration whose parameter entity definition is an ExternalID. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-012"
+       URI="valid/not-sa/012.xml" SECTIONS="4.3.1 [77]"
+       OUTPUT="valid/not-sa/out/012.xml">
+    Test demonstrates an enternal parsed entity that begins with a text declaration. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-013"
+       URI="valid/not-sa/013.xml" SECTIONS="3.4 [62]"
+       OUTPUT="valid/not-sa/out/013.xml">
+    Test demonstrates the use of the conditional section INCLUDE that will include its contents as part of the DTD. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-014"
+       URI="valid/not-sa/014.xml" SECTIONS="3.4 [62]"
+       OUTPUT="valid/not-sa/out/014.xml">
+    Test demonstrates the use of the conditional section INCLUDE that will include its contents as part of the DTD.  The keyword is a parameter-entity reference. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-015"
+       URI="valid/not-sa/015.xml" SECTIONS="3.4 [63]"
+       OUTPUT="valid/not-sa/out/015.xml">
+    Test demonstrates the use of the conditonal section IGNORE the will ignore its content from being part of the DTD.  The keyword is a parameter-entity reference. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-016"
+       URI="valid/not-sa/016.xml" SECTIONS="3.4 [62]"
+       OUTPUT="valid/not-sa/out/016.xml">
+    Test demonstrates the use of the conditional section INCLUDE that will include its contents as part of the DTD.  The keyword is a parameter-entity reference.</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-017"
+       URI="valid/not-sa/017.xml" SECTIONS="4.2 [72]"
+       OUTPUT="valid/not-sa/out/017.xml">
+    Test demonstrates a parameter entity declaration that contains an attribute list declaration. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-018"
+       URI="valid/not-sa/018.xml" SECTIONS="4.2.2 [75]"
+       OUTPUT="valid/not-sa/out/018.xml">
+    Test demonstrates an EnternalID whose contents contain an parameter entity declaration and a attribute list definition. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-019"
+       URI="valid/not-sa/019.xml" SECTIONS="4.4.8"
+       OUTPUT="valid/not-sa/out/019.xml">
+    Test demonstrates that a parameter entity will be expanded with spaces on either side. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-020"
+       URI="valid/not-sa/020.xml" SECTIONS="4.4.8"
+       OUTPUT="valid/not-sa/out/020.xml">
+    Parameter entities expand with spaces on either side.</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-021"
+       URI="valid/not-sa/021.xml" SECTIONS="4.2 [72]"
+       OUTPUT="valid/not-sa/out/021.xml">
+    Test demonstrates a parameter entity declaration that contains a partial attribute list declaration. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-023"
+       URI="valid/not-sa/023.xml" SECTIONS="2.3 4.1 [10] [69]"
+       OUTPUT="valid/not-sa/out/023.xml">
+    Test demonstrates the use of a parameter entity reference within an attribute list declaration.
+</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-024"
+       URI="valid/not-sa/024.xml" SECTIONS="2.8, 4.1 [69]"
+       OUTPUT="valid/not-sa/out/024.xml">
+    Constructs an &lt;!ATTLIST...&gt; declaration from several PEs.</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-025"
+       URI="valid/not-sa/025.xml" SECTIONS="4.2"
+       OUTPUT="valid/not-sa/out/025.xml">
+    Test demonstrates that when more that one definition is provided for the same entity only the first declaration is binding. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-026"
+       URI="valid/not-sa/026.xml" SECTIONS="3.3 [52]"
+       OUTPUT="valid/not-sa/out/026.xml">
+    Test demonstrates that when more that one definition is provided for the same attribute of a given element type only the first declaration is binding. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-027"
+       URI="valid/not-sa/027.xml" SECTIONS="4.1 [69]"
+       OUTPUT="valid/not-sa/out/027.xml">
+    Test demonstrates a parameter entity reference whose value is NULL. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-028"
+       URI="valid/not-sa/028.xml" SECTIONS="3.4 [62]"
+       OUTPUT="valid/not-sa/out/028.xml">
+    Test demonstrates the use of the conditional section INCLUDE that will include its contents. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-029"
+       URI="valid/not-sa/029.xml" SECTIONS="3.4 [62]"
+       OUTPUT="valid/not-sa/out/029.xml">
+    Test demonstrates the use of the conditonal section IGNORE the will ignore its content from being used. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-030"
+       URI="valid/not-sa/030.xml" SECTIONS="3.4 [62]"
+       OUTPUT="valid/not-sa/out/030.xml">
+    Test demonstrates the use of the conditonal section IGNORE the will ignore its content from being used. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-not-sa-031"
+       URI="valid/not-sa/031.xml" SECTIONS="2.7"
+       OUTPUT="valid/not-sa/out/031.xml">
+    Expands a general entity which contains a CDATA section with
+    what looks like a markup declaration (but is just text since
+    it's in a CDATA section).</TEST>
+
+
+<!-- Start:  valid/ext-sa -->
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-001"
+       URI="valid/ext-sa/001.xml" SECTIONS="2.11"
+       OUTPUT="valid/ext-sa/out/001.xml">
+    A combination of carriage return line feed in an external entity must
+    be normalized to a single newline. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-002"
+       URI="valid/ext-sa/002.xml" SECTIONS="2.11"
+       OUTPUT="valid/ext-sa/out/002.xml">
+    A carriage return (also CRLF) in an external entity must
+    be normalized to a single newline. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-003"
+       URI="valid/ext-sa/003.xml" SECTIONS="3.1 4.1 [43] [68]"
+       OUTPUT="valid/ext-sa/out/003.xml">
+    Test demonstrates that the content of an element can be empty. In this case the external entity is an empty file. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-004"
+       URI="valid/ext-sa/004.xml" SECTIONS="2.11"
+       OUTPUT="valid/ext-sa/out/004.xml">
+    A carriage return (also CRLF) in an external entity must
+    be normalized to a single newline. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-005"
+       URI="valid/ext-sa/005.xml" SECTIONS="3.2.1 4.2.2 [48] [75]"
+       OUTPUT="valid/ext-sa/out/005.xml">
+    Test demonstrates the use of optional character and content particles within an element content.  The test also show the use of external entity. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-006"
+       URI="valid/ext-sa/006.xml" SECTIONS="2.11 3.2.1 3.2.2 4.2.2 [48] [51] [75]"
+       OUTPUT="valid/ext-sa/out/006.xml">
+    Test demonstrates the use of optional character and content particles within mixed element content.  The test also shows the use of an external entity and that a carriage control line feed in an external entity must be normalized to a single newline. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-007"
+       URI="valid/ext-sa/007.xml" SECTIONS="4.2.2 4.4.3 [75]"
+       OUTPUT="valid/ext-sa/out/007.xml">
+    Test demonstrates the use of external entity and how replacement 
+text is retrieved and processed. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-008"
+       URI="valid/ext-sa/008.xml" SECTIONS="4.2.2 4.3.3. 4.4.3 [75] [80]"
+       OUTPUT="valid/ext-sa/out/008.xml"> Test demonstrates the use of external 
+entity and how replacement text is retrieved and processed.  Also tests the use of an 
+EncodingDecl of UTF-16.</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-009"
+       URI="valid/ext-sa/009.xml" SECTIONS="2.11"
+       OUTPUT="valid/ext-sa/out/009.xml">
+    A carriage return (also CRLF) in an external entity must
+    be normalized to a single newline. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-011"
+       URI="valid/ext-sa/011.xml" SECTIONS="2.11 4.2.2 [75]"
+       OUTPUT="valid/ext-sa/out/011.xml">
+    Test demonstrates the use of a public identifier with and external entity.  
+The test also show that a carriage control line feed combination in an external 
+entity must be normalized to a single newline. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-012"
+       URI="valid/ext-sa/012.xml" SECTIONS="4.2.1 4.2.2"
+       OUTPUT="valid/ext-sa/out/012.xml">
+     Test demonstrates both internal and external entities and that processing of entity references may be required to produce the correct replacement text.</TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-013"
+       URI="valid/ext-sa/013.xml" SECTIONS="3.3.3"
+       OUTPUT="valid/ext-sa/out/013.xml">
+    Test demonstrates that whitespace is handled by adding a single whitespace to the normalized value in the attribute list. </TEST>
+<TEST TYPE="valid" ENTITIES="both" ID="valid-ext-sa-014"
+       URI="valid/ext-sa/014.xml" SECTIONS="4.1 4.4.3 [68]"
+       OUTPUT="valid/ext-sa/out/014.xml">
+    Test demonstrates use of characters outside of normal ASCII range.</TEST>
+</TESTCASES>
index a2ae9c4d5885bc514a2c0073d89d2c379c0dd550..7a263853324b3716b80f684f9521d8ad64687616 100644 (file)
@@ -1,83 +1,97 @@
-! Copyright (C) 2005, 2006 Daniel Ehrenberg
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays ascii assocs combinators
-combinators.short-circuit fry io.encodings io.encodings.iana
-io.encodings.string io.encodings.utf16 io.encodings.utf8 kernel make
-math math.parser namespaces sequences sets splitting state-parser
-strings xml.char-classes xml.data xml.entities xml.errors hashtables ;
+USING: namespaces xml.state kernel sequences accessors
+xml.char-classes xml.errors math io sbufs fry strings ascii
+circular xml.entities assocs make splitting math.parser
+locals combinators arrays ;
 IN: xml.tokenize
 
-! XML namespace processing: ns = namespace
+SYMBOL: prolog-data
 
-! A stack of hashtables
-SYMBOL: ns-stack
-
-: attrs>ns ( attrs-alist -- hash )
-    ! this should check to make sure URIs are valid
-    [
-        [
-            swap dup space>> "xmlns" =
-            [ main>> set ]
-            [
-                T{ name f "" "xmlns" f } names-match?
-                [ "" set ] [ drop ] if
-            ] if
-        ] assoc-each
-    ] { } make-assoc f like ;
-
-: add-ns ( name -- )
-    dup space>> dup ns-stack get assoc-stack
-    [ nip ] [ nonexist-ns ] if* >>url drop ;
-
-: push-ns ( hash -- )
-    ns-stack get push ;
-
-: pop-ns ( -- )
-    ns-stack get pop* ;
-
-: init-ns-stack ( -- )
-    V{ H{
-        { "xml" "http://www.w3.org/XML/1998/namespace" }
-        { "xmlns" "http://www.w3.org/2000/xmlns" }
-        { "" "" }
-    } } clone
-    ns-stack set ;
-
-: tag-ns ( name attrs-alist -- name attrs )
-    dup attrs>ns push-ns
-    [ dup add-ns ] dip dup [ drop add-ns ] assoc-each <attrs> ;
-
-! Parsing names
+SYMBOL: depth
 
 : version=1.0? ( -- ? )
-    prolog-data get version>> "1.0" = ;
-
-! version=1.0? is calculated once and passed around for efficiency
-
-: assure-name ( str version=1.0? -- str )
-    over {
-        [ first name-start? ]
-        [ rest-slice [ name-char? ] with all? ]
-    } 2&& [ bad-name ] unless ;
+    prolog-data get [ version>> "1.0" = ] [ t ] if* ;
 
-: (parse-name) ( start -- str )
-    version=1.0?
-    [ [ get-char name-char? not ] curry take-until append ]
-    [ assure-name ] bi ;
-
-: parse-name-starting ( start -- name )
-    (parse-name) get-char CHAR: : =
-    [ next "" (parse-name) ] [ "" swap ] if f <name> ;
-
-: parse-name ( -- name )
-    "" parse-name-starting ;
-
-!   -- Parsing strings
+: assure-good-char ( ch -- ch )
+    [
+        version=1.0? over text? not get-check and
+        [ disallowed-char ] when
+    ] [ f ] if* ;
+
+! * Basic utility words
+
+: record ( char -- )
+    CHAR: \n =
+    [ 0 get-line 1+ set-line ] [ get-column 1+ ] if
+    set-column ;
+
+! (next) normalizes \r\n and \r
+: (next) ( -- char )
+    get-next read1
+    2dup swap CHAR: \r = [
+        CHAR: \n =
+        [ nip read1 ] [ nip CHAR: \n swap ] if
+    ] [ drop ] if
+    set-next dup set-char assure-good-char ;
+
+: next ( -- )
+    #! Increment spot.
+    get-char [ unexpected-end ] unless (next) record ;
+
+: init-parser ( -- )
+    0 1 0 f f <spot> spot set
+    read1 set-next next ;
+
+: with-state ( stream quot -- )
+    ! with-input-stream implicitly creates a new scope which we use
+    swap [ init-parser call ] with-input-stream ; inline
+
+: skip-until ( quot: ( -- ? ) -- )
+    get-char [
+        [ call ] keep swap [ drop ] [
+            next skip-until
+        ] if
+    ] [ drop ] if ; inline recursive
+
+: take-until ( quot -- string )
+    #! Take the substring of a string starting at spot
+    #! from code until the quotation given is true and
+    #! advance spot to after the substring.
+    10 <sbuf> [
+        '[ @ [ t ] [ get-char _ push f ] if ] skip-until
+    ] keep >string ; inline
+
+: take-char ( ch -- string )
+    [ dup get-char = ] take-until nip ;
+
+: pass-blank ( -- )
+    #! Advance code past any whitespace, including newlines
+    [ get-char blank? not ] skip-until ;
+
+: string-matches? ( string circular -- ? )
+    get-char over push-circular
+    sequence= ;
+
+: take-string ( match -- string )
+    dup length <circular-string>
+    [ 2dup string-matches? ] take-until nip
+    dup length rot length 1- - head
+    get-char [ missing-close ] unless next ;
+
+: expect ( ch -- )
+    get-char 2dup = [ 2drop ] [
+        [ 1string ] bi@ expected
+    ] if next ;
+
+: expect-string ( string -- )
+    dup [ get-char next ] replicate 2dup =
+    [ 2drop ] [ expected ] if ;
 
 : parse-named-entity ( string -- )
-    dup entities at [ , ] [ 
+    dup entities at [ , ] [
         dup extra-entities get at
-        [ dup number? [ , ] [ % ] if ] [ no-entity ] ?if ! Make less hackish
+        [ % ] [ no-entity ] ?if
     ] ?if ;
 
 : parse-entity ( -- )
@@ -86,279 +100,57 @@ SYMBOL: ns-stack
         "x" ?head 16 10 ? base> ,
     ] [ parse-named-entity ] if ;
 
-: (parse-char) ( ch -- )
-    get-char {
-        { [ dup not ] [ 2drop ] }
-        { [ 2dup = ] [ 2drop next ] }
-        { [ dup CHAR: & = ] [ drop parse-entity (parse-char) ] }
-        [ , next (parse-char) ]
-    } cond ;
+SYMBOL: pe-table
+SYMBOL: in-dtd?
 
-: parse-char ( ch -- string )
-    [ (parse-char) ] "" make ;
+: parse-pe ( -- )
+    next CHAR: ; take-char dup next
+    pe-table get at [ % ] [ no-entity ] ?if ;
 
-: parse-text ( -- string )
-    CHAR: < parse-char ;
-                                   
-! Parsing tags
-
-: start-tag ( -- name ? )
-    #! Outputs the name and whether this is a closing tag
-    get-char CHAR: / = dup [ next ] when
-    parse-name swap ;
-
-: (parse-quote) ( ch -- string )
-    parse-char get-char
-    [ unclosed-quote ] unless ;
+:: (parse-char) ( quot: ( ch -- ? ) -- )
+    get-char :> char
+    {
+        { [ char not ] [ ] }
+        { [ char quot call ] [ next ] }
+        { [ char CHAR: & = ] [ parse-entity quot (parse-char) ] }
+        { [ in-dtd? get char CHAR: % = and ] [ parse-pe quot (parse-char) ] }
+        [ char , next quot (parse-char) ]
+    } cond ; inline recursive
+
+: parse-char ( quot: ( ch -- ? ) -- seq )
+    [ (parse-char) ] "" make ; inline
+
+: assure-no-]]> ( circular -- )
+    "]]>" sequence= [ text-w/]]> ] when ;
+
+:: parse-text ( -- string )
+    3 f <array> <circular> :> circ
+    depth get zero? :> no-text [| char |
+        char circ push-circular
+        circ assure-no-]]>
+        no-text [ char blank? char CHAR: < = or [
+            char 1string t pre/post-content
+        ] unless ] when
+        char CHAR: < =
+    ] parse-char ;
+
+: close ( -- )
+    pass-blank CHAR: > expect ;
+
+: normalize-quote ( str -- str )
+    [ dup "\t\r\n" member? [ drop CHAR: \s ] when ] map ;
+
+: (parse-quote) ( <-disallowed? ch -- string )
+    swap '[
+        dup _ = [ drop t ]
+        [ CHAR: < = _ and [ attr-w/< ] [ f ] if ] if
+    ] parse-char normalize-quote get-char
+    [ unclosed-quote ] unless ; inline
+
+: parse-quote* ( <-disallowed? -- seq )
+    pass-blank get-char dup "'\"" member?
+    [ next (parse-quote) ] [ quoteless-attr ] if ; inline
 
 : parse-quote ( -- seq )
-    pass-blank get-char dup "'\"" member?
-    [ next (parse-quote) ] [ quoteless-attr ] if ;
-
-: parse-attr ( -- )
-    parse-name
-    pass-blank CHAR: = expect
-    parse-quote
-    2array , ;
-
-: (middle-tag) ( -- )
-    pass-blank version=1.0? get-char name-start?
-    [ parse-attr (middle-tag) ] when ;
-
-: middle-tag ( -- attrs-alist )
-    ! f make will make a vector if it has any elements
-    [ (middle-tag) ] f make pass-blank ;
-
-: end-tag ( name attrs-alist -- tag )
-    tag-ns pass-blank get-char CHAR: / =
-    [ pop-ns <contained> next ] [ <opener> ] if ;
-
-: take-comment ( -- comment )
-    "--" expect-string
-    "--" take-string
-    <comment>
-    CHAR: > expect ;
-
-: take-cdata ( -- string )
-    "[CDATA[" expect-string "]]>" take-string ;
-
-: take-element-decl ( -- element-decl )
-    pass-blank " " take-string pass-blank ">" take-string <element-decl> ;
-
-: take-attlist-decl ( -- doctype-decl )
-    pass-blank " " take-string pass-blank ">" take-string <attlist-decl> ;
-
-: take-until-one-of ( seps -- str sep )
-    '[ get-char _ member? ] take-until get-char ;
-
-: only-blanks ( str -- )
-    [ blank? ] all? [ bad-doctype-decl ] unless ;
-
-: take-system-literal ( -- str ) ! replace with parse-quote?
-    pass-blank get-char next {
-        { CHAR: ' [ "'" take-string ] }
-        { CHAR: " [ "\"" take-string ] }
-    } case ;
-
-: take-system-id ( -- system-id )
-    take-system-literal <system-id>
-    ">" take-string only-blanks ;
-
-: take-public-id ( -- public-id )
-    take-system-literal
-    take-system-literal <public-id>
-    ">" take-string only-blanks ;
-
-DEFER: direct
-
-: (take-internal-subset) ( -- )
-    pass-blank get-char {
-        { CHAR: ] [ next ] }
-        [ drop "<!" expect-string direct , (take-internal-subset) ]
-    } case ;
-
-: take-internal-subset ( -- seq )
-    [ (take-internal-subset) ] { } make ;
-
-: (take-external-id) ( token -- external-id )
-    pass-blank {
-        { "SYSTEM" [ take-system-id ] }
-        { "PUBLIC" [ take-public-id ] }
-        [ bad-external-id ]
-    } case ;
-
-: take-external-id ( -- external-id )
-    " " take-string (take-external-id) ;
-
-: take-doctype-decl ( -- doctype-decl )
-    pass-blank " >" take-until-one-of {
-        { CHAR: \s [
-            pass-blank get-char CHAR: [ = [
-                next take-internal-subset f swap
-                ">" take-string only-blanks
-            ] [
-                " >" take-until-one-of {
-                    { CHAR: \s [ (take-external-id) ] }
-                    { CHAR: > [ only-blanks f ] }
-                } case f
-            ] if
-        ] }
-        { CHAR: > [ f f ] }
-    } case <doctype-decl> ;
-
-: take-entity-def ( -- entity-name entity-def )
-    " " take-string pass-blank get-char {
-        { CHAR: ' [ parse-quote ] }
-        { CHAR: " [ parse-quote ] }
-        [ drop take-external-id ]
-    } case ;
-
-: associate-entity ( entity-name entity-def -- )
-    swap extra-entities [ ?set-at ] change ;
-
-: take-entity-decl ( -- entity-decl )
-    pass-blank get-char {
-        { CHAR: % [ next pass-blank take-entity-def ] }
-        [ drop take-entity-def 2dup associate-entity ]
-    } case
-    ">" take-string only-blanks <entity-decl> ;
-
-: take-directive ( -- directive )
-    " " take-string {
-        { "ELEMENT" [ take-element-decl ] }
-        { "ATTLIST" [ take-attlist-decl ] }
-        { "DOCTYPE" [ take-doctype-decl ] }
-        { "ENTITY" [ take-entity-decl ] }
-        [ bad-directive ]
-    } case ;
-
-: direct ( -- object )
-    get-char {
-        { CHAR: - [ take-comment ] }
-        { CHAR: [ [ take-cdata ] }
-        [ drop take-directive ]
-    } case ;
-
-: yes/no>bool ( string -- t/f )
-    {
-        { "yes" [ t ] }
-        { "no" [ f ] }
-        [ not-yes/no ]
-    } case ;
-
-: assure-no-extra ( seq -- )
-    [ first ] map {
-        T{ name f "" "version" f }
-        T{ name f "" "encoding" f }
-        T{ name f "" "standalone" f }
-    } diff
-    [ extra-attrs ] unless-empty ; 
-
-: good-version ( version -- version )
-    dup { "1.0" "1.1" } member? [ bad-version ] unless ;
-
-: prolog-version ( alist -- version )
-    T{ name f "" "version" f } swap at
-    [ good-version ] [ versionless-prolog ] if* ;
-
-: prolog-encoding ( alist -- encoding )
-    T{ name f "" "encoding" f } swap at "UTF-8" or ;
-
-: prolog-standalone ( alist -- version )
-    T{ name f "" "standalone" f } swap at
-    [ yes/no>bool ] [ f ] if* ;
-
-: prolog-attrs ( alist -- prolog )
-    [ prolog-version ]
-    [ prolog-encoding ]
-    [ prolog-standalone ]
-    tri <prolog> ;
-
-SYMBOL: string-input?
-: decode-input-if ( encoding -- )
-    string-input? get [ drop ] [ decode-input ] if ;
-
-: parse-prolog ( -- prolog )
-    pass-blank middle-tag "?>" expect-string
-    dup assure-no-extra prolog-attrs
-    dup encoding>> dup "UTF-16" =
-    [ drop ] [ name>encoding [ decode-input-if ] when* ] if
-    dup prolog-data set ;
-
-: instruct ( -- instruction )
-    "" (parse-name) dup "xml" =
-    [ drop parse-prolog ] [
-        dup >lower "xml" =
-        [ capitalized-prolog ]
-        [ "?>" take-string append <instruction> ] if
-    ] if ;
-
-: make-tag ( -- tag )
-    {
-        { [ get-char dup CHAR: ! = ] [ drop next direct ] }
-        { [ CHAR: ? = ] [ next instruct ] }
-        [
-            start-tag [ dup add-ns pop-ns <closer> ]
-            [ middle-tag end-tag ] if
-            CHAR: > expect
-        ]
-    } cond ;
-
-! Autodetecting encodings
-
-: continue-make-tag ( str -- tag )
-    parse-name-starting middle-tag end-tag CHAR: > expect ;
-
-: start-utf16le ( -- tag )
-    utf16le decode-input-if
-    CHAR: ? expect
-    0 expect instruct ;
-
-: 10xxxxxx? ( ch -- ? )
-    -6 shift 3 bitand 2 = ;
-          
-: start<name ( ch -- tag )
-    ascii?
-    [ utf8 decode-input-if next make-tag ] [
-        next
-        [ get-next 10xxxxxx? not ] take-until
-        get-char suffix utf8 decode
-        utf8 decode-input-if next
-        continue-make-tag
-    ] if ;
-          
-: start< ( -- tag )
-    get-next {
-        { 0 [ next next start-utf16le ] }
-        { CHAR: ? [ next next instruct ] } ! XML prolog parsing sets the encoding
-        { CHAR: ! [ utf8 decode-input next next direct ] }
-        [ start<name ]
-    } case ;
-
-: skip-utf8-bom ( -- tag )
-    "\u0000bb\u0000bf" expect utf8 decode-input
-    CHAR: < expect make-tag ;
-
-: decode-expecting ( encoding string -- tag )
-    [ decode-input-if next ] [ expect-string ] bi* make-tag ;
-
-: start-utf16be ( -- tag )
-    utf16be "<" decode-expecting ;
-
-: skip-utf16le-bom ( -- tag )
-    utf16le "\u0000fe<" decode-expecting ;
-
-: skip-utf16be-bom ( -- tag )
-    utf16be "\u0000ff<" decode-expecting ;
-
-: start-document ( -- tag )
-    get-char {
-        { CHAR: < [ start< ] }
-        { 0 [ start-utf16be ] }
-        { HEX: EF [ skip-utf8-bom ] }
-        { HEX: FF [ skip-utf16le-bom ] }
-        { HEX: FE [ skip-utf16be-bom ] }
-        { f [ "" ] }
-        [ drop utf8 decode-input-if f ]
-        ! Same problem as with <e`>, in the case of XML chunks?
-    } case ;
+   f parse-quote* ;
+
diff --git a/basis/xml/utilities/utilities-docs.factor b/basis/xml/utilities/utilities-docs.factor
new file mode 100644 (file)
index 0000000..5e39183
--- /dev/null
@@ -0,0 +1,101 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax xml.data sequences strings ;
+IN: xml.utilities
+
+ABOUT: "xml.utilities"
+
+ARTICLE: "xml.utilities" "Utilities for processing XML"
+    "Utilities for processing XML include..."
+    $nl
+    "System sfor creating words which dispatch on XML tags:"
+    { $subsection POSTPONE: PROCESS: }
+    { $subsection POSTPONE: TAG: }
+    "Getting parts of an XML document or tag:"
+    $nl
+    "Note: the difference between deep-tag-named and tag-named is that the former searches recursively among all children and children of children of the tag, while the latter only looks at the direct children, and is therefore more efficient."
+    { $subsection tag-named }
+    { $subsection tags-named }
+    { $subsection deep-tag-named }
+    { $subsection deep-tags-named }
+    { $subsection get-id }
+    "Words for simplified generation of XML:"
+    { $subsection build-tag* }
+    { $subsection build-tag }
+    { $subsection build-xml }
+    "Other relevant words:"
+    { $subsection children>string }
+    { $subsection children-tags }
+    { $subsection first-child-tag }
+    { $subsection assert-tag } ;
+
+HELP: deep-tag-named
+{ $values { "tag" "an XML tag or document" } { "name/string" "an XML name or string representing a name" } { "matching-tag" tag } }
+{ $description "finds an XML tag with a matching name, recursively searching children and children of children" }
+{ $see-also tags-named tag-named deep-tags-named } ;
+
+HELP: deep-tags-named
+{ $values { "tag" "an XML tag or document" } { "name/string" "an XML name or string representing a name" } { "tags-seq" "a sequence of tags" } }
+{ $description "returns a sequence of all tags of a matching name, recursively searching children and children of children" }
+{ $see-also tag-named deep-tag-named tags-named } ;
+
+HELP: children>string
+{ $values { "tag" "an XML tag or document" } { "string" "a string" } }
+{ $description "concatenates the children of the tag, ignoring everything that's not a string" } ;
+
+HELP: children-tags
+{ $values { "tag" "an XML tag or document" } { "sequence" sequence } }
+{ $description "gets the children of the tag that are themselves tags" }
+{ $see-also first-child-tag } ;
+
+HELP: first-child-tag
+{ $values { "tag" "an XML tag or document" } { "tag" tag } }
+{ $description "returns the first child of the given tag that is a tag" }
+{ $see-also children-tags } ;
+
+HELP: tag-named
+{ $values { "tag" "an XML tag or document" }
+    { "name/string" "an XML name or string representing the name" }
+    { "matching-tag" tag } }
+{ $description "finds the first tag with matching name which is the direct child of the given tag" }
+{ $see-also deep-tags-named deep-tag-named tags-named } ;
+
+HELP: tags-named
+{ $values { "tag" "an XML tag or document" }
+    { "name/string" "an XML name or string representing the name" }
+    { "tags-seq" "a sequence of tags" } }
+{ $description "finds all tags with matching name that are the direct children of the given tag" }
+{ $see-also deep-tag-named deep-tags-named tag-named } ;
+
+HELP: get-id
+{ $values { "tag" "an XML tag or document" } { "id" "a string" } { "elem" "an XML element or f" } }
+{ $description "finds the XML tag with the specified id, ignoring the namespace" } ;
+
+HELP: PROCESS:
+{ $syntax "PROCESS: word" }
+{ $values { "word" "a new word to define" } }
+{ $description "creates a new word to process XML tags" }
+{ $see-also POSTPONE: TAG: } ;
+
+HELP: TAG:
+{ $syntax "TAG: tag word definition... ;" }
+{ $values { "tag" "an xml tag name" } { "word" "an XML process" } }
+{ $description "defines what a process should do when it encounters a specific tag" }
+{ $examples { $code "PROCESS: x ( tag -- )\nTAG: a x drop \"hi\" write ;" } }
+{ $see-also POSTPONE: PROCESS: } ;
+
+HELP: build-tag*
+{ $values { "items" "sequence of elements" } { "name" "string" }
+    { "tag" tag } }
+{ $description "builds a " { $link tag } " with the specified name, in the namespace \"\" and URL \"\" containing the children listed in item" }
+{ $see-also build-tag build-xml } ;
+
+HELP: build-tag
+{ $values { "item" "an element" } { "name" string } { "tag" tag } }
+{ $description "builds a " { $link tag } " with the specified name containing the single child item" }
+{ $see-also build-tag* build-xml } ;
+
+HELP: build-xml
+{ $values { "tag" tag } { "xml" "an XML document" } }
+{ $description "builds an XML document out of a tag" }
+{ $see-also build-tag* build-tag } ;
diff --git a/basis/xml/writer/writer-docs.factor b/basis/xml/writer/writer-docs.factor
new file mode 100644 (file)
index 0000000..b470403
--- /dev/null
@@ -0,0 +1,56 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.syntax help.markup io strings ;
+IN: xml.writer
+
+ABOUT: "xml.writer"
+
+ARTICLE: "xml.writer" "Writing XML"
+    "These words are used in implementing prettyprint"
+    { $subsection write-xml-chunk }
+    "These words are used to print XML normally"
+    { $subsection xml>string }
+    { $subsection write-xml }
+    "These words are used to prettyprint XML"
+    { $subsection pprint-xml>string }
+    { $subsection pprint-xml>string-but }
+    { $subsection pprint-xml }
+    { $subsection pprint-xml-but } ;
+
+HELP: write-xml-chunk
+{ $values { "object" "an XML element" } }
+{ $description "writes an XML element to " { $link output-stream } "." }
+{ $see-also write-xml-chunk write-xml } ;
+
+HELP: xml>string
+{ $values { "xml" "an xml document" } { "string" "a string" } }
+{ $description "converts an XML document into a string" }
+{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
+
+HELP: pprint-xml>string
+{ $values { "xml" "an xml document" } { "string" "a string" } }
+{ $description "converts an XML document into a string in a prettyprinted form." }
+{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
+
+HELP: write-xml
+{ $values { "xml" "an XML document" } }
+{ $description "prints the contents of an XML document to " { $link output-stream } "." }
+{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
+
+HELP: pprint-xml
+{ $values { "xml" "an XML document" } }
+{ $description "prints the contents of an XML document to " { $link output-stream } " in a prettyprinted form." }
+{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
+
+HELP: pprint-xml-but
+{ $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } }
+{ $description "Prettyprints an XML document, leaving the whitespace of the tags with names in sensitive-tags intact." }
+{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
+
+HELP: pprint-xml>string-but
+{ $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } { "string" string } }
+{ $description "Prettyprints an XML document, returning the result as a string and leaving the whitespace of the tags with names in sensitive-tags intact." }
+{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
+
+{ xml>string write-xml pprint-xml pprint-xml>string pprint-xml>string-but pprint-xml-but } related-words
+
index acfe4bfe1e00ba3632d028b237c130433f83db48..2b00c90344816068d20a7b1b0a248c56d5322bdb 100644 (file)
@@ -1,5 +1,62 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: xml.data xml.writer tools.test fry xml kernel multiline
+xml.writer.private io.streams.string xml.utilities sequences ;
 IN: xml.writer.tests
-USING: xml.data xml.writer tools.test ;
+
+\ write-xml must-infer
+\ xml>string must-infer
+\ pprint-xml must-infer
+\ pprint-xml-but must-infer
 
 [ "foo" ] [ T{ name { main "foo" } } name>string ] unit-test
+[ "foo" ] [ T{ name { space "" } { main "foo" } } name>string ] unit-test
 [ "ns:foo" ] [ T{ name { space "ns" } { main "foo" } } name>string ] unit-test
+
+: reprints-as ( to from -- )
+     [ '[ _ ] ] [ '[ _ string>xml xml>string ] ] bi* unit-test ;
+
+: pprint-reprints-as ( to from -- )
+     [ '[ _ ] ] [ '[ _ string>xml pprint-xml>string ] ] bi* unit-test ;
+
+: reprints-same ( string -- ) dup reprints-as ;
+
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?><x/>" reprints-same
+
+{" <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE foo [<!ENTITY foo "bar">]>
+<x>bar</x> "}
+{" <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE foo [<!ENTITY foo 'bar'>]>
+<x>&foo;</x> "} reprints-as
+
+{" <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE foo [
+  <!ENTITY foo "bar">
+  <!ELEMENT br EMPTY>
+  <!ATTLIST list type    (bullets|ordered|glossary)  "ordered">
+  <!NOTATION foo bar>
+  <?baz bing bang bong?>
+  <!--wtf-->
+]>
+<x>
+  bar
+</x>"}
+{" <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE foo [ <!ENTITY foo 'bar'> <!ELEMENT br EMPTY>
+<!ATTLIST list
+          type    (bullets|ordered|glossary)  "ordered">
+<!NOTATION     foo bar> <?baz bing bang bong?>
+               <!--wtf-->
+]>
+<x>&foo;</x>"} pprint-reprints-as
+
+[ t ] [ "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' >" dup string>xml-chunk xml-chunk>string = ] unit-test
+[ "foo" ] [ "<!ENTITY bar 'foo'><x>&bar;</x>" string>xml children>string ] unit-test
+[ V{ "hello" } ] [ "hello" string>xml-chunk ] unit-test
+[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a b=\"c\"/>" ]
+    [ "<a b='c'/>" string>xml xml>string ] unit-test
+[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo>bar baz</foo>" ]
+[ "<foo>bar</foo>" string>xml [ " baz" append ] map xml>string ] unit-test
+[ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<foo>\n  bar\n</foo>" ]
+[ "<foo>         bar            </foo>" string>xml pprint-xml>string ] unit-test
index cd6fd944a414180852d27257be7e2bde3d862d67..3a274d7135d7ab0d2cd6fcac39ec58f214154284 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2005, 2006 Daniel Ehrenberg\r
+! Copyright (C) 2005, 2009 Daniel Ehrenberg\r
 ! See http://factorcode.org/license.txt for BSD license.\r
 USING: hashtables kernel math namespaces sequences strings\r
 assocs combinators io io.streams.string accessors\r
@@ -11,6 +11,8 @@ SYMBOL: indentation
 SYMBOL: indenter\r
 "  " indenter set-global\r
 \r
+<PRIVATE\r
+\r
 : sensitive? ( tag -- ? )\r
     sensitive-tags get swap '[ _ names-match? ] contains? ;\r
 \r
@@ -40,9 +42,13 @@ SYMBOL: indenter
 : name>string ( name -- string )\r
     [ main>> ] [ space>> ] bi [ ":" rot 3append ] unless-empty ;\r
 \r
+PRIVATE>\r
+\r
 : print-name ( name -- )\r
     name>string write ;\r
 \r
+<PRIVATE\r
+\r
 : print-attrs ( assoc -- )\r
     [\r
         " " write\r
@@ -52,11 +58,18 @@ SYMBOL: indenter
         "\"" write\r
     ] assoc-each ;\r
 \r
+PRIVATE>\r
+\r
 GENERIC: write-xml-chunk ( object -- )\r
 \r
+<PRIVATE\r
+\r
 M: string write-xml-chunk\r
-    escape-string dup empty? not xml-pprint? get and\r
-    [ nl 80 indent-string indented-break ] when write ;\r
+    escape-string xml-pprint? get [\r
+        dup [ blank? ] all?\r
+        [ drop "" ]\r
+        [ nl 80 indent-string indented-break ] if\r
+    ] when write ;\r
 \r
 : write-tag ( tag -- )\r
     ?indent CHAR: < write1\r
@@ -100,12 +113,21 @@ M: attlist-decl write-xml-chunk
     [ att-defs>> write ">" write ]\r
     bi ;\r
 \r
-M: entity-decl write-xml-chunk\r
-    "<!ENTITY " write\r
+M: notation-decl write-xml-chunk\r
+    "<!NOTATION " write\r
     [ name>> write " " write ]\r
-    [ def>> write-xml-chunk ">" write ]\r
+    [ id>> write ">" write ]\r
     bi ;\r
 \r
+M: entity-decl write-xml-chunk\r
+    "<!ENTITY " write\r
+    [ pe?>> [ " % " write ] when ]\r
+    [ name>> write " \"" write ] [\r
+        def>> f xml-pprint?\r
+        [ write-xml-chunk ] with-variable\r
+        "\">" write\r
+    ] tri ;\r
+\r
 M: system-id write-xml-chunk\r
     "SYSTEM '" write system-literal>> write "'" write ;\r
 \r
@@ -114,17 +136,21 @@ M: public-id write-xml-chunk
     [ pubid-literal>> write "' '" write ]\r
     [ system-literal>> write "'" write ] bi ;\r
 \r
+: write-internal-subset ( seq -- )\r
+    [\r
+        "[" write indent\r
+        [ ?indent write-xml-chunk ] each\r
+        unindent ?indent "]" write\r
+    ] when* ;\r
+\r
 M: doctype-decl write-xml-chunk\r
-    "<!DOCTYPE " write\r
+    ?indent "<!DOCTYPE " write\r
     [ name>> write " " write ]\r
     [ external-id>> [ write-xml-chunk " " write ] when* ]\r
-    [\r
-        internal-subset>>\r
-        [ "[" write [ write-xml-chunk ] each "]" write ] when* ">" write\r
-    ] tri ;\r
+    [ internal-subset>> write-internal-subset ">" write ] tri ;\r
 \r
 M: directive write-xml-chunk\r
-    "<!" write text>> write CHAR: > write1 ;\r
+    "<!" write text>> write CHAR: > write1 nl ;\r
 \r
 M: instruction write-xml-chunk\r
     "<?" write text>> write "?>" write ;\r
@@ -138,6 +164,8 @@ M: sequence write-xml-chunk
     standalone>> [ "\" standalone=\"yes" write ] when\r
     "\"?>" write ;\r
 \r
+PRIVATE>\r
+\r
 : write-xml ( xml -- )\r
     {\r
         [ prolog>> write-prolog ]\r
@@ -149,28 +177,25 @@ M: sequence write-xml-chunk
 M: xml write-xml-chunk\r
     body>> write-xml-chunk ;\r
 \r
-: print-xml ( xml -- )\r
-    write-xml nl ;\r
-\r
 : xml>string ( xml -- string )\r
     [ write-xml ] with-string-writer ;\r
 \r
-: with-xml-pprint ( sensitive-tags quot -- )\r
+: xml-chunk>string ( object -- string )\r
+    [ write-xml-chunk ] with-string-writer ;\r
+\r
+: pprint-xml-but ( xml sensitive-tags -- )\r
     [\r
-        swap [ assure-name ] map sensitive-tags set\r
+        [ assure-name ] map sensitive-tags set\r
         0 indentation set\r
         xml-pprint? on\r
-        call\r
-    ] with-scope ; inline\r
-\r
-: pprint-xml-but ( xml sensitive-tags -- )\r
-    [ print-xml ] with-xml-pprint ;\r
+        write-xml\r
+    ] with-scope ;\r
 \r
 : pprint-xml ( xml -- )\r
     f pprint-xml-but ;\r
 \r
 : pprint-xml>string-but ( xml sensitive-tags -- string )\r
-    [ xml>string ] with-xml-pprint ;\r
+    [ pprint-xml-but ] with-string-writer ;\r
 \r
 : pprint-xml>string ( xml -- string )\r
     f pprint-xml>string-but ;\r
index e87c32d375095c96b4b9f3d8de9ebd9606de9154..60bc88bad6c8818bead6f118203ee3cf889ebafd 100644 (file)
@@ -1,8 +1,6 @@
-! Copyright (C) 2005, 2006 Daniel Ehrenberg\r
+! Copyright (C) 2005, 2009 Daniel Ehrenberg\r
 ! See http://factorcode.org/license.txt for BSD license.\r
-USING: help.markup help.syntax kernel xml.data xml.errors\r
-xml.writer state-parser xml.tokenize xml.utilities xml.entities\r
-strings sequences io xml.entities.html ;\r
+USING: help.markup help.syntax xml.data io ;\r
 IN: xml\r
 \r
 HELP: string>xml\r
@@ -13,7 +11,7 @@ HELP: string>xml
 HELP: read-xml\r
 { $values { "stream" "a stream that supports readln" }\r
     { "xml" "an XML document" } }\r
-{ $description "exausts the given stream, reading an XML document from it" } ;\r
+{ $description "exausts the given stream, reading an XML document from it. A binary stream, one without encoding, should be used as input, and the encoding is automatically detected." } ;\r
 \r
 HELP: file>xml\r
 { $values { "filename" "a string representing a filename" }\r
@@ -22,170 +20,10 @@ HELP: file>xml
 \r
 { string>xml read-xml file>xml } related-words\r
 \r
-HELP: xml>string\r
-{ $values { "xml" "an xml document" } { "string" "a string" } }\r
-{ $description "converts an xml document (" { $link xml } ") into a string" }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: pprint-xml>string\r
-{ $values { "xml" "an xml document" } { "string" "a string" } }\r
-{ $description "converts an xml document (" { $link xml } ") into a string in a prettyprinted form." }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: xml-parse-error\r
-{ $class-description "the exception class that all parsing errors in XML documents are in." } ;\r
-\r
-HELP: xml-reprint\r
-{ $values { "string" "a string of XML" } }\r
-{ $description "parses XML and prints it out again, for testing purposes" }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: write-xml\r
-{ $values { "xml" "an XML document" } }\r
-{ $description "prints the contents of an XML document (" { $link xml } ") to " { $link output-stream } "." }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: print-xml\r
-{ $values { "xml" "an XML document" } }\r
-{ $description "prints the contents of an XML document (" { $link xml } ") to " { $link output-stream } ", followed by a newline" }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: pprint-xml\r
-{ $values { "xml" "an XML document" } }\r
-{ $description "prints the contents of an XML document (" { $link xml } ") to " { $link output-stream } " in a prettyprinted form." }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: pprint-xml-but\r
-{ $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } }\r
-{ $description "Prettyprints an XML document, leaving the whitespace of the tags with names in sensitive-tags intact." }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-HELP: pprint-xml>string-but\r
-{ $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } { "string" string } }\r
-{ $description "Prettyprints an XML document, returning the result as a string and leaving the whitespace of the tags with names in sensitive-tags intact." }\r
-{ $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;\r
-\r
-{ xml>string print-xml write-xml pprint-xml xml-reprint pprint-xml>string pprint-xml>string-but pprint-xml-but } related-words\r
-\r
-HELP: PROCESS:\r
-{ $syntax "PROCESS: word" }\r
-{ $values { "word" "a new word to define" } }\r
-{ $description "creates a new word to process XML tags" }\r
-{ $see-also POSTPONE: TAG: } ;\r
-\r
-HELP: TAG:\r
-{ $syntax "TAG: tag word definition... ;" }\r
-{ $values { "tag" "an xml tag name" } { "word" "an XML process" } }\r
-{ $description "defines what a process should do when it encounters a specific tag" }\r
-{ $examples { $code "PROCESS: x ( tag -- )\nTAG: a x drop \"hi\" write ;" } }\r
-{ $see-also POSTPONE: PROCESS: } ;\r
-HELP: build-tag*\r
-{ $values { "items" "sequence of elements" } { "name" "string" }\r
-    { "tag" tag } }\r
-{ $description "builds a " { $link tag } " with the specified name, in the namespace \"\" and URL \"\" containing the children listed in item" }\r
-{ $see-also build-tag build-xml } ;\r
-\r
-HELP: build-tag\r
-{ $values { "item" "an element" } { "name" string } { "tag" tag } }\r
-{ $description "builds a " { $link tag } " with the specified name containing the single child item" }\r
-{ $see-also build-tag* build-xml } ;\r
-\r
-HELP: build-xml\r
-{ $values { "tag" tag } { "xml" "an XML document" } }\r
-{ $description "builds an XML document out of a tag" }\r
-{ $see-also build-tag* build-tag } ;\r
-\r
-HELP: tag\r
-{ $class-description "tuple representing an XML tag, delegating to a " { $link\r
-name } ", containing the slots attrs (an alist of names to strings) and children (a sequence). Tags implement the sequence protocol by acting like a sequence of its chidren, and the assoc protocol by acting like its attributes." }\r
-{ $see-also <tag> name contained-tag xml } ;\r
-\r
-HELP: <tag>\r
-{ $values { "name" "an XML tag name" }\r
-    { "attrs" "an alist of names to strings" }\r
-    { "children" sequence }\r
-    { "tag" tag } }\r
-{ $description "constructs an XML " { $link tag } " with the name (not a string) and tag attributes specified in attrs and children specified" }\r
-{ $see-also tag <contained-tag> build-tag build-tag* } ;\r
-\r
-HELP: name\r
-{ $class-description "represents an XML name, with the fields space (a string representing the namespace, as written in the document, tag (a string of the actual name of the tag) and url (a string of the URL that the namespace points to)" }\r
-{ $see-also <name> tag } ;\r
-\r
-HELP: <name>\r
-{ $values { "space" "a string" } { "main" "a string" } { "url" "a string" }\r
-    { "name" "an XML tag name" } }\r
-{ $description "creates a name tuple with the name-space space and the tag-name tag and the tag-url url." }\r
-{ $see-also name <tag> } ;\r
-\r
-HELP: contained-tag\r
-{ $class-description "delegates to tag representing a tag like <a/> with no contents. The tag attributes are accessed with tag-attrs" }\r
-{ $see-also tag <contained-tag> } ;\r
-\r
-HELP: <contained-tag>\r
-{ $values { "name" "an XML tag name" }\r
-    { "attrs" "an alist from names to strings" }\r
-    { "tag" tag } }\r
-{ $description "creates an empty tag (like <a/>) with the specified name and tag attributes. This delegates to tag" }\r
-{ $see-also contained-tag <tag> } ;\r
-\r
-HELP: xml\r
-{ $class-description "tuple representing an XML document, delegating to the main tag, containing the fields prolog (the header <?xml...?>), before (whatever comes between the prolog and the main tag) and after (whatever comes after the main tag)" }\r
-{ $see-also <xml> tag prolog } ;\r
-\r
-HELP: <xml>\r
-{ $values { "prolog" "an XML prolog" } { "before" "a sequence of XML elements" }\r
-{ "body" tag } { "after" "a sequence of XML elements" } { "xml" "an XML document" } }\r
-{ $description "creates an XML document, delegating to the main tag, with the specified prolog, before, and after" }\r
-{ $see-also xml <tag> } ;\r
-\r
-HELP: prolog\r
-{ $class-description "represents an XML prolog, with the tuple fields version (containing \"1.0\" or \"1.1\"), encoding (a string representing the encoding type), and standalone (t or f, whether the document is standalone without external entities)" }\r
-{ $see-also <prolog> xml } ;\r
-\r
-HELP: <prolog>\r
-{ $values { "version" "a string, 1.0 or 1.1" }\r
-{ "encoding" "a string" } { "standalone" "a boolean" } { "prolog" "an XML prolog" } }\r
-{ $description "creates an XML prolog tuple" }\r
-{ $see-also prolog <xml> } ;\r
-\r
-HELP: comment\r
-{ $class-description "represents a comment in XML. Has one slot, text, which contains the string of the comment" }\r
-{ $see-also <comment> } ;\r
-\r
-HELP: <comment>\r
-{ $values { "text" "a string" } { "comment" "a comment" } }\r
-{ $description "creates an XML comment tuple" }\r
-{ $see-also comment } ;\r
-\r
-HELP: instruction\r
-{ $class-description "represents an XML instruction, such as <?xsl stylesheet='foo.xml'?>. Contains one slot, text, which contains the string between the question marks." }\r
-{ $see-also <instruction> } ;\r
-\r
-HELP: <instruction>\r
-{ $values { "text" "a string" } { "instruction" "an XML instruction" } }\r
-{ $description "creates an XML parsing instruction, such as <?xsl stylesheet='foo.xml'?>." }\r
-{ $see-also instruction } ;\r
-\r
-HELP: names-match?\r
-{ $values { "name1" "a name" } { "name2" "a name" } { "?" "t or f" } }\r
-{ $description "checks to see if the two names match, that is, if all fields are equal, ignoring fields whose value is f in either name." }\r
-{ $example "USING: prettyprint xml.data ;" "T{ name f \"rpc\" \"methodCall\" f } T{ name f f \"methodCall\" \"http://www.xmlrpc.org/\" } names-match? ." "t" }\r
-{ $see-also name } ;\r
-\r
 HELP: read-xml-chunk\r
 { $values { "stream" "an input stream" } { "seq" "a sequence of elements" } }\r
 { $description "rather than parse a document, as " { $link read-xml } " does, this word parses and returns a sequence of XML elements (tags, strings, etc), ie a document fragment. This is useful for pieces of XML which may have more than one main tag." }\r
-{ $see-also write-xml-chunk read-xml } ;\r
-\r
-HELP: get-id\r
-{ $values { "tag" "an XML tag or document" } { "id" "a string" } { "elem" "an XML element or f" } }\r
-{ $description "finds the XML tag with the specified id, ignoring the namespace" }\r
-{ $see-also } ;\r
-\r
-HELP: process\r
-{ $values { "object" "an opener, closer, contained or text element" } }\r
-{ $description  "takes an XML event and, using the XML stack, processes it and adds it to the tree"  } ;\r
+{ $see-also read-xml } ;\r
 \r
 HELP: sax\r
 { $values { "stream" "an input stream" } { "quot" "a quotation ( xml-elem -- )" } }\r
@@ -193,33 +31,6 @@ HELP: sax
 { $notes "It is important to note that this is not SAX, merely an event-based XML view" }\r
 { $see-also read-xml } ;\r
 \r
-HELP: opener\r
-{ $class-description "describes an opening tag, like <a>. Contains two slots, name and attrs containing, respectively, the name of the tag and its attributes. Usually, the name-url will be f." }\r
-{ $see-also closer contained } ;\r
-\r
-HELP: closer\r
-{ $class-description "describes a closing tag, like </a>. Contains one slot, name, containing the tag's name. Usually, the name-url will be f." }\r
-{ $see-also opener contained } ;\r
-\r
-HELP: contained\r
-{ $class-description "represents a self-closing tag, like <a/>. Contains two slots, name and attrs containing, respectively, the name of the tag and its attributes. Usually, the name-url will be f." }\r
-{ $see-also opener closer } ;\r
-\r
-HELP: parse-text\r
-{ $values { "string" "a string" } }\r
-{ $description "moves the pointer from the current spot to the beginning of the next tag, parsing the text underneath, returning the text element it passed. This parses XML entities like &bar; &#97; and &amp;" }\r
-{ $see-also parse-name } ;\r
-\r
-HELP: parse-name\r
-{ $values { "name" "an XML name" } }\r
-{ $description "parses a " { $link name } " from the input stream. Returns a name with only the name-space and name-tag defined, with name-url=f" }\r
-{ $see-also parse-text } ;\r
-\r
-HELP: make-tag\r
-{ $values { "tag" "an opener, closer or contained" } }\r
-{ $description "assuming the pointer is just past a <, this word parses until the next > and emits a tuple representing the tag parsed" }\r
-{ $see-also opener closer contained } ;\r
-\r
 HELP: pull-xml\r
 { $class-description "represents the state of a pull-parser for XML. Has one slot, scope, which is a namespace which contains all relevant state information." }\r
 { $see-also <pull-xml> pull-event pull-elem } ;\r
@@ -239,116 +50,6 @@ HELP: pull-event
 { $description "gets the next XML event from the given XML pull parser. Returns f upon exhaustion." }\r
 { $see-also pull-xml <pull-xml> pull-elem } ;\r
 \r
-HELP: write-xml-chunk\r
-{ $values { "object" "an XML element" } }\r
-{ $description "writes an XML element to " { $link output-stream } "." }\r
-{ $see-also write-xml-chunk write-xml } ;\r
-\r
-HELP: deep-tag-named\r
-{ $values { "tag" "an XML tag or document" } { "name/string" "an XML name or string representing a name" } { "matching-tag" tag } }\r
-{ $description "finds an XML tag with a matching name, recursively searching children and children of children" }\r
-{ $see-also tags-named tag-named deep-tags-named } ;\r
-\r
-HELP: deep-tags-named\r
-{ $values { "tag" "an XML tag or document" } { "name/string" "an XML name or string representing a name" } { "tags-seq" "a sequence of tags" } }\r
-{ $description "returns a sequence of all tags of a matching name, recursively searching children and children of children" }\r
-{ $see-also tag-named deep-tag-named tags-named } ;\r
-\r
-HELP: children>string\r
-{ $values { "tag" "an XML tag or document" } { "string" "a string" } }\r
-{ $description "concatenates the children of the tag, ignoring everything that's not a string" } ;\r
-\r
-HELP: children-tags\r
-{ $values { "tag" "an XML tag or document" } { "sequence" sequence } }\r
-{ $description "gets the children of the tag that are themselves tags" }\r
-{ $see-also first-child-tag } ;\r
-\r
-HELP: first-child-tag\r
-{ $values { "tag" "an XML tag or document" } { "tag" tag } }\r
-{ $description "returns the first child of the given tag that is a tag" }\r
-{ $see-also children-tags } ;\r
-\r
-HELP: multitags\r
-{ $class-description "XML parsing error describing the case where there is more than one main tag in a document. Contains no slots" } ;\r
-\r
-HELP: notags\r
-{ $class-description "XML parsing error describing the case where an XML document contains no main tag, or any tags at all" } ;\r
-\r
-HELP: extra-attrs\r
-{ $class-description "XML parsing error describing the case where the XML prolog (<?xml ...?>) contains attributes other than the three allowed ones, standalone, version and encoding. Contains one slot, attrs, which is a hashtable of all the extra attributes' names. Delegates to " { $link parsing-error } "." } ;\r
-\r
-HELP: nonexist-ns\r
-{ $class-description "XML parsing error describing the case where a namespace doesn't exist but it is used in a tag. Contains one slot, name, which contains the name of the undeclared namespace, and delegates to " { $link parsing-error } "." } ;\r
-\r
-HELP: not-yes/no\r
-{ $class-description "XML parsing error used to describe the case where standalone is set in the XML prolog to something other than 'yes' or 'no'. Delegates to " { $link parsing-error } " and contains one slot, text, which contains offending value." } ;\r
-\r
-HELP: unclosed\r
-{ $class-description "XML parsing error used to describe the case where the XML document contains classes which are not closed by the end of the document. Contains one slot, tags, a sequence of names." } ;\r
-\r
-HELP: mismatched\r
-{ $class-description "XML parsing error describing mismatched tags, eg <a></c>. Contains two slots: open is the name of the opening tag and close is the name of the closing tag. Delegates to " { $link parsing-error } " showing the location of the closing tag" } ;\r
-\r
-HELP: expected\r
-{ $class-description "XML parsing error describing when an expected token was not present. Delegates to " { $link parsing-error } ". Contains two slots, should-be, which has the expected string, and was, which has the actual string." } ;\r
-\r
-HELP: no-entity\r
-{ $class-description "XML parsing error describing the use of an undefined entity in a case where standalone is marked yes. Delegates to " { $link parsing-error } ". Contains one slot, thing, containing a string representing the entity." } ;\r
-\r
-HELP: open-tag\r
-{ $class-description "represents a tag that does have children, ie is not a contained tag" }\r
-{ $notes "the constructor used for this class is simply " { $link <tag> } "." }\r
-{ $see-also tag contained-tag } ;\r
-\r
-HELP: tag-named\r
-{ $values { "tag" "an XML tag or document" }\r
-    { "name/string" "an XML name or string representing the name" }\r
-    { "matching-tag" tag } }\r
-{ $description "finds the first tag with matching name which is the direct child of the given tag" }\r
-{ $see-also deep-tags-named deep-tag-named tags-named } ;\r
-\r
-HELP: tags-named\r
-{ $values { "tag" "an XML tag or document" }\r
-    { "name/string" "an XML name or string representing the name" }\r
-    { "tags-seq" "a sequence of tags" } }\r
-{ $description "finds all tags with matching name that are the direct children of the given tag" }\r
-{ $see-also deep-tag-named deep-tags-named tag-named } ;\r
-\r
-HELP: state-parse\r
-{ $values { "stream" "an input stream" } { "quot" "a quotation ( -- )" } }\r
-{ $description "takes a stream and runs an imperative parser on it, allowing words like " { $link next } " to be used within the context of the stream." } ;\r
-\r
-HELP: pre/post-content\r
-{ $class-description "describes the error where a non-whitespace string is used before or after the main tag in an XML document. Contains two slots: string contains the offending string, and pre? is t if it occured before the main tag and f if it occured after" } ;\r
-\r
-HELP: unclosed-quote\r
-{ $class-description "describes the error where a quotation for an attribute value is opened but not closed before the end of the document." } ;\r
-\r
-HELP: bad-name\r
-{ $class-description "describes the error where a name is used, for example in an XML tag or attribute key, which is invalid." } ;\r
-\r
-HELP: quoteless-attr\r
-{ $class-description "describes the error where an attribute of an XML tag is missing quotes around a value." } ;\r
-\r
-HELP: entities\r
-{ $description "a hash table from default XML entity names (like &amp; and &lt;) to the characters they represent. This is automatically included when parsing any XML document." }\r
-{ $see-also html-entities } ;\r
-\r
-HELP: html-entities\r
-{ $description "a hash table from HTML entity names to their character values" }\r
-{ $see-also entities with-html-entities } ;\r
-\r
-HELP: with-entities\r
-{ $values { "entities" "a hash table of strings to chars" }\r
-    { "quot" "a quotation ( -- )" } }\r
-{ $description "calls the quotation using the given table of entity values (symbolizing, eg, that &foo; represents CHAR: a) on top of the default XML entities" }\r
-{ $see-also with-html-entities } ;\r
-\r
-HELP: with-html-entities\r
-{ $values { "quot" "a quotation ( -- )" } }\r
-{ $description "calls the given quotation using HTML entity values" }\r
-{ $see-also html-entities with-entities } ;\r
-\r
 ARTICLE: { "xml" "reading" } "Reading XML"\r
     "The following words are used to read something into an XML document"\r
     { $subsection string>xml }\r
@@ -357,77 +58,8 @@ ARTICLE: { "xml" "reading" } "Reading XML"
     { $subsection string>xml-chunk }\r
     { $subsection file>xml } ;\r
 \r
-ARTICLE: { "xml" "writing" } "Writing XML"\r
-    "These words are used in implementing prettyprint"\r
-    { $subsection write-xml-chunk }\r
-    "These words are used to print XML normally"\r
-    { $subsection xml>string }\r
-    { $subsection write-xml }\r
-    { $subsection print-xml }\r
-    "These words are used to prettyprint XML"\r
-    { $subsection pprint-xml>string }\r
-    { $subsection pprint-xml>string-but }\r
-    { $subsection pprint-xml }\r
-    { $subsection pprint-xml-but }\r
-    "This word reads and writes XML"\r
-    { $subsection xml-reprint } ;\r
-\r
-ARTICLE: { "xml" "classes" } "XML data classes"\r
-    "Data types that XML documents are made of:"\r
-    { $subsection name }\r
-    { $subsection tag }\r
-    { $subsection contained-tag }\r
-    { $subsection open-tag }\r
-    { $subsection xml }\r
-    { $subsection prolog }\r
-    { $subsection comment }\r
-    { $subsection instruction } ;\r
-\r
-ARTICLE: { "xml" "construct" } "XML data constructors"\r
-    "These data types are constructed with:"\r
-    { $subsection <name> }\r
-    { $subsection <tag> }\r
-    { $subsection <contained-tag> }\r
-    { $subsection <xml> }\r
-    { $subsection <prolog> }\r
-    { $subsection <comment> }\r
-    { $subsection <instruction> } ;\r
-\r
-ARTICLE: { "xml" "utils" } "XML processing utilities"\r
-    "Utilities for processing XML include..."\r
-    $nl\r
-    "System sfor creating words which dispatch on XML tags:"\r
-    { $subsection POSTPONE: PROCESS: }\r
-    { $subsection POSTPONE: TAG: }\r
-    "Getting parts of an XML document or tag:"\r
-    $nl\r
-    "Note: the difference between deep-tag-named and tag-named is that the former searches recursively among all children and children of children of the tag, while the latter only looks at the direct children, and is therefore more efficient."\r
-    { $subsection tag-named }\r
-    { $subsection tags-named }\r
-    { $subsection deep-tag-named }\r
-    { $subsection deep-tags-named }\r
-    { $subsection get-id }\r
-    "Words for simplified generation of XML:"\r
-    { $subsection build-tag* }\r
-    { $subsection build-tag }\r
-    { $subsection build-xml }\r
-    "Other relevant words:"\r
-    { $subsection children>string }\r
-    { $subsection children-tags }\r
-    { $subsection first-child-tag }\r
-    { $subsection names-match? }\r
-    { $subsection assert-tag } ;\r
-\r
-ARTICLE: { "xml" "internal" } "Internals of the XML parser"\r
-    "The XML parser creates its own parsing framework to process XML documents. The parser operates on streams. Important words involved in processing are:"\r
-    { $subsection parse-text }\r
-    { $subsection make-tag }\r
-    { $subsection parse-name }\r
-    { $subsection process }\r
-    "The XML parser is implemented using the libs/state-parser module. For more information, see " { $link { "state-parser" "main" } } ;\r
-\r
 ARTICLE: { "xml" "events" } "Event-based XML parsing"\r
-    "In addition to DOM-style parsing based around " { $link read-xml } ", the XML module also provides SAX-style event-based parsing. This uses much of the same data structures as normal XML, with the exception of the classes " { $link xml } " and " { $link tag } " and as such, the articles " { $link { "xml" "classes" } } " and " { $link { "xml" "construct" } } " may be useful in learning how to process documents in this way. Other useful words are:"\r
+    "In addition to DOM-style parsing based around " { $link read-xml } ", the XML module also provides SAX-style event-based parsing. This uses much of the same data structures as normal XML, with the exception of the classes " { $link xml } " and " { $link tag } " and as such, the article " { $vocab-link "xml.data" } " may be useful in learning how to process documents in this way. Other useful words are:"\r
     { $subsection sax }\r
     { $subsection opener }\r
     { $subsection closer }\r
@@ -438,44 +70,14 @@ ARTICLE: { "xml" "events" } "Event-based XML parsing"
     { $subsection pull-event }\r
     { $subsection pull-elem } ;\r
 \r
-ARTICLE: { "xml" "errors" } "XML parsing errors"\r
-    "The XML module provides a rich and highly inspectable set of parsing errors. All XML errors are described by the union class " { $link xml-parse-error } " but there are many classes contained in that:"\r
-    { $subsection multitags }\r
-    { $subsection notags }\r
-    { $subsection extra-attrs }\r
-    { $subsection nonexist-ns }\r
-    { $subsection not-yes/no }\r
-    { $subsection unclosed }\r
-    { $subsection mismatched }\r
-    { $subsection expected }\r
-    { $subsection no-entity }\r
-    { $subsection pre/post-content }\r
-    { $subsection unclosed-quote }\r
-    { $subsection bad-name }\r
-    { $subsection quoteless-attr }\r
-    "Additionally, most of these errors delegate to " { $link parsing-error } " in order to provide more information"\r
-    $nl\r
-    "Note that, in parsing an XML document, only the first error is reported." ;\r
-\r
-ARTICLE: { "xml" "entities" } "XML entities"\r
-    "When XML is parsed, entities like &foo; are replaced with the characters they represent. A few entities like &amp; and &lt; are defined by default, but more are available, and the set of entities can be customized. Below are some words involved in XML entities, defined in the vocabulary 'entities':"\r
-    { $subsection entities }\r
-    { $subsection html-entities }\r
-    { $subsection with-entities }\r
-    { $subsection with-html-entities } ;\r
-\r
 ARTICLE: "xml" "XML parser"\r
 "The " { $vocab-link "xml" } " vocabulary implements the XML 1.0 and 1.1 standards, converting strings of text into XML and vice versa."\r
     { $subsection { "xml" "reading" } }\r
-    { $subsection { "xml" "writing" } }\r
-    { $subsection { "xml" "classes" } }\r
-    { $subsection { "xml" "construct" } }\r
-    { $subsection { "xml" "utils" } }\r
-    { $subsection { "xml" "internal" } }\r
     { $subsection { "xml" "events" } }\r
-    { $subsection { "xml" "errors" } }\r
-    { $subsection { "xml" "entities" } } ;\r
-\r
-IN: xml\r
+    { $vocab-subsection "Utilities for processing XML" "xml.utilities" }\r
+    { $vocab-subsection "Writing XML" "xml.writer" }\r
+    { $vocab-subsection "XML parsing errors" "xml.errors" }\r
+    { $vocab-subsection "XML entities" "xml.entities" }\r
+    { $vocab-subsection "XML data types" "xml.data" } ;\r
 \r
 ABOUT: "xml"\r
index 328a058a582bcba6f783acd88d6c714d9df4e8ad..636aa288b58748fd5c8a76f7a695e215e72ed233 100644 (file)
@@ -1,9 +1,9 @@
-! Copyright (C) 2005, 2006 Daniel Ehrenberg
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays io io.encodings.binary io.files
-io.streams.string kernel namespaces sequences state-parser strings
-xml.backend xml.data xml.errors xml.tokenize ascii
-xml.writer ;
+io.streams.string kernel namespaces sequences strings
+xml.backend xml.data xml.errors xml.elements ascii xml.entities
+xml.writer xml.state xml.autoencoding assocs xml.tokenize xml.name ;
 IN: xml
 
 !   -- Overall parser with data tree
@@ -25,11 +25,6 @@ M: prolog process
     xml-stack get V{ { f V{ } } } =
     [ bad-prolog ] unless drop ;
 
-M: instruction process
-    xml-stack get length 1 =
-    [ bad-instruction ] unless
-    add-child ;
-
 M: directive process
     xml-stack get dup length 1 =
     swap first second [ tag? ] contains? not and
@@ -53,7 +48,9 @@ M: closer process
     <tag> add-child ;
 
 : init-xml-stack ( -- )
-    V{ } clone xml-stack set f push-xml ;
+    V{ } clone xml-stack set
+    extra-entities [ H{ } assoc-like ] change
+    f push-xml ;
 
 : default-prolog ( -- prolog )
     "1.0" "UTF-8" f <prolog> ;
@@ -135,7 +132,7 @@ TUPLE: pull-xml scope ;
         reset-prolog init-ns-stack
         start-document [ call-under ] when*
         sax-loop
-    ] state-parse ; inline recursive
+    ] with-state ; inline recursive
 
 : (read-xml) ( -- )
     start-document [ process ] when*
@@ -147,14 +144,15 @@ TUPLE: pull-xml scope ;
         done? [ unclosed ] unless
         xml-stack get first second
         prolog-data get swap
-    ] state-parse ;
+    ] with-state ;
 
 : read-xml ( stream -- xml )
-    #! Produces a tree of XML nodes
-    (read-xml-chunk) make-xml-doc ;
+    0 depth
+    [ (read-xml-chunk) make-xml-doc ] with-variable ;
 
 : read-xml-chunk ( stream -- seq )
-    (read-xml-chunk) nip ;
+    1 depth
+    [ (read-xml-chunk) nip ] with-variable ;
 
 : string>xml ( string -- xml )
     <string-reader> read-xml ;
@@ -164,9 +162,4 @@ TUPLE: pull-xml scope ;
     [ <string-reader> read-xml-chunk ] with-variable ;
 
 : file>xml ( filename -- xml )
-    ! Autodetect encoding!
     binary <file-reader> read-xml ;
-
-: xml-reprint ( string -- )
-    string>xml print-xml ;
-
index 969c7249a9205150c01fdacb1b82db9f273411ab..ac82da7b9be495ab478a9db72523c344ab7cda96 100644 (file)
@@ -118,3 +118,15 @@ unit-test
         { "nachos" "cheese" }
     } extract-keys
 ] unit-test
+
+[ f ] [
+    "a" H{ { "a" f } } at-default
+] unit-test
+
+[ "b" ] [
+    "b" H{ { "a" f } } at-default
+] unit-test
+
+[ "x" ] [
+    "a" H{ { "a" "x" } } at-default
+] unit-test
\ No newline at end of file
index 748300ef0f8d20e0020249fbcfe5116eecd64bbb..7f34c3b19da946108c50f06c87eb8fd398308557 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Daniel Ehrenberg, Slava Pestov
+! Copyright (C) 2007, 2009 Daniel Ehrenberg, Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel sequences arrays math sequences.private vectors
 accessors ;
@@ -41,8 +41,7 @@ GENERIC: >alist ( assoc -- newassoc )
     over assoc-map-as ; inline
 
 : assoc-push-if ( key value quot accum -- )
-    [ 2keep rot ] dip swap
-    [ [ 2array ] dip push ] [ 3drop ] if ; inline
+    [ 2keep ] dip [ [ 2array ] dip push ] 3curry when ; inline
 
 : assoc-pusher ( quot -- quot' accum )
     V{ } clone [ [ assoc-push-if ] 2curry ] keep ; inline
@@ -62,9 +61,12 @@ GENERIC: >alist ( assoc -- newassoc )
 : at ( key assoc -- value/f )
     at* drop ; inline
 
+: at-default ( key assoc -- value/key )
+    2dup at* [ 2nip ] [ 2drop ] if ; inline
+
 M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
     over assoc-size swap new-assoc
-    swap [ swap pick set-at ] assoc-each ;
+    [ [ swapd set-at ] curry assoc-each ] keep ;
 
 : keys ( assoc -- keys )
     [ drop ] { } assoc>map ;
@@ -76,7 +78,7 @@ M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
     [ at* ] 2keep delete-at ;
 
 : rename-at ( newkey key assoc -- )
-    tuck delete-at* [ -rot set-at ] [ 3drop ] if ;
+    [ delete-at* ] keep [ swapd set-at ] curry [ 2drop ] if ;
 
 : assoc-empty? ( assoc -- ? )
     assoc-size zero? ;
@@ -132,14 +134,16 @@ M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
     substituter map ;
 
 : cache ( key assoc quot -- value )
-    2over at* [
-        [ 3drop ] dip
-    ] [
-        drop pick rot [ call dup ] 2dip set-at
-    ] if ; inline
+    [ [ at* ] 2keep ] dip
+    [ [ nip call dup ] [ drop ] 3bi set-at ] 3curry
+    [ drop ] prepose
+    unless ; inline
+
+: 2cache ( key1 key2 assoc quot -- value )
+    [ 2array ] 2dip [ first2 ] prepose cache ; inline
 
 : change-at ( key assoc quot -- )
-    [ [ at ] dip call ] 3keep drop set-at ; inline
+    [ [ at ] dip call ] [ drop ] 3bi set-at ; inline
 
 : at+ ( n key assoc -- ) [ 0 or + ] change-at ; inline
 
index 1b86ce0b0a939e44afd21b709222af71ade524a6..4625c665bf229bc79a56fdf1ce2950693c80002c 100644 (file)
@@ -17,9 +17,6 @@ TUPLE: anonymous-complement class ;
 \r
 C: <anonymous-complement> anonymous-complement\r
 \r
-: 2cache ( key1 key2 assoc quot -- value )\r
-    [ 2array ] 2dip [ first2 ] prepose cache ; inline\r
-\r
 GENERIC: valid-class? ( obj -- ? )\r
 \r
 M: class valid-class? drop t ;\r
index 1aeed75470d0d28c8b8dfdd8f406fc70e3ff4e09..ea7cf829c461ce7f278c87ead2d2669a9b01fd15 100644 (file)
@@ -1096,7 +1096,7 @@ HELP: set-fourth
 
 HELP: replicate
 { $values
-     { "seq" sequence } { "quot" quotation }
+     { "seq" sequence } { "quot" { $quotation "( -- elt )" } }
      { "newseq" sequence } }
 { $description "Calls the quotation for every element of the sequence in order. However, the element is not passed to the quotation -- it is dropped, and the quotation produces an element of its own that is collected into a sequence of the same class as the input sequence." }
 { $examples 
index 99766cadc218b2d289fe129b569ef816378bc8cf..f166378d9d20aa3a3a747a4e97272d00c38e5cc6 100644 (file)
@@ -1,9 +1,9 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays byte-arrays kernel kernel.private math namespaces
 make sequences strings words effects generic generic.standard
 classes classes.algebra slots.private combinators accessors
-words sequences.private assocs alien quotations ;
+words sequences.private assocs alien quotations hashtables ;
 IN: slots
 
 TUPLE: slot-spec name offset class initial read-only ;
@@ -86,7 +86,7 @@ ERROR: bad-slot-value value class ;
     ] [ ] make ;
 
 : writer-props ( slot-spec -- assoc )
-    [ "writing" set ] H{ } make-assoc ;
+    "writing" associate ;
 
 : define-writer ( class slot-spec -- )
     [ name>> writer-word ] [ writer-quot ] [ writer-props ] tri
index a2a302d995fad1b6f47b16b55584713afef4b60e..e31a25b687f981d581afb76cfba310556db64611 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel math make strings arrays vectors sequences
 sets math.order accessors ;
@@ -16,19 +16,23 @@ IN: splitting
 : ?tail-slice ( seq end -- newseq ? )
     2dup tail? [ length head-slice* t ] [ drop f ] if ;
 
+: (split1) ( seq subseq -- start end ? )
+    tuck swap start dup
+    [ swap [ drop ] [ length + ] 2bi t ]
+    [ 2drop f f f ]
+    if ;
+
 : split1 ( seq subseq -- before after )
-    dup pick start dup [
-        [ [ over ] dip head -rot length ] keep + tail
-    ] [
-        2drop f
-    ] if ;
+    [ drop ] [ (split1) ] 2bi
+    [ [ over ] dip [ head ] [ tail ] 2bi* ]
+    [ 2drop f ]
+    if ;
 
 : split1-slice ( seq subseq -- before-slice after-slice )
-    dup pick start dup [
-        [ [ over ] dip head-slice -rot length ] keep + tail-slice
-    ] [
-        2drop f
-    ] if ;
+    [ drop ] [ (split1) ] 2bi
+    [ [ over ] dip [ head-slice ] [ tail-slice ] 2bi* ]
+    [ 2drop f ]
+    if ;
 
 : split1-last ( seq subseq -- before after )
     [ <reversed> ] bi@ split1 [ reverse ] bi@
index 1908e28d39365d30ecb350a51850e15bca3ea173..3d46e06b686476fee5fff46818571d04e0a060ff 100755 (executable)
@@ -30,7 +30,7 @@ USING: asn1 asn1.ldap io io.streams.string tools.test ;
     ] unit-test
 
     [ B{ 133 6 97 98 99 100 101 102 } ] [ 
-        5 "abcdef" >ber-contextspecific 
+        5 "abcdef" >ber-contextspecific-string 
     ] unit-test
 
     ! triggers array
@@ -45,7 +45,7 @@ USING: asn1 asn1.ldap io io.streams.string tools.test ;
     ] unit-test
 
     [ B{ 160 4 49 50 51 52 } ] [ 
-        { 1 2 3 4 } >ber-contextspecific 
+        { 1 2 3 4 } >ber-contextspecific-array
     ] unit-test
 
 ] with-ber
index b087d3ae2baf47636c91feeb0af739f31ba59bb5..2b96d2a4f4e02dde9f33c783815b61a9f609480c 100644 (file)
@@ -7,6 +7,24 @@ math.parser namespaces make pack strings sequences accessors ;
 
 IN: asn1
 
+<PRIVATE
+
+: (>128-ber) ( n -- )
+    dup 0 > [
+        [ HEX: 7f bitand HEX: 80 bitor , ] keep -7 shift
+        (>128-ber)
+    ] [
+        drop
+    ] if ;
+
+PRIVATE>
+
+: >128-ber ( n -- str )
+    [
+        [ HEX: 7f bitand , ] keep -7 shift
+        (>128-ber)
+    ] { } make reverse ;
+
 : tag-classes ( -- seq )
     { "universal" "application" "context_specific" "private" } ;
 
@@ -191,8 +209,7 @@ M: string >ber ( str -- byte-array )
 : >ber-application-string ( n str -- byte-array )
     [ HEX: 40 + set-tag ] dip >ber ;
 
-GENERIC: >ber-contextspecific ( n obj -- byte-array )
-M: string >ber-contextspecific ( n str -- byte-array )
+: >ber-contextspecific-string ( n str -- byte-array )
     [ HEX: 80 + set-tag ] dip >ber ;
 
 ! =========================================================
@@ -215,5 +232,5 @@ M: array >ber ( array -- byte-array )
 : >ber-appsequence ( array -- byte-array )
     HEX: 60 >ber-seq-internal ;
 
-M: array >ber-contextspecific ( array -- byte-array )
+: >ber-contextspecific-array ( array -- byte-array )
     HEX: A0 >ber-seq-internal ;
index f52a34ff28fa5ea91b249d120639e40a25897801..2bf8f1b98d36df37ec124185f2a1592b7c68412e 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz.
 ! See http://factorcode.org/license.txt for BSD license.
 
-USING: accessors arrays assocs compiler.units definitions fuel.eval
-fuel.help help.markup help.topics io.pathnames kernel math math.order
-memoize namespaces parser sequences sets sorting tools.crossref
-tools.scaffold tools.vocabs vocabs vocabs.loader vocabs.parser words ;
+USING: assocs compiler.units fuel.eval fuel.help fuel.remote fuel.xref
+help.topics io.pathnames kernel namespaces parser sequences
+tools.scaffold vocabs.loader ;
 
 IN: fuel
 
@@ -50,92 +49,40 @@ PRIVATE>
 
 ! Edit locations
 
-<PRIVATE
-
-: fuel-normalize-loc ( seq -- path line )
-    [ dup length 0 > [ first (normalize-path) ] [ drop f ] if ]
-    [ dup length 1 > [ second ] [ drop 1 ] if ] bi ;
-
-: fuel-get-loc ( object -- )
-    fuel-normalize-loc 2array fuel-eval-set-result ;
-
-PRIVATE>
-
-: fuel-get-edit-location ( word -- ) where fuel-get-loc ; inline
+: fuel-get-word-location ( word -- )
+    word-location fuel-eval-set-result ;
 
 : fuel-get-vocab-location ( vocab -- )
-    >vocab-link fuel-get-edit-location ; inline
-
-: fuel-get-doc-location ( word -- ) props>> "help-loc" swap at fuel-get-loc ;
-
-: fuel-get-article-location ( name -- ) article loc>> fuel-get-loc ;
-
-! Cross-references
-
-<PRIVATE
-
-: fuel-word>xref ( word -- xref )
-    [ name>> ] [ vocabulary>> ] [ where fuel-normalize-loc ] tri 4array ;
-
-: fuel-sort-xrefs ( seq -- seq' )
-    [ [ first ] dip first <=> ] sort ; inline
-
-: fuel-format-xrefs ( seq -- seq' )
-    [ word? ] filter [ fuel-word>xref ] map ; inline
-
-: (fuel-index) ( seq -- seq )
-    [ [ >link name>> ] [ article-title ] bi 2array \ $subsection prefix ] map ;
-
-PRIVATE>
-
-: fuel-callers-xref ( word -- )
-    usage fuel-format-xrefs fuel-sort-xrefs fuel-eval-set-result ; inline
-
-: fuel-callees-xref ( word -- )
-    uses fuel-format-xrefs fuel-sort-xrefs fuel-eval-set-result ; inline
-
-: fuel-apropos-xref ( str -- )
-    words-matching fuel-format-xrefs fuel-eval-set-result ; inline
-
-: fuel-vocab-xref ( vocab -- )
-    words fuel-format-xrefs fuel-eval-set-result ; inline
+    vocab-location fuel-eval-set-result ;
 
-: fuel-index ( quot: ( -- seq ) -- )
-    call (fuel-index) fuel-eval-set-result ; inline
+: fuel-get-doc-location ( word -- )
+    doc-location fuel-eval-set-result ;
 
-! Completion support
+: fuel-get-article-location ( name -- )
+    article-location fuel-eval-set-result ;
 
-<PRIVATE
-
-: fuel-filter-prefix ( seq prefix -- seq )
-    [ drop-prefix nip length 0 = ] curry filter prune ; inline
+: fuel-get-vocabs ( -- )
+    get-vocabs fuel-eval-set-result ;
 
-: (fuel-get-vocabs) ( -- seq )
-    all-vocabs-seq [ vocab-name ] map ; inline
+: fuel-get-vocabs/prefix ( prefix -- )
+    get-vocabs/prefix fuel-eval-set-result ;
 
-MEMO: (fuel-vocab-words) ( name -- seq )
-    >vocab-link words [ name>> ] map ;
+: fuel-get-words ( prefix names -- )
+    get-vocabs-words/prefix fuel-eval-set-result ;
 
-: fuel-current-words ( -- seq )
-    use get [ keys ] map concat ; inline
+! Cross-references
 
-: fuel-vocabs-words ( names -- seq )
-    prune [ (fuel-vocab-words) ] map concat ; inline
+: fuel-callers-xref ( word -- ) callers-xref fuel-eval-set-result ;
 
-: (fuel-get-words) ( prefix names/f -- seq )
-    [ fuel-vocabs-words ] [ fuel-current-words ] if* natural-sort
-    swap fuel-filter-prefix ;
+: fuel-callees-xref ( word -- ) callees-xref fuel-eval-set-result ;
 
-PRIVATE>
+: fuel-apropos-xref ( str -- ) apropos-xref fuel-eval-set-result ;
 
-: fuel-get-vocabs ( -- )
-    (fuel-get-vocabs) fuel-eval-set-result ;
+: fuel-vocab-xref ( vocab -- ) vocab-xref fuel-eval-set-result ;
 
-: fuel-get-vocabs/prefix ( prefix -- )
-    (fuel-get-vocabs) swap fuel-filter-prefix fuel-eval-set-result ;
+: fuel-vocab-uses-xref ( vocab -- ) vocab-uses-xref fuel-eval-set-result ;
 
-: fuel-get-words ( prefix names -- )
-    (fuel-get-words) fuel-eval-set-result ;
+: fuel-vocab-usage-xref ( vocab -- ) vocab-usage-xref fuel-eval-set-result ;
 
 ! Help support
 
@@ -155,6 +102,8 @@ PRIVATE>
 : fuel-vocab-summary ( name -- )
     (fuel-vocab-summary) fuel-eval-set-result ;
 
+: fuel-index ( quot -- ) call format-index fuel-eval-set-result ;
+
 : fuel-get-vocabs/tag ( tag -- )
     (fuel-get-vocabs/tag) fuel-eval-set-result ;
 
@@ -174,3 +123,6 @@ PRIVATE>
 
 : fuel-scaffold-get-root ( name -- ) find-vocab-root fuel-eval-set-result ;
 
+! Remote connection
+
+MAIN: fuel-start-remote-listener*
index ff7239ac8f4820fb2d59e8f817efddddd7f3effa..e70327bd35b949ad9cd51409bb90a8d1d9e94475 100644 (file)
@@ -109,3 +109,6 @@ MEMO: (fuel-get-vocabs/author) ( author -- element )
 MEMO: (fuel-get-vocabs/tag) ( tag -- element )
     [ "Vocabularies tagged " prepend \ $heading swap 2array ]
     [ tagged fuel-vocab-list ] bi 2array ;
+
+: format-index ( seq -- seq )
+    [ [ >link name>> ] [ article-title ] bi 2array \ $subsection prefix ] map ;
diff --git a/extra/fuel/remote/authors.txt b/extra/fuel/remote/authors.txt
new file mode 100644 (file)
index 0000000..48f802a
--- /dev/null
@@ -0,0 +1 @@
+Jose Antonio Ortega Ruiz
\ No newline at end of file
diff --git a/extra/fuel/remote/remote.factor b/extra/fuel/remote/remote.factor
new file mode 100644 (file)
index 0000000..454265d
--- /dev/null
@@ -0,0 +1,28 @@
+! Copyright (C) 2009 Jose Antonio Ortega Ruiz.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors io io.encodings.utf8 io.servers.connection kernel
+listener math ;
+
+IN: fuel.remote
+
+<PRIVATE
+
+: server ( port -- server )
+    <threaded-server>
+        "tty-server" >>name
+        utf8 >>encoding
+        swap local-server >>insecure
+        [ listener ] >>handler
+        f >>timeout ;
+
+: print-banner ( -- )
+    "Starting server. Connect with 'M-x connect-to-factor' in Emacs"
+    write nl flush ;
+
+PRIVATE>
+
+: fuel-start-remote-listener ( port/f -- )
+    print-banner integer? [ 9000 ] unless* server start-server ;
+
+: fuel-start-remote-listener* ( -- ) f fuel-start-remote-listener ;
+
diff --git a/extra/fuel/xref/authors.txt b/extra/fuel/xref/authors.txt
new file mode 100644 (file)
index 0000000..48f802a
--- /dev/null
@@ -0,0 +1 @@
+Jose Antonio Ortega Ruiz
\ No newline at end of file
diff --git a/extra/fuel/xref/xref.factor b/extra/fuel/xref/xref.factor
new file mode 100644 (file)
index 0000000..5f5e28d
--- /dev/null
@@ -0,0 +1,69 @@
+! Copyright (C) 2009 Jose Antonio Ortega Ruiz.
+! See http://factorcode.org/license.txt for BSD license.
+
+USING: accessors arrays assocs definitions help.topics io.pathnames
+kernel math math.order memoize namespaces sequences sets sorting
+tools.crossref tools.vocabs vocabs vocabs.parser words ;
+
+IN: fuel.xref
+
+<PRIVATE
+
+: normalize-loc ( seq -- path line )
+    [ dup length 0 > [ first (normalize-path) ] [ drop f ] if ]
+    [ dup length 1 > [ second ] [ drop 1 ] if ] bi ;
+
+: get-loc ( object -- loc ) normalize-loc 2array ;
+
+: word>xref ( word -- xref )
+    [ name>> ] [ vocabulary>> ] [ where normalize-loc ] tri 4array ;
+
+: vocab>xref ( vocab -- xref )
+    dup dup >vocab-link where normalize-loc 4array ;
+
+: sort-xrefs ( seq -- seq' )
+    [ [ first ] dip first <=> ] sort ; inline
+
+: format-xrefs ( seq -- seq' )
+    [ word? ] filter [ word>xref ] map ; inline
+
+: filter-prefix ( seq prefix -- seq )
+    [ drop-prefix nip length 0 = ] curry filter prune ; inline
+
+MEMO: (vocab-words) ( name -- seq )
+    >vocab-link words [ name>> ] map ;
+
+: current-words ( -- seq )
+    use get [ keys ] map concat ; inline
+
+: vocabs-words ( names -- seq )
+    prune [ (vocab-words) ] map concat ; inline
+
+PRIVATE>
+
+: callers-xref ( word -- seq ) usage format-xrefs sort-xrefs ;
+
+: callees-xref ( word -- seq ) uses format-xrefs sort-xrefs ;
+
+: apropos-xref ( str -- seq ) words-matching format-xrefs ;
+
+: vocab-xref ( vocab -- seq ) words format-xrefs ;
+
+: word-location ( word -- loc ) where get-loc ;
+
+: vocab-location ( vocab -- loc ) >vocab-link where get-loc ;
+
+: vocab-uses-xref ( vocab -- seq ) vocab-uses [ vocab>xref ] map ;
+
+: vocab-usage-xref ( vocab -- seq ) vocab-usage [ vocab>xref ] map ;
+
+: doc-location ( word -- loc ) props>> "help-loc" swap at get-loc ;
+
+: article-location ( name -- loc ) article loc>> get-loc ;
+
+: get-vocabs ( -- seq ) all-vocabs-seq [ vocab-name ] map ;
+
+: get-vocabs/prefix ( prefix -- seq ) get-vocabs swap filter-prefix ;
+
+: get-vocabs-words/prefix ( prefix names/f -- seq )
+    [ vocabs-words ] [ current-words ] if* natural-sort swap filter-prefix ;
index 836693026a41da1152f6851da2b6f79ca5c9376d..c445b708c5859bf73e2ad6bf6f317f7f2ca3608f 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays html.parser.utils hashtables io kernel
 namespaces make prettyprint quotations sequences splitting
-state-parser strings unicode.categories unicode.case ;
+html.parser.state strings unicode.categories unicode.case ;
 IN: html.parser
 
 TUPLE: tag name attributes text closing? ;
@@ -59,8 +59,8 @@ SYMBOL: tagstack
     [ get-char CHAR: " = ] take-until ;
 
 : read-quote ( -- string )
-    get-char next* CHAR: ' =
-    [ read-single-quote ] [ read-double-quote ] if next* ;
+    get-char next CHAR: ' =
+    [ read-single-quote ] [ read-double-quote ] if next ;
 
 : read-key ( -- string )
     read-whitespace*
@@ -68,7 +68,7 @@ SYMBOL: tagstack
 
 : read-= ( -- )
     read-whitespace*
-    [ get-char CHAR: = = ] take-until drop next* ;
+    [ get-char CHAR: = = ] take-until drop next ;
 
 : read-value ( -- string )
     read-whitespace*
@@ -76,14 +76,14 @@ SYMBOL: tagstack
     [ blank? ] trim ;
 
 : read-comment ( -- )
-    "-->" take-string* make-comment-tag push-tag ;
+    "-->" take-string make-comment-tag push-tag ;
 
 : read-dtd ( -- )
-    ">" take-string* make-dtd-tag push-tag ;
+    ">" take-string make-dtd-tag push-tag ;
 
 : read-bang ( -- )
-    next* get-char CHAR: - = get-next CHAR: - = and [
-        next* next*
+    next get-char CHAR: - = get-next CHAR: - = and [
+        next next
         read-comment
     ] [
         read-dtd
@@ -91,10 +91,10 @@ SYMBOL: tagstack
 
 : read-tag ( -- string )
     [ get-char CHAR: > = get-char CHAR: < = or ] take-until
-    get-char CHAR: < = [ next* ] unless ;
+    get-char CHAR: < = [ next ] unless ;
 
 : read-< ( -- string )
-    next* get-char CHAR: ! = [
+    next get-char CHAR: ! = [
         read-bang f
     ] [
         read-tag
diff --git a/extra/html/parser/state/state-tests.factor b/extra/html/parser/state/state-tests.factor
new file mode 100644 (file)
index 0000000..a9be38c
--- /dev/null
@@ -0,0 +1,13 @@
+USING: tools.test html.parser.state ascii kernel ;
+IN: html.parser.state.tests
+
+: take-rest ( -- string )
+    [ f ] take-until ;
+
+: take-char ( -- string )
+    [ get-char = ] curry take-until ;
+
+[ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test
+[ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until take-rest ] string-parse ] unit-test
+[ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test
+! [ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test
diff --git a/extra/html/parser/state/state.factor b/extra/html/parser/state/state.factor
new file mode 100644 (file)
index 0000000..4b1027d
--- /dev/null
@@ -0,0 +1,41 @@
+! Copyright (C) 2005, 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: namespaces math kernel sequences accessors fry circular ;
+IN: html.parser.state
+
+TUPLE: state string i ;
+
+: get-i ( -- i ) state get i>> ;
+
+: get-char ( -- char )
+    state get [ i>> ] [ string>> ] bi ?nth ;
+
+: get-next ( -- char )
+    state get [ i>> 1+ ] [ string>> ] bi ?nth ;
+
+: next ( -- )
+    state get [ 1+ ] change-i drop ;
+
+: string-parse ( string quot -- )
+    [ 0 state boa state ] dip with-variable ;
+
+: short* ( n seq -- n' seq )
+    over [ nip dup length swap ] unless ;
+
+: skip-until ( quot: ( -- ? ) -- )
+    get-char [
+        [ call ] keep swap
+        [ drop ] [ next skip-until ] if
+    ] [ drop ] if ; inline recursive
+
+: take-until ( quot: ( -- ? ) -- )
+    [ get-i ] dip skip-until get-i
+    state get string>> subseq ;
+
+: string-matches? ( string circular -- ? )
+    get-char over push-circular sequence= ;
+
+: take-string ( match -- string )
+    dup length <circular-string>
+    [ 2dup string-matches? ] take-until nip
+    dup length rot length 1- - head next ;
index 4b25db16fd860a3e1c578d099f32e8fb3239af76..6d8e3bc05f07128f9c288fd3247ecd74ef30d905 100644 (file)
@@ -1,7 +1,7 @@
 USING: assocs combinators continuations hashtables
 hashtables.private io kernel math
 namespaces prettyprint quotations sequences splitting
-state-parser strings tools.test ;
+strings tools.test ;
 USING: html.parser.utils ;
 IN: html.parser.utils.tests
 
index c2a9d73af89de917a2335c59807d6354ee8069d3..c913b9d306cebd77db6e8785706300fb7063b73e 100644 (file)
@@ -2,17 +2,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs circular combinators continuations hashtables
 hashtables.private io kernel math namespaces prettyprint
-quotations sequences splitting state-parser strings
+quotations sequences splitting html.parser.state strings
 combinators.short-circuit ;
 IN: html.parser.utils
 
 : string-parse-end? ( -- ? ) get-next not ;
 
-: take-string* ( match -- string )
-    dup length <circular-string>
-    [ 2dup string-matches? ] take-until nip
-    dup length rot length 1- - head next* ;
-
 : trim1 ( seq ch -- newseq )
     [ [ ?head-slice drop ] [ ?tail-slice drop ] bi ] 2keep drop like ;
 
index 5720c09ed9b42917b4f8c1c413a8056098f82d8e..bccaeb0103eb1fcbcff99327ab2b143bfc876489 100755 (executable)
@@ -16,6 +16,9 @@ SYMBOLS: base-dir filename ;
 
 : tar-trim ( seq -- newseq ) [ "\0 " member? ] trim ;
 
+: read-c-string* ( n -- str/f )
+    read [ zero? ] trim-right [ f ] when-empty ;
+
 : read-tar-header ( -- obj )
     \ tar-header new
     100 read-c-string* >>name
diff --git a/extra/webapps/imagebin/authors.txt b/extra/webapps/imagebin/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/extra/webapps/imagebin/imagebin.factor b/extra/webapps/imagebin/imagebin.factor
new file mode 100755 (executable)
index 0000000..f347377
--- /dev/null
@@ -0,0 +1,39 @@
+! Copyright (C) 2008 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel furnace.actions html.forms
+http.server.dispatchers db db.tuples db.types urls
+furnace.redirection multiline http namespaces ;
+IN: webapps.imagebin
+
+TUPLE: imagebin < dispatcher ;
+
+TUPLE: image id path ;
+
+image "IMAGE" {
+    { "id" "ID" INTEGER +db-assigned-id+ }
+    { "path" "PATH" { VARCHAR 256 } +not-null+ }
+} define-persistent
+
+: <uploaded-image-action> ( -- action )
+    <page-action>
+        { imagebin "uploaded-image" } >>template ;
+
+SYMBOL: my-post-data
+: <upload-image-action> ( -- action )
+    <page-action>
+        { imagebin "upload-image" } >>template
+        [
+            
+            ! request get post-data>> my-post-data set-global
+            ! image new
+            !    "file" value
+                ! insert-tuple
+            "uploaded-image" <redirect>
+        ] >>submit ;
+
+: <imagebin> ( -- responder )
+    imagebin new-dispatcher
+        <upload-image-action> "" add-responder
+        <upload-image-action> "upload-image" add-responder
+        <uploaded-image-action> "uploaded-image" add-responder ;
+
diff --git a/extra/webapps/imagebin/upload-image.xml b/extra/webapps/imagebin/upload-image.xml
new file mode 100644 (file)
index 0000000..ed6704f
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version='1.0' ?>
+<html>
+<head><title>Upload</title></head>
+<body>
+<form action="upload-image" method="post" enctype="multipart/form-data" name="upload">
+
+               <table>
+               <tr><th class="field-label">Image: </th><td><input type="file" name="file1" /></td></tr>
+               <tr><th class="field-label">Image: </th><td><input type="file" name="file2" /></td></tr>
+               <tr><th class="field-label">Image: </th><td><input type="file" name="file3" /></td></tr>
+               <tr><th class="field-label">Text: </th><td><input type="text" name="text1" /></td></tr>
+               </table>
+
+               <p> <button type="submit">Submit</button> </p>
+</form>
+</body>
+</html>
diff --git a/extra/webapps/imagebin/uploaded-image.xml b/extra/webapps/imagebin/uploaded-image.xml
new file mode 100644 (file)
index 0000000..903be5c
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version='1.0' ?>
+<html>
+<head><title>Uploaded</title></head>
+<body>
+hi from uploaded-image
+</body>
+</html>
index cfb8f5b66d9ebb5172ca39ff660b33b0dedfb8b0..759f26c1b2efd116a7e5b742db11600b2b50eb4e 100644 (file)
@@ -53,6 +53,20 @@ beast.
   factor image (overwriting the current one) with all the needed
   vocabs.
 
+*** Connecting to a running Factor
+
+  'run-factor' starts a new factor listener process managed by Emacs.
+  If you prefer to start Factor externally, you can also connect
+  remotely from Emacs. Here's how to proceed:
+
+  - In the factor listener, run FUEL:
+      "fuel" run
+    This will start a server listener in port 9000.
+  - Switch to Emacs and issue the command 'M-x connect-to-factor'.
+
+  That's it; you should be up and running. See the help for
+  'connect-to-factor' for how to use a different port.
+
 *** Vocabulary creation
 
     FUEL offers a basic interface with Factor's scaffolding utilities.
@@ -99,8 +113,10 @@ beast.
     - C-cC-dp : find words containing given substring (M-x fuel-apropos)
     - C-cC-dv : show words in current file (with prefix, ask for vocab)
 
-    - C-cM-<, C-cC-d< : show callers of word at point
-    - C-cM->, C-cC-d> : show callees of word at point
+    - C-cM-<, C-cC-d< : show callers of word or vocabulary at point
+                        (M-x fuel-show-callers, M-x fuel-vocab-usage)
+    - C-cM->, C-cC-d> : show callees of word or vocabulary at point
+                        (M-x fuel-show-callees, M-x fuel-vocab-uses)
 
     - C-cC-xs : extract innermost sexp (up to point)  as a separate word
     - C-cC-xr : extract region as a separate word
index 95365964ab616fa5940d627ba919d09b535844ba..e9217fbd036b47e420ba6ef6c7977249a84295eb 100644 (file)
@@ -24,6 +24,9 @@
 (autoload 'switch-to-factor "fuel-listener.el"
   "Start a Factor listener, or switch to a running one." t)
 
+(autoload 'connect-to-factor "fuel-listener.el"
+  "Connect to an external Factor listener." t)
+
 (autoload 'fuel-autodoc-mode "fuel-help.el"
   "Minor mode showing in the minibuffer a synopsis of Factor word at point."
   t)
index 6f08e0c4cdffc881c0a47c0a4e901c06394def84..e6ec8b2dc93e5d04ef5c16a5f85fc905e55b436c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; fuel-completion.el -- completion utilities
 
-;; Copyright (C) 2008 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz
 ;; See http://factorcode.org/license.txt for BSD license.
 
 ;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
              (fuel-eval--send/wait '(:fuel* (fuel-get-vocabs) "fuel" (:array)))))))
   fuel-completion--vocabs)
 
+(defun fuel-completion--read-vocab (&optional reload init-input history)
+  (let ((vocabs (fuel-completion--vocabs reload)))
+    (completing-read "Vocab name: " vocabs nil nil init-input history)))
+
 (defsubst fuel-completion--vocab-list (prefix)
   (fuel-eval--retort-result
    (fuel-eval--send/wait `(:fuel* (,prefix fuel-get-vocabs/prefix) t t))))
index 4d84ad5141344ce9a121ec803c05b9beb9c138b7..611884e087e47da800bf030f9d77f65af97c6925 100644 (file)
@@ -1,6 +1,6 @@
 ;;; fuel-debug.el -- debugging factor code
 
-;; Copyright (C) 2008 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz
 ;; See http://factorcode.org/license.txt for BSD license.
 
 ;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
@@ -213,7 +213,7 @@ the debugger."
                 (goto-char (point-min))
                 (when (search-forward (car ci) nil t)
                   (setq str (format "%c %s, %s" (cdr ci) (car ci) str))))))
-          (if (and (not err) fuel-debug--uses) "u to update USING:, " "")))
+          (if fuel-debug--uses "u to update USING:, " "")))
 
 (defun fuel-debug--buffer-file ()
   (with-current-buffer (fuel-debug--buffer)
@@ -287,7 +287,8 @@ the debugger."
   (goto-char (point-min))
   (if (re-search-forward "^USING: " nil t)
       (let ((begin (point))
-            (end (or (and (re-search-forward "\\_<;\\_>") (point)) (point))))
+            (end (or (and (re-search-forward ";\\( \\|$\\)") (point))
+                     (point))))
         (kill-region begin end))
     (re-search-forward "^IN: " nil t)
     (beginning-of-line)
index 0334ab61041bca7068b0ad7dcd5f2488153f9d68..e5f0ffd26fcc08bfe270d9fd546ec157a9396d3f 100644 (file)
 \f
 ;;; Customization
 
-(defcustom fuel-edit-word-method nil
-  "How the new buffer is opened when invoking
-\\[fuel-edit-word-at-point]."
-  :group 'fuel
-  :type '(choice (const :tag "Other window" window)
-                 (const :tag "Other frame" frame)
-                 (const :tag "Current window" nil)))
+(defmacro fuel-edit--define-custom-visit (var group doc)
+  `(defcustom ,var nil
+     ,doc
+     :group ',group
+     :type '(choice (const :tag "Other window" window)
+                    (const :tag "Other frame" frame)
+                    (const :tag "Current window" nil))))
+
+(fuel-edit--define-custom-visit
+ fuel-edit-word-method fuel
+ "How the new buffer is opened when invoking \\[fuel-edit-word-at-point]")
 
 \f
 ;;; Auxiliar functions:
 
+(defun fuel-edit--visit-file (file method)
+  (cond ((eq method 'window) (find-file-other-window file))
+        ((eq method 'frame) (find-file-other-frame file))
+        (t (find-file file))))
+
 (defun fuel-edit--looking-at-vocab ()
   (save-excursion
     (fuel-syntax--beginning-of-defun)
-    (looking-at "USING:\\|USE:")))
+    (looking-at "USING:\\|USE:\\|IN:")))
 
 (defun fuel-edit--try-edit (ret)
   (let* ((err (fuel-eval--retort-error ret))
@@ -45,9 +54,7 @@
       (error "Couldn't find edit location"))
     (unless (file-readable-p (car loc))
       (error "Couldn't open '%s' for read" (car loc)))
-    (cond ((eq fuel-edit-word-method 'window) (find-file-other-window (car loc)))
-          ((eq fuel-edit-word-method 'frame) (find-file-other-frame (car loc)))
-          (t (find-file (car loc))))
+    (fuel-edit--visit-file (car loc) fuel-edit-word-method)
     (goto-line (if (numberp (cadr loc)) (cadr loc) 1))))
 
 (defun fuel-edit--read-vocabulary-name (refresh)
@@ -86,7 +93,7 @@ offered."
                                            nil
                                            fuel-edit--word-history
                                            arg))
-         (cmd `(:fuel* ((:quote ,word) fuel-get-edit-location))))
+         (cmd `(:fuel* ((:quote ,word) fuel-get-word-location))))
     (fuel-edit--try-edit (fuel-eval--send/wait cmd))))
 
 (defun fuel-edit-word-at-point (&optional arg)
@@ -95,7 +102,7 @@ With prefix, asks for the word to edit."
   (interactive "P")
   (let* ((word (or (and (not arg) (fuel-syntax-symbol-at-point))
                    (fuel-completion--read-word "Edit word: ")))
-         (cmd `(:fuel* ((:quote ,word) fuel-get-edit-location)))
+         (cmd `(:fuel* ((:quote ,word) fuel-get-word-location)))
          (marker (and (not arg) (point-marker))))
     (if (and (not arg) (fuel-edit--looking-at-vocab))
         (fuel-edit-vocabulary nil word)
index 5b4ae09f251673218504c48acba98de15f1c9cd8..4b3607b96deaca32ed2008d0dd4319b25a05e454 100644 (file)
@@ -75,7 +75,7 @@
 (defun fuel-font-lock--syntactic-face (state)
   (if (nth 3 state) 'factor-font-lock-string
     (let ((c (char-after (nth 8 state))))
-      (cond ((char-equal c ?\ )
+      (cond ((or (char-equal c ?\ ) (char-equal c ?\n))
              (save-excursion
                (goto-char (nth 8 state))
                (beginning-of-line)
@@ -92,9 +92,9 @@
   `((,fuel-syntax--stack-effect-regex . 'factor-font-lock-stack-effect)
     (,fuel-syntax--brace-words-regex 1 'factor-font-lock-parsing-word)
     (,fuel-syntax--vocab-ref-regexp  2 'factor-font-lock-vocabulary-name)
-    (,fuel-syntax--constructor-regex (1 'factor-font-lock-word)
-                                     (2 'factor-font-lock-type-name)
-                                     (3 'factor-font-lock-invalid-syntax nil t))
+    (,fuel-syntax--constructor-decl-regex (1 'factor-font-lock-word)
+                                          (2 'factor-font-lock-type-name)
+                                          (3 'factor-font-lock-invalid-syntax nil t))
     (,fuel-syntax--typedef-regex (1 'factor-font-lock-type-name)
                                  (2 'factor-font-lock-type-name)
                                  (3 'factor-font-lock-invalid-syntax nil t))
index ad3c1fc272a7977b541c16d286e6f8bf447e235b..d0898de04f78b7d986fd7a4fe7d439a90f6701bd 100644 (file)
@@ -87,6 +87,17 @@ buffer."
     (fuel-listener--wait-for-prompt 10000)
     (fuel-con--setup-connection (current-buffer))))
 
+(defun fuel-listener--connect-process (port)
+  (message "Connecting to remote listener ...")
+  (pop-to-buffer (fuel-listener--buffer))
+  (let ((process (get-buffer-process (current-buffer))))
+    (when (or (not process)
+              (y-or-n-p "Kill current listener? "))
+      (make-comint-in-buffer "fuel listener" (current-buffer)
+                             (cons "localhost" port))
+      (fuel-listener--wait-for-prompt 10000)
+      (fuel-con--setup-connection (current-buffer)))))
+
 (defun fuel-listener--process (&optional start)
   (or (and (buffer-live-p (fuel-listener--buffer))
            (get-buffer-process (fuel-listener--buffer)))
@@ -123,6 +134,17 @@ buffer."
         (pop-to-buffer buf)
       (switch-to-buffer buf))))
 
+(defun connect-to-factor (&optional arg)
+  "Connects to a remote listener running in the same host.
+Without prefix argument, the default port, 9000, is used.
+Otherwise, you'll be prompted for it. To make this work, in the
+remote listener you need to issue the words
+'fuel-start-remote-listener*' or 'port
+fuel-start-remote-listener', from the fuel vocabulary."
+  (interactive "P")
+  (let ((port (if (not arg) 9000 (read-number "Port: "))))
+    (fuel-listener--connect-process port)))
+
 (defun fuel-listener-nuke ()
   "Try this command if the listener becomes unresponsive."
   (interactive)
index 788033cf8842334f78088dd3f0a6c515e36cfdde..f44234ae1b62c64829fb820bfa4dd8fa12d94a7c 100644 (file)
   (let* ((code (buffer-substring begin end))
          (existing (fuel-refactor--reuse-existing code))
          (code-str (or existing (fuel--region-to-string begin end)))
+         (word (or (car existing) (read-string "New word name: ")))
          (stack-effect (or existing
                            (fuel-stack--infer-effect code-str)
-                           (read-string "Stack effect: ")))
-         (word (or (car existing) (read-string "New word name: "))))
+                           (read-string "Stack effect: "))))
     (goto-char begin)
     (delete-region begin end)
     (insert word)
@@ -164,6 +164,11 @@ word."
         (save-excursion (font-lock-fontify-region start (point)))
         (indent-region start (point))))))
 
+\f
+;;; Rename word:
+
+
+
 \f
 ;;; Extract vocab:
 
index 880a8eca65a8bfdd933453dcd23503fdcc203190..66b77df49e12e42f2db638a50afb9a09d785f49e 100644 (file)
           (format ":[^ ]* [^ ]+\\(%s\\)*" fuel-syntax--stack-effect-regex)
           "M[^:]*: [^ ]+ [^ ]+"))
 
-(defconst fuel-syntax--constructor-regex
+(defconst fuel-syntax--constructor-decl-regex
   "\\_<C: +\\(\\w+\\) +\\(\\w+\\)\\( .*\\)?$")
 
 (defconst fuel-syntax--typedef-regex
     ("\\_<\\(#?!\\)\\(\n\\|$\\)" (1 "<") (2 ">"))
     ("\\_<\\((\\) \\([^)\n]*?\\) \\()\\)\\_>" (1 "<b") (2 "w") (3 ">b"))
     ;; Strings
-    ("\\_<\\(\"\\)\\([^\n\r\f\"]\\|\\\\\"\\)*\\(\"\\)\\_>" (1 "\"") (3 "\""))
+    ("\\( \\|^\\)\\(\"\\)[^\n\r\f]*\\(\"\\)\\( \\|\n\\)" (2 "\"") (3 "\""))
     ("\\_<<\\(\"\\)\\_>" (1 "<b"))
     ("\\_<\\(\"\\)>\\_>" (1 ">b"))
     ;; Multiline constructs
     ("\\_<\\(U\\)SING: \\(;\\)" (1 "<b") (2 ">b"))
     ("\\_<USING:\\( \\)" (1 "<b"))
-    ("\\_<TUPLE: +\\w+? +< +\\w+? *\\( \\)" (1 "<b"))
-    ("\\_<\\(TUPLE\\|SYMBOLS\\|VARS\\): +\\w+? *\\( \\)\\([^<\n]\\|\\_>\\)" (2 "<b"))
+    ("\\_<TUPLE: +\\w+? +< +\\w+? *\\( \\|\n\\)\\([^;]\\|$\\)" (1 "<b"))
+    ("\\_<\\(TUPLE\\|SYMBOLS\\|VARS\\): +\\w+? *\\( \\|\n\\)\\([^;<\n]\\|\\_>\\)"
+     (2 "<b"))
     ("\\(\n\\| \\);\\_>" (1 ">b"))
     ;; Let and lambda:
     ("\\_<\\(!(\\) .* \\()\\)" (1 "<") (2 ">"))
index f754c626f718c8c58679050d0bd78287529dc7ab..cae7923bee145e833a5e1d904560abec14a3d443 100644 (file)
@@ -37,6 +37,11 @@ cursor at the first ocurrence of the used word."
   :group 'fuel-xref
   :type 'boolean)
 
+(fuel-edit--define-custom-visit
+ fuel-xref-follow-link-method
+ fuel-xref
+ "How new buffers are opened when following a crossref link.")
+
 (fuel-font-lock--defface fuel-font-lock-xref-link
   'link fuel-xref "highlighting links in cross-reference buffers")
 
@@ -59,12 +64,12 @@ cursor at the first ocurrence of the used word."
     (when (not (file-readable-p file))
       (error "File '%s' is not readable" file))
     (let ((word fuel-xref--word))
-      (find-file-other-window file)
+      (fuel-edit--visit-file file fuel-xref-follow-link-method)
       (when (numberp line) (goto-line line))
       (when (and word fuel-xref-follow-link-to-word-p)
-        (and (search-forward word
-                             (fuel-syntax--end-of-defun-pos)
-                             t)
+        (and (re-search-forward (format "\\_<%s\\_>" word)
+                                (fuel-syntax--end-of-defun-pos)
+                                t)
              (goto-char (match-beginning 0)))))))
 
 \f
@@ -78,11 +83,11 @@ cursor at the first ocurrence of the used word."
 (defvar fuel-xref--help-string
   "(Press RET or click to follow crossrefs, or h for help on word at point)")
 
-(defun fuel-xref--title (word cc count)
+(defun fuel-xref--title (word cc count thing)
   (put-text-property 0 (length word) 'font-lock-face 'bold word)
-  (cond ((zerop count) (format "No known words %s %s" cc word))
-        ((= 1 count) (format "1 word %s %s:" cc word))
-        (t (format "%s words %s %s:" count cc word))))
+  (cond ((zerop count) (format "No known %s %s %s" thing cc word))
+        ((= 1 count) (format "1 %s %s %s:" thing cc word))
+        (t (format "%s %ss %s %s:" count thing cc word))))
 
 (defun fuel-xref--insert-ref (ref &optional no-vocab)
   (when (and (stringp (first ref))
@@ -101,7 +106,7 @@ cursor at the first ocurrence of the used word."
     (newline)
     t))
 
-(defun fuel-xref--fill-buffer (word cc refs &optional no-vocab app)
+(defun fuel-xref--fill-buffer (word cc refs &optional no-vocab app thing)
   (let ((inhibit-read-only t)
         (count 0))
     (with-current-buffer (fuel-xref--buffer)
@@ -113,34 +118,38 @@ cursor at the first ocurrence of the used word."
         (newline)
         (goto-char start)
         (save-excursion
-          (insert (fuel-xref--title word cc count) "\n\n"))
+          (insert (fuel-xref--title word cc count (or thing "word")) "\n\n"))
         count))))
 
-(defun fuel-xref--fill-and-display (word cc refs &optional no-vocab)
-  (let ((count (fuel-xref--fill-buffer word cc refs no-vocab)))
+(defun fuel-xref--fill-and-display (word cc refs &optional no-vocab thing)
+  (let ((count (fuel-xref--fill-buffer word cc refs no-vocab nil (or thing "word"))))
     (if (zerop count)
-        (error (fuel-xref--title word cc 0))
+        (error (fuel-xref--title word cc 0 (or thing "word")))
       (message "")
       (fuel-popup--display (fuel-xref--buffer)))))
 
 (defun fuel-xref--show-callers (word)
   (let* ((cmd `(:fuel* (((:quote ,word) fuel-callers-xref))))
          (res (fuel-eval--retort-result (fuel-eval--send/wait cmd))))
+    (with-current-buffer (fuel-xref--buffer) (setq fuel-xref--word word))
     (fuel-xref--fill-and-display word "using" res)))
 
 (defun fuel-xref--show-callees (word)
   (let* ((cmd `(:fuel* (((:quote ,word) fuel-callees-xref))))
          (res (fuel-eval--retort-result (fuel-eval--send/wait cmd))))
+    (with-current-buffer (fuel-xref--buffer) (setq fuel-xref--word nil))
     (fuel-xref--fill-and-display word "used by" res)))
 
 (defun fuel-xref--apropos (str)
   (let* ((cmd `(:fuel* ((,str fuel-apropos-xref))))
          (res (fuel-eval--retort-result (fuel-eval--send/wait cmd))))
+    (with-current-buffer (fuel-xref--buffer) (setq fuel-xref--word nil))
     (fuel-xref--fill-and-display str "containing" res)))
 
 (defun fuel-xref--show-vocab (vocab &optional app)
   (let* ((cmd `(:fuel* ((,vocab fuel-vocab-xref)) ,vocab))
          (res (fuel-eval--retort-result (fuel-eval--send/wait cmd))))
+    (with-current-buffer (fuel-xref--buffer) (setq fuel-xref--word nil))
     (fuel-xref--fill-buffer vocab "in vocabulary" res t app)))
 
 (defun fuel-xref--show-vocab-words (vocab &optional private)
@@ -151,13 +160,25 @@ cursor at the first ocurrence of the used word."
   (fuel-popup--display (fuel-xref--buffer))
   (goto-char (point-min)))
 
+(defun fuel-xref--show-vocab-usage (vocab)
+  (let* ((cmd `(:fuel* ((,vocab fuel-vocab-usage-xref))))
+         (res (fuel-eval--retort-result (fuel-eval--send/wait cmd))))
+    (with-current-buffer (fuel-xref--buffer) (setq fuel-xref--word nil))
+    (fuel-xref--fill-and-display vocab "using" res t "vocab")))
+
+(defun fuel-xref--show-vocab-uses (vocab)
+  (let* ((cmd `(:fuel* ((,vocab fuel-vocab-uses-xref))))
+         (res (fuel-eval--retort-result (fuel-eval--send/wait cmd))))
+    (with-current-buffer (fuel-xref--buffer) (setq fuel-xref--word nil))
+    (fuel-xref--fill-and-display vocab "used by" res t "vocab")))
+
 \f
 ;;; User commands:
 
 (defvar fuel-xref--word-history nil)
 
 (defun fuel-show-callers (&optional arg)
-  "Show a list of callers of word at point.
+  "Show a list of callers of word or vocabulary at point.
 With prefix argument, ask for word."
   (interactive "P")
   (let ((word (if arg (fuel-completion--read-word "Find callers for: "
@@ -165,11 +186,14 @@ With prefix argument, ask for word."
                                                   fuel-xref--word-history)
                 (fuel-syntax-symbol-at-point))))
     (when word
-      (message "Looking up %s's callers ..." word)
-      (fuel-xref--show-callers word))))
+      (message "Looking up %s's users ..." word)
+      (if (and (not arg)
+               (fuel-edit--looking-at-vocab))
+          (fuel-xref--show-vocab-usage word)
+        (fuel-xref--show-callers word)))))
 
 (defun fuel-show-callees (&optional arg)
-  "Show a list of callers of word at point.
+  "Show a list of callers of word or vocabulary at point.
 With prefix argument, ask for word."
   (interactive "P")
   (let ((word (if arg (fuel-completion--read-word "Find callees for: "
@@ -178,7 +202,30 @@ With prefix argument, ask for word."
                 (fuel-syntax-symbol-at-point))))
     (when word
       (message "Looking up %s's callees ..." word)
-      (fuel-xref--show-callees word))))
+      (if (and (not arg)
+               (fuel-edit--looking-at-vocab))
+          (fuel-xref--show-vocab-uses word)
+        (fuel-xref--show-callees word)))))
+
+(defvar fuel-xref--vocab-history nil)
+
+(defun fuel-vocab-uses (&optional arg)
+  "Show a list of vocabularies used by a given one.
+With prefix argument, force reload of vocabulary list."
+  (interactive "P")
+  (let ((vocab (fuel-completion--read-vocab arg
+                                            (fuel-syntax-symbol-at-point)
+                                            fuel-xref--vocab-history)))
+    (fuel-xref--show-vocab-uses vocab)))
+
+(defun fuel-vocab-usage (&optional arg)
+  "Show a list of vocabularies that use a given one.
+With prefix argument, force reload of vocabulary list."
+  (interactive "P")
+  (let ((vocab (fuel-completion--read-vocab arg
+                                            (fuel-syntax-symbol-at-point)
+                                            fuel-xref--vocab-history)))
+    (fuel-xref--show-vocab-usage vocab)))
 
 (defun fuel-apropos (str)
   "Show a list of words containing the given substring."
index 717322d1adef172a9bb05cdf3ff0395ab8f939ff..d9042c945563a854a3b149dc9df24ea554b72c25 100755 (executable)
@@ -53,8 +53,9 @@ INLINE bool factor_arg(const F_CHAR* str, const F_CHAR* arg, CELL* value)
 void init_parameters_from_args(F_PARAMETERS *p, int argc, F_CHAR **argv)
 {
        default_parameters(p);
+       p->executable_path = argv[0];
 
-       int i;
+       int i = 0;
 
        for(i = 1; i < argc; i++)
        {
@@ -104,13 +105,14 @@ void init_factor(F_PARAMETERS *p)
        /* OS-specific initialization */
        early_init();
 
-       if(p->image_path == NULL)
-               p->image_path = default_image_path();
-
        const F_CHAR *executable_path = vm_executable_path();
+
        if(executable_path)
                p->executable_path = executable_path;
 
+       if(p->image_path == NULL)
+               p->image_path = default_image_path();
+
        srand(current_micros());
        init_ffi();
        init_stacks(p->ds_size,p->rs_size);