Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

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

Michael Kay

2005-09-02

Replies:

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@jdom.org [mailto:jdom-interest-bounces@jdom.org] On Behalf Of Vish D.
Sent: 01 September 2005 16:41
To: jdom-interest@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@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

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.