cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghow...@apache.org
Subject cvs commit: cocoon-2.1/tools/src/anttasks XConfToolTask.java
Date Thu, 05 Jun 2003 02:55:51 GMT
ghoward     2003/06/04 19:55:51

  Modified:    tools/src/anttasks XConfToolTask.java
  Log:
  Add "unless-path".  Functionally identical but clearer name than "unless".
  For back compat, unless is used when unless-path is not specified.
  
  Revision  Changes    Path
  1.6       +9 -4      cocoon-2.1/tools/src/anttasks/XConfToolTask.java
  
  Index: XConfToolTask.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/src/anttasks/XConfToolTask.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XConfToolTask.java	23 May 2003 02:48:03 -0000	1.5
  +++ XConfToolTask.java	5 Jun 2003 02:55:51 -0000	1.6
  @@ -247,15 +247,20 @@
           Node root = nodes.item(0);
   
           // Test that 'root' node satisfies 'component' insertion criteria
  -        String test = component.getDocumentElement().getAttribute("unless");
  +        String testPath = component.getDocumentElement().getAttribute("unless-path");
  +        if (testPath == null) {
  +            // only look for old "unless" attr if unless-path is not present
  +            testPath = component.getDocumentElement().getAttribute("unless");
  +        }
  +        // Is if-path needed?
           String ifProp = component.getDocumentElement().getAttribute("if-prop");
           boolean ifValue = Boolean.valueOf(project.getProperty(ifProp)).booleanValue();
        
           if (ifProp != null && (ifProp.length()>0) && !ifValue ) {
               log("Skipping: " + file, Project.MSG_DEBUG);
               return false;
  -        } else if ((test!=null) && (test.length()>0) &&
  -            (XPathAPI.selectNodeList(root, test).getLength()!=0)) {
  +        } else if ((testPath!=null) && (testPath.length()>0) &&
  +            (XPathAPI.selectNodeList(root, testPath).getLength()!=0)) {
               log("Skipping: " + file, Project.MSG_DEBUG);
               return false;
           } else {
  
  
  

Mime
View raw message