costin      2003/05/03 07:30:26

  Modified:    src/main/org/apache/tools/ant UnknownElement.java
               src/main/org/apache/tools/ant/helper ProjectHelper2.java
  Log:
  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 ).
  
  Revision  Changes    Path
  1.49      +22 -0     ant/src/main/org/apache/tools/ant/UnknownElement.java
  
  Index: UnknownElement.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- UnknownElement.java       28 Apr 2003 12:42:47 -0000      1.48
  +++ UnknownElement.java       3 May 2003 14:30:25 -0000       1.49
  @@ -73,6 +73,11 @@
        * 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.
  @@ -103,6 +108,23 @@
        */
       public String getTag() {
           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;
       }
   
       /**
  
  
  
  1.19      +2 -1      
ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
  
  Index: ProjectHelper2.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ProjectHelper2.java       28 Apr 2003 12:19:18 -0000      1.18
  +++ ProjectHelper2.java       3 May 2003 14:30:26 -0000       1.19
  @@ -753,7 +753,8 @@
   
               /* 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);
   
  
  
  

Reply via email to