Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] reading an xml from a socket

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT ccil.org>
  • To: Steve Loughran <steve.loughran AT gmail.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] reading an xml from a socket
  • Date: Sat, 21 Oct 2006 19:26:17 -0400

Steve Loughran scripsit:

> > > Also, ASCII 0 is a forbidden character in an XML document. So you
> > > could write something that streams out a document and sticks a NUL at
> > > the end. The reciepient relays everything to an XML parser (via a
> > > special Reader), until that NUL gets received, at which point an
> > > end-of-file should be signalled. Result: no need to determine the size
> > > of the message.
> >
> > Might be a non-issue, but to be precise: NUL may occur for encodings
> > other than ASCII and UTF-8.
> > In contrast, Consistent Overhead Byte Stuffing (COBS) provides
> > efficient, reliable, unambigous packet framing regardless of packet
> > content.
>
> that's a good point. While NUL may be illegal character in an XML
> document, it may not be illegal in an encoding. I duly corrected :)

Actually, you had it right the first time. The byte 0x00 may appear in
in an encoding such as UTF-16, but the character U+0000 cannot appear
in an XML document. So it would be straightforward to layer a specialized
Reader over a standard InputStreamReader that detects U+0000 and returns
end-of-input.

--
Unless it was by accident that I had John Cowan
offended someone, I never apologized. cowan AT ccil.org
--Quentin Crisp http://www.ccil.org/~cowan




Archive powered by MHonArc 2.6.24.

Top of Page