[
Lists Home |
Date Index |
Thread Index
]
Context: Ant, apache build tool, consumes an XML description of build.
Specifically: Ant embeds the notion of default namespace in the processor itself e.g. so one doesnt have to explicitly define as below with xmlns="" attribute.
<project xmlns="antlib:org.apache.tools.ant">
....
<target>
....
</target>
</project>
furthermore and somewhat strangely, Ant places (in java) elements actually into 2 default namespaces, the default namespace and the namespace of the object the holds the nested element
[note following was snipped from message from Ant list to illustrate]
> For example, the if task from ant-contrib extends ConditionBase, so
> it has nested elements like - equals.
>
> The rules above allow the following:
>
> <ac:if xmlns:ac="antlib:net.sf.antcontrib>
> <ac:and>
> <equals arg1="a" arg2="${p1}"/>
> <ac:equals arg1="b" arg2="${p2}"/>
> </ac:and>
> <then>
> <echo>the args are equal</echo>
> </then>
> <ac:else>
> <echo>They are not equal</echo>
> </ac:else>
> </ac:if>
so the above <equals/> element would simultaneously be in the default and xmlns:ac (antcontrib) namespace.
Questions:
a) I can understand the 'ease of use' reasons for doing something like placing elements into 2 namespaces, however invalid...ultimately Ant is about getting work done. Was wondering if there ever was any discussion of such behavior in namespace spec process (e.g. composing groups of namespaces)?
b) Since my build processes span across multiple markups (and namespaces), I always explicitly define default namespace elements...I dont like the idea of a processor assuming/imposing a default namespace. Is there any other examples of processors (of XML) that impose a defualt namespace....is there a need to define simple processing switches here?
c) Ant specifically doesnt consume anything other then what it expects, which means that we always spend cycles to transform it down to an XML format that Ant expects. I am of the mind that the a dense layered XML composite document should be processed by Ant, by just ignoring namespaces it doesnt know anything about. Would be nice to have a standard switch on anything that processes XML to -ignore-unknown-namespaces...
Was wondering if anyone would like to comment on the above. I will summarise and report back to Ant dev list with this as well.
cheers, Jim Fuller
|