[standards-jig] JNG Ramblings.

Wing, Oliver owing at vianetworks.com
Fri Aug 9 10:44:20 UTC 2002


> > Right now, I take a tcp stream and pass that as the document source to a
> > SAX parser. viola jabber client :)
> Aren't you also doing something to accumulate depth=1 elements into a
> DOM? What if you didn't want blocking I/O?
> I recall that at one point Jabber.NET was feeding characters to its XML
> parser one at a time, because otherwise it would block. I think now it's
> doing something only slightly cleverer. Joe is a smart guy, and I don't
> think he would do something this bad if the protocol and tools available
> to him didn't make him.

There are several ways to do it in .NET, but it does work. Further, the
XmlTextReader (read SAX) has built in support for depth levels, and decent
namespace handling. As for blocking I/O, it is a valid issue.

> There are any number of similar anecdotes. Some people get really lucky
> and have XML suites that have to be hacked very minimally to get things
> to work. Other people get really unlucky and have to write their own XML
> lexers.

Agreed, but there in you have the issue. To some libraries, it's not an
issue. By adding framing not only do you break those libraries, but possibly
making it a lot harder. By adding bytes on a socket, you're preventing
anyone passing a socket stream directly to a SAX parser, and therefore
possibly slowing performance and complexity rather than improving it.

I'm all for framing in a form. What I'm not for though is forcing it upon
anyone. Why can framing not be optional, perhaps an option in the initial
handshake similar to JEP-0035 allows for SSL?


Oliver Wing

More information about the Standards mailing list