<!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] Is JDOM dying?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&lt;jest:rant xmlns:jest=&quot;<A HREF="http://www.w3.org/TR/REC-xml-names/#defaulting" TARGET="_blank">http://www.w3.org/TR/REC-xml-names/#defaulting</A>&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Beg to differ, Elliotte, but... since you insist on being pedantically accurate (which is a good thing), you must re-consider your statements, I feel.</FONT></P>

<P><FONT SIZE=2>&lt;/jest:rant&gt;</FONT>
</P>

<P><FONT SIZE=2>in the example given...</FONT>
</P>

<P><FONT SIZE=2>&gt;Thus, you can do something like:</FONT>
<BR><FONT SIZE=2>&gt;&lt;xhtml:html xmlns:html=&quot;...&quot;&gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;head&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&gt;&lt;/xhtml:html&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;and do not have to do:</FONT>
<BR><FONT SIZE=2>&gt;&lt;xhtml:html xmlns:html=&quot;...&quot;&gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xhtml:head&gt;&lt;xhtml:title&gt;my title&lt;/xhtml:title&gt;&lt;/xhtml:head&gt;</FONT>
<BR><FONT SIZE=2>&gt;&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>There is a conceptual issue:</FONT>
<BR><FONT SIZE=2>xmlns prefix for &quot;html&quot; element is &quot;xhtml&quot; which is not declared. (xmlns:html IS (Note the missing &quot;x&quot;)).</FONT>
<BR><FONT SIZE=2>Thus, the document is invalid.</FONT>
</P>

<P><FONT SIZE=2>I think Elliotte's generally brusk and blunt manner is a result of the number of people who have not read the Namespace specification, esp. in regard to &quot;defaulting&quot;, who then have &quot;deep and meaningful&quot; criticisms which are off-base and wrong.</FONT></P>

<P><FONT SIZE=2>So, to those who believe they understand Namespaces, but still challenge JDom's behaviour, I humbly request that they re-read, then re-read, and finally re-read the recommendation: <A HREF="http://www.w3.org/TR/REC-xml-names/#defaulting" TARGET="_blank">http://www.w3.org/TR/REC-xml-names/#defaulting</A></FONT></P>

<P><FONT SIZE=2>Quite clearly it says that Elliotte is always right!!!!</FONT>
</P>

<P><FONT SIZE=2>To quote:</FONT>
<BR><FONT SIZE=2>A default namespace is considered to apply to the element where it is declared (if that element has no namespace prefix), and to all elements with no prefix within the content of that element. If the URI reference in a default namespace declaration is empty, then unprefixed elements in the scope of the declaration are not considered to be in any namespace. Note that default namespaces do not apply directly to attributes.</FONT></P>

<P><FONT SIZE=2>So, because others are tired of correcting people, and I am still relatively new, let me explain why the (typographically corrected) examples are not equivalent:</FONT></P>

<P><FONT SIZE=2>&lt;xhtml:html xmlns:xhtml=&quot;...&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;head&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>is equivalent to:</FONT>
</P>

<P><FONT SIZE=2>&lt;xhtml:html xmlns:xhtml=&quot;...&quot; xmlns=&quot;&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;head&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>which is equivalent to:</FONT>
</P>

<P><FONT SIZE=2>&lt;xhtml:html xmlns:xhtml=&quot;...&quot; xmlns=&quot;&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;head xmlns=&quot;&quot;&gt;&lt;title xmlns=&quot;&quot;&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>which is equivalent to:</FONT>
</P>

<P><FONT SIZE=2>&lt;html xmlns=&quot;...&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;head xmlns=&quot;&quot;&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/html&gt;</FONT>
</P>
<BR>

<P><FONT SIZE=2>AND</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>&lt;xhtml:html xmlns:xhtml=&quot;...&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;xhtml:head&gt;&lt;xhtml:title&gt;my title&lt;/xhtml:title&gt;&lt;/xhtml:head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>is equivalent to</FONT>
</P>

<P><FONT SIZE=2>&lt;xhtml:html xmlns:xhtml=&quot;...&quot; xmlns=&quot;...&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;head&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>which is equivalent to:</FONT>
</P>

<P><FONT SIZE=2>&lt;html xmlns=&quot;...&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;head&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&lt;/html&gt;</FONT>
</P>

