[jdom-interest] Is JDOM dying?

Rolf Lear rlear at algorithmics.com
Mon Mar 24 07:41:26 PST 2003


<jest:rant xmlns:jest="http://www.w3.org/TR/REC-xml-names/#defaulting">
   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.
</jest:rant>

in the example given...

>Thus, you can do something like:
><xhtml:html xmlns:html="...">
>	<head><title>my title</title></head>
></xhtml:html>
>
>and do not have to do:
><xhtml:html xmlns:html="...">
>	<xhtml:head><xhtml:title>my title</xhtml:title></xhtml:head>
></xhtml:html>

There is a conceptual issue:
xmlns prefix for "html" element is "xhtml" which is not declared.
(xmlns:html IS (Note the missing "x")).
Thus, the document is invalid.

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 "defaulting", who then have "deep and meaningful" criticisms which
are off-base and wrong.

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:
http://www.w3.org/TR/REC-xml-names/#defaulting

Quite clearly it says that Elliotte is always right!!!!

To quote:
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.

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:

<xhtml:html xmlns:xhtml="...">
	<head><title>my title</title></head>
</xhtml:html>

is equivalent to:

<xhtml:html xmlns:xhtml="..." xmlns="">
	<head><title>my title</title></head>
</xhtml:html>

which is equivalent to:

<xhtml:html xmlns:xhtml="..." xmlns="">
	<head xmlns=""><title xmlns="">my title</title></head>
</xhtml:html>

which is equivalent to:

<html xmlns="...">
	<head xmlns=""><title>my title</title></head>
</html>


AND



<xhtml:html xmlns:xhtml="...">
	<xhtml:head><xhtml:title>my title</xhtml:title></xhtml:head>
</xhtml:html>

is equivalent to

<xhtml:html xmlns:xhtml="..." xmlns="...">
	<head><title>my title</title></head>
</xhtml:html>

which is equivalent to:

<html xmlns="...">
	<head><title>my title</title></head>
</html>

Rolf


-----Original Message-----
From: Elliotte Rusty Harold [mailto:elharo at metalab.unc.edu]
Sent: Friday, March 21, 2003 10:36 PM
To: malachi at tremerechantry.com
Cc: JDOM
Subject: Re: [jdom-interest] Is JDOM dying?


>Well, this could be due to the fact that I use XML 1.1, and JDOM uses XML
1.0

No, it's not. 1.1 in no way changes any of this.

>>From what I understood of the XML 1.1 spec (and related Namespace spec), a
>child
>element is in the same namespace as the parent element unless 
>otherwise specified.

Untrue.

>Thus, you can do something like:
><xhtml:html xmlns:html="...">
>	<head><title>my title</title></head>
></xhtml:html>
>
>and do not have to do:
><xhtml:html xmlns:html="...">
>	<xhtml:head><xhtml:title>my title</xhtml:title></xhtml:head>
></xhtml:html>

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

>This can also be seen in W3C's examples and W3SCHOOLS tutorials.

I very much doubt that you'll find this in the W3C examples. You're 
probably misinterpreting the horrible mess that is 
elementFormDefault="unqualified", and reading more into it than is 
actually there.

I don't know anything about the W3SCHOOLS. Possibly they have the 
same misunderstanding you do and are propagating this misinformation, 
though looking around on their site I don't notice any evidence of 
this.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030324/3d5a97ed/attachment.htm


More information about the jdom-interest mailing list