At 12.46 01/07/2005 +0200, Axel Weià wrote:
Alberto Massari (JIRA) wrote:
> [
> http://issues.apache.org/jira/browse/XERCESC-1452?page=comments#actio
>n_12314869 ]
>
> Alberto Massari commented on XERCESC-1452:
> ------------------------------------------
>
> Hi Jeff,
> the DOMNamedNodeMapImpl class is not used to store attributes in an
> element (that's DOMAttrMapImpl); it is used to store the list of
> entities, notations and elements in a DTD. Can you double check why
> reducing the size of these 3 maps improves your performances?
Hi Alberto,
querying all attributes of an element, is done by the loop:
DOMNamedNodeMap *map = node->getAttributes();
if (map){
int i, size = map->Length();
for (i=0; i<size; ++i){
DOMNode *attr = map->item(i);
// ...
}
}
As I understand, the performance improvement here is made with respect
to the item(.) method (which is called size times and that's why it's
improvement is important), and not with respect to the internal
attribute handling of xerces.
Hi Axel,
that code queries the attributes through an
interface (DOMNamedNodeMap), but it is actually
talking to an object of type DOMAttrMapImpl; the
fix he suggests is for the class
DOMNamedNodeMapImpl, but that will never store
attributes, only nodes stored in the DTD. The
only place where DOMNamedNodeMapImpl::item() is
invoked should be only when cloning the DTD node or if he does it in his code.
Alberto
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]