Tests with a xml document consisting of prolog followed by element then Misc
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- Above is XMLDecl --> <!DOCTYPE animal [ <!ELEMENT animal (cat|tiger|leopard)+> <!ELEMENT cat EMPTY> <!ELEMENT tiger (#PCDATA)> <!ELEMENT leopard ANY> <!ELEMENT small EMPTY> <!ELEMENT big EMPTY> <!ATTLIST tiger color CDATA #REQUIRED> ]> <!-- Above is DTD --> <?music "Here is a PI" ?> <animal> <cat/> <tiger color="white">This is a white tiger in Mirage!!</tiger> <cat/> <leopard> <small/> <big/> </leopard> </animal> <!-- Above is element animal -->
Expected result | Actual result for com.jclark.xml.sax.SAX2Driver |
---|---|
<?xml version="1.0" encoding="UTF-8"?> <ConformanceResults> <startDocument/> <processingInstruction> <target>music</target> <data>"Here\sis\sa\sPI"\s</data> </processingInstruction> <startElement> <namespaceURI/> <localName>animal</localName> <qualifiedName>animal</qualifiedName> <attributes/> </startElement> <ignorable>\n</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <startElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> </endElement> <ignorable>\n</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <startElement> <namespaceURI/> <localName>tiger</localName> <qualifiedName>tiger</qualifiedName> <attributes> <attribute> <namespaceURI/> <localName>color</localName> <qualifiedName>color</qualifiedName> <value>white</value> <type>CDATA</type> </attribute> </attributes> </startElement> <char>T</char> <char>h</char> <char>i</char> <char>s</char> <char>\s</char> <char>i</char> <char>s</char> <char>\s</char> <char>a</char> <char>\s</char> <char>w</char> <char>h</char> <char>i</char> <char>t</char> <char>e</char> <char>\s</char> <char>t</char> <char>i</char> <char>g</char> <char>e</char> <char>r</char> <char>\s</char> <char>i</char> <char>n</char> <char>\s</char> <char>M</char> <char>i</char> <char>r</char> <char>a</char> <char>g</char> <char>e</char> <char>!</char> <char>!</char> <endElement> <namespaceURI/> <localName>tiger</localName> <qualifiedName>tiger</qualifiedName> </endElement> <ignorable>\n</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <startElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> </endElement> <ignorable>\n</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <ignorable>\s</ignorable> <startElement> <namespaceURI/> <localName>leopard</localName> <qualifiedName>leopard</qualifiedName> <attributes/> </startElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>small</localName> <qualifiedName>small</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>small</localName> <qualifiedName>small</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>big</localName> <qualifiedName>big</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>big</localName> <qualifiedName>big</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <endElement> <namespaceURI/> <localName>leopard</localName> <qualifiedName>leopard</qualifiedName> </endElement> <ignorable>\n</ignorable> <endElement> <namespaceURI/> <localName>animal</localName> <qualifiedName>animal</qualifiedName> </endElement> <endDocument/> </ConformanceResults> | <?xml version="1.0" encoding="UTF-8"?> <ConformanceResults> <startDocument/> <processingInstruction> <target>music</target> <data>"Here\sis\sa\sPI"\s</data> </processingInstruction> <startElement> <namespaceURI/> <localName>animal</localName> <qualifiedName>animal</qualifiedName> <attributes/> </startElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>tiger</localName> <qualifiedName>tiger</qualifiedName> <attributes> <attribute> <namespaceURI/> <localName>color</localName> <qualifiedName>color</qualifiedName> <value>white</value> <type>CDATA</type> </attribute> </attributes> </startElement> <char>T</char> <char>h</char> <char>i</char> <char>s</char> <char>\s</char> <char>i</char> <char>s</char> <char>\s</char> <char>a</char> <char>\s</char> <char>w</char> <char>h</char> <char>i</char> <char>t</char> <char>e</char> <char>\s</char> <char>t</char> <char>i</char> <char>g</char> <char>e</char> <char>r</char> <char>\s</char> <char>i</char> <char>n</char> <char>\s</char> <char>M</char> <char>i</char> <char>r</char> <char>a</char> <char>g</char> <char>e</char> <char>!</char> <char>!</char> <endElement> <namespaceURI/> <localName>tiger</localName> <qualifiedName>tiger</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>cat</localName> <qualifiedName>cat</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>leopard</localName> <qualifiedName>leopard</qualifiedName> <attributes/> </startElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>small</localName> <qualifiedName>small</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>small</localName> <qualifiedName>small</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <char>\s</char> <startElement> <namespaceURI/> <localName>big</localName> <qualifiedName>big</qualifiedName> <attributes/> </startElement> <endElement> <namespaceURI/> <localName>big</localName> <qualifiedName>big</qualifiedName> </endElement> <char>\n</char> <char>\s</char> <char>\s</char> <char>\s</char> <endElement> <namespaceURI/> <localName>leopard</localName> <qualifiedName>leopard</qualifiedName> </endElement> <char>\n</char> <endElement> <namespaceURI/> <localName>animal</localName> <qualifiedName>animal</qualifiedName> </endElement> <endDocument/> </ConformanceResults> |