<P><FONT SIZE=2>Rolf</FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Elliotte Rusty Harold [<A HREF="mailto:elharo@metalab.unc.edu">mailto:elharo@metalab.unc.edu</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, March 21, 2003 10:36 PM</FONT>
<BR><FONT SIZE=2>To: malachi@tremerechantry.com</FONT>
<BR><FONT SIZE=2>Cc: JDOM</FONT>
<BR><FONT SIZE=2>Subject: Re: [jdom-interest] Is JDOM dying?</FONT>
</P>
<BR>

<P><FONT SIZE=2>&gt;Well, this could be due to the fact that I use XML 1.1, and JDOM uses XML 1.0</FONT>
</P>

<P><FONT SIZE=2>No, it's not. 1.1 in no way changes any of this.</FONT>
</P>

<P><FONT SIZE=2>&gt;&gt;From what I understood of the XML 1.1 spec (and related Namespace spec), a</FONT>
<BR><FONT SIZE=2>&gt;child</FONT>
<BR><FONT SIZE=2>&gt;element is in the same namespace as the parent element unless </FONT>
<BR><FONT SIZE=2>&gt;otherwise specified.</FONT>
</P>

<P><FONT SIZE=2>Untrue.</FONT>
</P>

<P><FONT SIZE=2>&gt;Thus, you can do something like:</FONT>
<BR><FONT SIZE=2>&gt;&lt;xhtml:html xmlns:html=&quot;...&quot;&gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;head&gt;&lt;title&gt;my title&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=2>&gt;&lt;/xhtml:html&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;and do not have to do:</FONT>
<BR><FONT SIZE=2>&gt;&lt;xhtml:html xmlns:html=&quot;...&quot;&gt;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xhtml:head&gt;&lt;xhtml:title&gt;my title&lt;/xhtml:title&gt;&lt;/xhtml:head&gt;</FONT>
<BR><FONT SIZE=2>&gt;&lt;/xhtml:html&gt;</FONT>
</P>

<P><FONT SIZE=2>No, you can't. In the example you cite, head and title are *NOT* in </FONT>
<BR><FONT SIZE=2>the XHTML namespace. If you think they are, then that explains why </FONT>
<BR><FONT SIZE=2>you are confused by JDOM. JDOM models namespaces correctly. Your </FONT>
<BR><FONT SIZE=2>mental model of how namespaces work is not correct.</FONT>
</P>

<P><FONT SIZE=2>&gt;This can also be seen in W3C's examples and W3SCHOOLS tutorials.</FONT>
</P>

<P><FONT SIZE=2>I very much doubt that you'll find this in the W3C examples. You're </FONT>
<BR><FONT SIZE=2>probably misinterpreting the horrible mess that is </FONT>
<BR><FONT SIZE=2>elementFormDefault=&quot;unqualified&quot;, and reading more into it than is </FONT>
<BR><FONT SIZE=2>actually there.</FONT>
</P>

<P><FONT SIZE=2>I don't know anything about the W3SCHOOLS. Possibly they have the </FONT>
<BR><FONT SIZE=2>same misunderstanding you do and are propagating this misinformation, </FONT>
<BR><FONT SIZE=2>though looking around on their site I don't notice any evidence of </FONT>
<BR><FONT SIZE=2>this.</FONT>
<BR><FONT SIZE=2>-- </FONT>
</P>

<P><FONT SIZE=2>+-----------------------+------------------------+-------------------+</FONT>
<BR><FONT SIZE=2>| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |</FONT>
<BR><FONT SIZE=2>+-----------------------+------------------------+-------------------+</FONT>
<BR><FONT SIZE=2>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Processing XML with Java (Addison-Wesley, 2002)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.cafeconleche.org/books/xmljava" TARGET="_blank">http://www.cafeconleche.org/books/xmljava</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>| <A HREF="http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA" TARGET="_blank">http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA</A>&nbsp; |</FONT>
<BR><FONT SIZE=2>+----------------------------------+---------------------------------+</FONT>
<BR><FONT SIZE=2>|&nbsp; Read Cafe au Lait for Java News:&nbsp; <A HREF="http://www.cafeaulait.org/" TARGET="_blank">http://www.cafeaulait.org/</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>|&nbsp; Read Cafe con Leche for XML News: <A HREF="http://www.cafeconleche.org/" TARGET="_blank">http://www.cafeconleche.org/</A>&nbsp;&nbsp;&nbsp; |</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.com" TARGET="_blank">http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com</A></FONT>
</P>

</BODY>
</HTML>