ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: svn commit: r357908 - /ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java
Date Wed, 21 Dec 2005 10:44:36 GMT
Stefan Bodewig wrote:
> On Tue, 20 Dec 2005, <bodewig@apache.org> wrote:
> 
> 
>>better deal with elements that don't have a namespace URI
> 
> 
> This is for the case where the task tells DOMElementWriter to qualify
> elements with namespaces but passes in a DOM tree with elements that
> don't have a namespace URI associated with them.
> 
> Is
> 
> 
>>+    private static String getNamespaceURI(Node n) {
>>+        String uri = n.getNamespaceURI();
>>+        if (uri == null) {
>>+            // FIXME: Is "No Namespace is Empty Namespace" really OK?
>>+            uri = "";
>>+        }
>>+        return uri;
>>     }
> 
> 

oh, do not ask me. I never understand DOM and its namespace stuff. I 
know that if you parse something without an ns, you cannot do 
Element.getLocalName(), you need to do something else like 
Element.getName(). Xom is more consistent, "" means local namespace. For 
dom it may be 'null' instead.

Think we will need some tests here to work out wtf is going on.

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


Mime
View raw message