validate_xml
Validate Control Expert XML against the installed XSD grammar to catch structural and LD semantic errors before import, returning validity, root, schema, and error details.
Instructions
Validate candidate Control Expert exchange XML against the installed XSD grammar (the authoritative SrcXmlSchema) BEFORE import_xml / build_project.
Catches structural errors (unknown elements, bad attribute enumerations, wrong ordering) instantly — far faster than the import+build round-trip — and steers authoring toward the full legal element set. Returns {valid, root, schema, errors}. For LD documents it additionally checks two semantic rules the grammar can't express: per-line cell-count arithmetic (each 's cell-spans must sum to nbColumns) and EBOOL-for-edge rules (P/N contacts and P/N coils need an EBOOL variable). Other semantics (FBD pin geometry, type compatibility) are still caught only by build_project, which remains the final oracle. Set CE_MCP_SCHEMA_DIR to override schema-folder auto-discovery.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | ||
| xml_content | No |