iOfficeAI / iOfficeAI/OfficeCLI

get/query on .docx body throws "The text value is not a valid enumeration value"

Open
#324 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
30.7k
Forks
2.1k
Avg merge
9d 8h
Merged PRs (30d)
5

Description

### Environment
- OfficeCLI version: 1.0.144 (latest from npm)
- OS: macOS (arm64)

### Repro
1. Take any .docx file that contains tables (standard Word/OpenXML document).
2. Root-level access works:
```
officecli get "/" --json
# success: { "path": "/", "type": "document", "childCount": 3, ... }
```
3. Any deep access under /body fails:
```
officecli get "/body" --json
```
```
officecli query "table" --json
```
4. Both return:
```
{
"success": false,
"error": {
"error": "The text value is not a valid enumeration value.",
"code": "internal_error"
}
}
```

### Expected behavior
`get /body` should return the document body node (its paragraphs/tables as children), and `query table` should match table elements — the same way the high-level DOM API works for .xlsx (e.g. `get "Sheet1!A1"`).

### Notes
- Reproduced across 3 different .docx files (all contain tables, all standard OOXML produced by common office suites).
- The error seems to occur while enumerating node types/attributes under /body — a value in the document is not recognized by the enumeration parser.
- `raw` / `raw-set` on the same files work correctly as a fallback, so the files themselves are valid.
- Impact: the high-level get/query/set DOM API is unusable for .docx content, which blocks template filling workflows.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `get /body` and `query table` on a .docx containing tables, then trace the high-level DOM API's node-type and attribute enumeration under `/body`. Compare this path with the working `raw` and `raw-set` commands. Done means `/body` returns its children and `query table` matches table elements without the enumeration error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.