ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/helper ProjectHelper2.java
Date Tue, 18 Nov 2003 17:07:24 GMT
peterreilly    2003/11/18 09:07:24

  Modified:    src/testcases/org/apache/tools/ant/taskdefs Tag:
                        ANT_16_BRANCH XmlnsTest.java
               src/etc/testcases/taskdefs Tag: ANT_16_BRANCH xmlns.xml
               src/main/org/apache/tools/ant/helper Tag: ANT_16_BRANCH
                        ProjectHelper2.java
  Log:
  Sync with HEAD
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.2.1   +8 -0      ant/src/testcases/org/apache/tools/ant/taskdefs/XmlnsTest.java
  
  Index: XmlnsTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/XmlnsTest.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- XmlnsTest.java	13 Aug 2003 13:36:36 -0000	1.2
  +++ XmlnsTest.java	18 Nov 2003 17:07:24 -0000	1.2.2.1
  @@ -88,6 +88,14 @@
               "Attempt to use a reserved URI ant:notallowed");
       }
   
  +    public void testOther() {
  +        expectLog("other", "a message");
  +    }
  +
  +    public void testNsAttributes() {
  +        expectLog("ns.attributes", "hello world");
  +    }
  +    
       public static class MyTask extends Task {
           public void execute() {
               log("MyTask called");
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +12 -1     ant/src/etc/testcases/taskdefs/xmlns.xml
  
  Index: xmlns.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/xmlns.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- xmlns.xml	29 Oct 2003 10:21:13 -0000	1.1.2.1
  +++ xmlns.xml	18 Nov 2003 17:07:24 -0000	1.1.2.2
  @@ -1,5 +1,6 @@
   <?xml version="1.0"?>
  -<project name="test">
  +<project name="test" xmlns:other="this is the other uri"
  +         other:attr="this should be ignored by ant">
   
     <property name="testcases.dir" location="../../../../build/testcases"/>
   
  @@ -14,6 +15,16 @@
                name="mytask"
                uri="this.is.another.test.uri" />
       <test:mytask/>
  +  </target>
  +
  +  <target name="other" other:a="this is another attribute">
  +    <echo other:g="abc" message="a message"/>
  +  </target>
  +
  +  <target name="ns.attributes">
  +    <taskdef name="my.echo" classname="org.apache.tools.ant.taskdefs.Echo"
  +             uri="x-uri"/>
  +    <x:my.echo x:message="hello world" xmlns:x="x-uri"/>
     </target>
   
     <target name="xmlns.file" xmlns:test="this.is.a.test.uri">
  
  
  
  No                   revision
  No                   revision
  1.33.2.4  +19 -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.33.2.3
  retrieving revision 1.33.2.4
  diff -u -r1.33.2.3 -r1.33.2.4
  --- ProjectHelper2.java	18 Nov 2003 11:29:06 -0000	1.33.2.3
  +++ ProjectHelper2.java	18 Nov 2003 17:07:24 -0000	1.33.2.4
  @@ -645,9 +645,15 @@
                */
   
               for (int i = 0; i < attrs.getLength(); i++) {
  +                String attrUri = attrs.getURI(i);
  +                if (attrUri != null
  +                    && !attrUri.equals("")
  +                    && !attrUri.equals(uri)) {
  +                    continue; // Ignore attributes from unknown uris
  +                }
                   String key = attrs.getLocalName(i);
                   String value = attrs.getValue(i);
  -
  + 
                   if (key.equals("default")) {
                       if (value != null && !value.equals("")) {
                           if (!context.isIgnoringProjectTag()) {
  @@ -797,6 +803,12 @@
               context.addTarget(target);
   
               for (int i = 0; i < attrs.getLength(); i++) {
  +                String attrUri = attrs.getURI(i);
  +                if (attrUri != null
  +                    && !attrUri.equals("")
  +                    && !attrUri.equals(uri)) {
  +                    continue; // Ignore attributes from unknown uris
  +                }
                   String key = attrs.getLocalName(i);
                   String value = attrs.getValue(i);
   
  @@ -967,6 +979,12 @@
                   = new RuntimeConfigurable(task, task.getTaskName());
   
               for (int i = 0; i < attrs.getLength(); i++) {
  +                String attrUri = attrs.getURI(i);
  +                if (attrUri != null
  +                    && !attrUri.equals("")
  +                    && !attrUri.equals(uri)) {
  +                    continue; // Ignore attributes from unknown uris
  +                }
                   String name = attrs.getLocalName(i);
                   String value = attrs.getValue(i);
                   // PR: Hack for ant-type value
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message