Class: Lutaml::Xsd::Validation::ValidationJob
- Inherits:
-
Object
- Object
- Lutaml::Xsd::Validation::ValidationJob
- Defined in:
- lib/lutaml/xsd/validation/validation_job.rb
Overview
ValidationJob executes the validation workflow
This class implements the Command pattern to execute XML validation against XSD schemas. It coordinates the validation process through multiple phases: XML parsing, structure validation, type validation, and constraint validation.
Instance Method Summary collapse
-
#execute ⇒ ValidationResult
Execute the validation workflow.
-
#initialize(xml_content:, repository:, rule_registry:, config:) ⇒ ValidationJob
constructor
Initialize a new ValidationJob.
Constructor Details
#initialize(xml_content:, repository:, rule_registry:, config:) ⇒ ValidationJob
Initialize a new ValidationJob
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/lutaml/xsd/validation/validation_job.rb', line 36 def initialize(xml_content:, repository:, rule_registry:, config:) @xml_content = xml_content @repository = repository @rule_registry = rule_registry @config = config @result_collector = ResultCollector.new(config) @navigator = nil @document = nil @rule_engine = nil end |
Instance Method Details
#execute ⇒ ValidationResult
Execute the validation workflow
Performs validation in the following order:
-
Parse XML document
-
Validate structure (elements, namespaces)
-
Validate types (simple and complex types)
-
Validate constraints (occurrences, identity constraints)
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/lutaml/xsd/validation/validation_job.rb', line 56 def execute return early_result if should_stop_early? parse_xml return result_from_collector if should_stop_after_parse? validate_structure if @config.feature_enabled?(:validate_types) return result_from_collector if should_stop_after_structure? validate_types if @config.feature_enabled?(:validate_types) return result_from_collector if should_stop_after_types? validate_constraints if @config.feature_enabled?(:validate_occurrences) return result_from_collector if should_stop_after_constraints? result_from_collector end |