Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docx writer: documents with lists fail to validate #9265

Closed
jgm opened this issue Dec 18, 2023 · 2 comments
Closed

docx writer: documents with lists fail to validate #9265

jgm opened this issue Dec 18, 2023 · 2 comments
Labels

Comments

@jgm
Copy link
Owner

jgm commented Dec 18, 2023

These documents in test/docx/golden fail to validate with docx-validator:
@edwintorok

lists.docx

./tmp/document-pretty.xml:129: element pStyle: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressLineNumbers, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pBdr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}shd, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tabs, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressAutoHyphens, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}kinsoku, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}wordWrap, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}overflowPunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}topLinePunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}autoSpaceDE ).

lists_div_bullets.docx

./tmp/document-pretty.xml:33: element pStyle: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressLineNumbers, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pBdr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}shd, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tabs, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressAutoHyphens, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}kinsoku, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}wordWrap, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}overflowPunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}topLinePunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}autoSpaceDE ).
./tmp/document-pretty.xml:45: element pStyle: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressLineNumbers, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pBdr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}shd, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tabs, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressAutoHyphens, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}kinsoku, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}wordWrap, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}overflowPunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}topLinePunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}autoSpaceDE ).

lists_multiple_initial.docx

./tmp/document-pretty.xml:10: element pStyle: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressLineNumbers, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pBdr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}shd, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tabs, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressAutoHyphens, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}kinsoku, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}wordWrap, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}overflowPunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}topLinePunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}autoSpaceDE ).
./tmp/document-pretty.xml:41: element pStyle: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressLineNumbers, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pBdr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}shd, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tabs, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressAutoHyphens, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}kinsoku, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}wordWrap, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}overflowPunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}topLinePunct, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}autoSpaceDE ).
@jgm jgm added the bug label Dec 18, 2023
@jgm
Copy link
Owner Author

jgm commented Dec 18, 2023

Looks like w:pStyle has to come before w:numPr?
https://github.com/devoidfury/docx-validator/blob/main/schemas/ISO-IEC29500-4_2016/wml.xsd#L1090

@edwintorok
Copy link
Contributor

Yes, looks like pStyle needs to be first. Looks like the xmllint error shows all the valid tags (up to a limit?) you can have in that position

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants