Module: Uniword::Docx::Reconciler::ReferentialIntegrity

Included in:
Uniword::Docx::Reconciler
Defined in:
lib/uniword/docx/reconciler/referential_integrity.rb

Overview

Cross-part referential integrity enforcement.

Verifies and repairs references between document.xml and other package parts. Each method follows the principle of least surprise:

  • For removable inline refs (notes): strip dangling silently
  • For structural refs (styles, numbering): warn and strip
  • For relationship refs (rId): reconcile against actual parts
  • For uniqueness constraints: deduplicate with deterministic resolution

Instance Method Summary collapse

Instance Method Details

#reconcile_referential_integrityObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/uniword/docx/reconciler/referential_integrity.rb', line 15

def reconcile_referential_integrity
  return unless package.document&.body

  if allocator
    validate_builder_references
  else
    repair_all_references
  end

  reconcile_style_references
  reconcile_style_inheritance
  reconcile_numbering_body_references
end