From b152a5f8f72c02296d30b09a406a7df25125c4ed Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Sat, 3 May 2003 14:30:26 +0000 Subject: [PATCH] Plug the namespace uri. One way or another - we'll need it. Also fix the qname - we need to use the localname. Originally used qname to avoid breaking build files that used : ( they still needed to declare a namespace for that previx - otherwise SAX would complain ). ( not sure about the last part - I think some parsers, when validation is off, will allow : to be used and pass whatever was used as qname ). git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274547 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/UnknownElement.java | 22 +++++++++++++++++++ .../tools/ant/helper/ProjectHelper2.java | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index 5f0d4dd3d..66030d9f6 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -73,6 +73,11 @@ public class UnknownElement extends Task { * been redefined since original creation. */ private String elementName; + + /** + * Holds the namespace of the element. + */ + private String namespace; /** * The real object after it has been loaded. @@ -105,6 +110,23 @@ public class UnknownElement extends Task { return elementName; } + /** Return the namespace of the XML element associated with this component. + * + * @return Namespace URI used in the xmlns declaration. + */ + public String getNamespace() { + return namespace; + } + + /** Set the namespace of the XML element associated with this component. + * This method is typically called by the XML processor. + * + * @param namespace URI used in the xmlns declaration. + */ + public void setNamespace(String namespace) { + this.namespace = namespace; + } + /** * Get the RuntimeConfigurable instance for this UnknownElement, containing * the configuration information. diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java index 7c1180556..b2dbb2f89 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java @@ -753,7 +753,8 @@ public class ProjectHelper2 extends ProjectHelper { /* UnknownElement is used for tasks and data types - with delayed eval */ - UnknownElement task = new UnknownElement(qname); + UnknownElement task = new UnknownElement(tag); + task.setNamespace(uri); task.setProject(context.getProject()); //XXX task.setTaskType(qname);