ant-user mailing list archives

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

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 
node.getAttributes():


      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 = 
getAttributeValue(attributeNode);
                     addProperty(prefix + attributeName, attributeValue, 
null);
                 } else {

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


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.

-Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message