Browse Source

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
master
Costin Manolache 22 years ago
parent
commit
b152a5f8f7
2 changed files with 24 additions and 1 deletions
  1. +22
    -0
      src/main/org/apache/tools/ant/UnknownElement.java
  2. +2
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java

+ 22
- 0
src/main/org/apache/tools/ant/UnknownElement.java View File

@@ -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.


+ 2
- 1
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -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);



Loading…
Cancel
Save