PoiScript / docx-rs

A Rust library for parsing and generating docx files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] creating a document and adding a table does not open

efx opened this issue · comments

See the example in #18 to reproduce.

  1. cargo run --example table
  2. open -a Microsoft\ Word table.docx
    This results in:

Screen Shot 2020-02-19 at 13 07 49

document tree

I have another tool that extracts docx files into the XML so I can observe locally. That shows up as:
Screen Shot 2020-02-19 at 13 08 34

At first glance it looks like some namespace declarations differ from a document created in MS Word.

Thanks for reporting this! Unfortunately, I don't have time to address this issue right now, like I said in #15, I'm now trying to migrated the whole codebase for docx-codegen to xmlparser-derive. And, for debugging, I personally use the command unzip -p test.docx word/styles.xml | xmllint --format - to quickly check the structure of xml in terminal.

Sorry for being absent. I just published a new version of strong-xml and the parser is now much robuster, for example, <p/> and <p></p> are both treated as a valid paragraph.

And then I ran the table example you provided and seemed the bug was gone: my libreoffice can open the docx files without any errors. So I'm going to close this now =)

no worries, thanks for fixing it @PoiScript!