Skip to content
Konstantinos edited this page May 1, 2015 · 11 revisions

Welcome to the XMLFilteringMechanism wiki!


What is XMLFilteringMechanism?

XMLFilteringMechanism is a java implemented cmd based utility that should be used to filter XML files stored in local filesystem using XPath Filters.


Requirements

The latest jdk should be installed from here


How it works

First you should download it from here.Unrar it to a convenient place in your system.The unrared package should contain the following files:

  1. XMLFiltering.jar
  2. XMLFiltering_lib folder
  3. configure.properties

Edit the following attribute in the configure.properties file:

filtering.output.folder="the output folder path"

filtering.xpath.queries=the XPath query declaration goes here

filtering.report.mode=true|false

Depending on the operating system of your machine open cmd (for Windows) a bash command program(for linux),change to directory where XMLFiltering.jar is located and enter the following:

java -jar XMLFiltering.jar <input_folder_path>

When the XMLFiltering completes its run in the destination folder path given in previous step will be created a folder named FILTERED_IN and a folder named FILTERED_OUT that contain the relative XML files.If you have chosen the XMLFiltering to create a report you can find it in the destination folder.

Tip: For large numbers of XML files on the command above you should add the argument Xmx and define the maximum size of heap size that should be used by the java virtual machine like this:

java -Xmx4096m -jar XMLFiltering.java <input_folder_path>

Filtering report

The validation report created as a result of XMLFiltering contains info related to files that are filtered out.At the tail of the report you can also see some general information like the following:

Total parsed files:6

Total time (ms):256

Number of filtered in records:0

Number of filtered out records:6

Log file structure

DATE---REPONAME---XPATH_EXPRESSION---RECORDS---DURATION(in ms)---FILTEREDIN---FILTEREDOUT