You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by th...@kodak.com on 2007/03/01 11:52:02 UTC

Re: items() method in javascript returns array elements in incorrect order

Hi Bruce,
    The 'attributes' attribute is of type NamedNodeMap and the DOM Level 2 
spec says:

        NamedNodeMaps are not maintained in any particular order. 
            Objects contained in an object implementing NamedNodeMap 
            may also be accessed by an ordinal index, but this is simply 
to 
            allow convenient enumeration of the contents of a NamedNodeMap
, 
            and does not imply that the DOM specifies an order to these 
Nodes. 

     We do in fact store these in a hash table so we can access them 
quickly by
name, as I think the DOM spec intends.

"Bruce Rindahl" <ri...@lrcwe.com> wrote on 02/27/2007 02:58:56 PM:

> I obtain a single node with numerous attributes from a server via
> XMLHTTPRequest.  I then want add the attributes as text to a SVG group. 
If
> the node is 'list' then each attribute name and value is obtained by:
> 
> for (i=1;i<list.attributes.length-1;i++){
>    list.attributes.item(i).name
>    list.attributes.item(i).value
> }
> 
> 
> This works perfectly in IE7/ASV, FF, Opera but in Batik the name and 
value
> pairs are in a different order.  It looks like the items() method uses a
> hash table ordering instead of the original.  Is this a bug or a design
> feature?
> 
> Thanks
> Bruce Rindahl 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org