Skip to content

command validate

zmworm edited this page Mar 31, 2026 · 23 revisions

validate

Validate a document against the OpenXML schema.

Synopsis

officecli validate <file> [--json]

Description

Validates the document against the OpenXML schema and reports any structural or formatting errors. Useful for verifying document integrity after modifications, especially after using raw-set.

Arguments

Name Type Required Default Description
file FileInfo Yes - Office document path (.docx, .xlsx, .pptx)

Options

Name Type Required Default Description
--json bool No false Output as structured JSON

Output

For each validation error, the output includes:

Field Description
ErrorType Type of validation error
Description Human-readable error description
Path XPath to the problematic element
Part Document part containing the error

If no errors are found, reports "0 errors".

Examples

# Validate a Word document
officecli validate report.docx

# Validate and get JSON output
officecli validate data.xlsx --json

# Validate a PowerPoint presentation
officecli validate slides.pptx

Notes

  • The raw-set and add-part commands automatically validate before and after modification, reporting any new errors introduced.
  • Validation checks structural correctness against the OpenXML schema. It does not check content quality (use view issues for that).

See Also


Based on OfficeCLI v1.0.28

Clone this wiki locally