I'm got validation turned off so the missing element declaration is not an issue, though I tried it just to be certain. The issue appears to be that the entity reference is in content rather than attribute values. The input file:

<?xml version="1.0"?>
<!DOCTYPE spec [
<!ENTITY name "xyzzy">
]>
<spec name="&name;"/>

works fine.

 - Dennis

Pavani Mukthipudi wrote:

Dennis Sosnoski wrote :

I'm getting an exception thrown running Xerces2 (2.0.0) DOMParser:

[Fatal Error] :2:13: The entity "name" was referenced, but not declared.
org.xml.sax.SAXParseException: The entity "name" was referenced, but not declared.
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:235)
at com.sosnoski.xmlbench.BenchXerces2.build(BenchXerces2.java:86)
at com.sosnoski.xmlbench.BenchDocBase.runTimeTest(BenchDocBase.java:353) at com.sosnoski.xmlbench.XMLBench.main(XMLBench.java:481)


with this input:

<?xml version="1.0"?>
<!DOCTYPE spec [
<!ENTITY name "xyzzy">
]>
<spec>&name;</spec>

Am I making some kind of subtle error, or is Xerces2 broken for entities outside of attribute values?


The declaration for element "spec" is missing. <?xml version="1.0"?> <!DOCTYPE spec [ <!ELEMENT spec (#PCDATA)> <!ENTITY name "xyzzy"> ]> <spec>&name;</spec>

This should work.

-Pavani




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to