• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

CMakeLists.txtD22-Nov-20231.6 KiB3028

README.mdD22-Nov-20232.3 KiB7757

xmlValidator.pyD22-Nov-20233.9 KiB11062

README.md

1# xmlValidator tool
2
3This tool can be used to check if the `.xml` files you have written are
4following the `.xsd` schemas provided by the PFW.  By doing so, you are *ensured*
5that your configuration is *fully compatible* with the `parameter-framework`.
6
7It scans all directories and subdirectories for `.xml` files and checks them
8with `.xsd` from a *schemas* directory you specified for the script.
9
10## Usage
11
12To run xmlValidator, just start it from the commandline with:
13
14    python xmlValidator.py <xmlRootDirectory> <xsdDirectory>
15
16where:
17
18* `<xmlRootDirectory>` is a path to a directory containing:
19    - `.xml` files
20    - subdirectories containing `.xml` files
21* `<xsdDirectory>` is a path to a directory containing:
22    - `.xsd` files (also called *schemas*)
23
24## Example of usage
25
26### File structure
27
28In the example, we have the following files:
29
30    |-- ParameterFrameworkConfiguration.xml
31    |-- Schemas
32    |   |-- ComponentLibrary.xsd
33    |   |-- ComponentTypeSet.xsd
34    |   |-- ConfigurableDomains.xsd
35    |   |-- FileIncluder.xsd
36    |   |-- ParameterFrameworkConfiguration.xsd
37    |   |-- ParameterSettings.xsd
38    |   |-- Parameter.xsd
39    |   |-- Subsystem.xsd
40    |   `-- SystemClass.xsd
41    |-- Settings
42    |   `-- FS
43    |       `-- Genres.xml
44    `--- Structure
45         `-- FS
46            |-- MusicLibraries.xml
47            `-- my_music.xml
48
49### Command
50We are in the directory which contains the structure detailed previously.
51To check the validity, we just run:
52
53    ../../tools/xmlValidator/xmlValidator.py . Schemas
54
55### Results
56And we will get the following output on the commandline:
57
58    [*] Validate xml files in /home/lab/MusicLibrary/ with /home/lab/MusicLibrary/Schemas
59    Attempt to validate ParameterFrameworkConfiguration.xml with ParameterFrameworkConfiguration.xsd
60    ParameterFrameworkConfiguration.xml is valid
61    Attempt to validate my_music.xml with Subsystem.xsd
62    my_music.xml is valid
63    Attempt to validate MusicLibraries.xml with SystemClass.xsd
64    MusicLibraries.xml is valid
65    Attempt to validate Genres.xml with ConfigurableDomains.xsd
66    Genres.xml is valid
67
68
69## Install requirements
70
71In order to use this tool, you must have the following packages (these
72are the names on a debian-based distribution):
73
74* `python` (2.7 or later)
75* `python-lxml`
76* `libpython2.7` or later
77