XML REUSE EXAMPLE
Source: https://yenra.com/xml-content-management/
Prepared October 4, 2026. Fictional educational content, custom XML vocabulary.

Files:
content.xml: one shared component referenced by two topics.
content.xsd: structure, required values, unique IDs and reference validation.
publish.xsl: XSLT 1.0 transformation selecting one topic per output.
build.py: validates first, then writes the two fixed HTML outputs.
output/: prebuilt examples that can be opened without installing anything.

Prerequisites for rebuilding: Python 3 and lxml.
Use a local test environment, review the code and follow your software policy.
If needed, install lxml from its normal Python package distribution using:
  python -m pip install lxml
Then run from this extracted folder:
  python build.py
Open output/visit.html and output/loan.html in a browser.

Exercise:
1. Both pages should include "Contact the service desk before booking."
2. Change that component's text in content.xml, rebuild, inspect both outputs.
3. In a disposable copy, change ref="contact" to ref="missing". Rebuilding
   should fail validation and should not replace the existing output files.
4. Restore the reference. A duplicate component id should also fail validation.
5. Restore the original source and rebuild successfully.

A failed build leaves prior outputs in place; those outputs do not represent
the invalid edited source. Check the command result before using outputs.
This demonstrates mechanics, not production security or a complete CMS.
The script reads the three supplied local source files and writes only the two
fixed output files. It has no network step. Do not feed it untrusted XML files.

References:
https://www.w3.org/TR/xml/
https://www.w3.org/TR/xmlschema-1/
https://www.w3.org/TR/xslt-10/
https://lxml.de/
