I have many XML's in one directory with the same structure and I need to generate HTML table, where "result" from every XML will be one column. Before I had one csv file, so that was easy. But now I don't even know how to start. I read something about XSLT, but I don't know how to use this because I have the only path to directory with XML files, not the path to one file.
Example file1.xml
<test>
<filename>aa</filename>
<status>ok</status>
</test>
Example file2.xml
<test>
<filename>aa</filename>
<status>failed</status>
</test>
I need a table like this:
filename | status1 | status2  | status n
aaa      |   ok    |  not ok  |    n
Edit: Some old piece of code by guy from my team (excuse me for any ugly line of this legacy code, It was written a lot of time ago)
public class Main {
private static ArrayList<TestSection> errors = new ArrayList<TestSection>();
private static int errorNum = 1;
public static void main(String[] args) throws JAXBException, IOException {
    ArrayList<Test> tests = new ArrayList<Test>();
    generateTestObjects(args, tests);
    createHTML(tests, args[1]);
}
private static void generateTestObjects(String[] args, ArrayList<Test> arrayList) throws IOException{
    Stream<Path> list = Files.list(Paths.get(args[0]));
    list.forEach(arg0 -> {
        try {
            arrayList.add(unmarshall(arg0.toString()));
        } catch (JAXBException e) {
            e.printStackTrace();
        }
    });
    list.close();
}
private static Test unmarshall(String fileName) throws JAXBException{
    JAXBContext context = JAXBContext.newInstance(Test.class);
    Unmarshaller un = context.createUnmarshaller();
    Test test = (Test) un.unmarshal(new File(fileName));
    return test;
}
private static void createHTML(ArrayList<Test> arraylist, String filename) throws IOException {
    File file = new File("xunit.html");
    FileWriter writer = new FileWriter(file);
    writer.write("<!DOCTYPE html>");
    writer.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
    writer.write("<head>");
    writer.write("<title>Xunit Report</title>");
    writer.write("<meta http-equiv=\"content-Type\" content=\"text/html; charset=UTF-8\" />");
    writer.write("</head>");
    writer.write("<body>");
    writer.write("<h1>Xunit Report</h1>");
    createHTMLTable(arraylist, writer);
    createHTMLTableCSV(filename, writer);
    writer.write("</body>");
    writer.write("</html>");
    writer.close();
}
private static void createHTMLTable(ArrayList<Test> arraylist, FileWriter fwriter) throws IOException{
    fwriter.write("<table border=\"1\">");
    fwriter.write("<tr bgcolor=\"#A9A9F5\">");
    fwriter.write("<th style=\"text-align:left\">Test case: </th>");
    List<TestSection> testSections = arraylist.stream().map(Test::getTestSection).collect(Collectors.toList());
    for(int file=0; file < arraylist.size(); file++){
        fwriter.write("<th style=\"text-align:left\">" + arraylist.get(file).getAppInformation().getWorkstationId() + "</th>");
    }
    for(int test=0; test < testSections.get(0).getTests().size(); test++){
        fwriter.write("<tr>");
        String testName = testSections.get(0).getTests().get(test).getTestName();
        testName = testName.replace("<", "<");
        testName = testName.replace(">", ">");
        fwriter.write("<td>" + testName + "</td>");
        for(int file=0; file < arraylist.size(); file++){
            String status = testSections.get(file).getTests().get(test).getStatus();
            if(status.equalsIgnoreCase("PASSED")){
                fwriter.write("<td bgcolor=\"#00FF00\">" + status + "</td>");
            } else{
                fwriter.write("<td bgcolor=\"#FF4000\">" +"<a href=\"#"+errorNum+"error\">"+ status + "</a></td>");
                errorNum++;
            }
        }
        fwriter.write("</tr>");
    }
    fwriter.write("</table> <br/> <br/>");
    for(Test test: arraylist){
        int id = 1;
        if(test.getTestSection().getFailedTests() != null){
            for(int i=0;i<test.getTestSection().getFailedTests().size();i++){
                String testName = test.getTestSection().getFailedTests().get(i).getTestName();
                testName = testName.replace("<", "<");
                testName = testName.replace(">", ">");
                fwriter.write("<h4 id=\""+id+"error\">" + testName +"       "+test.getAppInformation().getWorkstationId()+"</h4>");
                fwriter.write("<h5>"+ test.getTestSection().getFailedTests().get(i).getDetails()+"</h5>");
                id++;
            }   
        }   
    }
}
 
    