peterreilly 2004/06/12 09:51:09
Modified: . WHATSNEW
src/main/org/apache/tools/ant IntrospectionHelper.java
docs/manual/CoreTypes namespace.html
Log:
Allow nested elements of namespaced types to below to the ant
default namespace as well as the type's namespace.
Revision Changes Path
1.621 +3 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.620
retrieving revision 1.621
diff -u -r1.620 -r1.621
--- WHATSNEW 10 Jun 2004 09:11:51 -0000 1.620
+++ WHATSNEW 12 Jun 2004 16:51:09 -0000 1.621
@@ -49,6 +49,9 @@
* 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:
-----------
1.85 +2 -2
ant/src/main/org/apache/tools/ant/IntrospectionHelper.java
Index: IntrospectionHelper.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- IntrospectionHelper.java 27 May 2004 14:38:46 -0000 1.84
+++ IntrospectionHelper.java 12 Jun 2004 16:51:09 -0000 1.85
@@ -604,7 +604,7 @@
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 @@
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;
1.2 +14 -1 ant/docs/manual/CoreTypes/namespace.html
Index: namespace.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTypes/namespace.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- namespace.html 18 Dec 2003 12:43:06 -0000 1.1
+++ namespace.html 12 Jun 2004 16:51:09 -0000 1.2
@@ -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 @@
...
</task>
</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>
<p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]