[jdom-interest] Resolving Entities...when no DTD is assigned(notDOCTYPE declaration) in XML

Michael Kay mike at saxonica.com
Fri Sep 2 00:58:10 PDT 2005


Yes: if you want an XML parser to process your file, then the file must be
well-formed XML. That means that if it contains any entity references, there
must be a declaration of those entities (so there must be a DTD).
 
You can probably preprocess your file to turn it into well-formed XML by
adding the DTD before parsing.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: jdom-interest-bounces at jdom.org [mailto:jdom-interest-bounces at jdom.org]
On Behalf Of Vish D.
Sent: 01 September 2005 16:41
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Resolving Entities...when no DTD is
assigned(notDOCTYPE declaration) in XML


So, in order for SAXBuilder to correctly parse/build a XML file, the XML
file must contain DOCTYPE declaration? 



On 8/31/05, Michael Kay <mike at saxonica.com> wrote: 


I am having some trouble figuring out how to go about resolving entities
when an XML file doesn't have DOCTYPE declaration (no DTD attached to it),
but contains entities that are 'non-standarad' (such as, '&nbsp;', etc...).

 
 
I don't think such a file can correctly be described as an XML file.

 
Michael Kay
http://www.saxonica.com/ 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20050902/20b66fad/attachment.htm


More information about the jdom-interest mailing list