Re: [xml] Refactoring of the SAX interface for namespace support.



On Wed, Aug 13, 2003 at 06:17:16PM -0400, Daniel Veillard wrote:
On Wed, Aug 13, 2003 at 10:19:46PM +0100, Graham Bennett wrote:
I like the idea of exposing more of the parser's data this way.  The
only thing that I don't like is that there doesn't seem to be any clear
separation between the end of the information for the start of the
element and the start of the content.

So if I get the following sequence of events:

startElementNS
namespace
namespace
attributeNS
attributeNS
-----------------
startElementNS
endElementNS
-----------------
endElementNS

Then I only know that I have all the information for the start of the
element once I get the next element callback.  The callback that tells
me this could equally well be a comment, text or processing instruction,
or am I missing something?

  Yup that's right, but following the exchange with Dave Beckett
we need to provide the namespaces as part of the startElementNS
callback. I simply suggest to also add the number of attributes
to come:

Yep that sounds fine.  That will also enable code to reserve the correct
amount of space for the attributes beforehand.

cheers,

-- 
Graham Bennett



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]