ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: <xmlproperty> intra-element attribute property resolution issue
Date Mon, 22 Jan 2007 11:36:45 GMT

I've been looking at teh xmlproperty source. The order the task works 
through attrs is driven by the order it comes from the DOM in 

      if (node.hasAttributes()) {

             NamedNodeMap nodeAttributes = node.getAttributes();

             // Is there an id attribute?
             Node idNode = nodeAttributes.getNamedItem(ID);
             id = (semanticAttributes && idNode != null
                   ? idNode.getNodeValue() : null);

             // Now, iterate through the attributes adding them.
             for (int i = 0; i < nodeAttributes.getLength(); i++) {

                 Node attributeNode = nodeAttributes.item(i);

                 if (!semanticAttributes) {
                     String attributeName = getAttributeName(attributeNode);
                     String attributeValue = 
                     addProperty(prefix + attributeName, attributeValue, 
                 } else {

                     String nodeName = attributeNode.getNodeName();
                     String attributeValue = 

Being an XML person, perhaps you can answer some details that are not in 
the javadocs.

1. What is the ordering in node.getAttributes() according to the 
normative DOM specification?

2. If we want attributes in declaration order, how do we do it? Go 
through all child nodes and only pick up things that are in the right order.

3. Does the same ordering appear when running Ant with the older version 
of Xerces?

XmlProperty is all dom based. If we cannot get stuff except in alpha 
order, then we are going to have to live with it and document the fact.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message