[JDEV] Parsing of jabber.xml

Jamin W. Collins jcollins at asgardsrealm.net
Mon Jan 6 19:05:53 CST 2003

On Tue, Jan 07, 2003 at 08:35:50AM +1100, Robert Norris wrote:
> > The server is correctly lauched with 
> > 
> > "<host><jabberd:cmdline flag='h'>servername</jabberd:cmdline></host>"
> > 
> > BUT NOT with 
> > 
> > "<host>
> >    <jabberd:cmdline flag='h'>servername</jabberd:cmdline>
> >  </host>"
> The problem is the extra whitespace included in the <host/> element. By
> default, XML does not remove whitespace, so you're actually setting the
> hostname to be "\n  servername\n" (or perhaps \r\n, not sure), which is
> of course invalid.

I'm certainly no XML expert, but that doesn't seem right to me.  In both
of the provided examples, <jabberd:cmdline/> is a child of <host/>.  In
both cases, <jabberd:cmdline/> has an attribute named 'flag' with a
value of 'h' and an element value of 'servername'.  While there is
additionally whitespace in the value of the <host/> element, that really
shouldn't make much difference.

> > Actually, initially i wanted to generate a configuration file for my
> > jabber server from a generic jabber.xml, and my parser automatically
> > produces xml flow following the second way.
> Your generator is broken - the two fragments are not equivalent.

While that is technically correct, the value of <jabberd:cmdline/> and
it's atrribute is the same in each, right?  Additionally, in both
<jabberd:cmdline/> is a child of <host/> in each, right?

Please correct me if I'm wrong in any of this.  The above is simply my

Jamin W. Collins

More information about the JDev mailing list