<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>RE: [jdom-interest] Bug in JDOM or not ????????</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>An XHTML document must always look like:</FONT>
</P>
<P><FONT SIZE=2><!DOCTYPE html </FONT>
<BR><FONT SIZE=2> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"</FONT>
<BR><FONT SIZE=2> "<A HREF="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" TARGET="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</A>"></FONT>
<BR><FONT SIZE=2><html xmlns="<A HREF="http://www.w3.org/1999/xhtml" TARGET="_blank">http://www.w3.org/1999/xhtml</A>" xml:lang="en" lang="en"></FONT>
<BR><FONT SIZE=2> ....</FONT>
<BR><FONT SIZE=2></html></FONT>
</P>
<BR>
<P><FONT SIZE=2>Without the doctype, the references are not included (you may want the transitional doctype though).</FONT>
</P>
<P><FONT SIZE=2>Rolf</FONT>
</P>
<BR>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Chris [<A HREF="mailto:chris@bitmead.com">mailto:chris@bitmead.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Wednesday, August 20, 2003 12:42 PM</FONT>
<BR><FONT SIZE=2>To: Sanjeev Verma [CONTRACTOR]</FONT>
<BR><FONT SIZE=2>Cc: jdom-interest@jdom.org</FONT>
<BR><FONT SIZE=2>Subject: Re: [jdom-interest] Bug in JDOM or not ????????</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>So, assuming I want to do xhtml, can you tell me what I need to do? :-)</FONT>
</P>
<P><FONT SIZE=2>Sanjeev Verma [CONTRACTOR] wrote:</FONT>
</P>
<P><FONT SIZE=2>>Hi Chris:</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>The reason for the exception you are seeing is not because your xml is invalid, </FONT>
<BR><FONT SIZE=2>>because as you rightly said, it is! The error message says: "Reference to </FONT>
<BR><FONT SIZE=2>>undefined entity "&reg;"". What it means is that the DTD of this XML does not </FONT>
<BR><FONT SIZE=2>>define this entity.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>This is XML parser behavior. Everytime it comes accross a entity, it will try to </FONT>
<BR><FONT SIZE=2>>resolve it as defined by the DTD. So, if the XML does not have a DOCTYPE </FONT>
<BR><FONT SIZE=2>>declaration at the beginning, or the DTD declared in the DOCTYTPE does not </FONT>
<BR><FONT SIZE=2>>define this entity, then this problem will occur. Check to see which is the </FONT>
<BR><FONT SIZE=2>>reason for failure in your case.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Regards</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Sanjeev</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>>Delivered-To: jdom-interest@dorothy.denveronline.net</FONT>
<BR><FONT SIZE=2>>>From: Chris <chris@bitmead.com></FONT>
<BR><FONT SIZE=2>>>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) </FONT>
<BR><FONT SIZE=2>>> </FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>Gecko/20030624</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>>X-Accept-Language: en-us, en</FONT>
<BR><FONT SIZE=2>>>MIME-Version: 1.0</FONT>
<BR><FONT SIZE=2>>>To: jdom-interest@jdom.org</FONT>
<BR><FONT SIZE=2>>>Content-Transfer-Encoding: 8bit</FONT>
<BR><FONT SIZE=2>>>Subject: [jdom-interest] Bug in JDOM or not ????????</FONT>
<BR><FONT SIZE=2>>>X-BeenThere: jdom-interest@jdom.org</FONT>
<BR><FONT SIZE=2>>>X-Mailman-Version: 2.0.1</FONT>
<BR><FONT SIZE=2>>>List-Help: <<A HREF="mailto:jdom-interest-request@jdom.org?subject=help">mailto:jdom-interest-request@jdom.org?subject=help</A>></FONT>
<BR><FONT SIZE=2>>>List-Post: <<A HREF="mailto:jdom-interest@jdom.org">mailto:jdom-interest@jdom.org</A>></FONT>
<BR><FONT SIZE=2>>>List-Subscribe: <<A HREF="http://lists.denveronline.net/mailman/listinfo/jdom-interest" TARGET="_blank">http://lists.denveronline.net/mailman/listinfo/jdom-interest</A>>, </FONT>
<BR><FONT SIZE=2>>> </FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>><<A HREF="mailto:jdom-interest-request@jdom.org?subject=subscribe">mailto:jdom-interest-request@jdom.org?subject=subscribe</A>></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>>List-Id: JDOM Mailing List for General Issues and Updates </FONT>
<BR><FONT SIZE=2>>> </FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>><jdom-interest.jdom.org></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>>List-Unsubscribe: </FONT>
<BR><FONT SIZE=2>>> </FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>><<A HREF="http://lists.denveronline.net/mailman/listinfo/jdom-interest" TARGET="_blank">http://lists.denveronline.net/mailman/listinfo/jdom-interest</A>>, </FONT>
<BR><FONT SIZE=2>><<A HREF="mailto:jdom-interest-request@jdom.org?subject=unsubscribe">mailto:jdom-interest-request@jdom.org?subject=unsubscribe</A>></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>>List-Archive: <<A HREF="http://lists.denveronline.net/pipermail/jdom-interest/" TARGET="_blank">http://lists.denveronline.net/pipermail/jdom-interest/</A>></FONT>
<BR><FONT SIZE=2>>>Date: Wed, 20 Aug 2003 23:26:24 +1000</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>Hi,</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>I'm parsing a file that looks like this....</FONT>
<BR><FONT SIZE=2>>><element></FONT>
<BR><FONT SIZE=2>>> &reg;</FONT>
<BR><FONT SIZE=2>>></element></FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>But JDOM dies with this error....</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>org.jdom.input.JDOMParseException: Error on line 2: Reference to </FONT>
<BR><FONT SIZE=2>>>undefined entity "&reg;".</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>My understanding is that &reg; is valid XML. Certainly it is part of XHTML.</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>The spec I read here.....</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>><A HREF="http://www.w3.org/TR/xhtml1/Overview.html#issues" TARGET="_blank">http://www.w3.org/TR/xhtml1/Overview.html#issues</A></FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>Seems to indicate it is ok....</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>"In both SGML and XML, the ampersand character ("&") declares the </FONT>
<BR><FONT SIZE=2>>>beginning of an entity reference (e.g., &reg; for the registered </FONT>
<BR><FONT SIZE=2>>>trademark symbol "®")."</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>Is this a bug or is there something I don't understand???</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>_______________________________________________</FONT>
<BR><FONT SIZE=2>>>To control your jdom-interest membership:</FONT>
<BR><FONT SIZE=2>>><A HREF="http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.c" TARGET="_blank">http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.c</A></FONT>
<BR><FONT SIZE=2>>> </FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>om</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Best Regards</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Sanjeev Verma</FONT>
<BR><FONT SIZE=2>>Sun ONE App Server Migration Consultant</FONT>
<BR><FONT SIZE=2>>Web Services, Tools and Migration Tools</FONT>
<BR><FONT SIZE=2>>Market Development Engineering</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
</P>
<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>To control your jdom-interest membership:</FONT>
<BR><FONT SIZE=2><A HREF="http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com" TARGET="_blank">http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com</A></FONT>
</P>
</BODY>
</HTML>