Alright, I started playing with REXML last night and so far it looks pretty
good. I just have a couple quick questions. Let me start by giving you a
little quick background on how the Jabber protocol works, so that you'll
understand the question I'm about to ask.

With Jabber, you open a TCP socket to the server and then create a "stream"
document. Basically, the entire connections takes place in what is
considered to be a single document. Actually, its really two documents, one
to the server and one from the server. So, the idea is that I need to be
able to create a "stream:stream" document and be able to add document
fragments to the document on the TCP socket. This sounds more difficult than
it really is.

Basically, I need to be able to send the initial "stream:stream" element
like this:

<stream:stream to='jabber.com' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'>

However, when I create the element with REXML it ends up being closed:

<stream:stream xmlns='jabber:client' to='jabber.com'
xmlns:stream='http://etherx.jabber.org/streams'/>

I figure I could probably work around this easily enough by writing the
output to a string and then removing the slash, but I was wondering if
somebody else had a better solution? (I could, of course, build the entire
opening element manually and not use REXML, but I'd prefer not to do this.)

Any help would be appreciated.

Ben

-----Original Message-----
From: John Carter [mailto:john.carter / tait.co.nz]
Sent: Monday, November 12, 2001 5:36 PM
To: Ben Schumacher
Subject: Re: [ruby-talk:24962] Re: XML libraries (Re: Re: ruby and
webser vices)


On Tue, 13 Nov 2001, Ben Schumacher wrote:

> I haven't played with REXML yet, but when first investigating which XML
> parser to use it wasn't available. I might go check it out, but I would be
> quite happy to find one that's intuitive and one programmed pure-Ruby is a
> plus.

Go have a bash. I found it very easy to use. The XPath facilities make it
really trivial to navigate the elements.


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter / tait.co.nz
New Zealand

Indeed, the first noble truth of Buddhism, usually translated as
`all life is suffering,' is more accurately rendered `life is filled
with a sense of pervasive unsatisfactoriness.'
		-- M.D. Epstein