[jdev] Help parsing incremental XML

Dr. Craig Hollabaugh craig at hollabaugh.com
Sat Mar 27 00:13:32 CST 2004


JD and Kevin,

SAX parsers parse as the stream comes in. Your code gets callbacks on a
tag by tag basis. A DOM parser creates a complete document to
manipulate. If you're parsing is really simple, you can use a regular
expression to find what you're looking for.

Craig



On Fri, 2004-03-26 at 23:08, JD Conley wrote:
> That sort of parsing is the basis of XMPP/Jabber.  In many cases SAX and
> DOM parsers do require the whole document.  But there are parsers that
> will parse a stream as it comes in.  I'm not sure how it's usually done
> in Java -- I'm a .NET guy myself -- but there are a few open source Java
> Jabber libraries available that you can look at.  The list of the most
> complete/popular libraries is here:
> http://www.jabber.org/software/libraries.php
> 
> Are you using Jabber for your project?  If not, you should check into
> it.  It will allow you to send your application's XML as payload in
> Jabber stanzas and will handle the routing, authentication, and all the
> particulars you probably don't want to worry about.
> 
> JD 
> 
> > -----Original Message-----
> > From: Kevin Zablonski [mailto:kzablonski at riches85.com] 
> > Sent: Friday, March 26, 2004 7:40 PM
> > To: jdev at jabber.org
> > Subject: [jdev] Help parsing incremental XML
> > 
> > I am developing an IM client/server application for the 
> > visually impaired
> > that will make use of the Java Speach API.  I am developing 
> > it as a senior
> > project and I am stuck on the XML parsing.  I am having 
> > trouble finding a
> > technology that will allow me to parse XML incrementally.  
> > The client will
> > connect to the server over a socket connection.  From there, 
> > the client
> > and the server will continually pass small XML streams back 
> > and forth.  I
> > have done some research into SAX and DOM, but it looks as if 
> > they expect
> > the whole document at once.  I was just wondering if it was 
> > possible and
> > if so, what technologies are being used.  I could just use 
> > some direction
> > direction right now.  I would appreciate any suggestions 
> > and/or comments
> > that could stear me in the right direction.  Thanks in Advance.
> > _______________________________________________
> > jdev mailing list
> > jdev at jabber.org
> > https://jabberstudio.org/mailman/listinfo/jdev
> > 
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> https://jabberstudio.org/mailman/listinfo/jdev
-- 
------------------------------------------------------------
Dr. Craig Hollabaugh, craig at hollabaugh.com
Author of Embedded Linux: Hardware, Software and Interfacing
www.embeddedlinuxinterfacing.com





More information about the JDev mailing list