Create Documentation for a Custom LIXI Schema
For those using the Customisation by Restriction framework, many of the elements and attributes within the LIXI Schema are excluded from the customised schema that is generated. In this case, whilst the LIXI Documentation is comprehensive, it can be larger and more complicated than necessary. In this situation, you can now use the LIXI Python Package to generate HTML documentation.
Install the LIXI Python Package
The LIXI Python Package has lots of useful features. The package is open source, all you need to do is install it from the Python Package index. In your development environment install the LIXI python package with the following command:
pip install lixi
The Python code to generate HTML documentation
Copy the following code into your main.py file, making sure to replace the schema filename with the name of your schema file:
import lixi schema_filename = "LIXI-CAL-2_6_23-Annotated.xsd" output_folder = "." output_name = "documentation" with open(schema_filename, "r") as f: schema_string = f.read() lixi.get_schema_documentation( schema_string=schema_string, output_folder=output_folder, output_name=output_name)
Open the Documentation in your Browser
Navigate to your output directory and open the index.html file in your web browser to view the documentation. You should see something like this:
John Matthews, LIXI Technical Lead
First Published: February 5, 2020