If you would like to help me (by reading these 90 lines of text), try your 
best to correct me where I am wrong, and answer my questions (Lines marked 
with an asterisk (*) are points which I especially am having trouble with):

1)

    <a xmlns="x:y">
      <b c="value1"/>
    </a>

In this example, <a/>, <b/> and c="" are all using the x:y namespace. <b/>'s 
namespace is "x:y", just like <a/>'s, as opposed to my previous theory that 
<b/>'s namespace becomes x:y:a.

* Would putting an x:y: prefix to every tag element's name do the same thing 
as the use of xmlns="x:y" in this example?

2)

    <a xmlns="http://..."; xmlns:s="x:y">
      <s:b c="value1">
        <d/>
        <e s:f="value2"/>
      </s:b>
    </a>

In this example,
<a/> is using the "http://..."; website namespace
<b/> is using the x:y bulltin namespace because of the s: prefix
c="" is using the x:y bulltin namespace because it is <b/>'s attribute.
<d/> is using the "http://..."; website namespace, because it's prefix doesn't 
depend on it's parent's prefix.
<e/> is using the "http://..."; website namespace for the same reason
f="" is using the x:y bulltin namespace. Although normally an attribute 
inherits from it's parent, f="" has an s: prefix.

3)

    <a xmlns="v:w">
      <b xmlns="x:y">
        <s:c/>
      </b>
    </a>

<a/> has v:w as it's namespace
<b/> has x:y as it's namespace
* <c/> has no namespace handler (?)

4)

In a more explicit example:

    <stream:stream 
    to="denmark" 
    xmlns="jabber:client" 
    xmlns:stream="http://etherx.jabber.org/streams";>
    [...]
    <iq type="set" id="1">
      <query xmlns="jabber:iq:auth">
        <username>nick</username>
        <password>pass</password>
        <resource>home</resource>
      </query>
    </iq>
    [...]
    </stream:stream>

<stream:stream/> uses the xmlns:stream namespace (because of the stream:... 
part) looking for the element definition of "stream" (because of the 
...stream part)
<iq/>, having no prefix, defaults to the jabber:client namespace.
<query/>, <username/>, <password/> and <resource/> all take from 
jabber:iq:auth.

* Do I take it that jabber, despite the xml standard, applies xmlns:* to the 
level and lower, but applies xmlns only to the lower levels? Or does every 
jabber:iq:* contain <query/> in it's definition?

* I notice that jabber:iq:auth has more than 1 colon (:). Is this only 
possible for namespaces, or can tag elements have that too (namespace 
declared like xmlns:a:b:c="name:space")? If so, how do you separate the 
element from the namespace? Is an actual element name not allowed to have any 
colons (:) in them?

I know I asked a lot of questions, and I may not have found the best way to 
communicate what I was asking, but knowing this information is key if I'm 
going to develop a successful Jabber client.

-Kriggs
RBJab

PS. Thanks Peter, those links helped a lot.

> You might want to read this:
>
> http://www.w3.org/TR/1999/REC-xml-names-19990114/
>
> As well as the documents referenced from here:
>
> http://www.jabber.org/ietf/
>
> Peter
>
> --
> Peter Saint-Andre
> Jabber Software Foundation
> http://www.jabber.org/people/stpeter.html
>
> On Mon, 8 Jul 2002, Kriggs wrote:
> > I'd like some confirmation on something right now. Can someone tell me if
> > I'm right in the following examples:
> >
> > <a:b/>
> > <a b="value"/>
> > <tag a:b="value"/>
> > <a><b/></a>
> > <a xmlns="r">
> >
> > where a is b's parent, and r is root? And am I forgetting anything?
> >
> > OK, now to talk about a part of the Programmer's Guide that lost me:
> >
> > "[...] The Jabber DTD is referenced from other XML documents and streams
> > with the identifier jabber:client.
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> >
> > <!-- The root of it all. -->
> >
> > <!ELEMENT jabber ((
> >   presence |
> >   iq |
> >   message
> > )*)>"
> >
> > So the jabber element contains presence, iq and message. Where did x and
> > error go? And does the jabber here mean jabber:client:jabber? Which would
> > mean that for those tags, (presence, iq, message, ...) the jabber:... is
> > implied? Maybe it means stream:stream:jabber, with jabber:... still
> > implied, in which case the xmlns... just confuses me... Or maybe it's an
> > error in the documentation? Or maybe I'm not seeing something?
> >
> > The clearest idea I have so far is that stream:stream is a "function" tag
> > that uses the jabber:client namespace. So everything inside of the
> > stream:stream uses jabber:client as it's parent. jabber:... would not be
> > implied, and so presence, iq, message, etc. would actually be
> > jabber:client:presence, jabber:client:iq, jabber:client:message, etc...
> > All (or most) namespaces, such as jabber:iq:auth and jabber:iq:version,
> > pull from the root level, meaning that jabber: is filled with a bunch of
> > namespaces, and jabber:client contains only the "function" tags. The root
> > tags would be stream: (for the transport layer's independence from
> > jabber), jabber, and anything we'd want to invent? If I didn't keep
> > getting the impression that there's an implied "jabber:..." in front of
> > the main "function" tags, I would have a better time believing my
> > explanation :)
> >
> > If the answer to all my hoohaa is that jabber just fakes having a
> > structure... well, for starters, I'd be very disappointed in what seemed
> > like such a good effort, then I'd use the explanation I've come up with,
> > despite it all. The chances of jabber evolving to have a tag of the same
> > name at the exact wrong place seems unlikely.
> >
> > Can anyone tell me where I'm wrong and/or right in all this?
> >
> > Thank you!
> >
> > -Kriggs
> > RBJab
> > _______________________________________________
> > jdev mailing list
> > [EMAIL PROTECTED]
> > http://mailman.jabber.org/listinfo/jdev
>
> _______________________________________________
> jdev mailing list
> [EMAIL PROTECTED]
> http://mailman.jabber.org/listinfo/jdev
_______________________________________________
jdev mailing list
[EMAIL PROTECTED]
http://mailman.jabber.org/listinfo/jdev

Reply via email to