[jdom-interest] Is JDOM dying?
Elliotte Rusty Harold
elharo at metalab.unc.edu
Fri Mar 21 19:35:43 PST 2003
>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/ |
+----------------------------------+---------------------------------+
More information about the jdom-interest
mailing list