Purpose and preparation#
Use an editor supporting XML Schema, such as VS Code with Red Hat XML. Extract the libraries/*.xsd set for your game version using X Catalog Tool; schemas reference one another, so md.xsd alone may be insufficient.
First exercise#
- Open a separate workspace and enable XML support.
- Keep schemas in reference/libraries with their relative relationships intact.
- Associate MD documents with md.xsd through xml.fileAssociations or a document schema reference. Use your installation's aiscripts.xsd for AI.
- Inspect Problems and attribute completion. Temporarily add an unknown attribute, confirm a diagnostic, then remove it.
<set_value name="$Count" exact="2 + 3" />Expected result#
The editor can complete set_value attributes from its schema. In a prepared MD context this fragment assigns 5 to $Count; the editor does not execute it or print a log message.
Checks and limits#
Do not associate every XML file with md.xsd: macros, diffs and MD documents have different roots. Schema validation does not establish object existence or successful XPath application. Schema types explain expression, object and constraints.