Validate the document against XSD schema and redlining rules. Raises: ValueError: If validation fails.
(self)
| 836 | shutil.rmtree(self.temp_dir) |
| 837 | |
| 838 | def validate(self) -> None: |
| 839 | """ |
| 840 | Validate the document against XSD schema and redlining rules. |
| 841 | |
| 842 | Raises: |
| 843 | ValueError: If validation fails. |
| 844 | """ |
| 845 | # Create validators with current state |
| 846 | schema_validator = DOCXSchemaValidator( |
| 847 | self.unpacked_path, self.original_docx, verbose=False |
| 848 | ) |
| 849 | redlining_validator = RedliningValidator( |
| 850 | self.unpacked_path, self.original_docx, verbose=False |
| 851 | ) |
| 852 | |
| 853 | # Run validations |
| 854 | if not schema_validator.validate(): |
| 855 | raise ValueError("Schema validation failed") |
| 856 | if not redlining_validator.validate(): |
| 857 | raise ValueError("Redlining validation failed") |
| 858 | |
| 859 | def save(self, destination=None, validate=True) -> None: |
| 860 | """ |
no test coverage detected