Skip to main content

DOCX Primitives

5 requirements · 17 scenarios

Document Round-Trip Fidelity

JR-docx-primitives-005
The system SHALL parse and serialize document content without data loss. All elements, attributes, namespaces, and text content SHALL be preserved through processing round-trips.
4 test scenarios
  • Element structure preserved through round-trip JR-docx-primitives-005.1
  • Namespace declarations preserved through round-trip JR-docx-primitives-005.2
  • Concatenated text content extracted from nested elements JR-docx-primitives-005.3
  • Empty string returned for absent content JR-docx-primitives-005.4

Stable Paragraph Identification

JR-docx-primitives-006
The system SHALL assign and persist stable unique identifiers to each paragraph. Identifier allocation SHALL be idempotent, ensuring the same paragraph receives the same identifier across repeated operations.
2 test scenarios
  • Paragraph identifiers follow expected format JR-docx-primitives-006.1
  • Assigned identifier retrievable after creation JR-docx-primitives-006.2

Tracked Changes Round-Trip Integrity

JR-docx-primitives-007
The system SHALL ensure that accepting all changes and rejecting all changes both produce semantically correct output. Structural diagnostics SHALL remain equivalent across round-trip projections of the same document.
2 test scenarios
  • Accept-all and reject-all preserve text parity JR-docx-primitives-007.1
  • Structural diagnostics equivalent across projections JR-docx-primitives-007.2

Tracked Change Acceptance

JR-docx-primitives-010
The system SHALL programmatically accept all tracked changes in a document, resolving each revision type into its accepted state. Supported revision types SHALL include insertions, deletions, formatting changes, and content moves.
6 test scenarios
  • Insertions accepted by incorporating added content JR-docx-primitives-010.1
  • Deletions accepted by removing deleted content JR-docx-primitives-010.2
  • Property changes accepted by removing change records JR-docx-primitives-010.3
  • Moves accepted by keeping destination content JR-docx-primitives-010.4
  • Nested revisions resolved in correct order JR-docx-primitives-010.5
  • Orphaned move references handled with safe fallback JR-docx-primitives-010.6

Redline Consolidation by Author

JR-docx-primitives-012
The system SHALL consolidate adjacent tracked changes of the same type and author to reduce document complexity without altering document semantics. Changes from different authors or of different types SHALL NOT be consolidated.
3 test scenarios
  • Same-author same-type changes consolidated JR-docx-primitives-012.1
  • Different-author changes never consolidated JR-docx-primitives-012.2
  • Different change types never consolidated JR-docx-primitives-012.3