git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@720775 13f79535-47bb-0310-9956-ffa450edef68master
@@ -555,6 +555,11 @@ Other changes: | |||||
* <xslt> now fails early if a specified stylesheet doesn't exist. | * <xslt> now fails early if a specified stylesheet doesn't exist. | ||||
Bugzilla Report 34525. | 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 | Changes from Ant 1.7.0 TO Ant 1.7.1 | ||||
============================================= | ============================================= | ||||
@@ -222,6 +222,14 @@ element which is used to perform Entity and URI resolution.</p> | |||||
<em>Since Ant 1.7</em>.</td> | <em>Since Ant 1.7</em>.</td> | ||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
</tr> | </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> | </table> | ||||
<h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
@@ -169,6 +169,13 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
*/ | */ | ||||
public static final String PROCESSOR_TRAX = "trax"; | 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. | * Creates a new XSLTProcess Task. | ||||
*/ | */ | ||||
@@ -513,6 +520,24 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
this.fileDirParameter = fileDirParameter; | this.fileDirParameter = fileDirParameter; | ||||
} | } | ||||
/** | |||||
* 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 | * Load processor here instead of in setProcessor - this will be | ||||
* called from within execute, so we have access to the latest | * called from within execute, so we have access to the latest | ||||
@@ -122,6 +122,9 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
/** factory attributes */ | /** factory attributes */ | ||||
private Vector attributes = new Vector(); | private Vector attributes = new Vector(); | ||||
/** whether to suppress warnings */ | |||||
private boolean suppressWarnings = false; | |||||
/** | /** | ||||
* Constructor for TraXLiaison. | * Constructor for TraXLiaison. | ||||
* @throws Exception never | * @throws Exception never | ||||
@@ -497,7 +500,9 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
* @param e the exception to log. | * @param e the exception to log. | ||||
*/ | */ | ||||
public void warning(TransformerException e) { | public void warning(TransformerException e) { | ||||
logError(e, "Warning"); | |||||
if (!suppressWarnings) { | |||||
logError(e, "Warning"); | |||||
} | |||||
} | } | ||||
private void logError(TransformerException e, String type) { | private void logError(TransformerException e, String type) { | ||||
@@ -588,5 +593,7 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
= (XSLTProcess.OutputProperty) props.nextElement(); | = (XSLTProcess.OutputProperty) props.nextElement(); | ||||
setOutputProperty(prop.getName(), prop.getValue()); | setOutputProperty(prop.getName(), prop.getValue()); | ||||
} | } | ||||
suppressWarnings = xsltTask.getSuppressWarnings(); | |||||
} | } | ||||
} | } |