OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] SAX/Java Character Buffers (was Re: [xml-dev] SAX andparal

[ Lists Home | Date Index | Thread Index ]



David Megginson wrote:
> On Sat, 01 Jan 2005 13:29:18 -0700, Uche Ogbuji
> <Uche.Ogbuji@fourthought.com> wrote:
> 
> [about SAX/Java character events providing an offset into an array
> rather than a test/string object]
> 
> 
>>I know the original SAX idea was optimization, but I do think this is
>>exactly one of those areas where perhaps (IMO) premature optimization
>>ends up limiting design evolution, and I also think that it interferes
>>with the "Simple" part.
> 
> 
> That was a tough choice at the time.  I think it was James Clark who
> suggested it -- he is justly famous for fast code, but as anyone who
> ever tried to work with SP (his C++ SGML parsing library) can attest,
> he's not famous for readable code. 

Character events do not usually have their boundaries where
you would want to create a string object from. It makes therefore
sense even today to leave that API as designed. Just create a helper
class that accumulates characters from sussessive events and
allows you to turn them into a string when an appropriate boundary
(like an end of element tag) is reached.

Aside from that argument, let's just say that if there was no "low level"
XML API one would have to invent it.

Karl




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS