[JDEV] XML stream parsing in Java

Bill Ataras billa at efax.com
Thu Sep 30 11:56:47 CDT 1999


-----Original Message-----
From: arh14 at cornell.edu <arh14 at cornell.edu>
To: jdev at jabber.org <jdev at jabber.org>
Date: Thursday, September 30, 1999 5:46 AM
Subject: [JDEV] XML stream parsing in Java


>
>(Apologies for losing track of the original authors)
>
>> > I know that there was some difficulty finding an XML parser in Java
that
>> > didn't require the full document (it wouldn't process a "stream" on the
>> > fly), so some work has gone into writing a streaming parser around the
>> > internal tokenizer of the XT parser.  Ask on the java-dev list for more
>> > info...
>
>Sun's XML project's parser which (or will be) a standard extension to the
>runtime library can parse an InputStream.  Sun's parser is also the one
>reviewed as most compliant on XML.com.
>
>> You might have the following:
>>
>> [packet type byte]
>> [1-2 other fixed bytes]
>> [4 bytes-from ID]
>> [4 bytes-to ID]
>> [data length byte]
>> Subject: Here's a subject of you want one.
>> Who needs threads?  I just want to send my buddy at message! :-)
>> Here you can have all kinds of XML (or HTML) attributes, fonts, etc...
>> asdgf asdfkjasgoijqwert asdgaldgjkas
>> <NULL>
>
>And with a fixed format, packet-based system, what would happen if you
>made an addition to the format, e.g., a new field?

Just to jump in here. You can have a simple extention bit scheme. The
protocol fax machines have been using for like 20 years have used this. And
fax machine connectivity is pretty damn good around the world across varying
phone systems etc etc.

This thing can bounce back and forth all day. I just wanted to mention that
basic extensible binnary protocols are possible and have been proven over
decades to work with incredible interconnectivity between diverse
manufacturers and over widely varying network qualities.



> Since Jabber's goal
>was to be a universal transport bridging many other local
>protocols/formats, Jabber must be flexible.  XML will handle this
>scenario nicely (the client will just ignore the addition), and clients
>will not have to be changed.
>
>Also, could you for instance, save all the messages in a database and
>execute queries against them?  Again with XML this is very easy...you can
>even use XQL (eXtensible Query Langauge I think, SQL counterpart in the
>XML world).
>
>> I think it's funny every time I read how XML is "totally expandable" on
>> the one hand, and "standardized" on the other hand.  Since the client has
>> to deal with new tags as the server guys come up with more makes me think
>> that it's harder to impliment.
>
>No the client doesn't have to.  Just like Netscape 2 doesn't know what
><applet> tags are, but it still works.
>
>
>Aaron
>
>_______________________________________________
>jdev mailing list
>jdev at jabber.org
>http://mailman.jabber.org/listinfo/jdev





More information about the JDev mailing list