ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject QName in DynamicAttributeNS
Date Tue, 13 Jun 2006 10:24:45 GMT

I'm now looking at the namespace aware dynamic attribute stuff

The qname parameter for this is built up as follows:
                 String qName = ("".equals(uri)
                                 ? localName : (uri + ":" + localName));

this is not how, say, Qname.toString() presents qnames, which is 

I'd change it, but then I looked at how XmlFragment handled it, which it 
does by handing it off to the Dom element

                 e.setAttributeNS(uri, qName, value);

I dont use classic DOM. but from what the javadocs imply, this appears 
wrong. the qname that Element.setAttributeNS() seems to want is a 
classic prefix:value tuple, like "xmlns:name" or "ant:example".

So really we should pass down the prefix and localname, as the uri comes 
down in the namespace URI param:

                 String qName = ("".equals(uri)
                                 ? localName : (prefix + ":" + localName));

Am I right here? This is not shipping code so we have time to correct 
it, but I'd need input from someone who knows Dom intimately enough to 
get it right. Me, I use Xom :)


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

View raw message