Class: Uniword::Validation::Rules::RelationshipIntegrityRule
- Defined in:
- lib/uniword/validation/rules/relationship_integrity_rule.rb
Overview
Validates relationship integrity: rId references resolve to real parts.
DOC-108: All rId references in XML parts must have matching Relationship entries, and targets must exist in the ZIP. Validity rule: R6
Constant Summary collapse
- R_NS =
"http://schemas.openxmlformats.org/officeDocument/2006/relationships"- RELS_NS =
"http://schemas.openxmlformats.org/package/2006/relationships"
Instance Method Summary collapse
- #applicable?(context) ⇒ Boolean
- #category ⇒ Object
- #check(context) ⇒ Object
- #code ⇒ Object
- #description ⇒ Object
- #severity ⇒ Object
- #validity_rule ⇒ Object
Instance Method Details
#applicable?(context) ⇒ Boolean
24 25 26 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 24 def applicable?(context) context.part_exists?("[Content_Types].xml") end |
#category ⇒ Object
21 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 21 def category = :relationships |
#check(context) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 28 def check(context) issues = [] check_document_rels(context, issues) check_package_rels(context, issues) issues end |
#code ⇒ Object
18 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 18 def code = "DOC-108" |
#description ⇒ Object
20 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 20 def description = "All rId references must resolve through .rels files to existing parts" |
#severity ⇒ Object
22 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 22 def severity = "error" |
#validity_rule ⇒ Object
19 |
# File 'lib/uniword/validation/rules/relationship_integrity_rule.rb', line 19 def validity_rule = "R6" |