iOfficeAI / iOfficeAI/OfficeCLI

# Bug: validate rejects pPrChange whose inner pPr contains rPr even in correct schema order

Open
#278 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

## Describe the bug

`officecli validate` reports "invalid child element 'rPr'" for a `w:pPrChange` whose inner `w:pPr` contains `w:rPr` — **even when the element order is schema-correct** (``). Verified with a hand-crafted document.

## To reproduce

Take any docx and manually inject into a paragraph's `w:pPr` (as its last child):

```xml

```

Then run `officecli validate`.

## Expected

Validation passes — this is the exact CT_PPr structure Word itself produces.

## Actual

Schema error: "The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:rPr'".

## Notes

A `w:pPrChange` with an empty inner `` validates fine. The validator appears to reject `rPr` inside the pPrChange snapshot specifically — the schema model used for the snapshot `w:pPr` seems incomplete. This is also why the output of the related bug (rPr-before-pStyle generation) still fails validation even after manually reordering the children.

Contributor guide

Open the contributing guide

Research direction

Start with the `officecli validate` entry point and the schema model used for the `w:pPrChange` snapshot, especially its inner `w:pPr` and `w:rPr` handling. Reproduce the issue with the provided WordprocessingML fragment, then confirm validation passes for the schema-correct `w:pStyle` followed by `w:rPr`.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.