wordinator icon indicating copy to clipboard operation
wordinator copied to clipboard

Provide SWPX to DOCX Comparison tool for verifying generated result

Open drmacro opened this issue 3 years ago • 0 comments

Implement within Wordinator a function that compares the input SWPX to the generated DOCX to verify:

  • All content in runs is reflected correctly in the result DOCX (i.e., a run-to-run comparison)
  • All fields are in the SWPX are reflected in the DOCX
  • Headers and footers match

It does not need to handle chunked DOCX results, meaning that it only verifies the SWPX when there is exactly one DOCX result generated from it.

For implementation, one approach would be to use XmlObject to construct cursors on the SWPX and the Document and then walk them in parallel--there should be a one-to-one alignment between paragraphs and runs modulo the effect of hyperlinks and fields, which have a slightly different (simpler) structure in SWPX than in DOCX.

Because there is not an exact alignment between formatting properties in SWPX and DOCX, doing validation on the formatting properties would be more involved and is not an immediate requirement.

The primary purpose of this comparison is to ensure that no content is being dropped or duplicated from the SWPX to DOCX.

drmacro avatar Jan 08 '22 17:01 drmacro