Re: [Libxmlplusplus-general] NodeLists, AttributeLists, etc.

Le Vendredi 31 Janvier 2003 20:12, Stefan Seefeld a écrit :
> I'v the impression that Node/Attribute containers
> could/should be avoided, at least in the DOM programming
> model: Once you get hold of a node, you may iterate over
> the child nodes by means of an iterator, avoiding unnecessary
> copies (of pointers, but still...)

That make sense to me.

> The only context in which I can see the need for a 'NodeList'
> is when you search for matching nodes in a document (using
> xpath expressions, say), so the result will be a temporary
> list.


> The SaxParser uses an 'AttributeMap', containing Attribute pointers.
> Given that an 'Attribute' is now a wrapper around a node (which is
> by design associated with the DOM programming model), I suggest
> we replace that with a simple pair of (unicode) strings. The
> current implementation will leak, as there is no way to delete
> attributes outside a document (again, by design, because Attributes
> live in the context of a document, which doesn't exist with SAX).

I agree that the Attribute class is no longer switable for this purpose.
As far as the pair of string, we should keep consistency between this and the 
way we do for Nodes contents : use templates... and this is true for the 
other methods too, although I'm not sure it will make things clear/easy (but 
this may be because it's a bit late for me :-/

> Suggestions ?

Well, nothing concrete for now, I'll think again about it tomorrow...

Best regards,


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