ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r720775 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTasks/style.html src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
Date Wed, 26 Nov 2008 09:34:16 GMT
Author: bodewig
Date: Wed Nov 26 01:34:16 2008
New Revision: 720775

URL: http://svn.apache.org/viewvc?rev=720775&view=rev
Log:
add an option to suppress processor warnings.  PR 18897.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTasks/style.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=720775&r1=720774&r2=720775&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Nov 26 01:34:16 2008
@@ -555,6 +555,11 @@
  * <xslt> now fails early if a specified stylesheet doesn't exist.
    Bugzilla Report 34525.
 
+ * <xslt> now has an option to supress transformer warnings.  This
+   option only has an effect for processors that support this feature;
+   the "trax" processor included with Ant does support it.
+   Bugzilla Report 18897.
+
 Changes from Ant 1.7.0 TO Ant 1.7.1
 =============================================
 

Modified: ant/core/trunk/docs/manual/CoreTasks/style.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/style.html?rev=720775&r1=720774&r2=720775&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/style.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/style.html Wed Nov 26 01:34:16 2008
@@ -222,6 +222,14 @@
     <em>Since Ant 1.7</em>.</td>
     <td valign="top" align="center">No</td>
   </tr>
+  <tr>
+    <td valign="top">supressWarnings</td>
+    <td valign="top">Whether processor warnings shall be suppressed.
+    This option requires support by the processor, it is supported by
+    the trax processor bundled with Ant. 
+    <em>Since Ant 1.8.0</em>.</td>
+    <td valign="top" align="center">No, default is false.</td>
+  </tr>
 </table>
 <h3>Parameters specified as nested elements</h3>
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java?rev=720775&r1=720774&r2=720775&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Wed Nov 26 01:34:16
2008
@@ -170,6 +170,13 @@
     public static final String PROCESSOR_TRAX = "trax";
 
     /**
+     * whether to suppress warnings.
+     *
+     * @since Ant 1.8.0
+     */
+    private boolean suppressWarnings = false;
+
+    /**
      * Creates a new XSLTProcess Task.
      */
     public XSLTProcess() {
@@ -514,6 +521,24 @@
     }
 
     /**
+     * Whether to suppress warning messages of the processor.
+     *
+     * @since Ant 1.8.0
+     */
+    public void setSuppressWarnings(boolean b) {
+        suppressWarnings = b;
+    }
+
+    /**
+     * Whether to suppress warning messages of the processor.
+     *
+     * @since Ant 1.8.0
+     */
+    public boolean getSuppressWarnings() {
+        return suppressWarnings;
+    }    
+
+    /**
      * Load processor here instead of in setProcessor - this will be
      * called from within execute, so we have access to the latest
      * classpath.

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java?rev=720775&r1=720774&r2=720775&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java Wed Nov
26 01:34:16 2008
@@ -122,6 +122,9 @@
     /** factory attributes */
     private Vector attributes = new Vector();
 
+    /** whether to suppress warnings */
+    private boolean suppressWarnings = false;
+
     /**
      * Constructor for TraXLiaison.
      * @throws Exception never
@@ -497,7 +500,9 @@
      * @param e the exception to log.
      */
     public void warning(TransformerException e) {
-        logError(e, "Warning");
+        if (!suppressWarnings) {
+            logError(e, "Warning");
+        }
     }
 
     private void logError(TransformerException e, String type) {
@@ -588,5 +593,7 @@
                 = (XSLTProcess.OutputProperty) props.nextElement();
             setOutputProperty(prop.getName(), prop.getValue());
         }
+
+        suppressWarnings = xsltTask.getSuppressWarnings();
     }
 }



Mime
View raw message