|
@@ -3,7 +3,7 @@ |
|
|
<body> |
|
|
<body> |
|
|
<h2><a name="namespace">XML Namespace Support</a></h2> |
|
|
<h2><a name="namespace">XML Namespace Support</a></h2> |
|
|
Ant 1.6 introduces support for XML namespaces. |
|
|
Ant 1.6 introduces support for XML namespaces. |
|
|
<h2>History</h2> |
|
|
|
|
|
|
|
|
<h3>History</h3> |
|
|
|
|
|
|
|
|
<p> |
|
|
<p> |
|
|
All releases of Ant prior to Ant 1.6 do not support XML namespaces. |
|
|
All releases of Ant prior to Ant 1.6 do not support XML namespaces. |
|
@@ -28,7 +28,7 @@ |
|
|
IIRC, and using any attribute starting with "xml" is actually strongly |
|
|
IIRC, and using any attribute starting with "xml" is actually strongly |
|
|
discouraged by the XML spec to reserve such names for future use. |
|
|
discouraged by the XML spec to reserve such names for future use. |
|
|
</p> |
|
|
</p> |
|
|
<h2>Motivation</h2> |
|
|
|
|
|
|
|
|
<h3>Motivation</h3> |
|
|
|
|
|
|
|
|
<p>In build files using a lot of custom and third-party tasks, it is |
|
|
<p>In build files using a lot of custom and third-party tasks, it is |
|
|
easy to get into name conflicts. When individual types are defined, the |
|
|
easy to get into name conflicts. When individual types are defined, the |
|
@@ -37,7 +37,7 @@ |
|
|
libraries of types using the <code><typedef></code> 'resource' attribute, the |
|
|
libraries of types using the <code><typedef></code> 'resource' attribute, the |
|
|
build file writer has no chance to override or even prefix the names |
|
|
build file writer has no chance to override or even prefix the names |
|
|
supplied by the library. </p> |
|
|
supplied by the library. </p> |
|
|
<h2>Assigning Namespaces</h2> |
|
|
|
|
|
|
|
|
<h3>Assigning Namespaces</h3> |
|
|
|
|
|
|
|
|
<p> |
|
|
<p> |
|
|
Adding a 'prefix' attribute to <code><typedef></code> might have been enough, |
|
|
Adding a 'prefix' attribute to <code><typedef></code> might have been enough, |
|
@@ -76,7 +76,7 @@ |
|
|
Here, the namespace is set as the default namespace for the <code><task></code> |
|
|
Here, the namespace is set as the default namespace for the <code><task></code> |
|
|
element and all its descendants. |
|
|
element and all its descendants. |
|
|
</p> |
|
|
</p> |
|
|
<h2>Default namespace</h2> |
|
|
|
|
|
|
|
|
<h3>Default namespace</h3> |
|
|
<p> |
|
|
<p> |
|
|
The default namespace used by Ant is "antlib:org.apache.tools.ant". |
|
|
The default namespace used by Ant is "antlib:org.apache.tools.ant". |
|
|
</p> |
|
|
</p> |
|
@@ -89,7 +89,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Namespaces and Nested Elements</h2> |
|
|
|
|
|
|
|
|
<h3>Namespaces and Nested Elements</h3> |
|
|
|
|
|
|
|
|
<p> |
|
|
<p> |
|
|
Almost always in Ant 1.6, elements nested inside a namespaced |
|
|
Almost always in Ant 1.6, elements nested inside a namespaced |
|
@@ -123,7 +123,7 @@ |
|
|
</my:task> |
|
|
</my:task> |
|
|
</pre> |
|
|
</pre> |
|
|
|
|
|
|
|
|
<h2>Namespaces and Attributes</h2> |
|
|
|
|
|
|
|
|
<h3>Namespaces and Attributes</h3> |
|
|
|
|
|
|
|
|
<p> |
|
|
<p> |
|
|
Attributes are only used to configure the element they belong to if: |
|
|
Attributes are only used to configure the element they belong to if: |
|
@@ -162,7 +162,7 @@ |
|
|
XML-Schema (whether that's a good thing or not). The same is not true |
|
|
XML-Schema (whether that's a good thing or not). The same is not true |
|
|
for elements from unknown namespaces, which result in a error. |
|
|
for elements from unknown namespaces, which result in a error. |
|
|
</p> |
|
|
</p> |
|
|
<h2>Mixing Elements from Different Namespaces</h2> |
|
|
|
|
|
|
|
|
<h3>Mixing Elements from Different Namespaces</h3> |
|
|
|
|
|
|
|
|
<p>Now comes the difficult part: elements from different namespaces can |
|
|
<p>Now comes the difficult part: elements from different namespaces can |
|
|
be woven together under certain circumstances. This has a lot to do |
|
|
be woven together under certain circumstances. This has a lot to do |
|
@@ -190,7 +190,7 @@ |
|
|
and elements like the builtin Ant conditions and selectors are not |
|
|
and elements like the builtin Ant conditions and selectors are not |
|
|
really types in 1.6. This is expected to change in Ant 1.7. |
|
|
really types in 1.6. This is expected to change in Ant 1.7. |
|
|
</p> |
|
|
</p> |
|
|
<h2>Namespaces and Antlib</h2> |
|
|
|
|
|
|
|
|
<h3>Namespaces and Antlib</h3> |
|
|
|
|
|
|
|
|
<p> |
|
|
<p> |
|
|
The new <a href="antlib.html">AntLib</a> |
|
|
The new <a href="antlib.html">AntLib</a> |
|
|