[JDEV] Re: [Win32-dev] Interface Ad Ins?

C. Scott Ananian cananian at lesser-magoo.lcs.mit.edu
Tue Dec 21 13:08:19 CST 1999


So here's the deal, as I understand it.

*Any* tag can define a new namespace.
*However* that tag *needs to be valid in the original DTD*.

The only tags valid in <message>, according to
     http://protocol.jabber.org/jabber/jabber.dtd
are <body>, <x>, <subject>, <thread>, and <priority>.

<ticker> is *not* a valid tag inside <message>.  Neither is
{jabber::ticker}ticker.

However, *anything* can be included inside the <x> tag, and by convention
that anything is a valid XML document in the namespace given by the xmlns
attribute.

I hope I've understood this correctly; see 
  http://protocol.jabber.org/jabber/jabber.dtd
and the validity constraints in
  http://www.w3.org/TR/1998/REC-xml-19980210
as well as the helpful namespace clarification at
  http://www.jclark.com/xml/xmlns.htm
which clarifies that "The XML Namespaces Recommendation does not define a
kind of validity distinct from XML 1.0 validity".

Strictly speaking, I believe that the DTD specified in
  http://protocol.jabber.org/jabber/jabber.dtd
is wrong, in that 'xmlns' can't be defined as an explicit attribute of the
<x> tag.  That is, the 'xmlns' attribute in this fragment

<message>
<x xmlns="foo">
...
</x>
</message>

changes the namespace *of the x element itself*.  {foo}x is not a valid
tag in message.  The correct syntax is:

<message>
<x xmlns:bar="foo">
  <bar:sometag>....</bar:sometag>
</x>
</message>

By using 'xmlns:bar', only those tags beginning with 'bar:' have their
namespace altered.  The 'x' tag is still in the original namespace
(because it does not have a 'bar:' prefix) and thus is still a legal tag
in the <message> context.

I hope I haven't muddied the waters too much.
 --s
[cc'ed to julian, the original author of the jabber.dtd file, so he can
 make sure i'm not smoking crack here.]
                                                         @ @
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
 C. Scott Ananian: cananian at lcs.mit.edu  /  Declare the Truth boldly and
 Laboratory for Computer Science/Crypto /       without hindrance.
 Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
 -.-. .-.. .. ..-. ..-. --- .-. -..  ... -.-. --- - -  .- -. .- -. .. .- -.
 PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian

FBI fissionable struggle Indonesia President security Japan Mossad 
quiche strategic Leitrim Peking Castro [Hello to all my fans in domestic surveillance] 






More information about the JDev mailing list