peter reilly wrote:
True. It seems quite difficult to use namespaces in a nice way.

You are not supposed to "use namespaces in a nice way". XML Namespaces are there so that you can avoid name clashes for XML element and attribute names if you want to use XML vocabularies from various uncoordinated sources together. XML Namespaces do *not* have the purpose of - link to a web page - point to a library/jar - link to whatever ressource. While even "names" from W3C TCs obviously commited such abberations, this doesn not mean it is good style. In fact, abusing XML namespaces for other purposes than disambiguating short element and attribute names has brought unnecessary difficulties into XML processing, and many of the people formerly advocating such uses are now regretting it.

The niceest I can thing of is to place all the jars in
${ant.home}/lib and set the namespace up in the project declation:

<project xmlns:antcontrib="antlib:${ant.home}/lib/ant-contrib.jar"
             xmlns:antcontrib="antlib:${ant.home}/lib/antleope.jar">

This is not only utter foolishness: it would mean the semantic of an XML element in the namespace the antcontrib prefix points to would change if ant.home changes, beside other problems. It has the additional problem of being syntactically invalid: you must not declare the same namespace prefix twice on the same element.

J.Pietschmann



Reply via email to