Skip to content

Metadata submitter tools - validate XML against an XSD schema

License

Notifications You must be signed in to change notification settings

CSCfi/metadata-submitter-tools

Folders and files

NameName
Last commit message
Last commit date
Jan 27, 2025
Aug 10, 2021
Sep 2, 2022
Jun 7, 2020
May 29, 2020
Jun 1, 2020
May 26, 2020
Nov 7, 2023
Jan 20, 2025
Feb 17, 2025
Nov 7, 2023

Repository files navigation

Python Unit Tests Python style check

Metadata submitter tools

XML Validation CLI

Command-line tool for validating a given XML file against a specific XSD Schema.

Installing

Note: The tool requires Python 3.11+

Clone the project and install with pip:

git clone https://github.com/CSCfi/metadata-submitter-tools.git
cd metadata-submitter-tools
pip install .

Tests

Tests can be executed with tox automation:

# Install tox first if not installed
pip install tox
# Run tests
tox

Usage

After installation, the validation tool is used by by executing xml-validate in a terminal with specified options/arguments followingly:

xml-validate <option> <xml-file> <schema-file>

The <xml-file> and <schema-file> arguments need to be the correct filenames (including path) of a local XML file and the corresponding XSD file. The <option> can be --help for showing help and -v or --verbose for delivering a detailed validation error message.

Below is a terminal demonstration of the usage of this tool, which displays the different outputs the CLI will produce:

asciicast

Packages/Libraries used

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contibuting

If you want to contribute to a project and make it better, your help is very welcome. For more info about how to contribute, see CONTRIBUTING.