Takes the Template.xml of a 1C spreadsheet document and generates a compact JSON definition (DSL). The inverse operation to /mxl-compile.
Usage
/mxl-decompile <TemplatePath> [OutputPath]
Parameters
| Parameter | Required | Description |
|---|---|---|
| TemplatePath | yes | Path to Template.xml |
| OutputPath | no | Path for JSON (if not specified — stdout) |
Command
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/mxl-decompile.ps1" -TemplatePath "<путь>/Template.xml" [-OutputPath "<путь>.json"]
Workflow
Decompiling an existing template for analysis or modification:
- Call
/mxl-decompileto get JSON from Template.xml - Analyze or modify the JSON (add areas, change styles)
- Call
/mxl-compileto generate a new Template.xml - Call
/mxl-validateto verify
The output JSON format is the same DSL that /mxl-compileaccepts; its description lives in the skill /mxl-compile.
Keys not present in the DSL description
In a parsed template there are keys that are not in the /mxl-compileinstructions: for example,
for rowStyle — the modifier apply, for an input field cell — controlType: "none". They carry
the state of the source file that cannot be expressed otherwise. You don't need to write them yourself; you shouldn't
delete them from the parsed JSON either: the compiler accepts them back as is, and without them the template
will change.
What you need to know about reassembly
Editing via DSL is a full regeneration of the template, not a pinpoint change of the XML. Therefore the diff after a "decompilation → compilation" cycle is usually wider than the actual modification, even when the content is preserved entirely.
You shouldn't always expect a byte-for-byte match with the source. In layouts that have been edited for a long time in the Designer, traces of previous states remain: for example, a cell format carries the column width, which has since changed. Such values are not output to the resulting document, and they are not returned to the rebuilt file.
They do not survive the cycle at all (they do not go into JSON, they do not come back into XML):
- merges not tied to a cell — across the entire height or width of the document;
- chart settings (
Chart,GanttChart) — the drawing itself is preserved, its contents are not; - print area.
If the task is to preserve someone else's layout as is and fix something small in it, verify the result
/mxl-info or with a diff: the items listed above need to be restored manually.