[jdom-interest] percent signs and XML parsing when internal DTD entities declared

Ted Toth ted.toth at vincera.com
Thu Mar 7 08:31:27 PST 2002


I've slightly altered the inline.xml file adding a link from the catalog.xml file which contains "%". This causes an exception that doesn't make any sense to me. I'm not sure this is a JDOM issue since the original exception is a SAXParseException. I think it has something to do with the internal DTD declaration. Any ideas?

------- altered inline.xml ----------------------------------------------------------

<?xml version='1.0'?>

<!DOCTYPE DOCUMENT [
  <!ELEMENT DOCUMENT (#PCDATA)>
  <!ENTITY nbsp '&#160;'>
  <!ENTITY aring '&#229;'>
  <!ENTITY auml '&#228;'>
  <!ENTITY ouml '&#246;'>
  <!ENTITY Aring '&#197;'>
  <!ENTITY Auml '&#196;'>
  <!ENTITY Ouml '&#214;'>
]>

<DOCUMENT>
  God forts&auml;ttning p&aring; det nya millenniet!
  <a href="http://www.amazon.com/exec/obidos/ASIN/B000007NMH/qid%3D913265342/sr%3D1-2/">Two by Three</a>
</DOCUMENT>

-------- exception generated by running DOMBuilderDemo sample with new inline.xml --------------------------------------------------

org.jdom.JDOMException: Error on line 16: Parameter entity references must not appear within markup declarations in the internal DTD subset.
 	at org.jdom.input.DOMBuilder.build(DOMBuilder.java:278)
 	at org.jdom.input.DOMBuilder.build(DOMBuilder.java:307)
 	at samples.DOMBuilderDemo.main(DOMBuilderDemo.java:113)
 Caused by: org.xml.sax.SAXParseException: Parameter entity references must not appear within markup declarations in the internal DTD subset.
 	at org.jdom.input.DOMBuilder.build(DOMBuilder.java:246)
 	at org.jdom.input.DOMBuilder.build(DOMBuilder.java:307)
 	at samples.DOMBuilderDemo.main(DOMBuilderDemo.java:113)
 


Ted Toth
Vincera
6801 N. Capital of Texas Highway
Building 1, Suite 101
Austin, TX 78731
512.233.5517
512.233.5501 fax



More information about the jdom-interest mailing list