Package org.apache.batik.test.xml
Class XSLXMLReportConsumer
java.lang.Object
org.apache.batik.test.xml.XSLXMLReportConsumer
- All Implemented Interfaces:
XMLTestReportProcessor.XMLReportConsumer
public class XSLXMLReportConsumer
extends Object
implements XMLTestReportProcessor.XMLReportConsumer
This implementation of the
XMLTestReportProcessor.XMLReportConsumer
interface simply applies an XSL transformation to the input
XML file and stores the result in a configurable directory.- Version:
- $Id: XSLXMLReportConsumer.java 1803263 2017-07-28 10:51:01Z ssteiner $
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXSLXMLReportConsumer
(String stylesheet, String outputDirectory, String outputFileName) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkDirectory
(File dir) Checks that the input File represents a directory that can be used.createNewReportOutput
(File reportDirectory) Returns a new file in the outputDirectory, with the requested report name.void
onNewReport
(File xmlReport, File reportDirectory) When a new report has been generated, this consumer applies the same stylesheet to the input XML document
-
Field Details
-
ERROR_OUTPUT_DIRECTORY_UNUSABLE
Error code used when the output directory cannot be used- See Also:
-
stylesheet
Stylesheet URI -
outputDirectory
Output directory, i.e., the directory where the result of the XSL transformation will be stored. -
outputFileName
Output file name
-
-
Constructor Details
-
XSLXMLReportConsumer
Constructor- Parameters:
stylesheet
- URI for the stylesheet to apply to the XML reportoutputDirectory
- directory where the result of the XSL transformation should be writtenoutputFileName
- name of the output report.
-
-
Method Details
-
onNewReport
When a new report has been generated, this consumer applies the same stylesheet to the input XML document- Specified by:
onNewReport
in interfaceXMLTestReportProcessor.XMLReportConsumer
- Parameters:
xmlReport
- file containing the xml reportreportDirectory
- base directory where any resource relative to the report processing should be stored.- Throws:
Exception
-
createNewReportOutput
Returns a new file in the outputDirectory, with the requested report name.- Throws:
Exception
-
checkDirectory
Checks that the input File represents a directory that can be used. If the directory does not exist, this method will attempt to create it.- Throws:
TestException
-