[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Pushing SAX events out onto the Web?


sax events to string
Hi Roger

Roger said:
I have a sensor that is collecting information over time.  As the data
is collected I want to stream it out to clients.  The data within each
element is huge.  Consequently, the number of SAX events would be small
compared with the size of the data.

I understand your point that sending a bunch of tiny event messages is a
bad idea.  I agree.  Streaming an XML string is preferred.  I think that
I can use SAX to stream XML strings (I believe that this is what Francis
was saying).  For example, for the SAX startElement method:

public void startElement (String ns, String local, 
                          String qName, Attributes atts) {
   -- startTag = XML string representing the start element
   -- along with attributes, and namespace, e.g.,
   -- <boeing:aircraft type="747">

   socket.send(startTag);
}

Is this what ya'll are saying

Didier replies:
>From the code snippet I deduce that you are using Java as an
implementation language. If you are using RIM or IIOP you'll have to
include the marshaling encoding/decoding in your equation.

Since you'll probably experience some network latencies, I would
recommend that you send the data in batch. Most preferably in a single
XML document and get the clients parse and process the XML document.
This will regulate the data flow between the client and the server. I
remember having done that for a smoking robot a couple years ago. The
XML document will act as a kind of buffer and tend to smooth the
latencies between the clients and the server. It is also easier to
server more than one client this way.

>From your problem statement it seems that the server has enough time to
parse and select only the pertinent elements. If the elements contain a
lot of data then packaging several of them in a single document make
sense. If network bandwidth is an issue, then compression may be
envisioned. If the server has not enough power to compress or any other
constrain restrain you to use this particular solution, then maybe a
complete new approach is demanded here. An approach that may not
necessarily use any XML technology.

Cheers
Didier PH Martin



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.