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.)
<!DOCTYPE doc [ <!ELEMENT doc (#PCDATA)> <!ENTITY e "<foo>"> ]> <doc>&e;</doc>
Expected result | Actual result for com.jclark.xml.sax.SAX2Driver |
---|---|
<?xml version="1.0" encoding="UTF-8"?> <ConformanceResults> <startDocument/> <startElement> <namespaceURI/> <localName>doc</localName> <qualifiedName>doc</qualifiedName> <attributes/> </startElement> <char><</char> <char>f</char> <char>o</char> <char>o</char> <char>></char> <endElement> <namespaceURI/> <localName>doc</localName> <qualifiedName>doc</qualifiedName> </endElement> <endDocument/> </ConformanceResults> | <?xml version="1.0" encoding="UTF-8"?> <ConformanceResults> <startDocument/> <startElement> <namespaceURI/> <localName>doc</localName> <qualifiedName>doc</qualifiedName> <attributes/> </startElement> <char><</char> <char>f</char> <char>o</char> <char>o</char> <char>></char> <endElement> <namespaceURI/> <localName>doc</localName> <qualifiedName>doc</qualifiedName> </endElement> <endDocument/> </ConformanceResults> |