[jdom-interest] Bug in JDOM or not ????????

Sanjeev Verma [CONTRACTOR] sanjeev.verma at Sun.Com
Wed Aug 20 09:39:21 PDT 2003


Hi Chris:

The reason for the exception you are seeing is not because your xml is invalid, 
because as you rightly said, it is! The error message says: "Reference to 
undefined entity "®"". What it means is that the DTD of this XML does not 
define this entity.

This is XML parser behavior. Everytime it comes accross a entity, it will try to 
resolve it as defined by the DTD. So, if the XML does not have a DOCTYPE 
declaration at the beginning, or the DTD declared in the DOCTYTPE does not 
define this entity, then this problem will occur. Check to see which is the 
reason for failure in your case.

Regards

Sanjeev

>Delivered-To: jdom-interest at dorothy.denveronline.net
>From: Chris <chris at bitmead.com>
>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) 
Gecko/20030624
>X-Accept-Language: en-us, en
>MIME-Version: 1.0
>To: jdom-interest at jdom.org
>Content-Transfer-Encoding: 8bit
>Subject: [jdom-interest] Bug in JDOM or not ????????
>X-BeenThere: jdom-interest at jdom.org
>X-Mailman-Version: 2.0.1
>List-Help: <mailto:jdom-interest-request at jdom.org?subject=help>
>List-Post: <mailto:jdom-interest at jdom.org>
>List-Subscribe: <http://lists.denveronline.net/mailman/listinfo/jdom-interest>, 
<mailto:jdom-interest-request at jdom.org?subject=subscribe>
>List-Id: JDOM Mailing List for General Issues and Updates 
<jdom-interest.jdom.org>
>List-Unsubscribe: 
<http://lists.denveronline.net/mailman/listinfo/jdom-interest>, 
<mailto:jdom-interest-request at jdom.org?subject=unsubscribe>
>List-Archive: <http://lists.denveronline.net/pipermail/jdom-interest/>
>Date: Wed, 20 Aug 2003 23:26:24 +1000
>
>Hi,
>
>I'm parsing a file that looks like this....
><element>
>    &reg;
></element>
>
>But JDOM dies with this error....
>
>org.jdom.input.JDOMParseException: Error on line 2: Reference to 
>undefined entity "&reg;".
>
>My understanding is that &reg; is valid XML. Certainly it is part of XHTML.
>
>The spec I read here.....
>
>http://www.w3.org/TR/xhtml1/Overview.html#issues
>
>Seems to indicate it is ok....
>
>"In both SGML and XML, the ampersand character ("&") declares the 
>beginning of an entity reference (e.g., &reg; for the registered 
>trademark symbol "®")."
>
>Is this a bug or is there something I don't understand???
>
>
>
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.c
om

Best Regards

Sanjeev Verma
Sun ONE App Server Migration Consultant
Web Services, Tools and Migration Tools
Market Development Engineering




More information about the jdom-interest mailing list