AgentSkillsCN

1c-mxl-info

对1C电子表格文档(MXL/Template.xml)的结构正确性进行校验。在生成或编辑布局之后,使用此功能可有效检查1C可能悄然忽略的结构性错误。

SKILL.md
--- frontmatter
name: 1c-mxl-info
description: "Analyze 1C spreadsheet document (MXL/Template.xml) structure — areas, parameters, column sets. Use to understand layout structure before writing fill code or modifying templates."

1C MXL Info — Layout Structure Analyzer

Reads Template.xml of a spreadsheet document and outputs a compact summary: named areas, parameters, column sets. Replaces the need to read thousands of XML lines.

Usage

code
1c-mxl-info <TemplatePath>
1c-mxl-info <ProcessorName> <TemplateName>
ParameterRequiredDefaultDescription
TemplatePathnoDirect path to Template.xml
ProcessorNamenoProcessor name (alternative to path)
TemplateNamenoTemplate name (alternative to path)
SrcDirnosrcSource directory
FormatnotextOutput format: text or json
WithTextnofalseInclude static text and templates
MaxParamsno10Max parameters per area in listing
Limitno150Max output lines (overflow protection)
Offsetno0Skip N lines (for pagination)

Specify either -TemplatePath, or both -ProcessorName and -TemplateName.

Command

powershell
powershell.exe -NoProfile -File skills/1c-mxl-info/scripts/mxl-info.ps1 -TemplatePath "<path>"

Or by processor/template name:

powershell
powershell.exe -NoProfile -File skills/1c-mxl-info/scripts/mxl-info.ps1 -ProcessorName "<Name>" -TemplateName "<Template>" [-SrcDir "<dir>"]

Additional flags:

powershell
... -WithText              # include text cell content
... -Format json           # JSON output for programmatic processing
... -MaxParams 20          # show more parameters per area
... -Offset 150            # pagination: skip first 150 lines

Reading the Output

Areas — Sorted Top to Bottom

Areas are listed in document order (by row position), not alphabetically. This matches the area output order in fill code — top to bottom.

code
--- Named areas ---
  Header             Rows     rows 1-4     (1 params)
  Supplier           Rows     rows 5-6     (1 params)
  Row                Rows     rows 14-14   (8 params)
  Total              Rows     rows 16-17   (1 params)

Area types:

  • Rows — horizontal area (row range). Access: Template.GetArea("Name")
  • Columns — vertical area (column range). Access: Template.GetArea("Name")
  • Rectangle — fixed area (rows + columns). Usually uses a separate column set.
  • Drawing — named drawing/barcode.

Column Sets

When the layout has multiple column sets, their sizes are shown in the header and per area:

code
  Column sets: 7 (default=19 cols + 6 additional)
    f01e015f...: 17 cols
    0adf41ed...: 4 cols
  ...
  Footer             Rows     rows 30-34  (5 params) [colset 14cols]
  PageNumbering      Rows     rows 59-59  (0 params) [colset 4cols]

Intersections

When both Rows and Columns areas exist (labels, price tags), the script outputs intersection pairs:

code
--- Intersections (use with GetArea) ---
  LabelHeight|LabelWidth

In BSL: Template.GetArea("LabelHeight|LabelWidth")

Parameters and detailParameter

Parameters are listed per area. If a parameter has a detailParameter (drill-down), it is shown below:

code
--- Parameters by area ---
  Supplier: SupplierPresentation
    detail: SupplierPresentation->Supplier
  Row: RowNumber, Product, Quantity, Price, Amount, ... (+3)
    detail: Product->Nomenclature

This means: parameter Product displays a value, and when clicked opens Nomenclature (drill-down object).

In BSL:

bsl
Area.Parameters.Product = TableRow.Nomenclature;
Area.Parameters.ProductDrillDown = TableRow.Nomenclature; // detailParameter

Template Parameters (suffix [tpl])

Some parameters are embedded in template text: "Inv No. [InventoryNumber]". They are filled via fillType=Template, not fillType=Parameter. The script always extracts them and marks with suffix [tpl]:

code
  PageNumbering: Number [tpl], Date [tpl], PageNumber [tpl]

In BSL, template parameters are filled the same way as regular ones:

bsl
Area.Parameters.Number = DocumentNumber;
Area.Parameters.Date = DocumentDate;

Numeric substitutions like [5], [6] (footnote references in official forms) are ignored.

Text Content (-WithText)

Shows static text (labels, headers) and template strings with substitutions [Parameter]:

code
--- Text content ---
  TableHeader:
    Text: "No.", "Product", "Unit", "Qty", "Price", "Amount"
  Row:
    Templates: "Inv No. [InventoryNumber]"
  • Text — static labels (fillType=Text). Useful for understanding column purposes.
  • Templates — text with substitutions [ParameterName] (fillType=Template). Parameter inside [] is filled programmatically.

When to Use

  • Before writing fill code: run 1c-mxl-info to understand area names and parameter lists, then write BSL output code following area order top to bottom
  • With -WithText: when context is needed — column headers, labels near parameters, template strings
  • With -Format json: when structured data is needed for programmatic processing
  • For existing layouts: analyze loaded or configuration layouts without reading raw XML

Overflow Protection

Output is limited to 150 lines by default. When exceeded:

code
[TRUNCATED] Shown 150 of 220 lines. Use -Offset 150 to continue.

Use -Offset N and -Limit N for paginated viewing.