Lists Home |
Date Index |
Elliotte Rusty Harold wrote:
> At 11:35 PM -0500 11/8/03, Alessandro Triglia wrote:
> >Who has made such a proposal??
> Go back to the very first post in this thread
> <http://lists.xml.org/archives/xml-dev/200311/msg00365.html> where
> Bob Wyman wrote:
> SAX assumes that the data it is reading is all of "character"
> type. SAX has no access to a schema file and thus has no idea
> of the real type of the characters it reads. However, a
> binary encoding will typically pass data in a form more
> appropriate for its type. Thus, an integer will be passed as
> something like a 32-bit value, not a string of characters.
> So, to build a "pure SAX" interface to a binary encoding, you
> would have to convert all the binary values to characters
> before passing them to the SAX event handlers. Of course, the
> first thing a lot of event handlers will do is convert the
> strings back into binary types like integers. The result is,
> of course, often wasteful silliness. It causes performance
> problems, memory fragmentation due to all the string allocations, etc.
> I read this paragraph as saying there's already binary data in the
> stream, and he just wants to convert that to the local type rather
> than converting it to a string and then converting that to the local
I believe Bob was referring to the BER and PER encodings of ASN.1, not to
XML. In my interpretation, he was contending that a binary SAX-alike
created over BER/PER might pass data in some binary form rather than convert
data back and forth to characters. I don't read his words as proposing a
change to XML so as to allow the inclusion of binary data in the stream.
Note that BER has existed for 20 years and PER has existed for 10 years. It
is reasonable for someone to propose the reuse of SAX's architecture and
concepts for creating an API over BER/PER encodings, modified to handle data
in binary form.
However, my personal view is that we don't need this. As I have stated
several times in this thread, I believe that present SAX2 can (and should)
be made work with BER and PER, and present to the application the same view
of the instance as if it were parsing an XML stream.