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-ffa450edef68master
@@ -49,6 +49,9 @@ Changes that could break older environments: | |||||
* All exceptions thrown by tasks are now wrapped in a buildexception | * All exceptions thrown by tasks are now wrapped in a buildexception | ||||
giving the location in the buildfile of the task. | 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: | Fixed bugs: | ||||
----------- | ----------- | ||||
@@ -91,7 +91,8 @@ | |||||
<h2>Namespaces and Nested Elements</h2> | <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 | element have the same namespace as their parent. So if 'task' in the | ||||
example above allowed a nested 'config' element, the build file snippet | example above allowed a nested 'config' element, the build file snippet | ||||
would look like this: | would look like this: | ||||
@@ -110,6 +111,18 @@ | |||||
... | ... | ||||
</task> | </task> | ||||
</pre> | </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> <typedef resource="org/example/tasks.properties" | |||||
uri="<a href="http://example.org/tasks">http://example.org/tasks</a>"/> | |||||
<my:task xmlns:my="<a href="http://example.org/tasks">http://example.org/tasks</a>"> | |||||
<config a="foo" b="bar"/> | |||||
... | |||||
</my:task> | |||||
</pre> | |||||
<h2>Namespaces and Attributes</h2> | <h2>Namespaces and Attributes</h2> | ||||
<p> | <p> | ||||
@@ -604,7 +604,7 @@ public final class IntrospectionHelper implements BuildListener { | |||||
parentUri = ""; | parentUri = ""; | ||||
} | } | ||||
NestedCreator nc = null; | NestedCreator nc = null; | ||||
if (uri.equals(parentUri)) { // || uri.equals("")) { | |||||
if (uri.equals(parentUri) || uri.equals("")) { | |||||
nc = (NestedCreator) nestedCreators.get( | nc = (NestedCreator) nestedCreators.get( | ||||
name.toLowerCase(Locale.US)); | name.toLowerCase(Locale.US)); | ||||
} | } | ||||
@@ -775,7 +775,7 @@ public final class IntrospectionHelper implements BuildListener { | |||||
return ( | return ( | ||||
nestedCreators.containsKey(name.toLowerCase(Locale.US)) | nestedCreators.containsKey(name.toLowerCase(Locale.US)) | ||||
&& (uri.equals(parentUri))) // || uri.equals(""))) | |||||
&& (uri.equals(parentUri) || uri.equals(""))) | |||||
|| DynamicElement.class.isAssignableFrom(bean) | || DynamicElement.class.isAssignableFrom(bean) | ||||
|| DynamicElementNS.class.isAssignableFrom(bean) | || DynamicElementNS.class.isAssignableFrom(bean) | ||||
|| addTypeMethods.size() != 0; | || addTypeMethods.size() != 0; | ||||