Skip to content

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

Description

@RickNote

Describe the bug

officecli validate reports "invalid child element 'rPr'" for a w:pPrChange whose inner w:pPr contains w:rPreven when the element order is schema-correct (<w:pStyle/><w:rPr/>). Verified with a hand-crafted document.

To reproduce

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

<w:pPrChange w:author="X" w:date="2026-01-01T00:00:00Z" w:id="99999999">
  <w:pPr><w:pStyle w:val="21" /><w:rPr><w:sz w:val="36" /></w:rPr></w:pPr>
</w:pPrChange>

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 <w:pPr/> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions