-
Notifications
You must be signed in to change notification settings - Fork 108
command validate
zmworm edited this page Mar 31, 2026
·
23 revisions
Validate a document against the OpenXML schema.
officecli validate <file> [--json]
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.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file |
FileInfo | Yes | - | Office document path (.docx, .xlsx, .pptx) |
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
--json |
bool | No | false |
Output as structured JSON |
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".
# 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- The
raw-setandadd-partcommands 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 issuesfor that).
- Command Reference
- raw / raw-set - Raw XML operations
-
view - Use
issuesmode for content quality checks
Based on OfficeCLI v1.0.28