Class XMLUtilsWriter


  • public final class XMLUtilsWriter
    extends Object
    The class implements common action to create control quality report.
    Since:
    1.3
    Author:
    Sandrine Perrin
    • Constructor Detail

      • XMLUtilsWriter

        public XMLUtilsWriter()
    • Method Detail

      • buildXMLCommonTagHeader

        public static void buildXMLCommonTagHeader​(Document doc,
                                                   Element parent,
                                                   RunData data)
                                            throws AozanException
        Add common tag in document header xml to describe Aozan and if data exists on run.
        Parameters:
        doc - document xml
        parent - parent element on tag
        data - instance of run data
        Throws:
        AozanException - if document or parent element doesn't exist
      • createXMLFile

        public static void createXMLFile​(Document doc,
                                         File output)
                                  throws IOException,
                                         AozanException
        Create a xml file from document xml.
        Parameters:
        doc - document xml
        output - the output
        Throws:
        IOException - if an error occurs while writing the file
        AozanException - if document or output file doesn't exist or if an error occurs during transforming document.
      • createXMLFileContent

        public static String createXMLFileContent​(Document doc)
                                           throws IOException,
                                                  AozanException
        Create a XML file content from XML document.
        Parameters:
        doc - the XML document
        Returns:
        a String with the XML document
        Throws:
        IOException - if an error occurs while writing the file
        AozanException - if document or output file doesn't exist or if an error occurs during transforming document.
      • createHTMLFileFromXSL

        public static String createHTMLFileFromXSL​(String XMLPath,
                                                   String XSLPath)
                                            throws AozanException
        Transform a XML file using XSL style sheet.
        Parameters:
        XMLPath - XML file
        XSLPath - XSL file
        Returns:
        the QC report as a String
        Throws:
        AozanException - if an error occurs while creating the report
      • createHTMLFileFromXSL

        public static String createHTMLFileFromXSL​(File XMLFile,
                                                   File XSLFile)
                                            throws AozanException
        Transform a XML file using XSL style sheet.
        Parameters:
        XMLFile - XML file
        XSLFile - XSL file
        Returns:
        the QC report as a String
        Throws:
        AozanException - if an error occurs while creating the report
      • createHTMLFileFromXSL

        public static void createHTMLFileFromXSL​(Document doc,
                                                 InputStream isXslFile,
                                                 File reportHtml)
                                          throws IOException,
                                                 AozanException
        Create a html file from document xml and xsl files.
        Parameters:
        doc - document xml
        isXslFile - input stream on the xsl file
        reportHtml - output html file
        Throws:
        IOException - if an error occurs while writing the file
        AozanException - if document or output file or xsl file doesn't exist or if an error occurs during transforming document.
      • createHTMLFileFromXSL

        public static String createHTMLFileFromXSL​(Document doc,
                                                   InputStream isXslFile)
                                            throws AozanException
        Create a html file from document xml and xsl files.
        Parameters:
        doc - document xml
        isXslFile - input stream on the xsl file
        Returns:
        document xml in html format
        Throws:
        AozanException - if document or output file or xsl file doesn't exist or if an error occurs during transforming document.