Browse Source

Allow nested elements of namespaced types to below to the ant

default namespace as well as the type's namespace.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276573 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
e5eca124f4
3 changed files with 19 additions and 3 deletions
  1. +3
    -0
      WHATSNEW
  2. +14
    -1
      docs/manual/CoreTypes/namespace.html
  3. +2
    -2
      src/main/org/apache/tools/ant/IntrospectionHelper.java

+ 3
- 0
WHATSNEW View File

@@ -49,6 +49,9 @@ Changes that could break older environments:
* All exceptions thrown by tasks are now wrapped in a buildexception
giving the location in the buildfile of the task.

* Nested elements for namespaced tasks and types may belong to the
Ant default namespace as well as the task's or type's namespace.

Fixed bugs:
-----------



+ 14
- 1
docs/manual/CoreTypes/namespace.html View File

@@ -91,7 +91,8 @@

<h2>Namespaces and Nested Elements</h2>

<p>Almost always in Ant 1.6, elements nested inside a namespaced
<p>
Almost always in Ant 1.6, elements nested inside a namespaced
element have the same namespace as their parent. So if 'task' in the
example above allowed a nested 'config' element, the build file snippet
would look like this:
@@ -110,6 +111,18 @@
...
&lt;/task&gt;
</pre>
<p>
From Ant 1.6.2, elements nested inside a namespaced element may also be
in Ant's default namespace. This means that the following is now allowed:
</p>
</p><pre> &lt;typedef resource="org/example/tasks.properties"
uri="<a href="http://example.org/tasks">http://example.org/tasks</a>"/&gt;
&lt;my:task xmlns:my="<a href="http://example.org/tasks">http://example.org/tasks</a>"&gt;
&lt;config a="foo" b="bar"/&gt;
...
&lt;/my:task&gt;
</pre>
<h2>Namespaces and Attributes</h2>

<p>


+ 2
- 2
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -604,7 +604,7 @@ public final class IntrospectionHelper implements BuildListener {
parentUri = "";
}
NestedCreator nc = null;
if (uri.equals(parentUri)) { // || uri.equals("")) {
if (uri.equals(parentUri) || uri.equals("")) {
nc = (NestedCreator) nestedCreators.get(
name.toLowerCase(Locale.US));
}
@@ -775,7 +775,7 @@ public final class IntrospectionHelper implements BuildListener {

return (
nestedCreators.containsKey(name.toLowerCase(Locale.US))
&& (uri.equals(parentUri))) // || uri.equals("")))
&& (uri.equals(parentUri) || uri.equals("")))
|| DynamicElement.class.isAssignableFrom(bean)
|| DynamicElementNS.class.isAssignableFrom(bean)
|| addTypeMethods.size() != 0;


Loading…
Cancel
Save