lutaml-model 0.7.7 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/dependent-repos.json +9 -0
- data/.github/workflows/dependent-tests.yml +4 -0
- data/.github/workflows/docs.yml +59 -0
- data/.github/workflows/downstream-performance.yml +153 -0
- data/.github/workflows/performance.yml +33 -0
- data/.github/workflows/rake.yml +13 -0
- data/.github/workflows/release.yml +5 -0
- data/.gitignore +27 -1
- data/.rubocop.yml +14 -2
- data/.rubocop_todo.yml +408 -88
- data/Gemfile +15 -9
- data/README.adoc +13736 -6922
- data/RELEASE_NOTES.adoc +51 -0
- data/Rakefile +2 -0
- data/bench/baselines/.gitkeep +0 -0
- data/bench/bench_all.rb +52 -0
- data/bench/bench_common.rb +147 -0
- data/bench/bench_compare.rb +195 -0
- data/bench/bench_mml.rb +53 -0
- data/bench/bench_niso.rb +54 -0
- data/bench/bench_sts.rb +49 -0
- data/bench/bench_unitsml.rb +43 -0
- data/bench/bench_xmi.rb +51 -0
- data/bench/gate_config.rb +120 -0
- data/benchmark/quick_benchmark.rb +297 -0
- data/benchmark/serialization_benchmark.rb +619 -0
- data/docs/.rubocop.yml +1 -0
- data/docs/.rubocop_todo.yml +7 -0
- data/docs/Gemfile +13 -0
- data/docs/PERFORMANCE_METHODOLOGY.md +645 -0
- data/docs/_config.yml +145 -0
- data/docs/_guides/advanced-mapping.adoc +564 -0
- data/docs/_guides/character-encoding.adoc +342 -0
- data/docs/_guides/collection-serialization.adoc +349 -0
- data/docs/_guides/creating-xsd.adoc +1221 -0
- data/docs/_guides/index.adoc +71 -0
- data/docs/_guides/keyvalue-serialization.adoc +1156 -0
- data/docs/_guides/liquid-templates.adoc +505 -0
- data/docs/_guides/missing-values-handling.adoc +1531 -0
- data/docs/_guides/ooxml-examples.adoc +755 -0
- data/docs/{schema_generation.adoc → _guides/schema-generation.adoc} +5 -0
- data/docs/{schema_import.adoc → _guides/schema-import.adoc} +276 -4
- data/docs/_guides/value-transformations.adoc +1388 -0
- data/docs/_guides/xml/namespace-presentation.adoc +476 -0
- data/docs/_guides/xml/namespace-semantics.adoc +677 -0
- data/docs/_guides/xml/reusable-mapping-classes.adoc +181 -0
- data/docs/_guides/xml/schema-location.adoc +245 -0
- data/docs/_guides/xml/type-namespaces.adoc +1011 -0
- data/docs/_guides/xml-mapping.adoc +1847 -0
- data/docs/_guides/xml-mappings-guide.adoc +21 -0
- data/docs/_guides/xml-namespace-declarations.adoc +662 -0
- data/docs/_guides/xml-namespace-qualification.adoc +720 -0
- data/docs/_guides/xml-namespaces.adoc +2613 -0
- data/docs/_guides/xml_mappings/01_introduction.adoc +65 -0
- data/docs/_guides/xml_mappings/02_core_concepts.adoc +177 -0
- data/docs/_guides/xml_mappings/03_architecture.adoc +205 -0
- data/docs/_guides/xml_mappings/04_xml_namespace_class.adoc +1754 -0
- data/docs/_guides/xml_mappings/05_common_patterns.adoc +1803 -0
- data/docs/_guides/xml_mappings/06_migration_guide.adoc +523 -0
- data/docs/_guides/xml_mappings/07_best_practices.adoc +959 -0
- data/docs/_guides/xml_mappings/08_troubleshooting.adoc +934 -0
- data/docs/_migrations/0-1-0-migrate-from-shale.adoc +304 -0
- data/docs/_migrations/0-8-0-namespace-restructuring.adoc +1572 -0
- data/docs/_migrations/0-8-0-xsd-features.adoc +729 -0
- data/docs/_migrations/index.adoc +18 -0
- data/docs/_migrations/xsd-type-migration.adoc +1294 -0
- data/docs/_pages/attributes.adoc +1156 -0
- data/docs/_pages/breaking-changes.adoc +154 -0
- data/docs/_pages/collections.adoc +1664 -0
- data/docs/_pages/comparison-with-shale.adoc +139 -0
- data/docs/_pages/configuration.adoc +306 -0
- data/docs/_pages/consolidation-mapping.adoc +252 -0
- data/docs/_pages/importable_models.adoc +591 -0
- data/docs/_pages/index.adoc +46 -0
- data/docs/_pages/installation.adoc +35 -0
- data/docs/_pages/models.adoc +332 -0
- data/docs/_pages/quick-start.adoc +124 -0
- data/docs/_pages/serialization_adapters.adoc +319 -0
- data/docs/_pages/troubleshooting.adoc +104 -0
- data/docs/_pages/validation.adoc +171 -0
- data/docs/_pages/value_types.adoc +1514 -0
- data/docs/_pages/xml-conformance.adoc +143 -0
- data/docs/_references/architecture.adoc +189 -0
- data/docs/{custom_adapters.adoc → _references/custom_adapters.adoc} +6 -1
- data/docs/_references/custom_registers.adoc +1026 -0
- data/docs/_references/data-modeling-in-a-nutshell.adoc +207 -0
- data/docs/_references/format-independent-features.adoc +713 -0
- data/docs/_references/index.adoc +47 -0
- data/docs/_references/instance-serialization.adoc +120 -0
- data/docs/_references/lutaml-namespace-planning.md +120 -0
- data/docs/_references/parent-root-context.adoc +122 -0
- data/docs/_references/reference_type.adoc +302 -0
- data/docs/_references/serialization-model-mappings.adoc +102 -0
- data/docs/_references/three-phase-namespace-architecture.adoc +470 -0
- data/docs/_references/xml-w3c-namespace-qualification.adoc +66 -0
- data/docs/_references/xsd-generation-with-namespace-support.adoc +449 -0
- data/docs/_references/xsd-schema-parsing.adoc +1260 -0
- data/docs/_references/xsd-type-architecture.adoc +534 -0
- data/docs/_tutorials/basic-model-definition.adoc +157 -0
- data/docs/_tutorials/custom-types-tutorial.adoc +258 -0
- data/docs/_tutorials/first-json-serialization.adoc +192 -0
- data/docs/_tutorials/first-xml-serialization.adoc +223 -0
- data/docs/_tutorials/index.adoc +60 -0
- data/docs/_tutorials/lutaml-xml-architecture.adoc +1354 -0
- data/docs/_tutorials/polymorphic-models-tutorial.adoc +253 -0
- data/docs/_tutorials/schema-compiler-module-namespaces.adoc +497 -0
- data/docs/_tutorials/validation-basics.adoc +232 -0
- data/docs/_tutorials/working-with-collections.adoc +201 -0
- data/docs/_tutorials/xml-element-attribute-namespace-guide.adoc +279 -0
- data/docs/_tutorials/xml-namespaces-basics.adoc +315 -0
- data/docs/_tutorials/xml-schema-primer-style-guide.adoc +1394 -0
- data/docs/architecture.md +424 -0
- data/docs/bugreports/BUGREPORT_element_order_render_empty.md +99 -0
- data/docs/cli_compare.adoc +249 -0
- data/docs/collection_validation.adoc +366 -0
- data/docs/index.adoc +108 -0
- data/docs/key_value_data_model.adoc +1229 -0
- data/docs/model_transforms.adoc +769 -0
- data/docs/namespace-management.adoc +1051 -0
- data/docs/xml-schema-qualification.md +171 -0
- data/docs/yamls_sequence.adoc +335 -0
- data/lib/lutaml/{model/hash_adapter → hash_format/adapter}/document.rb +3 -4
- data/lib/lutaml/hash_format/adapter/mapping.rb +19 -0
- data/lib/lutaml/hash_format/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/{model/hash_adapter → hash_format/adapter}/standard_adapter.rb +3 -3
- data/lib/lutaml/hash_format/adapter/transform.rb +9 -0
- data/lib/lutaml/hash_format/adapter.rb +13 -0
- data/lib/lutaml/hash_format/type/serializers.rb +24 -0
- data/lib/lutaml/hash_format.rb +29 -0
- data/lib/lutaml/{model/json → json/adapter}/document.rb +3 -3
- data/lib/lutaml/json/adapter/mapping.rb +19 -0
- data/lib/lutaml/json/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/json/adapter/multi_json_adapter.rb +38 -0
- data/lib/lutaml/json/adapter/oj_adapter.rb +38 -0
- data/lib/lutaml/json/adapter/standard_adapter.rb +36 -0
- data/lib/lutaml/json/adapter/transform.rb +9 -0
- data/lib/lutaml/json/adapter.rb +20 -0
- data/lib/lutaml/json/schema/json_schema.rb +62 -0
- data/lib/lutaml/json/schema.rb +9 -0
- data/lib/lutaml/json/type/serializers.rb +72 -0
- data/lib/lutaml/json.rb +62 -0
- data/lib/lutaml/{model/jsonl → jsonl/adapter}/document.rb +2 -2
- data/lib/lutaml/jsonl/adapter/mapping.rb +19 -0
- data/lib/lutaml/jsonl/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/{model/jsonl → jsonl/adapter}/standard_adapter.rb +5 -4
- data/lib/lutaml/jsonl/adapter/transform.rb +26 -0
- data/lib/lutaml/jsonl/adapter.rb +13 -0
- data/lib/lutaml/jsonl.rb +21 -0
- data/lib/lutaml/key_value/adapter/hash/document.rb +13 -0
- data/lib/lutaml/key_value/adapter/hash/mapping.rb +19 -0
- data/lib/lutaml/key_value/adapter/hash/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/hash/standard_adapter.rb +19 -0
- data/lib/lutaml/key_value/adapter/hash/transform.rb +10 -0
- data/lib/lutaml/key_value/adapter/hash.rb +15 -0
- data/lib/lutaml/key_value/adapter/json/document.rb +16 -0
- data/lib/lutaml/key_value/adapter/json/mapping.rb +24 -0
- data/lib/lutaml/key_value/adapter/json/mapping_rule.rb +14 -0
- data/lib/lutaml/key_value/adapter/json/multi_json_adapter.rb +43 -0
- data/lib/lutaml/key_value/adapter/json/oj_adapter.rb +43 -0
- data/lib/lutaml/key_value/adapter/json/standard_adapter.rb +41 -0
- data/lib/lutaml/key_value/adapter/json/transform.rb +14 -0
- data/lib/lutaml/key_value/adapter/json.rb +24 -0
- data/lib/lutaml/key_value/adapter/jsonl/document.rb +16 -0
- data/lib/lutaml/key_value/adapter/jsonl/mapping.rb +19 -0
- data/lib/lutaml/key_value/adapter/jsonl/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/jsonl/standard_adapter.rb +36 -0
- data/lib/lutaml/key_value/adapter/jsonl/transform.rb +26 -0
- data/lib/lutaml/key_value/adapter/jsonl.rb +17 -0
- data/lib/lutaml/key_value/adapter/toml/document.rb +13 -0
- data/lib/lutaml/key_value/adapter/toml/mapping.rb +28 -0
- data/lib/lutaml/key_value/adapter/toml/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/toml/toml_rb_adapter.rb +40 -0
- data/lib/lutaml/key_value/adapter/toml/tomlib_adapter.rb +46 -0
- data/lib/lutaml/key_value/adapter/toml/transform.rb +10 -0
- data/lib/lutaml/key_value/adapter/toml.rb +21 -0
- data/lib/lutaml/key_value/adapter/yaml/document.rb +12 -0
- data/lib/lutaml/key_value/adapter/yaml/mapping.rb +19 -0
- data/lib/lutaml/key_value/adapter/yaml/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/yaml/standard_adapter.rb +41 -0
- data/lib/lutaml/key_value/adapter/yaml/transform.rb +10 -0
- data/lib/lutaml/key_value/adapter/yaml.rb +17 -0
- data/lib/lutaml/key_value/adapter/yamls/document.rb +16 -0
- data/lib/lutaml/key_value/adapter/yamls/mapping.rb +19 -0
- data/lib/lutaml/key_value/adapter/yamls/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/yamls/standard_adapter.rb +37 -0
- data/lib/lutaml/key_value/adapter/yamls/transform.rb +26 -0
- data/lib/lutaml/key_value/adapter/yamls.rb +17 -0
- data/lib/lutaml/key_value/adapter.rb +14 -0
- data/lib/lutaml/key_value/data_model/element.rb +222 -0
- data/lib/lutaml/key_value/data_model.rb +14 -0
- data/lib/lutaml/{model/key_value_document.rb → key_value/document.rb} +2 -2
- data/lib/lutaml/{model/mapping/key_value_mapping.rb → key_value/mapping.rb} +81 -43
- data/lib/lutaml/{model/mapping/key_value_mapping_rule.rb → key_value/mapping_rule.rb} +9 -10
- data/lib/lutaml/{model/transform/key_value_transform.rb → key_value/transform.rb} +111 -65
- data/lib/lutaml/key_value/transformation/collection_serializer.rb +575 -0
- data/lib/lutaml/key_value/transformation/rule_compiler.rb +294 -0
- data/lib/lutaml/key_value/transformation/value_serializer.rb +268 -0
- data/lib/lutaml/key_value/transformation.rb +1071 -0
- data/lib/lutaml/key_value/transformation_builder.rb +30 -0
- data/lib/lutaml/key_value.rb +24 -0
- data/lib/lutaml/model/adapter_resolver.rb +410 -0
- data/lib/lutaml/model/adapter_scope.rb +64 -0
- data/lib/lutaml/model/attribute.rb +515 -121
- data/lib/lutaml/model/attribute_validator.rb +288 -0
- data/lib/lutaml/model/cached_type_resolver/concurrent_map_cache.rb +46 -0
- data/lib/lutaml/model/cached_type_resolver/mutex_hash_cache.rb +51 -0
- data/lib/lutaml/model/cached_type_resolver.rb +144 -0
- data/lib/lutaml/model/choice.rb +230 -13
- data/lib/lutaml/model/cli.rb +75 -121
- data/lib/lutaml/model/collection.rb +510 -43
- data/lib/lutaml/model/collection_handler.rb +106 -0
- data/lib/lutaml/model/comparable_model.rb +11 -3
- data/lib/lutaml/model/comparable_nil.rb +0 -2
- data/lib/lutaml/model/compiled_rule.rb +208 -0
- data/lib/lutaml/model/config.rb +111 -80
- data/lib/lutaml/model/configuration.rb +91 -0
- data/lib/lutaml/model/consolidation/attribute_grouper.rb +44 -0
- data/lib/lutaml/model/consolidation/dispatcher.rb +45 -0
- data/lib/lutaml/model/consolidation/engine.rb +33 -0
- data/lib/lutaml/model/consolidation/pattern_chunker.rb +87 -0
- data/lib/lutaml/model/consolidation_map.rb +68 -0
- data/lib/lutaml/model/consolidation_rule/dispatch_block.rb +34 -0
- data/lib/lutaml/model/consolidation_rule/gather_rule.rb +17 -0
- data/lib/lutaml/model/consolidation_rule/pattern_content_rule.rb +15 -0
- data/lib/lutaml/model/consolidation_rule/pattern_element_rule.rb +17 -0
- data/lib/lutaml/model/consolidation_rule.rb +27 -0
- data/lib/lutaml/model/constants.rb +5 -3
- data/lib/lutaml/model/context_registry.rb +208 -0
- data/lib/lutaml/model/error/element_count_out_of_range_error.rb +13 -7
- data/lib/lutaml/model/error/format_adapter_not_specified_error.rb +25 -0
- data/lib/lutaml/model/error/invalid_attribute_type_error.rb +98 -0
- data/lib/lutaml/model/error/invalid_format_error.rb +11 -0
- data/lib/lutaml/model/error/liquid_class_not_found_error.rb +9 -0
- data/lib/lutaml/model/error/mapping_already_exists_error.rb +6 -0
- data/lib/lutaml/model/error/mapping_attribute_missing_error.rb +6 -0
- data/lib/lutaml/model/error/mapping_attribute_type_error.rb +6 -0
- data/lib/lutaml/model/error/mixed_content_collection_error.rb +17 -0
- data/lib/lutaml/model/error/no_attributes_defined_liquid_error.rb +9 -0
- data/lib/lutaml/model/error/no_mapping_found_error.rb +9 -0
- data/lib/lutaml/model/error/required_attribute_missing_error.rb +9 -0
- data/lib/lutaml/model/error/reverse_transform_block_not_defined_error.rb +6 -0
- data/lib/lutaml/model/error/reverse_transformation_declaration_error.rb +6 -0
- data/lib/lutaml/model/error/sorting_configuration_conflict_error.rb +9 -0
- data/lib/lutaml/model/error/transform_block_not_defined_error.rb +6 -0
- data/lib/lutaml/model/error/type.rb +17 -0
- data/lib/lutaml/model/error/undefined_attribute_error.rb +9 -0
- data/lib/lutaml/model/error/unknown_adapter_type_error.rb +82 -3
- data/lib/lutaml/model/error/unknown_type_error.rb +25 -2
- data/lib/lutaml/model/error/unresolvable_type_error.rb +27 -0
- data/lib/lutaml/model/error.rb +2 -33
- data/lib/lutaml/model/errors.rb +4 -2
- data/lib/lutaml/model/finalization_cache.rb +51 -0
- data/lib/lutaml/model/format_registry.rb +170 -9
- data/lib/lutaml/model/global_context.rb +446 -0
- data/lib/lutaml/model/global_register.rb +106 -5
- data/lib/lutaml/model/hash.rb +15 -0
- data/lib/lutaml/model/import_registry.rb +250 -0
- data/lib/lutaml/model/instrumentation.rb +304 -0
- data/lib/lutaml/model/json.rb +17 -13
- data/lib/lutaml/model/jsonl.rb +7 -13
- data/lib/lutaml/model/liquefiable.rb +100 -12
- data/lib/lutaml/model/liquid/mapping.rb +30 -0
- data/lib/lutaml/model/liquid.rb +9 -0
- data/lib/lutaml/model/mapping/listener.rb +124 -0
- data/lib/lutaml/model/mapping/mapping.rb +99 -1
- data/lib/lutaml/model/mapping/mapping_rule.rb +172 -17
- data/lib/lutaml/model/mapping/model_mapping.rb +133 -0
- data/lib/lutaml/model/mapping/model_mapping_rule.rb +57 -0
- data/lib/lutaml/model/mapping_hash.rb +3 -1
- data/lib/lutaml/model/model_transformer.rb +101 -0
- data/lib/lutaml/model/one_entry_cache.rb +57 -0
- data/lib/lutaml/model/organization.rb +29 -0
- data/lib/lutaml/model/register/model_tree_importer.rb +88 -0
- data/lib/lutaml/model/register/namespace_binding.rb +92 -0
- data/lib/lutaml/model/register.rb +500 -35
- data/lib/lutaml/model/registrable.rb +2 -0
- data/lib/lutaml/model/render_policy.rb +154 -0
- data/lib/lutaml/model/runtime_compatibility.rb +95 -0
- data/lib/lutaml/model/schema/base_schema.rb +1 -3
- data/lib/lutaml/model/schema/decorators/attribute.rb +3 -1
- data/lib/lutaml/model/schema/decorators/choices.rb +0 -2
- data/lib/lutaml/model/schema/decorators/class_definition.rb +4 -5
- data/lib/lutaml/model/schema/decorators/definition_collection.rb +7 -7
- data/lib/lutaml/model/schema/decorators.rb +15 -0
- data/lib/lutaml/model/schema/generator/definition.rb +4 -3
- data/lib/lutaml/model/schema/generator/definitions_collection.rb +4 -3
- data/lib/lutaml/model/schema/generator/properties_collection.rb +7 -5
- data/lib/lutaml/model/schema/generator/property.rb +5 -1
- data/lib/lutaml/model/schema/generator.rb +15 -0
- data/lib/lutaml/model/schema/helpers.rb +11 -0
- data/lib/lutaml/model/schema/json_schema.rb +9 -53
- data/lib/lutaml/model/schema/renderer.rb +19 -17
- data/lib/lutaml/model/schema/schema_builder/nokogiri.rb +41 -0
- data/lib/lutaml/model/schema/schema_builder/oga.rb +92 -0
- data/lib/lutaml/model/schema/shared_methods.rb +2 -2
- data/lib/lutaml/model/schema/xml_compiler/attribute.rb +33 -12
- data/lib/lutaml/model/schema/xml_compiler/attribute_group.rb +3 -1
- data/lib/lutaml/model/schema/xml_compiler/choice.rb +4 -2
- data/lib/lutaml/model/schema/xml_compiler/complex_type.rb +73 -36
- data/lib/lutaml/model/schema/xml_compiler/element.rb +18 -1
- data/lib/lutaml/model/schema/xml_compiler/group.rb +20 -4
- data/lib/lutaml/model/schema/xml_compiler/registry_generator.rb +127 -0
- data/lib/lutaml/model/schema/xml_compiler/restriction.rb +5 -2
- data/lib/lutaml/model/schema/xml_compiler/sequence.rb +6 -2
- data/lib/lutaml/model/schema/xml_compiler/simple_content.rb +7 -3
- data/lib/lutaml/model/schema/xml_compiler/simple_type.rb +127 -51
- data/lib/lutaml/model/schema/xml_compiler/xml_namespace_class.rb +110 -0
- data/lib/lutaml/model/schema/xml_compiler.rb +256 -82
- data/lib/lutaml/model/schema/yaml_schema.rb +10 -50
- data/lib/lutaml/model/schema.rb +49 -14
- data/lib/lutaml/model/schema_location.rb +12 -60
- data/lib/lutaml/model/sequence.rb +102 -30
- data/lib/lutaml/model/serializable.rb +1 -3
- data/lib/lutaml/model/serialization_adapter.rb +2 -0
- data/lib/lutaml/model/serialize/attribute_definition.rb +229 -0
- data/lib/lutaml/model/serialize/builder.rb +169 -0
- data/lib/lutaml/model/serialize/enum_handling.rb +124 -0
- data/lib/lutaml/model/serialize/format_conversion.rb +337 -0
- data/lib/lutaml/model/serialize/initialization.rb +308 -0
- data/lib/lutaml/model/serialize/model_import.rb +357 -0
- data/lib/lutaml/model/serialize/transformation_builder.rb +127 -0
- data/lib/lutaml/model/serialize/value_mapping.rb +200 -0
- data/lib/lutaml/model/serialize.rb +175 -578
- data/lib/lutaml/model/services/base.rb +2 -2
- data/lib/lutaml/model/services/default_value_resolver.rb +60 -0
- data/lib/lutaml/model/services/logger.rb +10 -7
- data/lib/lutaml/model/services/rule_value_extractor.rb +22 -36
- data/lib/lutaml/model/services/transformer.rb +50 -9
- data/lib/lutaml/model/services/type/validator/string.rb +3 -2
- data/lib/lutaml/model/services/type/validator/symbol.rb +30 -0
- data/lib/lutaml/model/services/type/validator.rb +5 -2
- data/lib/lutaml/model/services/type.rb +9 -0
- data/lib/lutaml/model/services/validator.rb +1 -3
- data/lib/lutaml/model/services.rb +12 -5
- data/lib/lutaml/model/store.rb +59 -0
- data/lib/lutaml/model/toml.rb +24 -18
- data/lib/lutaml/model/transform/xml_transform.rb +4 -227
- data/lib/lutaml/model/transform.rb +49 -17
- data/lib/lutaml/model/transformation.rb +84 -0
- data/lib/lutaml/model/transformation_builder.rb +55 -0
- data/lib/lutaml/model/transformation_registry.rb +314 -0
- data/lib/lutaml/model/type/base64_binary.rb +58 -0
- data/lib/lutaml/model/type/boolean.rb +9 -16
- data/lib/lutaml/model/type/date.rb +49 -9
- data/lib/lutaml/model/type/date_time.rb +30 -18
- data/lib/lutaml/model/type/decimal.rb +28 -9
- data/lib/lutaml/model/type/duration.rb +82 -0
- data/lib/lutaml/model/type/float.rb +12 -13
- data/lib/lutaml/model/type/hash.rb +10 -17
- data/lib/lutaml/model/type/hex_binary.rb +56 -0
- data/lib/lutaml/model/type/integer.rb +19 -1
- data/lib/lutaml/model/type/qname.rb +85 -0
- data/lib/lutaml/model/type/reference.rb +76 -0
- data/lib/lutaml/model/type/string.rb +18 -35
- data/lib/lutaml/model/type/symbol.rb +67 -0
- data/lib/lutaml/model/type/time.rb +19 -22
- data/lib/lutaml/model/type/time_without_date.rb +18 -18
- data/lib/lutaml/model/type/uninitialized_class_guard.rb +36 -0
- data/lib/lutaml/model/type/uri.rb +51 -0
- data/lib/lutaml/model/type/value.rb +52 -5
- data/lib/lutaml/model/type.rb +98 -13
- data/lib/lutaml/model/type_context.rb +279 -0
- data/lib/lutaml/model/type_registry.rb +165 -0
- data/lib/lutaml/model/type_resolver.rb +185 -0
- data/lib/lutaml/model/type_substitution.rb +117 -0
- data/lib/lutaml/model/uninitialized_class.rb +1 -1
- data/lib/lutaml/model/utils.rb +110 -9
- data/lib/lutaml/model/validation.rb +50 -7
- data/lib/lutaml/model/value_transformer.rb +25 -0
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/yaml.rb +7 -13
- data/lib/lutaml/model/yamls.rb +7 -13
- data/lib/lutaml/model.rb +229 -25
- data/lib/lutaml/{model/toml → toml/adapter}/document.rb +3 -4
- data/lib/lutaml/{model/toml → toml/adapter}/mapping.rb +7 -6
- data/lib/lutaml/toml/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/toml/adapter/toml_rb_adapter.rb +38 -0
- data/lib/lutaml/toml/adapter/tomlib_adapter.rb +54 -0
- data/lib/lutaml/toml/adapter/transform.rb +9 -0
- data/lib/lutaml/toml/adapter.rb +19 -0
- data/lib/lutaml/toml/type/serializers.rb +71 -0
- data/lib/lutaml/toml.rb +48 -0
- data/lib/lutaml/xml/adapter/adapter_helpers.rb +149 -0
- data/lib/lutaml/xml/adapter/base_adapter.rb +672 -0
- data/lib/lutaml/xml/adapter/namespace_data.rb +73 -0
- data/lib/lutaml/xml/adapter/nokogiri_adapter.rb +1115 -0
- data/lib/lutaml/xml/adapter/oga_adapter.rb +849 -0
- data/lib/lutaml/xml/adapter/ox_adapter.rb +891 -0
- data/lib/lutaml/xml/adapter/rexml_adapter.rb +869 -0
- data/lib/lutaml/xml/adapter/xml_serialization.rb +145 -0
- data/lib/lutaml/xml/adapter.rb +20 -0
- data/lib/lutaml/xml/adapter_element.rb +185 -0
- data/lib/lutaml/xml/adapter_loader.rb +53 -0
- data/lib/lutaml/xml/attribute_namespace_resolver.rb +139 -0
- data/lib/lutaml/xml/blank_namespace.rb +51 -0
- data/lib/lutaml/xml/blank_namespace_handler.rb +50 -0
- data/lib/lutaml/xml/builder/base.rb +215 -0
- data/lib/lutaml/xml/builder/nokogiri.rb +12 -0
- data/lib/lutaml/xml/builder/oga.rb +15 -0
- data/lib/lutaml/xml/builder/ox.rb +15 -0
- data/lib/lutaml/xml/builder/rexml.rb +15 -0
- data/lib/lutaml/xml/builder.rb +16 -0
- data/lib/lutaml/xml/configurable.rb +214 -0
- data/lib/lutaml/xml/data_model.rb +257 -0
- data/lib/lutaml/xml/decisions/decision.rb +103 -0
- data/lib/lutaml/xml/decisions/decision_context.rb +225 -0
- data/lib/lutaml/xml/decisions/decision_engine.rb +67 -0
- data/lib/lutaml/xml/decisions/decision_rule.rb +54 -0
- data/lib/lutaml/xml/decisions/element_prefix_resolver.rb +85 -0
- data/lib/lutaml/xml/decisions/rules/attribute_usage_rule.rb +37 -0
- data/lib/lutaml/xml/decisions/rules/default_preference_rule.rb +62 -0
- data/lib/lutaml/xml/decisions/rules/element_form_default_rule.rb +66 -0
- data/lib/lutaml/xml/decisions/rules/element_form_default_unqualified_rule.rb +73 -0
- data/lib/lutaml/xml/decisions/rules/element_form_option_rule.rb +83 -0
- data/lib/lutaml/xml/decisions/rules/explicit_option_rule.rb +57 -0
- data/lib/lutaml/xml/decisions/rules/format_preservation_rule.rb +74 -0
- data/lib/lutaml/xml/decisions/rules/hoisted_on_parent_rule.rb +60 -0
- data/lib/lutaml/xml/decisions/rules/inherit_from_parent_rule.rb +52 -0
- data/lib/lutaml/xml/decisions/rules/inherit_parent_prefix_rule.rb +69 -0
- data/lib/lutaml/xml/decisions/rules/namespace_scope_rule.rb +54 -0
- data/lib/lutaml/xml/decisions/rules/reuse_parent_prefix_rule.rb +78 -0
- data/lib/lutaml/xml/decisions/rules/used_prefix_rule.rb +70 -0
- data/lib/lutaml/xml/decisions/rules.rb +39 -0
- data/lib/lutaml/xml/decisions.rb +15 -0
- data/lib/lutaml/xml/declaration_handler.rb +217 -0
- data/lib/lutaml/xml/declaration_plan/attribute_node.rb +81 -0
- data/lib/lutaml/xml/declaration_plan/element_node.rb +101 -0
- data/lib/lutaml/xml/declaration_plan.rb +480 -0
- data/lib/lutaml/xml/declaration_plan_query.rb +105 -0
- data/lib/lutaml/xml/declaration_planner.rb +1849 -0
- data/lib/lutaml/xml/doctype_extractor.rb +51 -0
- data/lib/lutaml/xml/document.rb +380 -0
- data/lib/lutaml/xml/element.rb +93 -0
- data/lib/lutaml/xml/element_prefix_resolver.rb +50 -0
- data/lib/lutaml/xml/encoding_normalizer.rb +54 -0
- data/lib/lutaml/xml/error/invalid_namespace_error.rb +46 -0
- data/lib/lutaml/xml/error/invalid_xsd_type_error.rb +43 -0
- data/lib/lutaml/xml/error/namespace_mismatch_error.rb +53 -0
- data/lib/lutaml/xml/error/xml_configuration_error.rb +17 -0
- data/lib/lutaml/xml/error/xml_error.rb +21 -0
- data/lib/lutaml/xml/format_chooser.rb +214 -0
- data/lib/lutaml/xml/hoisting_algorithm.rb +234 -0
- data/lib/lutaml/xml/listener.rb +33 -0
- data/lib/lutaml/xml/mapping.rb +1470 -0
- data/lib/lutaml/xml/mapping_rule.rb +565 -0
- data/lib/lutaml/xml/model_transform.rb +944 -0
- data/lib/lutaml/xml/namespace.rb +435 -0
- data/lib/lutaml/xml/namespace_class_registry.rb +144 -0
- data/lib/lutaml/xml/namespace_collector.rb +611 -0
- data/lib/lutaml/xml/namespace_declaration.rb +202 -0
- data/lib/lutaml/xml/namespace_declaration_builder.rb +67 -0
- data/lib/lutaml/xml/namespace_declaration_data.rb +182 -0
- data/lib/lutaml/xml/namespace_inheritance_resolver.rb +142 -0
- data/lib/lutaml/xml/namespace_inheritance_strategy.rb +26 -0
- data/lib/lutaml/xml/namespace_needs.rb +213 -0
- data/lib/lutaml/xml/namespace_resolution_strategy.rb +230 -0
- data/lib/lutaml/xml/namespace_resolver.rb +219 -0
- data/lib/lutaml/xml/namespace_scope_config.rb +109 -0
- data/lib/lutaml/xml/namespace_type_resolver.rb +135 -0
- data/lib/lutaml/xml/namespace_usage.rb +121 -0
- data/lib/lutaml/xml/nokogiri/element.rb +34 -0
- data/lib/lutaml/xml/nokogiri.rb +10 -0
- data/lib/lutaml/xml/oga/element.rb +15 -0
- data/lib/lutaml/xml/oga.rb +10 -0
- data/lib/lutaml/xml/ox/element.rb +15 -0
- data/lib/lutaml/xml/ox.rb +10 -0
- data/lib/lutaml/xml/parsed_namespace_declaration.rb +129 -0
- data/lib/lutaml/xml/parsed_namespace_set.rb +149 -0
- data/lib/lutaml/xml/polymorphic_value_handler.rb +41 -0
- data/lib/lutaml/xml/qualified_inheritance_strategy.rb +27 -0
- data/lib/lutaml/xml/rexml/element.rb +15 -0
- data/lib/lutaml/xml/rexml.rb +10 -0
- data/lib/lutaml/xml/schema/builder/nokogiri.rb +41 -0
- data/lib/lutaml/xml/schema/builder/oga.rb +92 -0
- data/lib/lutaml/xml/schema/builder.rb +59 -0
- data/lib/lutaml/xml/schema/builtin_types.rb +112 -0
- data/lib/lutaml/{model → xml}/schema/relaxng_schema.rb +9 -4
- data/lib/lutaml/xml/schema/xsd/all.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/annotation.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/any.rb +33 -0
- data/lib/lutaml/xml/schema/xsd/any_attribute.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/appinfo.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/attribute.rb +78 -0
- data/lib/lutaml/xml/schema/xsd/attribute_group.rb +89 -0
- data/lib/lutaml/xml/schema/xsd/base.rb +267 -0
- data/lib/lutaml/xml/schema/xsd/choice.rb +68 -0
- data/lib/lutaml/xml/schema/xsd/complex_content.rb +39 -0
- data/lib/lutaml/xml/schema/xsd/complex_type.rb +157 -0
- data/lib/lutaml/xml/schema/xsd/documentation.rb +26 -0
- data/lib/lutaml/xml/schema/xsd/element.rb +117 -0
- data/lib/lutaml/xml/schema/xsd/enumeration.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/errors/enhanced_error.rb +142 -0
- data/lib/lutaml/xml/schema/xsd/errors/error_context.rb +67 -0
- data/lib/lutaml/xml/schema/xsd/errors/message_builder.rb +103 -0
- data/lib/lutaml/xml/schema/xsd/errors/suggestion.rb +67 -0
- data/lib/lutaml/xml/schema/xsd/errors/troubleshooters/namespace_troubleshooter.rb +96 -0
- data/lib/lutaml/xml/schema/xsd/errors/troubleshooters/troubleshooting_handler.rb +70 -0
- data/lib/lutaml/xml/schema/xsd/errors.rb +148 -0
- data/lib/lutaml/xml/schema/xsd/extension_complex_content.rb +63 -0
- data/lib/lutaml/xml/schema/xsd/extension_simple_content.rb +48 -0
- data/lib/lutaml/xml/schema/xsd/field.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/file_validation_result.rb +55 -0
- data/lib/lutaml/xml/schema/xsd/fraction_digits.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/glob.rb +105 -0
- data/lib/lutaml/xml/schema/xsd/group.rb +79 -0
- data/lib/lutaml/xml/schema/xsd/import.rb +33 -0
- data/lib/lutaml/xml/schema/xsd/include.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/key.rb +32 -0
- data/lib/lutaml/xml/schema/xsd/keyref.rb +33 -0
- data/lib/lutaml/xml/schema/xsd/length.rb +27 -0
- data/lib/lutaml/xml/schema/xsd/list.rb +28 -0
- data/lib/lutaml/xml/schema/xsd/max_exclusive.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/max_inclusive.rb +23 -0
- data/lib/lutaml/xml/schema/xsd/max_length.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/min_exclusive.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/min_inclusive.rb +23 -0
- data/lib/lutaml/xml/schema/xsd/min_length.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/namespace_mapping.rb +37 -0
- data/lib/lutaml/xml/schema/xsd/namespace_uri_remapping.rb +79 -0
- data/lib/lutaml/xml/schema/xsd/notation.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/pattern.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/redefine.rb +35 -0
- data/lib/lutaml/xml/schema/xsd/restriction_complex_content.rb +56 -0
- data/lib/lutaml/xml/schema/xsd/restriction_simple_content.rb +84 -0
- data/lib/lutaml/xml/schema/xsd/restriction_simple_type.rb +64 -0
- data/lib/lutaml/xml/schema/xsd/schema.rb +373 -0
- data/lib/lutaml/xml/schema/xsd/schema_file_validation_results.rb +55 -0
- data/lib/lutaml/xml/schema/xsd/schema_location_mapping.rb +74 -0
- data/lib/lutaml/xml/schema/xsd/schema_name_resolver.rb +32 -0
- data/lib/lutaml/xml/schema/xsd/schema_path.rb +196 -0
- data/lib/lutaml/xml/schema/xsd/schema_validator.rb +256 -0
- data/lib/lutaml/xml/schema/xsd/selector.rb +27 -0
- data/lib/lutaml/xml/schema/xsd/sequence.rb +68 -0
- data/lib/lutaml/xml/schema/xsd/serialized_schema.rb +185 -0
- data/lib/lutaml/xml/schema/xsd/simple_content.rb +61 -0
- data/lib/lutaml/xml/schema/xsd/simple_type.rb +37 -0
- data/lib/lutaml/xml/schema/xsd/total_digits.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/type_index_entry.rb +40 -0
- data/lib/lutaml/xml/schema/xsd/type_resolution_result.rb +112 -0
- data/lib/lutaml/xml/schema/xsd/union.rb +30 -0
- data/lib/lutaml/xml/schema/xsd/unique.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/validation_error.rb +48 -0
- data/lib/lutaml/xml/schema/xsd/validation_result.rb +86 -0
- data/lib/lutaml/xml/schema/xsd/version.rb +11 -0
- data/lib/lutaml/xml/schema/xsd/white_space.rb +27 -0
- data/lib/lutaml/xml/schema/xsd.rb +165 -0
- data/lib/lutaml/xml/schema/xsd_namespace.rb +29 -0
- data/lib/lutaml/xml/schema/xsd_schema.rb +536 -0
- data/lib/lutaml/xml/schema.rb +13 -0
- data/lib/lutaml/xml/schema_location.rb +155 -0
- data/lib/lutaml/xml/serialization/collection_ext.rb +61 -0
- data/lib/lutaml/xml/serialization/format_conversion.rb +402 -0
- data/lib/lutaml/xml/serialization/instance_methods.rb +303 -0
- data/lib/lutaml/xml/serialization/model_import_ext.rb +40 -0
- data/lib/lutaml/xml/serialization.rb +15 -0
- data/lib/lutaml/xml/shared_dsl.rb +119 -0
- data/lib/lutaml/xml/transform.rb +6 -0
- data/lib/lutaml/xml/transformation/custom_method_wrapper.rb +262 -0
- data/lib/lutaml/xml/transformation/element_builder.rb +586 -0
- data/lib/lutaml/xml/transformation/ordered_applier.rb +329 -0
- data/lib/lutaml/xml/transformation/rule_applier.rb +379 -0
- data/lib/lutaml/xml/transformation/rule_compiler.rb +543 -0
- data/lib/lutaml/xml/transformation/skip_logic.rb +70 -0
- data/lib/lutaml/xml/transformation/value_serializer.rb +139 -0
- data/lib/lutaml/xml/transformation.rb +340 -0
- data/lib/lutaml/xml/transformation_builder.rb +28 -0
- data/lib/lutaml/xml/transformation_support.rb +14 -0
- data/lib/lutaml/xml/type/configurable.rb +157 -0
- data/lib/lutaml/xml/type/serializers.rb +98 -0
- data/lib/lutaml/xml/type/value_xml_mapping.rb +94 -0
- data/lib/lutaml/xml/type_namespace/collector.rb +101 -0
- data/lib/lutaml/xml/type_namespace/declaration.rb +61 -0
- data/lib/lutaml/xml/type_namespace/planner.rb +121 -0
- data/lib/lutaml/xml/type_namespace/reference.rb +71 -0
- data/lib/lutaml/xml/type_namespace/resolver.rb +43 -0
- data/lib/lutaml/xml/type_namespace.rb +13 -0
- data/lib/lutaml/xml/type_namespace_resolver.rb +76 -0
- data/lib/lutaml/xml/unqualified_inheritance_strategy.rb +34 -0
- data/lib/lutaml/xml/w3c/registration.rb +66 -0
- data/lib/lutaml/xml/w3c.rb +398 -0
- data/lib/lutaml/xml/xml_attribute.rb +38 -0
- data/lib/lutaml/xml/xml_element.rb +447 -0
- data/lib/lutaml/xml/xml_namespace.rb +72 -0
- data/lib/lutaml/xml.rb +294 -0
- data/lib/lutaml/{model/yaml → yaml/adapter}/document.rb +3 -3
- data/lib/lutaml/yaml/adapter/mapping.rb +19 -0
- data/lib/lutaml/yaml/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/yaml/adapter/standard_adapter.rb +39 -0
- data/lib/lutaml/yaml/adapter/transform.rb +9 -0
- data/lib/lutaml/yaml/adapter.rb +13 -0
- data/lib/lutaml/yaml/schema/yaml_schema.rb +65 -0
- data/lib/lutaml/yaml/schema.rb +9 -0
- data/lib/lutaml/yaml/type/serializers.rb +60 -0
- data/lib/lutaml/yaml.rb +30 -0
- data/lib/lutaml/{model/yamls → yamls/adapter}/document.rb +2 -2
- data/lib/lutaml/yamls/adapter/mapping.rb +26 -0
- data/lib/lutaml/yamls/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/yamls/adapter/standard_adapter.rb +56 -0
- data/lib/lutaml/yamls/adapter/transform.rb +124 -0
- data/lib/lutaml/yamls/adapter/yamls_sequence.rb +20 -0
- data/lib/lutaml/yamls/adapter/yamls_sequence_rule.rb +48 -0
- data/lib/lutaml/yamls/adapter.rb +15 -0
- data/lib/lutaml/yamls.rb +21 -0
- data/lib/tasks/benchmark_runner.rb +161 -0
- data/lib/tasks/memory_profile.rb +176 -0
- data/lib/tasks/performance.rake +75 -0
- data/lib/tasks/performance_benchmark.rb +499 -0
- data/lib/tasks/performance_comparator.rb +114 -0
- data/lib/tasks/performance_helpers.rb +149 -0
- data/lib/tasks/xml_compiler_benchmark.rb +226 -0
- data/lib/tasks/xml_optimization_benchmark.rb +178 -0
- data/lutaml-model.gemspec +11 -1
- data/reference-docs/XML Entity Definitions for Characters (3rd Edition).html +595 -0
- data/scripts-xmi-profile/profile_xmi.rb +192 -0
- data/scripts-xmi-profile/profile_xmi_simple.rb +210 -0
- data/spec/address_person_spec.rb +436 -0
- data/spec/address_spec.rb +20 -18
- data/spec/ceramic_spec.rb +25 -7
- data/spec/fixtures/address.rb +2 -2
- data/spec/fixtures/ceramic.rb +6 -2
- data/spec/fixtures/geolexica_v2_concept.rb +136 -0
- data/spec/fixtures/geolexica_v2_sample.yaml +36 -0
- data/spec/fixtures/geolexica_v2_sample2.yaml +38 -0
- data/spec/fixtures/person.rb +14 -13
- data/spec/fixtures/sample_model.rb +3 -3
- data/spec/fixtures/vase.rb +3 -3
- data/spec/fixtures/xml/address_example_260.xsd +8 -4
- data/spec/fixtures/xml/examples/nested_categories.xml +45 -51
- data/spec/fixtures/xml/examples/valid_catalog.xml +27 -41
- data/spec/fixtures/xml/math_document_schema.xsd +7 -5
- data/spec/fixtures/xml/product_catalog.xsd +19 -138
- data/spec/fixtures/xml/schema/xsd/build_test_package.rb +19 -0
- data/spec/fixtures/xml/schema/xsd/citygml/2.0/cityGMLBase.xsd +339 -0
- data/spec/fixtures/xml/schema/xsd/citygml/appearance/2.0/appearance.xsd +332 -0
- data/spec/fixtures/xml/schema/xsd/citygml/bridge/2.0/bridge.xsd +578 -0
- data/spec/fixtures/xml/schema/xsd/citygml/building/2.0/building.xsd +535 -0
- data/spec/fixtures/xml/schema/xsd/citygml/cityfurniture/2.0/cityFurniture.xsd +57 -0
- data/spec/fixtures/xml/schema/xsd/citygml/cityobjectgroup/2.0/cityObjectGroup.xsd +84 -0
- data/spec/fixtures/xml/schema/xsd/citygml/examples/2.0/ade/noise-ade/CityGML-NoiseADE.xsd +174 -0
- data/spec/fixtures/xml/schema/xsd/citygml/examples/2.0/ade/robotics-ade/stdOp.xsd +46 -0
- data/spec/fixtures/xml/schema/xsd/citygml/examples/2.0/ade/robotics-ade/unr.xsd +46 -0
- data/spec/fixtures/xml/schema/xsd/citygml/generics/2.0/generics.xsd +184 -0
- data/spec/fixtures/xml/schema/xsd/citygml/landuse/2.0/landUse.xsd +50 -0
- data/spec/fixtures/xml/schema/xsd/citygml/profiles/base/2.0/CityGML.xsd +30 -0
- data/spec/fixtures/xml/schema/xsd/citygml/relief/2.0/relief.xsd +186 -0
- data/spec/fixtures/xml/schema/xsd/citygml/texturedsurface/2.0/texturedSurface.xsd +157 -0
- data/spec/fixtures/xml/schema/xsd/citygml/transportation/2.0/transportation.xsd +224 -0
- data/spec/fixtures/xml/schema/xsd/citygml/tunnel/2.0/tunnel.xsd +530 -0
- data/spec/fixtures/xml/schema/xsd/citygml/vegetation/2.0/vegetation.xsd +108 -0
- data/spec/fixtures/xml/schema/xsd/citygml/waterbody/2.0/waterBody.xsd +171 -0
- data/spec/fixtures/xml/schema/xsd/citygml/xAL/xAL.xsd +1680 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/basicTypes.xsd +262 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coordinateOperations.xsd +519 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coordinateReferenceSystems.xsd +367 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coordinateSystems.xsd +291 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coverage.xsd +287 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/datums.xsd +281 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/defaultStyle.xsd +447 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/deprecatedTypes.xsd +1128 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/dictionary.xsd +84 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/direction.xsd +78 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/dynamicFeature.xsd +103 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/feature.xsd +88 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryAggregates.xsd +191 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryBasic0d1d.xsd +271 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryBasic2d.xsd +118 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryComplexes.xsd +89 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryPrimitives.xsd +841 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/gml.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/gmlBase.xsd +179 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/grids.xsd +58 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/measures.xsd +63 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/observation.xsd +90 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/referenceSystems.xsd +64 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/temporal.xsd +263 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/temporalReferenceSystems.xsd +183 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/temporalTopology.xsd +113 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/topology.xsd +380 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/units.xsd +156 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/valueObjects.xsd +199 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gco/basicTypes.xsd +429 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gco/gco.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gco/gcoBase.xsd +61 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/applicationSchema.xsd +42 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/citation.xsd +275 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/constraints.xsd +106 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/content.xsd +188 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/dataQuality.xsd +554 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/distribution.xsd +202 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/extent.xsd +205 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/freeText.xsd +122 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/gmd.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/identification.xsd +348 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/maintenance.xsd +86 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/metadataApplication.xsd +175 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/metadataEntity.xsd +70 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/metadataExtension.xsd +99 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/portrayalCatalogue.xsd +36 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/referenceSystem.xsd +100 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/spatialRepresentation.xsd +237 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/catalogues.xsd +112 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/codelistItem.xsd +168 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/crsItem.xsd +1030 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/extendedTypes.xsd +75 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/gmx.xsd +2 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/gmxUsage.xsd +127 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/uomItem.xsd +162 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gsr/gsr.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gsr/spatialReferencing.xsd +24 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gss/geometry.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gss/gss.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gts/gts.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gts/temporalObjects.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/xlink/1.0.0/xlinks.xsd +122 -0
- data/spec/fixtures/xml/schema/xsd/i-ur/urbanFunction.xsd +2772 -0
- data/spec/fixtures/xml/schema/xsd/i-ur/urbanObject.xsd +3344 -0
- data/spec/fixtures/xml/schema/xsd/import-without-location.xsd +9 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2/baseTypes.xsd +775 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2/gco.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2.0/baseTypes.xsd +775 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2.0/gco.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2/extendedTypes.xsd +151 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2/gcx.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2.0/extendedTypes.xsd +151 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2.0/gcx.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/coordinateGeometry.xsd +1078 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometricAggregates.xsd +141 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometricComplex.xsd +177 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometricPrimative.xsd +526 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometry.xsd +9 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometryRoot.xsd +59 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/gss.xsd +26 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topoComplex.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topoPrimative.xsd +432 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topoRoot.xsd +9 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topology.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/coordinates.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/curves.xsd +22 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/geometry.xsd +41 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/gss.xsd +21 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/simplicialGeometry.xsd +63 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/solids.xsd +21 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/surfaces.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/topology.xsd +21 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.1.0/abstract.xsd +47 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.1.0/fcc.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2/abstract.xsd +45 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2/fcc.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2.0/abstract.xsd +45 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2.0/fcc.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/1.0/gfc.xsd +497 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.1.0/featureCatalogue.xsd +673 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.1.0/gfc.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2/featureCatalogue.xsd +798 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2/gfc.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2.0/featureCatalogue.xsd +798 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2.0/gfc.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/fcc/1.0/abstract.xsd +49 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/fcc/1.0/fcc.xsd +9 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/gfc/1.1/featureCatalogue.xsd +671 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19110/gfc/1.1/gfc.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1/rbc.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1/rbcStubs.xsd +195 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.0/rbc.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.0/rbcStubs.xsd +195 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/AbstractCommonClasses.xsd +282 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/commonClasses.xsd +127 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordOps.xsd +676 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordRefSys.xsd +498 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordSys.xsd +844 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordinates.xsd +101 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/datum.xsd +474 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/rbc.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3/cit.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3/citation.xsd +445 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3.0/cit.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3.0/citation.xsd +445 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3/extent.xsd +243 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3/gex.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.0/extent.xsd +243 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.0/gex.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.1/extent.xsd +244 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.1/gex.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3/lan.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3/language.xsd +152 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3.0/lan.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3.0/language.xsd +152 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3/applicationSchema.xsd +58 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3/mas.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3.0/applicationSchema.xsd +58 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3.0/mas.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3/AbstractCommonClasses.xsd +378 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3/commonClasses.xsd +205 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3/mcc.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3.0/AbstractCommonClasses.xsd +378 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3.0/commonClasses.xsd +205 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3.0/mcc.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3/constraints.xsd +171 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3/mco.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3.0/constraints.xsd +171 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3.0/mco.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3/mda.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3/metadataApplication.xsd +207 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.0/mda.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.0/metadataApplication.xsd +207 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.1/mda.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.1/metadataApplication.xsd +247 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3/mdb.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3/metadataBase.xsd +117 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3/metadataBaseMDAerror.xsd +116 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.0/mdb.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.0/metadataBase.xsd +117 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.0/metadataBaseMDAerror.xsd +116 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.1/mdb.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.1/metadataBase.xsd +144 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3/metadataExtension.xsd +138 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3/mex.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3.0/metadataExtension.xsd +138 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3.0/mex.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3/maintenance.xsd +70 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3/mmi.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3.0/maintenance.xsd +70 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3.0/mmi.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3/mpc.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3/portrayalCatalogue.xsd +40 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3.0/mpc.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3.0/portrayalCatalogue.xsd +40 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3/content.xsd +368 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3/mrc.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.0/content.xsd +368 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.0/mrc.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.1/content.xsd +366 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.1/mrc.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3/distribution.xsd +232 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3/mrd.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3.0/distribution.xsd +232 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3.0/mrd.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3/identification.xsd +425 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3/mri.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3.0/identification.xsd +425 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3.0/mri.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3/lineage.xsd +130 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3/mrl.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3.0/lineage.xsd +130 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3.0/mrl.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3/mrs.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3/referenceSystem.xsd +67 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.0/mrs.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.0/referenceSystem.xsd +67 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.1/mrs.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.1/referenceSystem.xsd +66 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3/msr.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3/spatialRepresentation.xsd +326 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.0/msr.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.0/spatialRepresentation.xsd +326 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.1/msr.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.1/spatialRepresentation.xsd +326 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3/serviceInformation.xsd +252 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3/srv.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3.0/serviceInformation.xsd +252 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3.0/srv.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/acquisitionInformation.xsd +415 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/contentInformation.xsd +147 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/dataQualityInformation.xsd +214 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/gmi.xsd +23 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/metadataEntitySet.xsd +43 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/spatialRepresentationInformation.xsd +140 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/acquisitionInformation.xsd +415 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/contentInformation.xsd +147 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/dataQualityInformation.xsd +214 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/gmi.xsd +24 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/metadataEntitySet.xsd +43 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/spatialRepresentationInformation.xsd +142 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2/acquisitionInformationImagery.xsd +796 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2/mac.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.0/acquisitionInformationImagery.xsd +796 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.0/mac.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.1/acquisitionInformationImagery.xsd +799 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.1/mac.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrc/2.2/contentInformationImagery.xsd +161 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrc/2.2.0/contentInformationImagery.xsd +161 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrc/2.2.1/contentInformationImagery.xsd +159 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrl/2.2/lineageImagery.xsd +312 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrl/2.2.0/lineageImagery.xsd +312 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/msr/2.2/spatialRepresentationImagery.xsd +138 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/msr/2.2.0/spatialRepresentationImagery.xsd +138 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/msr/2.2.1/spatialRepresentationImagery.xsd +145 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/cat.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/catalogues.xsd +59 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/codelistItem.xsd +63 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/crsItem.xsd +188 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/uomItem.xsd +45 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/1.0/cit.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/1.0/citation.xsd +400 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/2.0/cit.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/2.0/citation.xsd +402 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gco/1.0/baseTypes.xsd +532 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gco/1.0/baseTypes2014.xsd +531 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gco/1.0/gco.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gcx/1.0/extendedTypes.xsd +97 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gcx/1.0/gcx.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gex/1.0/extent.xsd +207 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gex/1.0/gex.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gmw/1.0/gmlWrapperTypes.xsd +147 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gmw/1.0/gmlWrapperTypes2014.xsd +147 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gmw/1.0/gmw.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/lan/1.0/lan.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/lan/1.0/language.xsd +141 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/1.0/acquisitionInformationImagery.xsd +424 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/1.0/mac.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/acquisitionInformationImagery.xsd +473 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/event.xsd +106 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/mac.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/metadataEntitySet.xsd +46 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mas/1.0/applicationSchema.xsd +53 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mas/1.0/mas.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mcc/1.0/AbstractCommonClasses.xsd +362 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mcc/1.0/commonClasses.xsd +179 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mcc/1.0/mcc.xsd +12 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mco/1.0/constraints.xsd +152 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mco/1.0/mco.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/1.0/md1.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/1.0/metadataWExtendedType.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/2.0/md1.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/2.0/metadataWExtendedType.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/1.0/md2.xsd +27 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/1.0/metadataWithExtensions.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/2.0/md2.xsd +27 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/2.0/metadataWithExtensions.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/1.0/mda.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/1.0/metadataApplication.xsd +188 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/2.0/mda.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/2.0/metadataApplication.xsd +189 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/1.0/mdb.xsd +23 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/1.0/metadataBase.xsd +97 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/2.0/mdb.xsd +23 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/2.0/metadataBase.xsd +105 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/1.0/mds.xsd +59 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/1.0/metadataDataServices.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/2.0/mds.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/2.0/metadataDataServices.xsd +10 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/1.0/mdt.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/1.0/metadataTransfer.xsd +121 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/2.0/mdt.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/2.0/metadataTransfer.xsd +121 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mex/1.0/metadataExtension.xsd +122 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mex/1.0/mex.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mmi/1.0/maintenance.xsd +63 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mmi/1.0/mmi.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mpc/1.0/mpc.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mpc/1.0/portrayalCatalogue.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/1.0/content.xsd +330 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/1.0/contentInformationImagery.xsd +160 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/1.0/mrc.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/2.0/content.xsd +334 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/2.0/contentInformationImagery.xsd +143 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/2.0/mrc.xsd +21 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrd/1.0/distribution.xsd +212 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrd/1.0/mrd.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mri/1.0/identification.xsd +385 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mri/1.0/mri.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/1.0/lineage.xsd +117 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/1.0/lineageImagery.xsd +168 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/1.0/mrl.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/2.0/lineage.xsd +118 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/2.0/lineageImagery.xsd +250 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/2.0/mrl.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrs/1.0/mrs.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrs/1.0/referenceSystem.xsd +47 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/1.0/msr.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/1.0/spatialRepresentation.xsd +288 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/1.0/spatialRepresentationImagery.xsd +113 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/2.0/msr.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/2.0/spatialRepresentation.xsd +296 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/2.0/spatialRepresentationImagery.xsd +114 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.0/serviceInformation.xsd +217 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.0/srv.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.1/serviceInformation.xsd +220 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.1/srv.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19119/-/srv/1.0/serviceMetadata.xsd +204 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19119/-/srv/1.0/serviceModel.xsd +230 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19119/-/srv/1.0/srv.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19119/srv/serviceMetadata.xsd +204 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19119/srv/serviceModel.xsd +238 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19119/srv/srv.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1/cis-0.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1/codeLists.xsd +68 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1/gridPoint.xsd +47 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1.0/cis-0.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1.0/codeLists.xsd +68 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1.0/gridPoint.xsd +47 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/3.1.0/codeLists.xsd +68 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/3.1.0/gridPoint.xsd +47 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.0/coverage.xsd +185 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.0/gmlcovAll.xsd +21 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.0/grids.xsd +115 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1/coverage.xsd +188 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1/gmlcovAll.xsd +25 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1/grids.xsd +119 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1.0/coverage.xsd +188 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1.0/gmlcovAll.xsd +25 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1.0/grids.xsd +119 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/3.1.0/coverage.xsd +188 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/3.1.0/gmlcovAll.xsd +23 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/3.1.0/grids.xsd +119 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/codeList.xsd +134 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/groundControlPoints.xsd +239 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/nonPhysicalSensorModel.xsd +321 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/physicalSensorModel.xsd +62 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/sensorModel.xsd +65 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/sensorParameters.xsd +762 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/spatialElements.xsd +497 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/codeList.xsd +129 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/groundControlPoints.xsd +235 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/nonPhysicalSensorModel.xsd +321 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/physicalSensorModel.xsd +62 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/sensorModel.xsd +65 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/sensorParameters.xsd +762 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/spatialElements.xsd +496 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/codeList.xsd +349 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/sensorModel.xsd +53 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/sensorParameters.xsd +681 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/spatialElements.xsd +902 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/codeList.xsd +344 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/sensorModel.xsd +49 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/sensorParameters.xsd +676 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/spatialElements.xsd +897 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-3/smi/1.1/smi.xsd +42 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-3/smi/1.1.0/smi.xsd +42 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19130/-3/smi/1.1.1/smi.xsd +42 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.0/dps.xsd +1344 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.0.0/dps.xsd +1344 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.2/dps.xsd +1522 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.2.0/dps.xsd +1522 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.2.1/dps.xsd +1522 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-1/dps/2.0/dps.xsd +1339 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19131/-1/dps/2.2.0/dps.xsd +1540 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/core.xsd +349 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/extended.xsd +1074 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/hierarchy.xsd +57 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/pir.xsd +13 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/core.xsd +344 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/extended.xsd +1076 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/hierarchy.xsd +58 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/pir.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/core.xsd +344 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/extended.xsd +1076 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/hierarchy.xsd +58 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/pir.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.0/abstract.xsd +42 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.0/pre.xsd +4 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.2.0/abstract.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.2.0/pre.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.0/reg.xsd +8 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.0/registration.xsd +562 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.2.0/reg.xsd +22 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.2.0/registration.xsd +590 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/basicTypes.xsd +275 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coordinateOperations.xsd +534 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coordinateReferenceSystems.xsd +379 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coordinateSystems.xsd +303 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coverage.xsd +298 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/datums.xsd +293 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/defaultStyle.xsd +462 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/deprecatedTypes.xsd +1139 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/dictionary.xsd +95 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/direction.xsd +90 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/dynamicFeature.xsd +114 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/feature.xsd +99 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryAggregates.xsd +203 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryBasic0d1d.xsd +283 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryBasic2d.xsd +130 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryComplexes.xsd +101 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryPrimitives.xsd +852 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/gml.xsd +25 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/gmlBase.xsd +191 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/grids.xsd +70 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/measures.xsd +74 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/observation.xsd +100 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/referenceSystems.xsd +78 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/temporal.xsd +274 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/temporalReferenceSystems.xsd +194 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/temporalTopology.xsd +124 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/topology.xsd +391 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/units.xsd +168 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/valueObjects.xsd +210 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1/gmlWrapperTypes.xsd +160 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1/gmw.xsd +27 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1.0/gmlWrapperTypes.xsd +160 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1.0/gmw.xsd +27 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/cat.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/catalogues.xsd +63 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/codelistItem.xsd +64 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/crsItem.xsd +200 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/uomItem.xsd +49 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/cat.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/catalogues.xsd +63 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/codelistItem.xsd +64 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/crsItem.xsd +200 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/uomItem.xsd +49 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gco/1.0/basicTypes.xsd +439 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gco/1.0/gco.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gco/1.0/gcoBase.xsd +71 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/applicationSchema.xsd +50 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/citation.xsd +283 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/constraints.xsd +114 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/content.xsd +197 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/dataQuality.xsd +563 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/distribution.xsd +210 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/extent.xsd +216 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/freeText.xsd +130 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/gmd.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/identification.xsd +356 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/maintenance.xsd +95 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/metadataApplication.xsd +183 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/metadataEntity.xsd +78 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/metadataExtension.xsd +107 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/portrayalCatalogue.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/referenceSystem.xsd +108 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/spatialRepresentation.xsd +246 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/catalogues.xsd +121 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/codelistItem.xsd +179 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/crsItem.xsd +1041 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/extendedTypes.xsd +83 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/gmx.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/gmxUsage.xsd +136 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/uomItem.xsd +173 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gsr/1.0/gsr.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gsr/1.0/spatialReferencing.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gss/1.0/geometry.xsd +45 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gss/1.0/gss.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gts/1.0/gts.xsd +18 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gts/1.0/temporalObjects.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19155/gpi/1.0/gpi.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19155/gpi/1.0/placeIdentifier.xsd +75 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19155/gpi/1.0/sampleGMLApplicationSchema.xsd +83 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2/abstract.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2/dqc.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2.0/abstract.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2.0/dqc.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2/dqm.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2/qualityMeasures.xsd +332 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2.0/dqm.xsd +19 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2.0/qualityMeasures.xsd +332 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityElement.xsd +583 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityEvaluation.xsd +199 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityImagery.xsd +75 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityResult.xsd +213 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/mdq.xsd +22 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/metaquality.xsd +93 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityElement.xsd +583 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityEvaluation.xsd +199 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityImagery.xsd +75 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityResult.xsd +213 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/mdq.xsd +22 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/metaquality.xsd +93 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.0/dataQualityCommon.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.0/dqc.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.1/dataQualityCommon.xsd +43 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.1/dqc.xsd +17 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.0/dataQualityMeasure.xsd +376 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.0/dqm.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.1/dataQualityMeasure.xsd +367 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.1/dqm.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/dataQuality.xsd +570 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/dataQualityEvaluation.xsd +227 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/dataQualityResult.xsd +191 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/mdq.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/metaquality.xsd +106 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/dataQuality.xsd +581 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/dataQualityEvaluation.xsd +227 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/dataQualityResult.xsd +198 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/mdq.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/metaquality.xsd +102 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqc/1.0/abstract.xsd +43 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqc/1.0/dqc.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqm/1.0/dqm.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqm/1.0/qualityMeasures.xsd +303 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityElement.xsd +554 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityEvaluation.xsd +182 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityImagery.xsd +72 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityResult.xsd +140 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/mdq.xsd +21 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/metaquality.xsd +89 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19160/-4/patdl/2.7.3/PATDL.v.2.7.3.xsd +517 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/IE_Imagery.xsd +520 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/IE_ImageryAndGriddedData.xsd +222 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/IE_ThematicGriddedData.xsd +117 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/igd.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/IE_Imagery.xsd +520 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/IE_ImageryAndGriddedData.xsd +222 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/IE_ThematicGriddedData.xsd +117 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/igd.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/IE_Imagery.xsd +518 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/IE_ImageryAndGriddedData.xsd +213 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/IE_ThematicGriddedData.xsd +116 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/igd.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19165/-1/gpm/1.0.0/geospatialPreservationMetadata.xsd +872 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19165/-1/gpm/1.0.0/gpm.xsd +11 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19165/gpm/1.0/geospatialPreservationMetadata.xsd +385 -0
- data/spec/fixtures/xml/schema/xsd/isotc211/19165/gpm/1.0/gpm.xsd +8 -0
- data/spec/fixtures/xml/schema/xsd/metaschema-datatypes.xsd +263 -0
- data/spec/fixtures/xml/schema/xsd/metaschema-markup-line.xsd +9 -0
- data/spec/fixtures/xml/schema/xsd/metaschema-markup-multiline.xsd +135 -0
- data/spec/fixtures/xml/schema/xsd/metaschema-meta-constraints.xsd +39 -0
- data/spec/fixtures/xml/schema/xsd/metaschema-prose-base.xsd +82 -0
- data/spec/fixtures/xml/schema/xsd/metaschema-prose-module.xsd +5 -0
- data/spec/fixtures/xml/schema/xsd/metaschema.xsd +1344 -0
- data/spec/fixtures/xml/schema/xsd/omml_schema.xsd +1528 -0
- data/spec/fixtures/xml/schema/xsd/smil20/rdf.xsd +16 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-AccessKeyTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-AudioLayout.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicAnimation.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicContentControl.xsd +49 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicInlineTiming.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicLayout.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicLinking.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicMedia.xsd +39 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicTimeContainers.xsd +37 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicTransitions.xsd +36 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-BrushMedia.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-CustomTestAttributes.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-EventTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-ExclTimeContainers.xsd +37 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-FillDefault.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-HierarchicalLayout.xsd +46 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-HostLanguage.xsd +85 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-InlineTransitions.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-IntegrationSet.xsd +72 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-LinkingAttributes.xsd +40 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaAccessibility.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaClipMarkers.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaClipping.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaDescription.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaMarkerTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaParam.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-Metainformation.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MinMaxTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MultiArcTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-MultiWindowLayout.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-ObjectLinking.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-PrefetchControl.xsd +31 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-RepeatTiming.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-RepeatValueTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-RestartDefault.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-RestartTiming.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-SkipContentControl.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-SplineAnimation.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-Structure.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncBehavior.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncBehaviorDefault.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncMaster.xsd +32 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncbaseTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-TimeContainerAttributes.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-TimeManipulations.xsd +35 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-TransitionModifiers.xsd +37 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-WallclockTiming.xsd +33 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-animate.xsd +229 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-content.xsd +148 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-language.xsd +834 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-layout.xsd +211 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-linking.xsd +117 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-media.xsd +175 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-meta.xsd +44 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-struct.xsd +47 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-timemanip.xsd +34 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-timing.xsd +344 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-transitions.xsd +138 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20-utility.xsd +57 -0
- data/spec/fixtures/xml/schema/xsd/smil20/smil20.xsd +86 -0
- data/spec/fixtures/xml/schema/xsd/smil20/xml-mod.xsd +25 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/advanced_encodings.xsd +186 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/basic_types.xsd +147 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/block_components.xsd +163 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/choice_components.xsd +56 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/examples/security.xsd +15 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/record_components.xsd +95 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/simple_components.xsd +536 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/simple_encodings.xsd +93 -0
- data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/swe.xsd +14 -0
- data/spec/fixtures/xml/schema/xsd/test_schema.lxr +0 -0
- data/spec/fixtures/xml/schema/xsd/test_schema.xsd +24 -0
- data/spec/fixtures/xml/schema/xsd/unitsml-v1.0-csd03.xsd +1333 -0
- data/spec/fixtures/xml/schema/xsd/unitsml-v1.0-csd04.xsd +1334 -0
- data/spec/fixtures/xml/schema/xsd/validation_config.yml +14 -0
- data/spec/fixtures/xml/special_char.xml +3 -4
- data/spec/fixtures/xml/user.xsd +14 -10
- data/spec/fixtures/yamls_range_concept.rb +139 -0
- data/spec/lutaml/key_value/transformation/collection_serializer_spec.rb +213 -0
- data/spec/lutaml/key_value/transformation/rule_compiler_spec.rb +229 -0
- data/spec/lutaml/key_value/transformation/value_serializer_spec.rb +216 -0
- data/spec/lutaml/key_value/transformation_spec.rb +292 -0
- data/spec/lutaml/model/attribute_collection_spec.rb +9 -6
- data/spec/lutaml/model/attribute_form_default_spec.rb +252 -0
- data/spec/lutaml/model/attribute_spec.rb +328 -38
- data/spec/lutaml/model/cached_type_resolver_spec.rb +362 -0
- data/spec/lutaml/model/cdata_spec.rb +180 -102
- data/spec/lutaml/model/choice_spec.rb +37 -7
- data/spec/lutaml/model/cli_spec.rb +452 -0
- data/spec/lutaml/model/collection_index_spec.rb +347 -0
- data/spec/lutaml/model/collection_mutation_spec.rb +124 -0
- data/spec/lutaml/model/collection_spec.rb +580 -155
- data/spec/lutaml/model/collection_validation_spec.rb +736 -0
- data/spec/lutaml/model/comparable_model_spec.rb +75 -0
- data/spec/lutaml/model/compiled_rule_spec.rb +364 -0
- data/spec/lutaml/model/consolidation_spec.rb +295 -0
- data/spec/lutaml/model/context_registry_spec.rb +269 -0
- data/spec/lutaml/model/custom_bibtex_adapter_spec.rb +21 -7
- data/spec/lutaml/model/custom_collection_spec.rb +321 -27
- data/spec/lutaml/model/custom_model_spec.rb +13 -10
- data/spec/lutaml/model/custom_serialization_spec.rb +12 -14
- data/spec/lutaml/model/custom_vobject_adapter_spec.rb +36 -16
- data/spec/lutaml/model/default_register_spec.rb +852 -0
- data/spec/lutaml/model/defaults_spec.rb +57 -6
- data/spec/lutaml/model/delegation_spec.rb +184 -110
- data/spec/lutaml/model/derived_attribute_serialization_spec.rb +33 -0
- data/spec/lutaml/model/dynamic_attribute_spec.rb +112 -0
- data/spec/lutaml/model/encoding_spec.rb +281 -0
- data/spec/lutaml/model/enum_spec.rb +46 -2
- data/spec/lutaml/model/except_spec.rb +240 -0
- data/spec/lutaml/model/finalization_cache_spec.rb +88 -0
- data/spec/lutaml/model/global_context_spec.rb +421 -0
- data/spec/lutaml/model/global_register_spec.rb +153 -36
- data/spec/lutaml/model/group_spec.rb +193 -54
- data/spec/lutaml/model/hash/adapter_spec.rb +5 -3
- data/spec/lutaml/model/import_registry_spec.rb +295 -0
- data/spec/lutaml/model/included_spec.rb +10 -17
- data/spec/lutaml/model/inheritance_spec.rb +6 -6
- data/spec/lutaml/model/json_adapter_spec.rb +13 -6
- data/spec/lutaml/model/json_spec.rb +33 -0
- data/spec/lutaml/model/key_value_data_model/key_value_element_spec.rb +320 -0
- data/spec/lutaml/model/key_value_mapping_spec.rb +12 -2
- data/spec/lutaml/model/lazy_collection_spec.rb +208 -0
- data/spec/lutaml/model/liquefiable_spec.rb +263 -24
- data/spec/lutaml/model/logger_spec.rb +68 -0
- data/spec/lutaml/model/map_all_spec.rb +36 -11
- data/spec/lutaml/model/map_content_spec.rb +4 -4
- data/spec/lutaml/model/mapping_rule_perf_guard_spec.rb +71 -0
- data/spec/lutaml/model/mixed_content_spec.rb +481 -171
- data/spec/lutaml/model/model_transformer_spec.rb +678 -0
- data/spec/lutaml/model/multiple_mapping_spec.rb +71 -39
- data/spec/lutaml/model/namespace_versioning_spec.rb +390 -0
- data/spec/lutaml/model/one_entry_cache_spec.rb +114 -0
- data/spec/lutaml/model/ordered_content_spec.rb +115 -24
- data/spec/lutaml/model/polymorphic_spec.rb +29 -6
- data/spec/lutaml/model/processing_instruction_spec.rb +375 -0
- data/spec/lutaml/model/{register/key_value_spec.rb → register_key_value_spec.rb} +57 -5
- data/spec/lutaml/model/register_spec.rb +235 -5
- data/spec/lutaml/model/render_empty_spec.rb +143 -6
- data/spec/lutaml/model/render_nil_spec.rb +15 -10
- data/spec/lutaml/model/root_mappings_spec.rb +16 -6
- data/spec/lutaml/model/rule_value_extractor_spec.rb +13 -44
- data/spec/lutaml/model/runtime_compatibility_spec.rb +36 -0
- data/spec/lutaml/model/schema/generator/definitions_collection_spec.rb +4 -0
- data/spec/lutaml/model/schema/json_schema_spec.rb +7 -1
- data/spec/lutaml/model/schema/relaxng_schema_spec.rb +1 -1
- data/spec/lutaml/model/schema/renderer_spec.rb +128 -0
- data/spec/lutaml/model/schema/xsd_schema_spec.rb +1 -1
- data/spec/lutaml/model/sequence_spec.rb +460 -15
- data/spec/lutaml/model/serializable_spec.rb +212 -12
- data/spec/lutaml/model/serializable_validation_spec.rb +3 -2
- data/spec/lutaml/model/serialize_perf_guard_spec.rb +100 -0
- data/spec/lutaml/model/services/default_value_resolver_spec.rb +162 -0
- data/spec/lutaml/model/simple_model_spec.rb +4 -4
- data/spec/lutaml/model/toml_adapter_spec.rb +11 -4
- data/spec/lutaml/model/toml_spec.rb +46 -2
- data/spec/lutaml/model/transformation_builder_spec.rb +283 -0
- data/spec/lutaml/model/transformation_spec.rb +165 -236
- data/spec/lutaml/model/type/base64_binary_spec.rb +202 -0
- data/spec/lutaml/model/type/date_spec.rb +132 -0
- data/spec/lutaml/model/type/date_time_spec.rb +54 -2
- data/spec/lutaml/model/type/decimal_spec.rb +1 -1
- data/spec/lutaml/model/type/duration_spec.rb +185 -0
- data/spec/lutaml/model/type/hex_binary_spec.rb +225 -0
- data/spec/lutaml/model/type/integer_spec.rb +1 -1
- data/spec/lutaml/model/type/qname_spec.rb +246 -0
- data/spec/lutaml/model/type/reference_integration_spec.rb +532 -0
- data/spec/lutaml/model/type/reference_spec.rb +293 -0
- data/spec/lutaml/model/type/symbol_spec.rb +322 -0
- data/spec/lutaml/model/type/time_spec.rb +6 -5
- data/spec/lutaml/model/type/time_without_date_spec.rb +1 -1
- data/spec/lutaml/model/type/uninitialized_class_spec.rb +110 -0
- data/spec/lutaml/model/type/uri_spec.rb +176 -0
- data/spec/lutaml/model/type/value_xml_mapping_spec.rb +162 -0
- data/spec/lutaml/model/type_context_spec.rb +370 -0
- data/spec/lutaml/model/type_registry_spec.rb +313 -0
- data/spec/lutaml/model/type_resolver_spec.rb +278 -0
- data/spec/lutaml/model/type_spec.rb +7 -8
- data/spec/lutaml/model/type_substitution_spec.rb +172 -0
- data/spec/lutaml/model/utils_spec.rb +39 -24
- data/spec/lutaml/model/value_map_spec.rb +2 -2
- data/spec/lutaml/model/value_transformation_comprehensive_spec.rb +676 -0
- data/spec/lutaml/model/with_child_mapping_spec.rb +1 -1
- data/spec/lutaml/model/xml_decoupling_spec.rb +436 -0
- data/spec/lutaml/model/xsd_form_default_patterns_spec.rb +664 -0
- data/spec/lutaml/model/xsd_patterns_spec.rb +278 -0
- data/spec/lutaml/model/xsd_type_spec.rb +345 -0
- data/spec/lutaml/model/xsd_type_validation_spec.rb +442 -0
- data/spec/lutaml/model/yamls/standard_adapter_spec.rb +2 -2
- data/spec/lutaml/model/yamls_range_spec.rb +393 -0
- data/spec/lutaml/model/yamls_sequence_spec.rb +245 -0
- data/spec/lutaml/xml/adapter/nokogiri_adapter_spec.rb +130 -0
- data/spec/lutaml/xml/adapter/oga_adapter_spec.rb +135 -0
- data/spec/lutaml/xml/adapter/ox_adapter_spec.rb +101 -0
- data/spec/lutaml/xml/adapter/rexml_adapter_spec.rb +101 -0
- data/spec/lutaml/xml/adapter/xml_namespace_spec.rb +531 -0
- data/spec/lutaml/xml/builder/builder_spec.rb +216 -0
- data/spec/lutaml/xml/compiled_rule_namespace_spec.rb +405 -0
- data/spec/lutaml/xml/conformance/xml_namespaces_spec.rb +580 -0
- data/spec/lutaml/xml/conformance/xml_schema_instance_spec.rb +266 -0
- data/spec/lutaml/xml/data_model_spec.rb +300 -0
- data/spec/lutaml/xml/decisions/decision_engine_spec.rb +242 -0
- data/spec/lutaml/xml/decisions/decision_spec.rb +217 -0
- data/spec/lutaml/xml/decisions/element_prefix_resolver_spec.rb +198 -0
- data/spec/lutaml/xml/declaration_planner_spec.rb +524 -0
- data/spec/lutaml/xml/default_namespace_spec.rb +190 -0
- data/spec/lutaml/{model/xml → xml}/derived_attributes_spec.rb +2 -2
- data/spec/lutaml/xml/doctype_preservation_spec.rb +323 -0
- data/spec/lutaml/xml/doubly_defined_namespace_spec.rb +415 -0
- data/spec/lutaml/xml/dual_namespace_element_spec.rb +181 -0
- data/spec/lutaml/xml/element_spec.rb +28 -0
- data/spec/lutaml/xml/encoding_normalizer_spec.rb +215 -0
- data/spec/lutaml/xml/enhanced_mapping_spec.rb +692 -0
- data/spec/lutaml/xml/entity_fragmentation_spec.rb +583 -0
- data/spec/lutaml/xml/format_chooser_spec.rb +0 -0
- data/spec/lutaml/xml/fpi_namespace_spec.rb +145 -0
- data/spec/lutaml/{model/xml/namespace_spec.rb → xml/general_namespace_spec.rb} +6 -5
- data/spec/lutaml/xml/mapping_finalization_guard_spec.rb +83 -0
- data/spec/lutaml/xml/mapping_rule_spec.rb +98 -0
- data/spec/lutaml/xml/mapping_spec.rb +1147 -0
- data/spec/lutaml/xml/model_transform_guard_spec.rb +126 -0
- data/spec/lutaml/{model/xml → xml}/namespace/nested_with_explicit_namespace_spec.rb +8 -5
- data/spec/lutaml/xml/namespace/w3c_reserved_warning_spec.rb +152 -0
- data/spec/lutaml/xml/namespace_alias_prefix_root_spec.rb +130 -0
- data/spec/lutaml/xml/namespace_alias_spec.rb +263 -0
- data/spec/lutaml/xml/namespace_aware_parsing_spec.rb +219 -0
- data/spec/lutaml/xml/namespace_backward_compatibility_spec.rb +48 -0
- data/spec/lutaml/xml/namespace_bound_element_roundtrip_spec.rb +433 -0
- data/spec/lutaml/xml/namespace_constant_spec.rb +383 -0
- data/spec/lutaml/xml/namespace_force_prefix_spec.rb +113 -0
- data/spec/lutaml/xml/namespace_format_preservation_spec.rb +49 -0
- data/spec/lutaml/xml/namespace_inheritance_deep_spec.rb +162 -0
- data/spec/lutaml/xml/namespace_inheritance_override_spec.rb +316 -0
- data/spec/lutaml/xml/namespace_inheritance_resolver_spec.rb +0 -0
- data/spec/lutaml/xml/namespace_inheritance_spec.rb +966 -0
- data/spec/lutaml/xml/namespace_integration_spec.rb +277 -0
- data/spec/lutaml/xml/namespace_missing_prefix_spec.rb +178 -0
- data/spec/lutaml/xml/namespace_no_hoisting_spec.rb +172 -0
- data/spec/lutaml/xml/namespace_placement_spec.rb +265 -0
- data/spec/lutaml/xml/namespace_preservation_spec.rb +427 -0
- data/spec/lutaml/xml/namespace_principles_spec.rb +909 -0
- data/spec/lutaml/xml/namespace_resolution_strategy_spec.rb +273 -0
- data/spec/lutaml/xml/namespace_scope_declare_spec.rb +205 -0
- data/spec/lutaml/xml/namespace_scope_spec.rb +389 -0
- data/spec/lutaml/xml/namespace_scope_vcard_spec.rb +616 -0
- data/spec/lutaml/xml/namespace_spec.rb +712 -0
- data/spec/lutaml/xml/namespace_three_phase_spec.rb +310 -0
- data/spec/lutaml/xml/nil_optional_element_namespace_spec.rb +84 -0
- data/spec/lutaml/xml/ooxml_namespace_spec.rb +177 -0
- data/spec/lutaml/xml/ordered_method_spec.rb +109 -0
- data/spec/lutaml/xml/prefix_control_spec.rb +286 -0
- data/spec/lutaml/{model/register/xml_spec.rb → xml/register_spec.rb} +75 -21
- data/spec/lutaml/xml/reusable_mapping_spec.rb +148 -0
- data/spec/lutaml/xml/reused_elements_namespace_spec.rb +85 -0
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/attribute_group_spec.rb +9 -3
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/attribute_spec.rb +11 -7
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/choice_spec.rb +5 -2
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/complex_content_restriction_spec.rb +7 -2
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/complex_content_spec.rb +5 -1
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/complex_type_spec.rb +49 -20
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/element_spec.rb +9 -4
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/group_spec.rb +9 -5
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/restriction_spec.rb +1 -0
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/sequence_spec.rb +10 -4
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/simple_content_spec.rb +9 -3
- data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/simple_type_spec.rb +10 -7
- data/spec/lutaml/{model/schema/xml_compiler_spec.rb → xml/schema/compiler_spec.rb} +219 -94
- data/spec/lutaml/xml/schema/xsd/errors/error_context_spec.rb +65 -0
- data/spec/lutaml/xml/schema/xsd/errors/suggestion_spec.rb +77 -0
- data/spec/lutaml/xml/schema/xsd/file_validation_result_spec.rb +131 -0
- data/spec/lutaml/xml/schema/xsd/glob_spec.rb +318 -0
- data/spec/lutaml/xml/schema/xsd/liquid_methods/attribute_and_group_spec.rb +76 -0
- data/spec/lutaml/xml/schema/xsd/liquid_methods/complex_type_spec.rb +159 -0
- data/spec/lutaml/xml/schema/xsd/liquid_methods/containers_spec.rb +104 -0
- data/spec/lutaml/xml/schema/xsd/liquid_methods/element_spec.rb +139 -0
- data/spec/lutaml/xml/schema/xsd/liquid_methods/schema_spec.rb +75 -0
- data/spec/lutaml/xml/schema/xsd/liquid_methods/simple_content_spec.rb +79 -0
- data/spec/lutaml/xml/schema/xsd/namespace_uri_remapping_spec.rb +246 -0
- data/spec/lutaml/xml/schema/xsd/schema_helper_methods_spec.rb +237 -0
- data/spec/lutaml/xml/schema/xsd/schema_mapping_spec.rb +742 -0
- data/spec/lutaml/xml/schema/xsd/schema_validator_spec.rb +228 -0
- data/spec/lutaml/xml/schema/xsd/spec_helper.rb +26 -0
- data/spec/lutaml/xml/schema/xsd/validation_error_spec.rb +189 -0
- data/spec/lutaml/xml/schema/xsd/validation_result_spec.rb +276 -0
- data/spec/lutaml/xml/schema/xsd/xsd_spec.rb +51 -0
- data/spec/lutaml/xml/schema_primer_spec.rb +393 -0
- data/spec/lutaml/xml/serializable_namespace_spec.rb +125 -0
- data/spec/lutaml/xml/transformation/custom_method_wrapper_spec.rb +48 -0
- data/spec/lutaml/xml/transformation_spec.rb +439 -0
- data/spec/lutaml/xml/type_namespace/collector_spec.rb +212 -0
- data/spec/lutaml/xml/type_namespace/planner_spec.rb +270 -0
- data/spec/lutaml/xml/type_namespace_examples_spec.rb +521 -0
- data/spec/lutaml/xml/type_namespace_integration_spec.rb +332 -0
- data/spec/lutaml/xml/type_namespace_prefix_spec.rb +370 -0
- data/spec/lutaml/xml/type_namespace_resolver_spec.rb +0 -0
- data/spec/lutaml/xml/type_namespace_roundtrip_spec.rb +580 -0
- data/spec/lutaml/xml/w3c_types_spec.rb +376 -0
- data/spec/lutaml/{model → xml}/xml_adapter_spec.rb +64 -17
- data/spec/lutaml/xml/xml_declaration_spec.rb +568 -0
- data/spec/lutaml/xml/xml_element_guard_spec.rb +138 -0
- data/spec/lutaml/{model/xml → xml}/xml_element_spec.rb +1 -1
- data/spec/lutaml/xml/xml_lang_spec.rb +441 -0
- data/spec/lutaml/xml/xml_space_spec.rb +247 -0
- data/spec/lutaml/xml/xml_space_type_spec.rb +161 -0
- data/spec/lutaml/xml/xml_spec.rb +122 -0
- data/spec/parent_root_spec.rb +63 -0
- data/spec/person_spec.rb +9 -9
- data/spec/spec_helper.rb +69 -6
- data/spec/support/test_adapter_config.rb +101 -0
- data/spec/support/test_namespaces.rb +185 -0
- data/spec/support/trace_helper.rb +0 -0
- data/spec/support/xml/schema_helper.rb +15 -0
- data/spec/support/xml/xsd/code_example_validator.rb +393 -0
- data/spec/support/xml_mapping_namespaces.rb +176 -0
- metadata +1475 -100
- data/docs/custom_registers.adoc +0 -228
- data/lib/lutaml/model/hash_adapter/mapping.rb +0 -19
- data/lib/lutaml/model/hash_adapter/mapping_rule.rb +0 -9
- data/lib/lutaml/model/hash_adapter/transform.rb +0 -8
- data/lib/lutaml/model/hash_adapter.rb +0 -21
- data/lib/lutaml/model/json/mapping.rb +0 -19
- data/lib/lutaml/model/json/mapping_rule.rb +0 -9
- data/lib/lutaml/model/json/multi_json_adapter.rb +0 -18
- data/lib/lutaml/model/json/standard_adapter.rb +0 -25
- data/lib/lutaml/model/json/transform.rb +0 -8
- data/lib/lutaml/model/jsonl/mapping.rb +0 -19
- data/lib/lutaml/model/jsonl/mapping_rule.rb +0 -9
- data/lib/lutaml/model/jsonl/transform.rb +0 -19
- data/lib/lutaml/model/schema/xsd_schema.rb +0 -62
- data/lib/lutaml/model/toml/mapping_rule.rb +0 -9
- data/lib/lutaml/model/toml/toml_rb_adapter.rb +0 -18
- data/lib/lutaml/model/toml/tomlib_adapter.rb +0 -19
- data/lib/lutaml/model/toml/transform.rb +0 -8
- data/lib/lutaml/model/xml/builder/nokogiri.rb +0 -101
- data/lib/lutaml/model/xml/builder/oga.rb +0 -183
- data/lib/lutaml/model/xml/builder/ox.rb +0 -121
- data/lib/lutaml/model/xml/document.rb +0 -477
- data/lib/lutaml/model/xml/element.rb +0 -32
- data/lib/lutaml/model/xml/mapping.rb +0 -471
- data/lib/lutaml/model/xml/mapping_rule.rb +0 -149
- data/lib/lutaml/model/xml/nokogiri_adapter.rb +0 -234
- data/lib/lutaml/model/xml/oga/document.rb +0 -20
- data/lib/lutaml/model/xml/oga/element.rb +0 -123
- data/lib/lutaml/model/xml/oga_adapter.rb +0 -172
- data/lib/lutaml/model/xml/ox_adapter.rb +0 -229
- data/lib/lutaml/model/xml/transform.rb +0 -8
- data/lib/lutaml/model/xml/xml_attribute.rb +0 -37
- data/lib/lutaml/model/xml/xml_element.rb +0 -167
- data/lib/lutaml/model/xml/xml_namespace.rb +0 -49
- data/lib/lutaml/model/xml.rb +0 -31
- data/lib/lutaml/model/xml_adapter/element.rb +0 -18
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +0 -15
- data/lib/lutaml/model/xml_adapter/oga_adapter.rb +0 -21
- data/lib/lutaml/model/xml_adapter/ox_adapter.rb +0 -18
- data/lib/lutaml/model/xml_adapter.rb +0 -7
- data/lib/lutaml/model/yaml/mapping.rb +0 -19
- data/lib/lutaml/model/yaml/mapping_rule.rb +0 -9
- data/lib/lutaml/model/yaml/standard_adapter.rb +0 -28
- data/lib/lutaml/model/yaml/transform.rb +0 -8
- data/lib/lutaml/model/yamls/mapping.rb +0 -19
- data/lib/lutaml/model/yamls/mapping_rule.rb +0 -9
- data/lib/lutaml/model/yamls/standard_adapter.rb +0 -34
- data/lib/lutaml/model/yamls/transform.rb +0 -19
- data/spec/benchmarks/xml_parsing_benchmark_spec.rb +0 -74
- data/spec/fixtures/xml/advanced_test_schema.xsd +0 -134
- data/spec/lutaml/model/namespace_spec.rb +0 -57
- data/spec/lutaml/model/xml_adapter/nokogiri_adapter_spec.rb +0 -56
- data/spec/lutaml/model/xml_adapter/oga_adapter_spec.rb +0 -60
- data/spec/lutaml/model/xml_adapter/ox_adapter_spec.rb +0 -61
- data/spec/lutaml/model/xml_adapter/xml_namespace_spec.rb +0 -368
- data/spec/lutaml/model/xml_mapping_rule_spec.rb +0 -158
- data/spec/lutaml/model/xml_mapping_spec.rb +0 -1318
- data/spec/lutaml/model/xml_spec.rb +0 -63
- /data/spec/lutaml/{model/xml → xml}/root_mappings/nested_child_mappings_spec.rb +0 -0
|
@@ -0,0 +1,2613 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: XML namespaces
|
|
3
|
+
nav_order: 2
|
|
4
|
+
has_children: true
|
|
5
|
+
---
|
|
6
|
+
= XML namespaces
|
|
7
|
+
:toc:
|
|
8
|
+
:toclevels: 3
|
|
9
|
+
|
|
10
|
+
== General
|
|
11
|
+
|
|
12
|
+
XML namespaces provide a way to qualify element and attribute names to avoid
|
|
13
|
+
conflicts. Lutaml::Model provides comprehensive namespace support following W3C
|
|
14
|
+
specifications.
|
|
15
|
+
|
|
16
|
+
=== Namespace prefix independence
|
|
17
|
+
|
|
18
|
+
==== General
|
|
19
|
+
|
|
20
|
+
Lutaml::Model implements W3C-compliant XML namespace processing where
|
|
21
|
+
**namespace URIs, not prefixes, determine element identity**. This means that
|
|
22
|
+
models will correctly parse XML documents regardless of which prefix (or no
|
|
23
|
+
prefix) is used, as long as the namespace URI matches.
|
|
24
|
+
|
|
25
|
+
This W3C-compliant behavior ensures maximum interoperability when consuming XML
|
|
26
|
+
from different sources.
|
|
27
|
+
|
|
28
|
+
The namespace URI determines identity, not the prefix.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
==== Supported prefix formats
|
|
32
|
+
|
|
33
|
+
When a model is defined with a namespace, it will successfully parse XML using
|
|
34
|
+
any of these formats:
|
|
35
|
+
|
|
36
|
+
Default namespace (unprefixed)::
|
|
37
|
+
`xmlns="http://example.com/ns"`
|
|
38
|
+
|
|
39
|
+
Prefixed namespace with model's default prefix::
|
|
40
|
+
`xmlns:cer="http://example.com/ns"`
|
|
41
|
+
|
|
42
|
+
Prefixed namespace with ANY arbitrary prefix::
|
|
43
|
+
`xmlns:pottery="http://example.com/ns"`
|
|
44
|
+
|
|
45
|
+
All three formats are semantically identical according to W3C XML Namespaces
|
|
46
|
+
specification.
|
|
47
|
+
|
|
48
|
+
When there is no default namespace declared, unprefixed elements are treated as
|
|
49
|
+
having the "blank" namespace, i.e. `xmlns=""`. It is possible to force elements
|
|
50
|
+
to have a blank namespace using `#to_xml(prefix: "")` or `#to_xml(prefix: nil)`.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
.Parsing XML with different prefix formats
|
|
54
|
+
[example]
|
|
55
|
+
====
|
|
56
|
+
[source,ruby]
|
|
57
|
+
----
|
|
58
|
+
class CeramicNamespace < Lutaml::Model::XmlNamespace
|
|
59
|
+
uri 'http://example.com/ceramic'
|
|
60
|
+
prefix_default 'cer'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class Ceramic < Lutaml::Model::Serializable
|
|
64
|
+
attribute :type, :string
|
|
65
|
+
|
|
66
|
+
xml do
|
|
67
|
+
element 'Ceramic'
|
|
68
|
+
namespace CeramicNamespace
|
|
69
|
+
map_element 'Type', to: :type
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# All these XML formats parse successfully to the same result:
|
|
74
|
+
|
|
75
|
+
# Format 1: Default namespace
|
|
76
|
+
xml1 = '<Ceramic xmlns="http://example.com/ceramic"><Type>Porcelain</Type></Ceramic>'
|
|
77
|
+
Ceramic.from_xml(xml1).type # => "Porcelain"
|
|
78
|
+
|
|
79
|
+
# Format 2: Model's defined prefix
|
|
80
|
+
xml2 = '<cer:Ceramic xmlns:cer="http://example.com/ceramic"><cer:Type>Porcelain</cer:Type></cer:Ceramic>'
|
|
81
|
+
Ceramic.from_xml(xml2).type # => "Porcelain"
|
|
82
|
+
|
|
83
|
+
# Format 3: Arbitrary prefix
|
|
84
|
+
xml3 = '<pottery:Ceramic xmlns:pottery="http://example.com/ceramic"><pottery:Type>Porcelain</pottery:Type></pottery:Ceramic>'
|
|
85
|
+
Ceramic.from_xml(xml3).type # => "Porcelain"
|
|
86
|
+
----
|
|
87
|
+
|
|
88
|
+
All three examples produce identical `Ceramic` objects. The namespace URI `http://example.com/ceramic` matches, which is what matters according to W3C specifications.
|
|
89
|
+
====
|
|
90
|
+
|
|
91
|
+
==== Nested models with different namespaces
|
|
92
|
+
|
|
93
|
+
Prefix independence extends to nested models where parent and child use different namespaces:
|
|
94
|
+
|
|
95
|
+
.Nested models with arbitrary prefixes
|
|
96
|
+
[example]
|
|
97
|
+
====
|
|
98
|
+
[source,ruby]
|
|
99
|
+
----
|
|
100
|
+
class GlazeNamespace < Lutaml::Model::XmlNamespace
|
|
101
|
+
uri 'http://example.com/glaze'
|
|
102
|
+
prefix_default 'glz'
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class Glaze < Lutaml::Model::Serializable
|
|
106
|
+
attribute :color, :string
|
|
107
|
+
|
|
108
|
+
xml do
|
|
109
|
+
element 'Glaze'
|
|
110
|
+
namespace GlazeNamespace
|
|
111
|
+
map_element 'Color', to: :color
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
class Ceramic < Lutaml::Model::Serializable
|
|
116
|
+
attribute :type, :string
|
|
117
|
+
attribute :glaze, Glaze
|
|
118
|
+
|
|
119
|
+
xml do
|
|
120
|
+
element 'Ceramic'
|
|
121
|
+
namespace CeramicNamespace
|
|
122
|
+
map_element 'Type', to: :type
|
|
123
|
+
map_element 'Glaze', to: :glaze
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Parent and child can use any prefixes as long as URIs match:
|
|
128
|
+
xml = <<~XML
|
|
129
|
+
<x:Ceramic xmlns:x="http://example.com/ceramic"
|
|
130
|
+
xmlns:y="http://example.com/glaze">
|
|
131
|
+
<x:Type>Porcelain</x:Type>
|
|
132
|
+
<y:Glaze>
|
|
133
|
+
<y:Color>Clear</y:Color>
|
|
134
|
+
</y:Glaze>
|
|
135
|
+
</x:Ceramic>
|
|
136
|
+
XML
|
|
137
|
+
|
|
138
|
+
result = Ceramic.from_xml(xml)
|
|
139
|
+
result.type # => "Porcelain"
|
|
140
|
+
result.glaze.color # => "Clear"
|
|
141
|
+
----
|
|
142
|
+
====
|
|
143
|
+
|
|
144
|
+
==== Type-level namespace prefix independence
|
|
145
|
+
|
|
146
|
+
When attribute types declare their own namespaces via `xml_namespace`, those
|
|
147
|
+
types also support prefix-independent parsing:
|
|
148
|
+
|
|
149
|
+
.Type namespace with arbitrary prefixes
|
|
150
|
+
[example]
|
|
151
|
+
====
|
|
152
|
+
[source,ruby]
|
|
153
|
+
----
|
|
154
|
+
class ColorNamespace < Lutaml::Model::XmlNamespace
|
|
155
|
+
uri 'http://example.com/color'
|
|
156
|
+
prefix_default 'clr'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
class ColorType < Lutaml::Model::Type::String
|
|
160
|
+
xml_namespace ColorNamespace
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
class Ceramic < Lutaml::Model::Serializable
|
|
164
|
+
attribute :type, :string
|
|
165
|
+
attribute :color, ColorType
|
|
166
|
+
|
|
167
|
+
xml do
|
|
168
|
+
element 'Ceramic'
|
|
169
|
+
namespace CeramicNamespace
|
|
170
|
+
map_element 'Type', to: :type
|
|
171
|
+
map_element 'Color', to: :color
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Color element can use any prefix for the color namespace:
|
|
176
|
+
xml = <<~XML
|
|
177
|
+
<Ceramic xmlns="http://example.com/ceramic"
|
|
178
|
+
xmlns:c="http://example.com/color">
|
|
179
|
+
<Type>Porcelain</Type>
|
|
180
|
+
<c:Color>Navy Blue</c:Color>
|
|
181
|
+
</Ceramic>
|
|
182
|
+
XML
|
|
183
|
+
|
|
184
|
+
result = Ceramic.from_xml(xml)
|
|
185
|
+
result.color # => "Navy Blue"
|
|
186
|
+
----
|
|
187
|
+
====
|
|
188
|
+
|
|
189
|
+
==== Round-trip serialization
|
|
190
|
+
|
|
191
|
+
Models support round-trip serialization between different namespace formats. You
|
|
192
|
+
can parse XML with any prefix format and serialize to either default or prefixed
|
|
193
|
+
format:
|
|
194
|
+
|
|
195
|
+
.Round-trip with different formats
|
|
196
|
+
[example]
|
|
197
|
+
====
|
|
198
|
+
[source,ruby]
|
|
199
|
+
----
|
|
200
|
+
# Parse XML with arbitrary prefix
|
|
201
|
+
xml_arbitrary = '<pottery:Ceramic xmlns:pottery="http://example.com/ceramic"><pottery:Type>Porcelain</pottery:Type></pottery:Ceramic>'
|
|
202
|
+
|
|
203
|
+
ceramic = Ceramic.from_xml(xml_arbitrary)
|
|
204
|
+
|
|
205
|
+
# Serialize to default namespace format
|
|
206
|
+
ceramic.to_xml
|
|
207
|
+
# => '<Ceramic xmlns="http://example.com/ceramic"><Type>Porcelain</Type></Ceramic>'
|
|
208
|
+
|
|
209
|
+
# Serialize to prefixed format with model's defined prefix
|
|
210
|
+
ceramic.to_xml(prefix: true)
|
|
211
|
+
# => '<cer:Ceramic xmlns:cer="http://example.com/ceramic"><cer:Type>Porcelain</cer:Type></cer:Ceramic>'
|
|
212
|
+
----
|
|
213
|
+
|
|
214
|
+
Both serialized formats can be parsed back successfully, demonstrating full prefix independence.
|
|
215
|
+
====
|
|
216
|
+
|
|
217
|
+
== Namespace Format Preservation (Round Trip)
|
|
218
|
+
|
|
219
|
+
=== Automatic Preservation
|
|
220
|
+
|
|
221
|
+
Lutaml::Model automatically preserves the namespace format from input XML:
|
|
222
|
+
|
|
223
|
+
.Default format preservation
|
|
224
|
+
[example]
|
|
225
|
+
====
|
|
226
|
+
[source,ruby]
|
|
227
|
+
----
|
|
228
|
+
# Parse XML with default format
|
|
229
|
+
xml = '<Model xmlns="http://example.com"><field>value</field></Model>'
|
|
230
|
+
model = Model.from_xml(xml)
|
|
231
|
+
|
|
232
|
+
# Serialize preserves default format
|
|
233
|
+
model.to_xml
|
|
234
|
+
# => '<Model xmlns="http://example.com">...</Model>'
|
|
235
|
+
----
|
|
236
|
+
====
|
|
237
|
+
|
|
238
|
+
.Prefix format preservation
|
|
239
|
+
[example]
|
|
240
|
+
====
|
|
241
|
+
[source,ruby]
|
|
242
|
+
----
|
|
243
|
+
# Parse XML with prefix format
|
|
244
|
+
xml = '<ex:Model xmlns:ex="http://example.com"><ex:field>value</ex:field></ex:Model>'
|
|
245
|
+
model = Model.from_xml(xml)
|
|
246
|
+
|
|
247
|
+
# Serialize preserves prefix format
|
|
248
|
+
model.to_xml
|
|
249
|
+
# => '<ex:Model xmlns:ex="http://example.com">...</ex:Model>'
|
|
250
|
+
----
|
|
251
|
+
====
|
|
252
|
+
|
|
253
|
+
=== Implementation Architecture
|
|
254
|
+
|
|
255
|
+
The format preservation uses a four-phase process:
|
|
256
|
+
|
|
257
|
+
1. **Phase 1: Input Format Capture** - During XML parsing, namespace declarations are extracted with their format (`:default` or `:prefix`)
|
|
258
|
+
2. **Phase 2: Metadata Storage** - Format information is stored on the model instance as `@__input_namespaces`
|
|
259
|
+
3. **Phase 3: Declaration Planning** - The DeclarationPlanner receives input namespaces and matches by URI to preserve format
|
|
260
|
+
4. **Phase 4: Serialization** - The adapter applies the planned declarations with preserved format
|
|
261
|
+
|
|
262
|
+
=== Programmatic Models
|
|
263
|
+
|
|
264
|
+
For models created programmatically (not from XML), the format is determined by:
|
|
265
|
+
|
|
266
|
+
1. Explicit `prefix` option: `model.to_xml(prefix: true/false)`
|
|
267
|
+
2. Namespace configuration: `prefix_default` in XmlNamespace class
|
|
268
|
+
3. W3C rules: Attributes in element's namespace require prefix format
|
|
269
|
+
4. Default: Prefer default format (cleaner output)
|
|
270
|
+
|
|
271
|
+
=== Format Priority
|
|
272
|
+
|
|
273
|
+
When multiple format sources exist, priority is:
|
|
274
|
+
|
|
275
|
+
1. **Input format** (from parsed XML) - Highest priority, always preserved
|
|
276
|
+
2. **Explicit option** (`prefix: true/false`)
|
|
277
|
+
3. **W3C compliance** (e.g., attributes require prefix)
|
|
278
|
+
4. **Namespace configuration** (`prefix_default`)
|
|
279
|
+
5. **Default format** - Lowest priority
|
|
280
|
+
|
|
281
|
+
=== Adapter Support
|
|
282
|
+
|
|
283
|
+
All three XML adapters support format preservation:
|
|
284
|
+
|
|
285
|
+
* **Nokogiri** - Full support ✅
|
|
286
|
+
* **Ox** - Full support ✅
|
|
287
|
+
* **Oga** - Full support ✅
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
==== Elements in blank namespace
|
|
291
|
+
|
|
292
|
+
When you need an element to have NO namespace (not even inherit parent
|
|
293
|
+
namespace), create a child model class without a namespace declaration.
|
|
294
|
+
|
|
295
|
+
.Using child model class for elements in blank namespace
|
|
296
|
+
[example]
|
|
297
|
+
====
|
|
298
|
+
[source,ruby]
|
|
299
|
+
----
|
|
300
|
+
# Child model with no namespace
|
|
301
|
+
class Note < Lutaml::Model::Serializable
|
|
302
|
+
attribute :value, :string
|
|
303
|
+
|
|
304
|
+
xml do
|
|
305
|
+
element "Note"
|
|
306
|
+
# No namespace declaration = blank namespace
|
|
307
|
+
map_content to: :value
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
class MixedModel < Lutaml::Model::Serializable
|
|
312
|
+
attribute :type, :string
|
|
313
|
+
attribute :note, Note
|
|
314
|
+
|
|
315
|
+
xml do
|
|
316
|
+
element "Ceramic"
|
|
317
|
+
namespace CeramicNamespace
|
|
318
|
+
map_element "Type", to: :type
|
|
319
|
+
map_element "Note", to: :note # Uses Note's namespace (blank)
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
----
|
|
323
|
+
|
|
324
|
+
**When parent uses prefixed namespace** (recommended):
|
|
325
|
+
|
|
326
|
+
Unprefixed child elements naturally have no namespace:
|
|
327
|
+
|
|
328
|
+
[source,xml]
|
|
329
|
+
----
|
|
330
|
+
<cer:Ceramic xmlns:cer="http://example.com/ceramic">
|
|
331
|
+
<cer:Type>Porcelain</cer:Type>
|
|
332
|
+
<Note>This element has no namespace</Note>
|
|
333
|
+
</cer:Ceramic>
|
|
334
|
+
----
|
|
335
|
+
|
|
336
|
+
**When parent uses default namespace**:
|
|
337
|
+
|
|
338
|
+
Must use `xmlns=""` to explicitly remove the namespace:
|
|
339
|
+
|
|
340
|
+
[source,xml]
|
|
341
|
+
----
|
|
342
|
+
<Ceramic xmlns="http://example.com/ceramic">
|
|
343
|
+
<Type>Porcelain</Type>
|
|
344
|
+
<Note xmlns="">This element has no namespace</Note>
|
|
345
|
+
</Ceramic>
|
|
346
|
+
----
|
|
347
|
+
|
|
348
|
+
Per W3C XML Namespace specification, unprefixed elements normally inherit their
|
|
349
|
+
parent's default namespace. The `xmlns=""` declaration explicitly removes that
|
|
350
|
+
inheritance.
|
|
351
|
+
|
|
352
|
+
**Parsing support**: All three adapters (Nokogiri, Ox, Oga) correctly handle both patterns.
|
|
353
|
+
====
|
|
354
|
+
|
|
355
|
+
[[namespace-priority-system]]
|
|
356
|
+
==== Namespace assignment priority
|
|
357
|
+
|
|
358
|
+
Namespace resolution follows a strict priority system when multiple namespace
|
|
359
|
+
sources are available:
|
|
360
|
+
|
|
361
|
+
.Namespace priority (highest to lowest)
|
|
362
|
+
[cols="1,3,2"]
|
|
363
|
+
|===
|
|
364
|
+
| Priority | Source | Example
|
|
365
|
+
|
|
366
|
+
| 1 (HIGHEST)
|
|
367
|
+
| Model-level namespace
|
|
368
|
+
| `attribute :attr, ChildModel` where `ChildModel` has `namespace`
|
|
369
|
+
|
|
370
|
+
| 2
|
|
371
|
+
| Type level
|
|
372
|
+
| `attribute :attr, CustomType` where `CustomType` has `xml_namespace`
|
|
373
|
+
|
|
374
|
+
| 3 (LOWEST)
|
|
375
|
+
| Context level (schema defaults)
|
|
376
|
+
| `element_form_default: :qualified` in parent namespace
|
|
377
|
+
|===
|
|
378
|
+
|
|
379
|
+
.Priority in action
|
|
380
|
+
[example]
|
|
381
|
+
====
|
|
382
|
+
[source,ruby]
|
|
383
|
+
----
|
|
384
|
+
class ItemNamespace < Lutaml::Model::XmlNamespace
|
|
385
|
+
uri "http://example.com/items"
|
|
386
|
+
prefix_default "item"
|
|
387
|
+
element_form_default :qualified
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
class BlankNamespace < Lutaml::Model::XmlNamespace
|
|
391
|
+
uri "" # Blank namespace
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
class PriceType < Lutaml::Model::Type::String
|
|
395
|
+
xml_namespace PriceNamespace # Type-level namespace
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
# Child model in blank namespace
|
|
399
|
+
class Name < Lutaml::Model::Serializable
|
|
400
|
+
attribute :value, :string
|
|
401
|
+
|
|
402
|
+
xml do
|
|
403
|
+
element "name"
|
|
404
|
+
namespace BlankNamespace # Model-level namespace (blank)
|
|
405
|
+
map_content to: :value
|
|
406
|
+
end
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
class Product < Lutaml::Model::Serializable
|
|
410
|
+
attribute :name, Name
|
|
411
|
+
attribute :price, PriceType
|
|
412
|
+
attribute :note, :string
|
|
413
|
+
|
|
414
|
+
xml do
|
|
415
|
+
element "product"
|
|
416
|
+
namespace ItemNamespace
|
|
417
|
+
|
|
418
|
+
# Priority 1: Model-level namespace (blank)
|
|
419
|
+
map_element "name", to: :name
|
|
420
|
+
|
|
421
|
+
# Priority 2: Type-level namespace
|
|
422
|
+
map_element "price", to: :price
|
|
423
|
+
|
|
424
|
+
# Priority 3: Context from schema (qualified by default)
|
|
425
|
+
map_element "note", to: :note
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
----
|
|
429
|
+
|
|
430
|
+
Result with `prefix: true`:
|
|
431
|
+
|
|
432
|
+
[source,xml]
|
|
433
|
+
----
|
|
434
|
+
<item:product xmlns:item="http://example.com/items"
|
|
435
|
+
xmlns:price="http://example.com/prices">
|
|
436
|
+
<name>Widget</name> <!-- Priority 1: model namespace (blank) -->
|
|
437
|
+
<price:price>19.99</price:price> <!-- Priority 2: type namespace -->
|
|
438
|
+
<item:note>Description</item:note> <!-- Priority 3: schema qualified -->
|
|
439
|
+
</item:product>
|
|
440
|
+
----
|
|
441
|
+
====
|
|
442
|
+
|
|
443
|
+
==== Implementation note
|
|
444
|
+
|
|
445
|
+
This prefix-independent behavior is achieved through namespace URI matching
|
|
446
|
+
during XML parsing. The implementation compares namespace URIs (not prefix
|
|
447
|
+
strings) when matching elements to model attributes, ensuring W3C compliance and
|
|
448
|
+
maximum interoperability.
|
|
449
|
+
|
|
450
|
+
=== W3C Standard Namespaces
|
|
451
|
+
|
|
452
|
+
==== The xml Namespace
|
|
453
|
+
|
|
454
|
+
The `xml` namespace (`http://www.w3.org/XML/1998/namespace`) has special status in W3C XML specifications:
|
|
455
|
+
|
|
456
|
+
* The prefix `xml` is **reserved and implicitly bound** to this URI
|
|
457
|
+
* **MUST NOT** be declared with `xmlns:xml="..."`
|
|
458
|
+
* Always available for xml:lang, xml:space, xml:base, xml:id attributes
|
|
459
|
+
|
|
460
|
+
Lutaml::Model correctly handles this W3C requirement - the xml namespace is never declared in serialized XML.
|
|
461
|
+
|
|
462
|
+
.Using W3C xml namespace attributes
|
|
463
|
+
[example]
|
|
464
|
+
====
|
|
465
|
+
[source,ruby]
|
|
466
|
+
----
|
|
467
|
+
class XmlNamespace < Lutaml::Model::XmlNamespace
|
|
468
|
+
uri "http://www.w3.org/XML/1998/namespace"
|
|
469
|
+
prefix_default "xml"
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
class XmlLangType < Lutaml::Model::Type::String
|
|
473
|
+
xml_namespace XmlNamespace
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
class XmlSpaceType < Lutaml::Model::Type::String
|
|
477
|
+
xml_namespace XmlNamespace
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
class Document < Lutaml::Model::Serializable
|
|
481
|
+
attribute :lang, XmlLangType
|
|
482
|
+
attribute :space, XmlSpaceType
|
|
483
|
+
attribute :content, :string
|
|
484
|
+
|
|
485
|
+
xml do
|
|
486
|
+
root "doc"
|
|
487
|
+
map_attribute "lang", to: :lang
|
|
488
|
+
map_attribute "space", to: :space
|
|
489
|
+
map_content to: :content
|
|
490
|
+
end
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
doc = Document.new(lang: "en", space: "preserve", content: " Text ")
|
|
494
|
+
puts doc.to_xml
|
|
495
|
+
----
|
|
496
|
+
|
|
497
|
+
Output:
|
|
498
|
+
|
|
499
|
+
[source,xml]
|
|
500
|
+
----
|
|
501
|
+
<doc xml:lang="en" xml:space="preserve"> Text </doc>
|
|
502
|
+
----
|
|
503
|
+
|
|
504
|
+
NOTE: No `xmlns:xml` declaration appears - the xml namespace is implicitly bound per W3C specification.
|
|
505
|
+
====
|
|
506
|
+
|
|
507
|
+
.Common xml namespace attributes
|
|
508
|
+
[cols="1,3"]
|
|
509
|
+
|===
|
|
510
|
+
| Attribute | Purpose
|
|
511
|
+
|
|
512
|
+
| `xml:lang`
|
|
513
|
+
| Specifies the natural language of content (RFC 5646 language tags)
|
|
514
|
+
|
|
515
|
+
| `xml:space`
|
|
516
|
+
| Controls whitespace handling (`default` or `preserve`)
|
|
517
|
+
|
|
518
|
+
| `xml:id`
|
|
519
|
+
| Provides unique identifiers (W3C XML ID)
|
|
520
|
+
|
|
521
|
+
| `xml:base`
|
|
522
|
+
| Sets base URI for relative URI resolution
|
|
523
|
+
|
|
524
|
+
|===
|
|
525
|
+
|
|
526
|
+
=== XML namespace
|
|
527
|
+
|
|
528
|
+
==== General
|
|
529
|
+
|
|
530
|
+
An XML namespace is represented in Lutaml::Model as an inherited class from
|
|
531
|
+
`XmlNamespace`. Model and value classes can declare their namespace using such
|
|
532
|
+
XML namespace class.
|
|
533
|
+
|
|
534
|
+
The `XmlNamespace` class provides a declarative way to define XML namespace
|
|
535
|
+
metadata following W3C XML Namespace and XSD specifications.
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
==== W3C XML namespace types
|
|
539
|
+
|
|
540
|
+
Lutaml::Model provides pre-defined type classes for W3C xml namespace attributes with built-in validation and serialization support.
|
|
541
|
+
|
|
542
|
+
.Available W3C XML attribute types
|
|
543
|
+
[cols="1,2,2,2"]
|
|
544
|
+
|===
|
|
545
|
+
| Type Class | Symbol | Purpose | Validation
|
|
546
|
+
|
|
547
|
+
| `Lutaml::Model::Xml::W3c::XmlLangType`
|
|
548
|
+
| `:xml_lang`
|
|
549
|
+
| Language identification (RFC 5646)
|
|
550
|
+
| Accepts any valid language tag
|
|
551
|
+
|
|
552
|
+
| `Lutaml::Model::Xml::W3c::XmlSpaceType`
|
|
553
|
+
| `:xml_space`
|
|
554
|
+
| Whitespace handling control
|
|
555
|
+
| Only "default" or "preserve"
|
|
556
|
+
|
|
557
|
+
| `Lutaml::Model::Xml::W3c::XmlBaseType`
|
|
558
|
+
| `:xml_base`
|
|
559
|
+
| Base URI for relative references
|
|
560
|
+
| Accepts any valid URI string
|
|
561
|
+
|
|
562
|
+
| `Lutaml::Model::Xml::W3c::XmlIdType`
|
|
563
|
+
| `:xml_id`
|
|
564
|
+
| Unique identifier (XML ID type)
|
|
565
|
+
| Must be valid NCName
|
|
566
|
+
|===
|
|
567
|
+
|
|
568
|
+
==== W3C XSI namespace types
|
|
569
|
+
|
|
570
|
+
The XSI namespace (`xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`) is used for schema validation hints.
|
|
571
|
+
|
|
572
|
+
.Available W3C XSI attribute types
|
|
573
|
+
[cols="1,2,2,2"]
|
|
574
|
+
|===
|
|
575
|
+
| Type Class | Symbol | Purpose | Validation
|
|
576
|
+
|
|
577
|
+
| `Lutaml::Model::Xml::W3c::XsiType`
|
|
578
|
+
| `:xsi_type`
|
|
579
|
+
| Element type annotation (QName)
|
|
580
|
+
| Accepts any QName string
|
|
581
|
+
|
|
582
|
+
| `Lutaml::Model::Xml::W3c::XsiNil`
|
|
583
|
+
| `:xsi_nil`
|
|
584
|
+
| Nil indicator
|
|
585
|
+
| Only "true" or "false"
|
|
586
|
+
|
|
587
|
+
| `Lutaml::Model::Xml::W3c::XsiSchemaLocationType`
|
|
588
|
+
| `:xsi_schema_location`
|
|
589
|
+
| Schema location pairs
|
|
590
|
+
| Whitespace-separated URI pairs
|
|
591
|
+
|
|
592
|
+
| `Lutaml::Model::Xml::W3c::XsiNoNamespaceSchemaLocationType`
|
|
593
|
+
| `:xsi_no_namespace_schema_location`
|
|
594
|
+
| Schema location without namespace
|
|
595
|
+
| Single URI
|
|
596
|
+
|===
|
|
597
|
+
|
|
598
|
+
.Using W3C XSI attribute types
|
|
599
|
+
[example]
|
|
600
|
+
====
|
|
601
|
+
[source,ruby]
|
|
602
|
+
----
|
|
603
|
+
class Item < Lutaml::Model::Serializable
|
|
604
|
+
attribute :nil_attr, :xsi_nil
|
|
605
|
+
attribute :type_attr, :xsi_type
|
|
606
|
+
|
|
607
|
+
xml do
|
|
608
|
+
element "Item"
|
|
609
|
+
end
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
item = Item.new(nil_attr: "true", type_attr: "string")
|
|
613
|
+
puts item.to_xml
|
|
614
|
+
# => <Item xsi:nil="true" xsi:type="string"
|
|
615
|
+
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
|
|
616
|
+
|
|
617
|
+
# Invalid xsi:nil value raises error
|
|
618
|
+
Item.new(nil_attr: "maybe")
|
|
619
|
+
# => ArgumentError: xsi:nil must be 'true' or 'false'
|
|
620
|
+
----
|
|
621
|
+
====
|
|
622
|
+
|
|
623
|
+
==== W3C XLink namespace types
|
|
624
|
+
|
|
625
|
+
The XLink namespace (`xmlns:xlink="http://www.w3.org/1999/xlink"`) is used for hyperlinks and references.
|
|
626
|
+
|
|
627
|
+
.Available W3C XLink attribute types
|
|
628
|
+
[cols="1,2,2,2"]
|
|
629
|
+
|===
|
|
630
|
+
| Type Class | Symbol | Purpose | Validation
|
|
631
|
+
|
|
632
|
+
| `Lutaml::Model::Xml::W3c::XlinkHrefType`
|
|
633
|
+
| `:xlink_href`
|
|
634
|
+
| Link target URI
|
|
635
|
+
| Any valid URI
|
|
636
|
+
|
|
637
|
+
| `Lutaml::Model::Xml::W3c::XlinkTypeAttrType`
|
|
638
|
+
| `:xlink_type`
|
|
639
|
+
| Link type
|
|
640
|
+
| "simple", "extended", "locator", "arc", "resource", "title"
|
|
641
|
+
|
|
642
|
+
| `Lutaml::Model::Xml::W3c::XlinkRoleType`
|
|
643
|
+
| `:xlink_role`
|
|
644
|
+
| Role URI
|
|
645
|
+
| Any valid URI
|
|
646
|
+
|
|
647
|
+
| `Lutaml::Model::Xml::W3c::XlinkArcroleType`
|
|
648
|
+
| `:xlink_arcrole`
|
|
649
|
+
| Arc role URI
|
|
650
|
+
| Any valid URI
|
|
651
|
+
|
|
652
|
+
| `Lutaml::Model::Xml::W3c::XlinkTitleType`
|
|
653
|
+
| `:xlink_title`
|
|
654
|
+
| Human-readable title
|
|
655
|
+
| Any string
|
|
656
|
+
|
|
657
|
+
| `Lutaml::Model::Xml::W3c::XlinkShowType`
|
|
658
|
+
| `:xlink_show`
|
|
659
|
+
| Display behavior
|
|
660
|
+
| "new", "replace", "embed", "other", "none"
|
|
661
|
+
|
|
662
|
+
| `Lutaml::Model::Xml::W3c::XlinkActuateType`
|
|
663
|
+
| `:xlink_actuate`
|
|
664
|
+
| Timing
|
|
665
|
+
| "onLoad", "onRequest", "other", "none"
|
|
666
|
+
|===
|
|
667
|
+
|
|
668
|
+
.Using W3C XLink attribute types
|
|
669
|
+
[example]
|
|
670
|
+
====
|
|
671
|
+
[source,ruby]
|
|
672
|
+
----
|
|
673
|
+
class Link < Lutaml::Model::Serializable
|
|
674
|
+
attribute :href, :xlink_href
|
|
675
|
+
attribute :title, :xlink_title
|
|
676
|
+
attribute :show, :xlink_show
|
|
677
|
+
attribute :actuate, :xlink_actuate
|
|
678
|
+
|
|
679
|
+
xml do
|
|
680
|
+
element "Link"
|
|
681
|
+
end
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
link = Link.new(
|
|
685
|
+
href: "http://example.com",
|
|
686
|
+
title: "Example",
|
|
687
|
+
show: "new",
|
|
688
|
+
actuate: "onRequest"
|
|
689
|
+
)
|
|
690
|
+
|
|
691
|
+
puts link.to_xml
|
|
692
|
+
# => <Link xlink:href="http://example.com" xlink:title="Example"
|
|
693
|
+
# xlink:show="new" xlink:actuate="onRequest"
|
|
694
|
+
# xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
|
695
|
+
|
|
696
|
+
# Invalid xlink:show value raises error
|
|
697
|
+
Link.new(show: "invalid")
|
|
698
|
+
# => ArgumentError: xlink:show must be one of: new, replace, embed, other, none
|
|
699
|
+
----
|
|
700
|
+
====
|
|
701
|
+
|
|
702
|
+
==== Symbol-based access for W3C types
|
|
703
|
+
|
|
704
|
+
All W3C types are registered with `Lutaml::Model::Type.register`, enabling convenient symbol-based attribute access:
|
|
705
|
+
|
|
706
|
+
[source,ruby]
|
|
707
|
+
----
|
|
708
|
+
# Instead of:
|
|
709
|
+
attribute :lang, Lutaml::Model::Xml::W3c::XmlLangType
|
|
710
|
+
|
|
711
|
+
# You can use:
|
|
712
|
+
attribute :lang, :xml_lang
|
|
713
|
+
|
|
714
|
+
# All symbols map to their corresponding type:
|
|
715
|
+
# :xml_lang => XmlLangType
|
|
716
|
+
# :xml_space => XmlSpaceType
|
|
717
|
+
# :xml_base => XmlBaseType
|
|
718
|
+
# :xml_id => XmlIdType
|
|
719
|
+
# :xsi_type => XsiType
|
|
720
|
+
# :xsi_nil => XsiNil
|
|
721
|
+
# :xsi_schema_location => XsiSchemaLocationType
|
|
722
|
+
# :xlink_href => XlinkHrefType
|
|
723
|
+
# :xlink_type => XlinkTypeAttrType
|
|
724
|
+
# :xlink_role => XlinkRoleType
|
|
725
|
+
# :xlink_arcrole => XlinkArcroleType
|
|
726
|
+
# :xlink_title => XlinkTitleType
|
|
727
|
+
# :xlink_show => XlinkShowType
|
|
728
|
+
# :xlink_actuate => XlinkActuateType
|
|
729
|
+
----
|
|
730
|
+
|
|
731
|
+
==== W3C reserved namespace warning
|
|
732
|
+
|
|
733
|
+
When defining a namespace, if you use a W3C-reserved URI or prefix, Lutaml::Model will issue a warning:
|
|
734
|
+
|
|
735
|
+
[source,ruby]
|
|
736
|
+
----
|
|
737
|
+
# WARNING: Defining namespace with W3C-reserved URI/prefix
|
|
738
|
+
class BadNamespace < Lutaml::Model::Xml::Namespace
|
|
739
|
+
uri "http://www.w3.org/XML/1998/namespace" # W3C-reserved URI
|
|
740
|
+
prefix_default "xsi" # W3C-reserved prefix
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
ns = BadNamespace.new
|
|
744
|
+
# => [WARNING] Defining a namespace with W3C-reserved URI 'http://www.w3.org/XML/1998/namespace'.
|
|
745
|
+
# Use Lutaml::Model::Xml::W3c::XmlNamespace for xml: attributes...
|
|
746
|
+
----
|
|
747
|
+
|
|
748
|
+
This helps ensure you use the official Lutaml-provided W3C namespace classes instead of redefining them.
|
|
749
|
+
|
|
750
|
+
.Using W3C XML attribute types with validation
|
|
751
|
+
[example]
|
|
752
|
+
====
|
|
753
|
+
[source,ruby]
|
|
754
|
+
----
|
|
755
|
+
class Article < Lutaml::Model::Serializable
|
|
756
|
+
attribute :lang, Lutaml::Model::Xml::W3c::XmlLangType
|
|
757
|
+
attribute :space, Lutaml::Model::Xml::W3c::XmlSpaceType
|
|
758
|
+
attribute :id, Lutaml::Model::Xml::W3c::XmlIdType
|
|
759
|
+
attribute :base, Lutaml::Model::Xml::W3c::XmlBaseType
|
|
760
|
+
attribute :title, :string
|
|
761
|
+
attribute :content, :string
|
|
762
|
+
|
|
763
|
+
xml do
|
|
764
|
+
root "article"
|
|
765
|
+
map_attribute "lang", to: :lang
|
|
766
|
+
map_attribute "space", to: :space
|
|
767
|
+
map_attribute "id", to: :id
|
|
768
|
+
map_attribute "base", to: :base
|
|
769
|
+
map_element "title", to: :title
|
|
770
|
+
map_content to: :content
|
|
771
|
+
end
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
# Valid usage
|
|
775
|
+
article = Article.new(
|
|
776
|
+
lang: "en-US",
|
|
777
|
+
space: "preserve",
|
|
778
|
+
id: "article1",
|
|
779
|
+
base: "http://example.com/",
|
|
780
|
+
title: "Title",
|
|
781
|
+
content: " Content with spaces "
|
|
782
|
+
)
|
|
783
|
+
|
|
784
|
+
puts article.to_xml
|
|
785
|
+
----
|
|
786
|
+
|
|
787
|
+
Output:
|
|
788
|
+
|
|
789
|
+
[source,xml]
|
|
790
|
+
----
|
|
791
|
+
<article xml:lang="en-US" xml:space="preserve" xml:id="article1" xml:base="http://example.com/">
|
|
792
|
+
<title>Title</title>
|
|
793
|
+
Content with spaces
|
|
794
|
+
</article>
|
|
795
|
+
----
|
|
796
|
+
|
|
797
|
+
Invalid usage raises errors:
|
|
798
|
+
|
|
799
|
+
[source,ruby]
|
|
800
|
+
----
|
|
801
|
+
# Invalid xml:space value
|
|
802
|
+
Article.new(space: "compact")
|
|
803
|
+
# => ArgumentError: xml:space must be 'default' or 'preserve'
|
|
804
|
+
|
|
805
|
+
# All W3C xml attributes serialize with xml: prefix
|
|
806
|
+
# No xmlns:xml declaration is ever generated
|
|
807
|
+
----
|
|
808
|
+
====
|
|
809
|
+
|
|
810
|
+
This enables automatic namespace qualification of elements and attributes based
|
|
811
|
+
on their type, following W3C XML Namespace specifications.
|
|
812
|
+
|
|
813
|
+
This approach centralizes namespace configuration and enables:
|
|
814
|
+
|
|
815
|
+
* Reusable namespace definitions across models
|
|
816
|
+
* Full XSD generation support with proper namespace declarations
|
|
817
|
+
* Control over element and attribute qualification
|
|
818
|
+
* Documentation and versioning of schemas
|
|
819
|
+
* Schema imports and includes
|
|
820
|
+
|
|
821
|
+
According to the W3C XML Namespace specification, unprefixed elements and
|
|
822
|
+
attributes are handled differently:
|
|
823
|
+
|
|
824
|
+
* unprefixed elements are considered to be in the default namespace (the
|
|
825
|
+
declared default namespace of the parent, or the blank namespace if none is
|
|
826
|
+
declared)
|
|
827
|
+
|
|
828
|
+
* unprefixed attributes are considered to be in the blank namespace unless
|
|
829
|
+
explicitly declared with a prefix.
|
|
830
|
+
|
|
831
|
+
Lutaml Models and Value types can each be specified to belong to an XML
|
|
832
|
+
namespace via their respective namespace methods (model: `namespace` method in
|
|
833
|
+
the `xml` block, value: `xml_namespace` method in the class). These models and
|
|
834
|
+
types will always serialize their elements and attributes qualified with their
|
|
835
|
+
namespace, either as the default namespace or with a prefix.
|
|
836
|
+
|
|
837
|
+
For models (i.e. serialized into XSD Types) and value types, the
|
|
838
|
+
`element_form_default` and `attribute_form_default` settings in the
|
|
839
|
+
`XmlNamespace` class are used to control the qualification of them within the
|
|
840
|
+
parent.
|
|
841
|
+
|
|
842
|
+
For example:
|
|
843
|
+
|
|
844
|
+
.Unqualified elements and attributes by default
|
|
845
|
+
====
|
|
846
|
+
[source,ruby]
|
|
847
|
+
----
|
|
848
|
+
class MyNamespace < Lutaml::Model::XmlNamespace
|
|
849
|
+
uri 'http://example.com/myns'
|
|
850
|
+
prefix_default 'myns'
|
|
851
|
+
element_form_default :qualified
|
|
852
|
+
attribute_form_default :unqualified
|
|
853
|
+
end
|
|
854
|
+
|
|
855
|
+
class MyModel < Lutaml::Model::Serializable
|
|
856
|
+
attribute :name, :string
|
|
857
|
+
attribute :age, :integer
|
|
858
|
+
|
|
859
|
+
xml do
|
|
860
|
+
element 'MyType'
|
|
861
|
+
namespace MyNamespace
|
|
862
|
+
map_element 'name', to: :name
|
|
863
|
+
map_attribute 'age', to: :age
|
|
864
|
+
end
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
my_model = MyModel.new(name: "Example", age: 30)
|
|
868
|
+
|
|
869
|
+
puts my_model.to_xml # defaults to using default prefix
|
|
870
|
+
#=>
|
|
871
|
+
<MyType xmlns:hello="http://example.com/myns" age="30">
|
|
872
|
+
<name>Example</name>
|
|
873
|
+
</MyType>
|
|
874
|
+
# Note: No prefix on elements (W3C Namespace standard says unprefixed elements
|
|
875
|
+
# are in default namespace), no prefix on attribute (W3C Namespace standard says
|
|
876
|
+
# unprefixed attributes are in blank namespace)
|
|
877
|
+
|
|
878
|
+
puts my_model.to_xml(prefix: "hello") # Force custom prefix usage
|
|
879
|
+
#=>
|
|
880
|
+
<hello:MyType xmlns:hello="http://example.com/myns" age="30">
|
|
881
|
+
<hello:name>Example</hello:name>
|
|
882
|
+
</hello:MyType>
|
|
883
|
+
# Note: Prefix on elements (qualified), no prefix on attribute (unqualified)
|
|
884
|
+
----
|
|
885
|
+
====
|
|
886
|
+
|
|
887
|
+
.Qualified attributes force prefixes
|
|
888
|
+
====
|
|
889
|
+
[source,ruby]
|
|
890
|
+
----
|
|
891
|
+
class MyNamespace < Lutaml::Model::XmlNamespace
|
|
892
|
+
uri 'http://example.com/myns'
|
|
893
|
+
prefix_default 'myns'
|
|
894
|
+
element_form_default :qualified
|
|
895
|
+
attribute_form_default :qualified
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
class MyModel < Lutaml::Model::Serializable
|
|
899
|
+
attribute :name, :string
|
|
900
|
+
attribute :age, :integer
|
|
901
|
+
|
|
902
|
+
xml do
|
|
903
|
+
element 'MyType'
|
|
904
|
+
namespace MyNamespace
|
|
905
|
+
map_element 'name', to: :name
|
|
906
|
+
map_attribute 'age', to: :age
|
|
907
|
+
end
|
|
908
|
+
end
|
|
909
|
+
|
|
910
|
+
my_model = MyModel.new(name: "Example", age: 30)
|
|
911
|
+
puts my_model.to_xml # defaults to using default prefix, prefix is forced
|
|
912
|
+
# because attribute_form_default is :qualified, an attribute MUST be prefixed
|
|
913
|
+
# to indicate its namespace, hence the parent element must provide a prefixed
|
|
914
|
+
# namespace.
|
|
915
|
+
#=>
|
|
916
|
+
<myns:MyType xmlns:myns="http://example.com/myns" myns:age="30">
|
|
917
|
+
<myns:name>Example</myns:name>
|
|
918
|
+
</myns:MyType>
|
|
919
|
+
----
|
|
920
|
+
|
|
921
|
+
Remember it is only the no-namespace model attributes that are affected by these
|
|
922
|
+
settings of `element_form_default` and `attribute_form_default`. If an
|
|
923
|
+
attribute or element is mapped to a type that belongs to a namespace, it will be
|
|
924
|
+
qualified according to that namespace's rules.
|
|
925
|
+
====
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
.Different element and attribute namespaces
|
|
929
|
+
====
|
|
930
|
+
[source,ruby]
|
|
931
|
+
----
|
|
932
|
+
class ElementNamespace < Lutaml::Model::XmlNamespace
|
|
933
|
+
uri 'http://example.com/elementns'
|
|
934
|
+
prefix_default 'elns'
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
class AttributeNamespace < Lutaml::Model::XmlNamespace
|
|
938
|
+
uri 'http://example.com/attributens'
|
|
939
|
+
prefix_default 'atns'
|
|
940
|
+
end
|
|
941
|
+
|
|
942
|
+
class AttributeValue < Lutaml::Model::Type::String
|
|
943
|
+
xml_namespace AttributeNamespace
|
|
944
|
+
end
|
|
945
|
+
|
|
946
|
+
class MyModel < Lutaml::Model::Serializable
|
|
947
|
+
attribute :name, :string
|
|
948
|
+
attribute :type, AttributeValue
|
|
949
|
+
|
|
950
|
+
xml do
|
|
951
|
+
element 'MyType'
|
|
952
|
+
namespace ElementNamespace
|
|
953
|
+
map_element 'name', to: :name
|
|
954
|
+
map_attribute 'type', to: :type
|
|
955
|
+
end
|
|
956
|
+
end
|
|
957
|
+
|
|
958
|
+
my_model = MyModel.new(name: "Example", type: "Special")
|
|
959
|
+
puts my_model.to_xml # element uses element namespace (which defaults to the
|
|
960
|
+
# default namespace), attribute uses attribute namespace, forcing a prefixed
|
|
961
|
+
# namespace
|
|
962
|
+
#=>
|
|
963
|
+
<MyType xmlns="http://example.com/elementns"
|
|
964
|
+
xmlns:atns="http://example.com/attributens"
|
|
965
|
+
atns:type="Special">
|
|
966
|
+
<name>Example</name>
|
|
967
|
+
</MyType>
|
|
968
|
+
----
|
|
969
|
+
====
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
==== Creating namespace classes
|
|
974
|
+
|
|
975
|
+
A namespace class inherits from `Lutaml::Model::XmlNamespace`
|
|
976
|
+
and uses a DSL to declare metadata.
|
|
977
|
+
|
|
978
|
+
Syntax:
|
|
979
|
+
|
|
980
|
+
[source,ruby]
|
|
981
|
+
----
|
|
982
|
+
class MyNamespace < Lutaml::Model::XmlNamespace
|
|
983
|
+
uri 'namespace-uri' # Required: namespace URI
|
|
984
|
+
schema_location 'schema-url' # Optional: XSD location
|
|
985
|
+
prefix_default 'default-prefix' # Optional: default prefix
|
|
986
|
+
element_form_default :qualified # Optional: element qualification
|
|
987
|
+
attribute_form_default :unqualified # Optional: attribute qualification
|
|
988
|
+
version 'version-string' # Optional: schema version
|
|
989
|
+
documentation 'description' # Optional: schema documentation
|
|
990
|
+
imports OtherNamespace # Optional: imported namespaces
|
|
991
|
+
includes 'schema-file.xsd' # Optional: included schemas
|
|
992
|
+
end
|
|
993
|
+
----
|
|
994
|
+
|
|
995
|
+
==== DSL methods
|
|
996
|
+
|
|
997
|
+
===== `uri`
|
|
998
|
+
|
|
999
|
+
Sets the namespace URI that uniquely identifies this namespace.
|
|
1000
|
+
|
|
1001
|
+
Syntax:
|
|
1002
|
+
|
|
1003
|
+
[source,ruby]
|
|
1004
|
+
----
|
|
1005
|
+
uri 'namespace-uri-string'
|
|
1006
|
+
----
|
|
1007
|
+
|
|
1008
|
+
This is the fundamental identifier for the namespace, used in `xmlns`
|
|
1009
|
+
declarations.
|
|
1010
|
+
|
|
1011
|
+
.Setting namespace URI
|
|
1012
|
+
[example]
|
|
1013
|
+
====
|
|
1014
|
+
[source,ruby]
|
|
1015
|
+
----
|
|
1016
|
+
class CeramicNamespace < Lutaml::Model::XmlNamespace
|
|
1017
|
+
uri 'https://example.com/schemas/ceramic/v1'
|
|
1018
|
+
end
|
|
1019
|
+
|
|
1020
|
+
# Results in XML: xmlns="https://example.com/schemas/ceramic/v1"
|
|
1021
|
+
# Or with prefix: xmlns:cer="https://example.com/schemas/ceramic/v1"
|
|
1022
|
+
----
|
|
1023
|
+
====
|
|
1024
|
+
|
|
1025
|
+
===== `uri_aliases`
|
|
1026
|
+
|
|
1027
|
+
Declares additional URI strings that should resolve to this namespace class.
|
|
1028
|
+
This enables a single namespace class to accept multiple URI variants during parsing
|
|
1029
|
+
and preserves the original URI during serialization.
|
|
1030
|
+
|
|
1031
|
+
Syntax:
|
|
1032
|
+
|
|
1033
|
+
[source,ruby]
|
|
1034
|
+
----
|
|
1035
|
+
uri_aliases 'alias-uri-1', 'alias-uri-2', ...
|
|
1036
|
+
----
|
|
1037
|
+
|
|
1038
|
+
Use this when a schema uses multiple URI forms for the same namespace
|
|
1039
|
+
(e.g., a schema with trailing slash variant like `http://example.com/ns/` alongside
|
|
1040
|
+
the canonical `http://example.com/ns/schema.xsd`).
|
|
1041
|
+
|
|
1042
|
+
.Validating URI aliases
|
|
1043
|
+
[NOTE]
|
|
1044
|
+
====
|
|
1045
|
+
All alias URIs must be non-empty strings. Attempting to set an invalid alias
|
|
1046
|
+
(like a number or empty string) raises an `ArgumentError`.
|
|
1047
|
+
====
|
|
1048
|
+
|
|
1049
|
+
.Setting URI aliases
|
|
1050
|
+
[example]
|
|
1051
|
+
====
|
|
1052
|
+
[source,ruby]
|
|
1053
|
+
----
|
|
1054
|
+
class ReqIfNamespace < Lutaml::Model::XmlNamespace
|
|
1055
|
+
uri "http://www.omg.org/spec/ReqIF/20110401/reqif.xsd"
|
|
1056
|
+
uri_aliases "http://www.omg.org/spec/ReqIF/20110401/"
|
|
1057
|
+
prefix_default "reqif"
|
|
1058
|
+
end
|
|
1059
|
+
|
|
1060
|
+
# During parsing, both URIs resolve to ReqIfNamespace:
|
|
1061
|
+
# - "http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" (canonical)
|
|
1062
|
+
# - "http://www.omg.org/spec/ReqIF/20110401/" (alias)
|
|
1063
|
+
|
|
1064
|
+
# The namespace class methods:
|
|
1065
|
+
ReqIfNamespace.uri
|
|
1066
|
+
# => "http://www.omg.org/spec/ReqIF/20110401/reqif.xsd"
|
|
1067
|
+
|
|
1068
|
+
ReqIfNamespace.uri_aliases
|
|
1069
|
+
# => ["http://www.omg.org/spec/ReqIF/20110401/"]
|
|
1070
|
+
|
|
1071
|
+
ReqIfNamespace.all_uris
|
|
1072
|
+
# => ["http://www.omg.org/spec/ReqIF/20110401/reqif.xsd",
|
|
1073
|
+
# "http://www.omg.org/spec/ReqIF/20110401/"]
|
|
1074
|
+
|
|
1075
|
+
ReqIfNamespace.is_alias?("http://www.omg.org/spec/ReqIF/20110401/")
|
|
1076
|
+
# => true
|
|
1077
|
+
----
|
|
1078
|
+
====
|
|
1079
|
+
|
|
1080
|
+
===== `schema_location`
|
|
1081
|
+
|
|
1082
|
+
Sets the URL where the XSD schema file can be found.
|
|
1083
|
+
|
|
1084
|
+
Syntax:
|
|
1085
|
+
|
|
1086
|
+
[source,ruby]
|
|
1087
|
+
----
|
|
1088
|
+
schema_location 'schema-url-or-path'
|
|
1089
|
+
----
|
|
1090
|
+
|
|
1091
|
+
Used in `xsi:schemaLocation` attributes for schema validation.
|
|
1092
|
+
|
|
1093
|
+
.Setting schema location
|
|
1094
|
+
[example]
|
|
1095
|
+
====
|
|
1096
|
+
[source,ruby]
|
|
1097
|
+
----
|
|
1098
|
+
class CeramicNamespace < Lutaml::Model::XmlNamespace
|
|
1099
|
+
uri 'https://example.com/schemas/ceramic/v1'
|
|
1100
|
+
schema_location 'https://example.com/schemas/ceramic/v1/ceramic.xsd'
|
|
1101
|
+
end
|
|
1102
|
+
----
|
|
1103
|
+
====
|
|
1104
|
+
|
|
1105
|
+
===== `prefix_default`
|
|
1106
|
+
|
|
1107
|
+
Sets the default prefix for this namespace.
|
|
1108
|
+
|
|
1109
|
+
Syntax:
|
|
1110
|
+
|
|
1111
|
+
[source,ruby]
|
|
1112
|
+
----
|
|
1113
|
+
prefix_default 'prefix' # or :prefix (symbol)
|
|
1114
|
+
----
|
|
1115
|
+
|
|
1116
|
+
The prefix can be overridden at runtime when creating namespace instances.
|
|
1117
|
+
|
|
1118
|
+
.Setting default prefix
|
|
1119
|
+
[example]
|
|
1120
|
+
====
|
|
1121
|
+
[source,ruby]
|
|
1122
|
+
----
|
|
1123
|
+
class CeramicNamespace < Lutaml::Model::XmlNamespace
|
|
1124
|
+
uri 'https://example.com/schemas/ceramic/v1'
|
|
1125
|
+
prefix_default 'cer'
|
|
1126
|
+
end
|
|
1127
|
+
|
|
1128
|
+
# Default usage: xmlns:cer="https://..."
|
|
1129
|
+
# Runtime override: xmlns:ceramic="https://..."
|
|
1130
|
+
----
|
|
1131
|
+
====
|
|
1132
|
+
|
|
1133
|
+
===== `element_form_default`
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
Controls whether locally declared elements must be namespace-qualified by
|
|
1137
|
+
default.
|
|
1138
|
+
|
|
1139
|
+
Syntax:
|
|
1140
|
+
|
|
1141
|
+
[source,ruby]
|
|
1142
|
+
----
|
|
1143
|
+
element_form_default :qualified # or :unqualified (default)
|
|
1144
|
+
----
|
|
1145
|
+
|
|
1146
|
+
Values:
|
|
1147
|
+
|
|
1148
|
+
`:qualified`::: Local elements must include namespace prefix
|
|
1149
|
+
`:unqualified`::: Local elements have no namespace prefix (default)
|
|
1150
|
+
|
|
1151
|
+
.Setting element qualification default
|
|
1152
|
+
[example]
|
|
1153
|
+
====
|
|
1154
|
+
[source,ruby]
|
|
1155
|
+
----
|
|
1156
|
+
class CeramicNamespace < Lutaml::Model::XmlNamespace
|
|
1157
|
+
uri 'https://example.com/schemas/ceramic/v1'
|
|
1158
|
+
prefix_default 'cer'
|
|
1159
|
+
element_form_default :qualified
|
|
1160
|
+
end
|
|
1161
|
+
|
|
1162
|
+
# With :qualified, child elements get: <cer:type>...</cer:type>
|
|
1163
|
+
# With :unqualified, child elements get: <type>...</type>
|
|
1164
|
+
----
|
|
1165
|
+
====
|
|
1166
|
+
|
|
1167
|
+
===== `attribute_form_default`
|
|
1168
|
+
|
|
1169
|
+
Controls whether locally declared attributes must be namespace-qualified by
|
|
1170
|
+
default.
|
|
1171
|
+
|
|
1172
|
+
Syntax:
|
|
1173
|
+
|
|
1174
|
+
[source,ruby]
|
|
1175
|
+
----
|
|
1176
|
+
attribute_form_default :qualified # or :unqualified (default)
|
|
1177
|
+
----
|
|
1178
|
+
|
|
1179
|
+
Values:
|
|
1180
|
+
|
|
1181
|
+
`:qualified`::: Local attributes must include namespace prefix
|
|
1182
|
+
`:unqualified`::: Local attributes have no namespace prefix (default)
|
|
1183
|
+
|
|
1184
|
+
NOTE: Per W3C conventions, attributes are typically unqualified.
|
|
1185
|
+
|
|
1186
|
+
.Setting attribute qualification default
|
|
1187
|
+
[example]
|
|
1188
|
+
====
|
|
1189
|
+
[source,ruby]
|
|
1190
|
+
----
|
|
1191
|
+
class CeramicNamespace < Lutaml::Model::XmlNamespace
|
|
1192
|
+
uri 'https://example.com/schemas/ceramic/v1'
|
|
1193
|
+
prefix_default 'cer'
|
|
1194
|
+
attribute_form_default :unqualified # Typically left unqualified
|
|
1195
|
+
end
|
|
1196
|
+
----
|
|
1197
|
+
====
|
|
1198
|
+
|
|
1199
|
+
===== `imports`
|
|
1200
|
+
|
|
1201
|
+
Declares dependencies on other namespaces via XSD `import` directive.
|
|
1202
|
+
|
|
1203
|
+
Syntax:
|
|
1204
|
+
|
|
1205
|
+
[source,ruby]
|
|
1206
|
+
----
|
|
1207
|
+
imports OtherNamespace1, OtherNamespace2, ...
|
|
1208
|
+
----
|
|
1209
|
+
|
|
1210
|
+
Used when referencing types from other namespaces.
|
|
1211
|
+
|
|
1212
|
+
.Importing other namespaces
|
|
1213
|
+
[example]
|
|
1214
|
+
====
|
|
1215
|
+
[source,ruby]
|
|
1216
|
+
----
|
|
1217
|
+
class AddressNamespace < Lutaml::Model::XmlNamespace
|
|
1218
|
+
uri 'https://example.com/schemas/address/v1'
|
|
1219
|
+
prefix_default 'addr'
|
|
1220
|
+
end
|
|
1221
|
+
|
|
1222
|
+
class ContactNamespace < Lutaml::Model::XmlNamespace
|
|
1223
|
+
uri 'https://example.com/schemas/contact/v1'
|
|
1224
|
+
prefix_default 'contact'
|
|
1225
|
+
imports AddressNamespace # Import address namespace
|
|
1226
|
+
end
|
|
1227
|
+
|
|
1228
|
+
# Generates in XSD:
|
|
1229
|
+
# <xs:import namespace="https://example.com/schemas/address/v1"
|
|
1230
|
+
# schemaLocation="..." />
|
|
1231
|
+
----
|
|
1232
|
+
====
|
|
1233
|
+
|
|
1234
|
+
===== `includes`
|
|
1235
|
+
|
|
1236
|
+
Declares schema components from the same namespace via XSD `include` directive.
|
|
1237
|
+
|
|
1238
|
+
Syntax:
|
|
1239
|
+
|
|
1240
|
+
[source,ruby]
|
|
1241
|
+
----
|
|
1242
|
+
includes 'schema-file.xsd', 'another-file.xsd', ...
|
|
1243
|
+
----
|
|
1244
|
+
|
|
1245
|
+
Used for modular schema organization within the same namespace.
|
|
1246
|
+
|
|
1247
|
+
.Including schema files
|
|
1248
|
+
[example]
|
|
1249
|
+
====
|
|
1250
|
+
[source,ruby]
|
|
1251
|
+
----
|
|
1252
|
+
class ContactNamespace < Lutaml::Model::XmlNamespace
|
|
1253
|
+
uri 'https://example.com/schemas/contact/v1'
|
|
1254
|
+
prefix_default 'contact'
|
|
1255
|
+
includes 'contact-common.xsd', 'contact-extensions.xsd'
|
|
1256
|
+
end
|
|
1257
|
+
|
|
1258
|
+
# Generates in XSD:
|
|
1259
|
+
# <xs:include schemaLocation="contact-common.xsd" />
|
|
1260
|
+
# <xs:include schemaLocation="contact-extensions.xsd" />
|
|
1261
|
+
----
|
|
1262
|
+
====
|
|
1263
|
+
|
|
1264
|
+
===== `version`
|
|
1265
|
+
|
|
1266
|
+
Sets the schema version for documentation and tracking.
|
|
1267
|
+
|
|
1268
|
+
Syntax:
|
|
1269
|
+
|
|
1270
|
+
[source,ruby]
|
|
1271
|
+
----
|
|
1272
|
+
version 'version-string'
|
|
1273
|
+
----
|
|
1274
|
+
|
|
1275
|
+
.Setting schema version
|
|
1276
|
+
[example]
|
|
1277
|
+
====
|
|
1278
|
+
[source,ruby]
|
|
1279
|
+
----
|
|
1280
|
+
class ContactNamespace < Lutaml::Model::XmlNamespace
|
|
1281
|
+
uri 'https://example.com/schemas/contact/v1'
|
|
1282
|
+
version '1.0.0'
|
|
1283
|
+
end
|
|
1284
|
+
|
|
1285
|
+
# Used in XSD: <xs:schema version="1.0.0">
|
|
1286
|
+
----
|
|
1287
|
+
====
|
|
1288
|
+
|
|
1289
|
+
===== `documentation`
|
|
1290
|
+
|
|
1291
|
+
Provides human-readable description for XSD annotation.
|
|
1292
|
+
|
|
1293
|
+
Syntax:
|
|
1294
|
+
|
|
1295
|
+
[source,ruby]
|
|
1296
|
+
----
|
|
1297
|
+
documentation 'description text'
|
|
1298
|
+
----
|
|
1299
|
+
|
|
1300
|
+
.Adding documentation
|
|
1301
|
+
[example]
|
|
1302
|
+
====
|
|
1303
|
+
[source,ruby]
|
|
1304
|
+
----
|
|
1305
|
+
class ContactNamespace < Lutaml::Model::XmlNamespace
|
|
1306
|
+
uri 'https://example.com/schemas/contact/v1'
|
|
1307
|
+
documentation "Contact information schema for Example Corp"
|
|
1308
|
+
end
|
|
1309
|
+
|
|
1310
|
+
# Generates in XSD:
|
|
1311
|
+
# <xs:annotation>
|
|
1312
|
+
# <xs:documentation>Contact information schema for Example Corp</xs:documentation>
|
|
1313
|
+
# </xs:annotation>
|
|
1314
|
+
----
|
|
1315
|
+
====
|
|
1316
|
+
|
|
1317
|
+
==== Complete namespace example
|
|
1318
|
+
|
|
1319
|
+
.Fully configured XML namespace
|
|
1320
|
+
[example]
|
|
1321
|
+
====
|
|
1322
|
+
[source,ruby]
|
|
1323
|
+
----
|
|
1324
|
+
# Define dependent namespace
|
|
1325
|
+
class AddressNamespace < Lutaml::Model::XmlNamespace
|
|
1326
|
+
uri 'https://example.com/schemas/address/v1'
|
|
1327
|
+
schema_location 'https://example.com/schemas/address/v1/address.xsd'
|
|
1328
|
+
prefix_default 'addr'
|
|
1329
|
+
end
|
|
1330
|
+
|
|
1331
|
+
# Define main namespace with all features
|
|
1332
|
+
class ContactNamespace < Lutaml::Model::XmlNamespace
|
|
1333
|
+
uri 'https://example.com/schemas/contact/v1'
|
|
1334
|
+
schema_location 'https://example.com/schemas/contact/v1/contact.xsd'
|
|
1335
|
+
prefix_default 'contact'
|
|
1336
|
+
element_form_default :qualified
|
|
1337
|
+
attribute_form_default :unqualified
|
|
1338
|
+
version '1.0'
|
|
1339
|
+
documentation "Contact information schema for Example Corp"
|
|
1340
|
+
|
|
1341
|
+
imports AddressNamespace
|
|
1342
|
+
includes 'contact-common.xsd', 'contact-types.xsd'
|
|
1343
|
+
end
|
|
1344
|
+
|
|
1345
|
+
# Use namespace in model
|
|
1346
|
+
class Person < Lutaml::Model::Serializable
|
|
1347
|
+
attribute :name, :string
|
|
1348
|
+
attribute :email, :string
|
|
1349
|
+
|
|
1350
|
+
xml do
|
|
1351
|
+
element "person"
|
|
1352
|
+
namespace ContactNamespace
|
|
1353
|
+
|
|
1354
|
+
sequence do
|
|
1355
|
+
map_element "name", to: :name
|
|
1356
|
+
map_element "email", to: :email
|
|
1357
|
+
end
|
|
1358
|
+
end
|
|
1359
|
+
end
|
|
1360
|
+
|
|
1361
|
+
person = Person.new(name: "John Doe", email: "john@example.com")
|
|
1362
|
+
puts person.to_xml
|
|
1363
|
+
# => <contact:person xmlns:contact="https://example.com/schemas/contact/v1">
|
|
1364
|
+
# <contact:name>John Doe</contact:name>
|
|
1365
|
+
# <contact:email>john@example.com</contact:email>
|
|
1366
|
+
# </contact:person>
|
|
1367
|
+
----
|
|
1368
|
+
====
|
|
1369
|
+
|
|
1370
|
+
[[root-namespace]]
|
|
1371
|
+
==== Namespace identity of element or type (`namespace` method)
|
|
1372
|
+
|
|
1373
|
+
[[xml-namespace-declaration]]
|
|
1374
|
+
===== Declaration of namespace
|
|
1375
|
+
|
|
1376
|
+
The `namespace` method in the `xml` block indicates that the element or type
|
|
1377
|
+
belongs to the specified XML namespace.
|
|
1378
|
+
|
|
1379
|
+
Syntax:
|
|
1380
|
+
|
|
1381
|
+
.Setting namespace of the XML element or XML type using a XmlNamespace
|
|
1382
|
+
[source,ruby]
|
|
1383
|
+
----
|
|
1384
|
+
# Assume we have defined an XmlNamespace class called ExampleXmlNamespace
|
|
1385
|
+
|
|
1386
|
+
xml do
|
|
1387
|
+
namespace ExampleXmlNamespace
|
|
1388
|
+
end
|
|
1389
|
+
----
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
.Using the `namespace` method to set namespace for an element
|
|
1393
|
+
[example]
|
|
1394
|
+
====
|
|
1395
|
+
[source,ruby]
|
|
1396
|
+
----
|
|
1397
|
+
class CeramicXmlNamespace
|
|
1398
|
+
uri 'http://example.com/ceramic'
|
|
1399
|
+
prefix_default 'cer'
|
|
1400
|
+
end
|
|
1401
|
+
|
|
1402
|
+
class Ceramic < Lutaml::Model::Serializable
|
|
1403
|
+
attribute :type, :string
|
|
1404
|
+
attribute :glaze, :string
|
|
1405
|
+
|
|
1406
|
+
xml do
|
|
1407
|
+
element 'Ceramic'
|
|
1408
|
+
namespace CeramicXmlNamespace
|
|
1409
|
+
map_element 'Type', to: :type
|
|
1410
|
+
map_element 'Glaze', to: :glaze
|
|
1411
|
+
end
|
|
1412
|
+
end
|
|
1413
|
+
----
|
|
1414
|
+
|
|
1415
|
+
[source,xml]
|
|
1416
|
+
----
|
|
1417
|
+
<Ceramic xmlns='http://example.com/ceramic'>
|
|
1418
|
+
<Type>Porcelain</Type>
|
|
1419
|
+
<Glaze>Clear</Glaze>
|
|
1420
|
+
</Ceramic>
|
|
1421
|
+
----
|
|
1422
|
+
|
|
1423
|
+
By default, serialization using `to_xml` uses the namespace as the XML
|
|
1424
|
+
default namespace.
|
|
1425
|
+
|
|
1426
|
+
[source,ruby]
|
|
1427
|
+
----
|
|
1428
|
+
> Ceramic.from_xml(xml_file)
|
|
1429
|
+
> #<Ceramic:0x0000000104ac7240 @type="Porcelain", @glaze="Clear">
|
|
1430
|
+
> Ceramic.new(type: "Porcelain", glaze: "Clear").to_xml
|
|
1431
|
+
> #<Ceramic xmlns="http://example.com/ceramic">
|
|
1432
|
+
# <Type>Porcelain</Type>
|
|
1433
|
+
# <Glaze>Clear</Glaze>
|
|
1434
|
+
#</Ceramic>
|
|
1435
|
+
----
|
|
1436
|
+
|
|
1437
|
+
Use the `#to_xml` `prefix: true` option to force the defined prefix:
|
|
1438
|
+
|
|
1439
|
+
[source,ruby]
|
|
1440
|
+
----
|
|
1441
|
+
> Ceramic.new(type: "Porcelain", glaze: "Clear").to_xml(prefix: true)
|
|
1442
|
+
> #<cer:Ceramic xmlns:cer="http://example.com/ceramic">
|
|
1443
|
+
# <cer:Type>Porcelain</cer:Type>
|
|
1444
|
+
# <cer:Glaze>Clear</cer:Glaze>
|
|
1445
|
+
#</cer:Ceramic>
|
|
1446
|
+
----
|
|
1447
|
+
|
|
1448
|
+
Use the `#to_xml` `prefix: "custom"` option to forces a custom prefix:
|
|
1449
|
+
|
|
1450
|
+
[source,ruby]
|
|
1451
|
+
----
|
|
1452
|
+
> Ceramic.new(type: "Porcelain", glaze: "Clear").to_xml(prefix: "custom")
|
|
1453
|
+
> #<custom:Ceramic xmlns:custom="http://example.com/ceramic">
|
|
1454
|
+
# <custom:Type>Porcelain</custom:Type>
|
|
1455
|
+
# <custom:Glaze>Clear</custom:Glaze>
|
|
1456
|
+
#</custom:Ceramic>
|
|
1457
|
+
----
|
|
1458
|
+
====
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
[[xml-namespace-instance-prefix-force]]
|
|
1462
|
+
===== Force display of unused prefixes
|
|
1463
|
+
|
|
1464
|
+
In some cases, you may want to declare additional namespaces in the XML output
|
|
1465
|
+
even if they are not used by any elements.
|
|
1466
|
+
|
|
1467
|
+
This is technically not needed by W3C standards conformant XML processors, but
|
|
1468
|
+
some legacy XML processors may require it.
|
|
1469
|
+
|
|
1470
|
+
In this case, the `namespace_scope` method can be used to force declaration of
|
|
1471
|
+
additional namespaces to be included in the output.
|
|
1472
|
+
|
|
1473
|
+
.Default namespace with additional prefixed namespaces
|
|
1474
|
+
[example]
|
|
1475
|
+
====
|
|
1476
|
+
[source,ruby]
|
|
1477
|
+
----
|
|
1478
|
+
class AppNamespace < Lutaml::Model::XmlNamespace
|
|
1479
|
+
uri 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'
|
|
1480
|
+
prefix_default 'app'
|
|
1481
|
+
end
|
|
1482
|
+
|
|
1483
|
+
class VtNamespace < Lutaml::Model::XmlNamespace
|
|
1484
|
+
uri 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'
|
|
1485
|
+
prefix_default 'vt'
|
|
1486
|
+
end
|
|
1487
|
+
|
|
1488
|
+
class Properties < Lutaml::Model::Serializable
|
|
1489
|
+
attribute :template, :string
|
|
1490
|
+
|
|
1491
|
+
xml do
|
|
1492
|
+
element "Properties"
|
|
1493
|
+
namespace AppNamespace
|
|
1494
|
+
|
|
1495
|
+
# Force vt namespace to be declared even if unused
|
|
1496
|
+
namespace_scope [
|
|
1497
|
+
{ namespace: VtNamespace, declare: :always }
|
|
1498
|
+
]
|
|
1499
|
+
|
|
1500
|
+
map_element "Template", to: :template
|
|
1501
|
+
end
|
|
1502
|
+
end
|
|
1503
|
+
|
|
1504
|
+
props = Properties.new(template: "Normal.dotm")
|
|
1505
|
+
puts props.to_xml # Default: root namespace is default, others prefixed
|
|
1506
|
+
----
|
|
1507
|
+
|
|
1508
|
+
Output:
|
|
1509
|
+
|
|
1510
|
+
[source,xml]
|
|
1511
|
+
----
|
|
1512
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
|
|
1513
|
+
xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
|
|
1514
|
+
<Template>Normal.dotm</Template>
|
|
1515
|
+
</Properties>
|
|
1516
|
+
----
|
|
1517
|
+
|
|
1518
|
+
With `prefix: true` option:
|
|
1519
|
+
|
|
1520
|
+
[source,ruby]
|
|
1521
|
+
----
|
|
1522
|
+
puts props.to_xml(prefix: true)
|
|
1523
|
+
----
|
|
1524
|
+
|
|
1525
|
+
Output:
|
|
1526
|
+
|
|
1527
|
+
[source,xml]
|
|
1528
|
+
----
|
|
1529
|
+
<app:Properties xmlns:app="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
|
|
1530
|
+
xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
|
|
1531
|
+
<app:Template>Normal.dotm</app:Template>
|
|
1532
|
+
</app:Properties>
|
|
1533
|
+
----
|
|
1534
|
+
|
|
1535
|
+
NOTE: The VtNamespace always uses "vt:" prefix regardless of the `prefix:` option.
|
|
1536
|
+
====
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
[[xml-namespace-instance-prefix-override]]
|
|
1540
|
+
===== Namespace prefix override
|
|
1541
|
+
|
|
1542
|
+
Namespace prefixes can be overridden when building namespace instances.
|
|
1543
|
+
|
|
1544
|
+
.Overriding namespace prefix
|
|
1545
|
+
[example]
|
|
1546
|
+
====
|
|
1547
|
+
[source,ruby]
|
|
1548
|
+
----
|
|
1549
|
+
class ContactNamespace < Lutaml::Model::XmlNamespace
|
|
1550
|
+
uri 'https://example.com/schemas/contact/v1'
|
|
1551
|
+
prefix_default 'contact'
|
|
1552
|
+
end
|
|
1553
|
+
|
|
1554
|
+
# Use default prefix
|
|
1555
|
+
class Person < Lutaml::Model::Serializable
|
|
1556
|
+
xml do
|
|
1557
|
+
element "person"
|
|
1558
|
+
namespace ContactNamespace # Uses 'contact' prefix
|
|
1559
|
+
end
|
|
1560
|
+
end
|
|
1561
|
+
|
|
1562
|
+
# Override prefix at mapping level
|
|
1563
|
+
class ShortPerson < Lutaml::Model::Serializable
|
|
1564
|
+
xml do
|
|
1565
|
+
element "person"
|
|
1566
|
+
namespace ContactNamespace, 'c' # Override to 'c' prefix
|
|
1567
|
+
end
|
|
1568
|
+
end
|
|
1569
|
+
|
|
1570
|
+
Person.new.to_xml
|
|
1571
|
+
# => <contact:person xmlns:contact="...">...</contact:person>
|
|
1572
|
+
|
|
1573
|
+
ShortPerson.new.to_xml
|
|
1574
|
+
# => <c:person xmlns:c="...">...</c:person>
|
|
1575
|
+
----
|
|
1576
|
+
====
|
|
1577
|
+
|
|
1578
|
+
[[namespace-scope]]
|
|
1579
|
+
==== Namespace scope consolidation (`namespace_scope` method)
|
|
1580
|
+
|
|
1581
|
+
NOTE: For detailed information on xmlns declaration strategies and the
|
|
1582
|
+
minimal-subtree principle, see
|
|
1583
|
+
link:xml-namespace-declarations.adoc[XML Namespace Declarations Guide].
|
|
1584
|
+
|
|
1585
|
+
===== General
|
|
1586
|
+
|
|
1587
|
+
The `namespace_scope` directive controls where namespace declarations
|
|
1588
|
+
*are eligible to* appear in serialized XML.
|
|
1589
|
+
|
|
1590
|
+
By default, namespaces are declared on the elements where they
|
|
1591
|
+
are used. With `namespace_scope`, you can consolidate multiple namespace
|
|
1592
|
+
declarations at a parent element for cleaner, more compact XML.
|
|
1593
|
+
|
|
1594
|
+
The `namespace_scope` directive supports a `declare:` option to force unused
|
|
1595
|
+
namespaces to be included in the output.
|
|
1596
|
+
|
|
1597
|
+
Syntax:
|
|
1598
|
+
|
|
1599
|
+
[source,ruby]
|
|
1600
|
+
----
|
|
1601
|
+
xml do
|
|
1602
|
+
namespace RootNamespace
|
|
1603
|
+
namespace_scope [Namespace1, Namespace2, Namespace3] # <1>
|
|
1604
|
+
# is identical to:
|
|
1605
|
+
# namespace_scope [
|
|
1606
|
+
# { namespace: Namespace1, declare: :auto },
|
|
1607
|
+
# { namespace: Namespace2, declare: :auto },
|
|
1608
|
+
# { namespace: Namespace3, declare: :auto }
|
|
1609
|
+
# ]
|
|
1610
|
+
|
|
1611
|
+
# Per-namespace control with hash format
|
|
1612
|
+
namespace_scope [ # <2>
|
|
1613
|
+
{ namespace: Namespace1, declare: :always },
|
|
1614
|
+
{ namespace: Namespace2, declare: :auto },
|
|
1615
|
+
# Namespace3 # CANNOT mix hash and class
|
|
1616
|
+
]
|
|
1617
|
+
end
|
|
1618
|
+
----
|
|
1619
|
+
<1> Simple list of XmlNamespace classes to declare at root (default: `:auto`)
|
|
1620
|
+
<2> Per-namespace control with individual `declare:` settings using hash format
|
|
1621
|
+
|
|
1622
|
+
Where,
|
|
1623
|
+
|
|
1624
|
+
`namespace_scope`:: Array of XmlNamespace class objects or Hash configurations.
|
|
1625
|
+
These namespaces will be declared at the root element based on their declaration
|
|
1626
|
+
mode.
|
|
1627
|
+
|
|
1628
|
+
`declare:`:: Controls when namespace is declared:
|
|
1629
|
+
|
|
1630
|
+
`:auto`::: (default) Declare only if namespace is actually used in child elements/attributes (or the element itself)
|
|
1631
|
+
`:always`::: Always declare namespace, even if unused in child elements/attributes or the element itself
|
|
1632
|
+
`:never`::: Never declare (error if used)
|
|
1633
|
+
|
|
1634
|
+
===== Basic namespace consolidation
|
|
1635
|
+
|
|
1636
|
+
.Namespace consolidation with vCard (using default :auto mode)
|
|
1637
|
+
[example]
|
|
1638
|
+
====
|
|
1639
|
+
[source,ruby]
|
|
1640
|
+
----
|
|
1641
|
+
class VcardNamespace < Lutaml::Model::XmlNamespace
|
|
1642
|
+
uri "urn:ietf:params:xml:ns:vcard-4.0"
|
|
1643
|
+
prefix_default "vcard"
|
|
1644
|
+
end
|
|
1645
|
+
|
|
1646
|
+
class DcNamespace < Lutaml::Model::XmlNamespace
|
|
1647
|
+
uri "http://purl.org/dc/elements/1.1/"
|
|
1648
|
+
prefix_default "dc"
|
|
1649
|
+
end
|
|
1650
|
+
|
|
1651
|
+
class DctermsNamespace < Lutaml::Model::XmlNamespace
|
|
1652
|
+
uri "http://purl.org/dc/terms/"
|
|
1653
|
+
prefix_default "dcterms"
|
|
1654
|
+
end
|
|
1655
|
+
|
|
1656
|
+
# Types with different namespaces
|
|
1657
|
+
class DcTitleType < Lutaml::Model::Type::String
|
|
1658
|
+
xml_namespace DcNamespace
|
|
1659
|
+
end
|
|
1660
|
+
|
|
1661
|
+
class DctermsCreatedType < Lutaml::Model::Type::DateTime
|
|
1662
|
+
xml_namespace DctermsNamespace
|
|
1663
|
+
end
|
|
1664
|
+
|
|
1665
|
+
class Vcard < Lutaml::Model::Serializable
|
|
1666
|
+
attribute :title, DcTitleType
|
|
1667
|
+
attribute :created, DctermsCreatedType
|
|
1668
|
+
|
|
1669
|
+
xml do
|
|
1670
|
+
element "vCard"
|
|
1671
|
+
namespace VcardNamespace
|
|
1672
|
+
namespace_scope [VcardNamespace, DcNamespace, DctermsNamespace] # <1>
|
|
1673
|
+
|
|
1674
|
+
map_element "title", to: :title
|
|
1675
|
+
map_element "created", to: :created
|
|
1676
|
+
end
|
|
1677
|
+
end
|
|
1678
|
+
|
|
1679
|
+
vcard = Vcard.new(
|
|
1680
|
+
title: "Dr. John Doe",
|
|
1681
|
+
created: DateTime.parse("2024-06-01T12:00:00Z")
|
|
1682
|
+
)
|
|
1683
|
+
|
|
1684
|
+
puts vcard.to_xml
|
|
1685
|
+
----
|
|
1686
|
+
<1> Consolidate all three namespaces at root element (default `:auto` mode)
|
|
1687
|
+
|
|
1688
|
+
Output with default namespace (no prefix option):
|
|
1689
|
+
|
|
1690
|
+
[source,xml]
|
|
1691
|
+
----
|
|
1692
|
+
<vCard xmlns="urn:ietf:params:xml:ns:vcard-4.0"
|
|
1693
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
1694
|
+
xmlns:dcterms="http://purl.org/dc/terms/">
|
|
1695
|
+
<dc:title>Dr. John Doe</dc:title>
|
|
1696
|
+
<dcterms:created>2024-06-01T12:00:00+00:00</dcterms:created>
|
|
1697
|
+
</vCard>
|
|
1698
|
+
----
|
|
1699
|
+
|
|
1700
|
+
Without `namespace_scope`, each namespace would be declared locally:
|
|
1701
|
+
|
|
1702
|
+
[source,xml]
|
|
1703
|
+
----
|
|
1704
|
+
<vCard xmlns="urn:ietf:params:xml:ns:vcard-4.0">
|
|
1705
|
+
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">Dr. John Doe</dc:title>
|
|
1706
|
+
<dcterms:created xmlns:dcterms="http://purl.org/dc/terms/">2024-06-01T12:00:00+00:00</dcterms:created>
|
|
1707
|
+
</vCard>
|
|
1708
|
+
----
|
|
1709
|
+
====
|
|
1710
|
+
|
|
1711
|
+
===== Forcing unused namespace declarations
|
|
1712
|
+
|
|
1713
|
+
Use `declare: :always` to force namespace declarations even when not used:
|
|
1714
|
+
|
|
1715
|
+
.Always declare namespace with `declare: :always`
|
|
1716
|
+
[example]
|
|
1717
|
+
====
|
|
1718
|
+
[source,ruby]
|
|
1719
|
+
----
|
|
1720
|
+
class AppNamespace < Lutaml::Model::XmlNamespace
|
|
1721
|
+
uri 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'
|
|
1722
|
+
prefix_default 'app'
|
|
1723
|
+
end
|
|
1724
|
+
|
|
1725
|
+
class VtNamespace < Lutaml::Model::XmlNamespace
|
|
1726
|
+
uri 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'
|
|
1727
|
+
prefix_default 'vt'
|
|
1728
|
+
end
|
|
1729
|
+
|
|
1730
|
+
class Properties < Lutaml::Model::Serializable
|
|
1731
|
+
attribute :template, :string
|
|
1732
|
+
|
|
1733
|
+
xml do
|
|
1734
|
+
element "Properties"
|
|
1735
|
+
namespace AppNamespace
|
|
1736
|
+
|
|
1737
|
+
# Force vt namespace declaration even though unused
|
|
1738
|
+
namespace_scope [
|
|
1739
|
+
{ namespace: VtNamespace, declare: :always }
|
|
1740
|
+
]
|
|
1741
|
+
|
|
1742
|
+
map_element "Template", to: :template
|
|
1743
|
+
end
|
|
1744
|
+
end
|
|
1745
|
+
|
|
1746
|
+
props = Properties.new(template: "Normal.dotm")
|
|
1747
|
+
puts props.to_xml
|
|
1748
|
+
----
|
|
1749
|
+
|
|
1750
|
+
Output:
|
|
1751
|
+
|
|
1752
|
+
[source,xml]
|
|
1753
|
+
----
|
|
1754
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
|
|
1755
|
+
xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
|
|
1756
|
+
<Template>Normal.dotm</Template>
|
|
1757
|
+
</Properties>
|
|
1758
|
+
----
|
|
1759
|
+
|
|
1760
|
+
NOTE: The `vt:` namespace is declared even though no elements use it. This is
|
|
1761
|
+
required by some XML consumers like Office Open XML.
|
|
1762
|
+
====
|
|
1763
|
+
|
|
1764
|
+
===== Per-namespace declaration control
|
|
1765
|
+
|
|
1766
|
+
Use Hash format for fine-grained control over individual namespaces:
|
|
1767
|
+
|
|
1768
|
+
.Mixed declaration modes with per-namespace control
|
|
1769
|
+
[example]
|
|
1770
|
+
====
|
|
1771
|
+
[source,ruby]
|
|
1772
|
+
----
|
|
1773
|
+
class CorePropertiesNamespace < Lutaml::Model::XmlNamespace
|
|
1774
|
+
uri 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'
|
|
1775
|
+
prefix_default 'cp'
|
|
1776
|
+
end
|
|
1777
|
+
|
|
1778
|
+
class DcNamespace < Lutaml::Model::XmlNamespace
|
|
1779
|
+
uri 'http://purl.org/dc/elements/1.1/'
|
|
1780
|
+
prefix_default 'dc'
|
|
1781
|
+
end
|
|
1782
|
+
|
|
1783
|
+
class XsiNamespace < Lutaml::Model::XmlNamespace
|
|
1784
|
+
uri 'http://www.w3.org/2001/XMLSchema-instance'
|
|
1785
|
+
prefix_default 'xsi'
|
|
1786
|
+
end
|
|
1787
|
+
|
|
1788
|
+
class CoreProperties < Lutaml::Model::Serializable
|
|
1789
|
+
attribute :title, :string
|
|
1790
|
+
|
|
1791
|
+
xml do
|
|
1792
|
+
element "coreProperties"
|
|
1793
|
+
namespace CorePropertiesNamespace
|
|
1794
|
+
|
|
1795
|
+
# Per-namespace declaration control
|
|
1796
|
+
namespace_scope [
|
|
1797
|
+
{ namespace: DcNamespace, declare: :auto }, # <1>
|
|
1798
|
+
{ namespace: XsiNamespace, declare: :always } # <2>
|
|
1799
|
+
]
|
|
1800
|
+
|
|
1801
|
+
map_element "title", to: :title
|
|
1802
|
+
end
|
|
1803
|
+
end
|
|
1804
|
+
----
|
|
1805
|
+
<1> DcNamespace declared only if used (`:auto` mode)
|
|
1806
|
+
<2> XsiNamespace always declared even if unused (`:always` mode)
|
|
1807
|
+
|
|
1808
|
+
When DcNamespace is used:
|
|
1809
|
+
|
|
1810
|
+
[source,xml]
|
|
1811
|
+
----
|
|
1812
|
+
<coreProperties xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
|
|
1813
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
1814
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
1815
|
+
<dc:title>Document Title</dc:title>
|
|
1816
|
+
</coreProperties>
|
|
1817
|
+
----
|
|
1818
|
+
|
|
1819
|
+
When DcNamespace is not used (title remains unset or uses different namespace):
|
|
1820
|
+
|
|
1821
|
+
[source,xml]
|
|
1822
|
+
----
|
|
1823
|
+
<coreProperties xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
|
|
1824
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
1825
|
+
</coreProperties>
|
|
1826
|
+
----
|
|
1827
|
+
|
|
1828
|
+
NOTE: XsiNamespace is always declared (`:always`), while DcNamespace is omitted
|
|
1829
|
+
when unused (`:auto`).
|
|
1830
|
+
====
|
|
1831
|
+
|
|
1832
|
+
===== Declaration modes
|
|
1833
|
+
|
|
1834
|
+
[cols="1,3"]
|
|
1835
|
+
|===
|
|
1836
|
+
| Mode | Behavior
|
|
1837
|
+
|
|
1838
|
+
| `:auto` (default)
|
|
1839
|
+
| Namespace declared only if actually used in elements or attributes
|
|
1840
|
+
|
|
1841
|
+
| `:always`
|
|
1842
|
+
| Namespace always declared at root, even if unused. Use for schema compliance
|
|
1843
|
+
or when external tools require namespace presence.
|
|
1844
|
+
|
|
1845
|
+
| `:never`
|
|
1846
|
+
| Namespace never declared. Error raised if namespace is used in elements.
|
|
1847
|
+
Reserved for future use.
|
|
1848
|
+
|
|
1849
|
+
|===
|
|
1850
|
+
|
|
1851
|
+
===== Use cases for declaration modes
|
|
1852
|
+
|
|
1853
|
+
**Use `:auto` mode (default) when:**
|
|
1854
|
+
|
|
1855
|
+
* Standard W3C namespace behavior desired
|
|
1856
|
+
* Minimize unnecessary namespace declarations
|
|
1857
|
+
* Generate clean, minimal XML
|
|
1858
|
+
* Examples: Most XML documents, APIs
|
|
1859
|
+
|
|
1860
|
+
**Use `:always` mode when:**
|
|
1861
|
+
|
|
1862
|
+
* Schema requires specific namespace declarations
|
|
1863
|
+
* External tools validate namespace presence
|
|
1864
|
+
* Format specifications mandate unused namespaces
|
|
1865
|
+
* Examples: Office Open XML (xmlns:vt required), SOAP envelopes
|
|
1866
|
+
|
|
1867
|
+
**Use `:never` mode when:**
|
|
1868
|
+
|
|
1869
|
+
* Explicitly prevent namespace usage
|
|
1870
|
+
* Catch errors during development
|
|
1871
|
+
* Reserved for future extensibility
|
|
1872
|
+
|
|
1873
|
+
|
|
1874
|
+
[[form-override]]
|
|
1875
|
+
==== Form override (W3C Schema compliance)
|
|
1876
|
+
|
|
1877
|
+
Per W3C XML Schema specification, the `form` attribute controls whether elements must be qualified (prefixed) or unqualified (no prefix) on a per-element basis.
|
|
1878
|
+
|
|
1879
|
+
===== When to use form override
|
|
1880
|
+
|
|
1881
|
+
Use `form` when:
|
|
1882
|
+
|
|
1883
|
+
* Schema specifies `elementFormDefault="qualified"` but some elements should be local
|
|
1884
|
+
* Schema specifies `elementFormDefault="unqualified"` but some elements need qualification
|
|
1885
|
+
* Mixing qualified and unqualified elements in same parent
|
|
1886
|
+
|
|
1887
|
+
===== Syntax
|
|
1888
|
+
|
|
1889
|
+
[source,ruby]
|
|
1890
|
+
----
|
|
1891
|
+
xml do
|
|
1892
|
+
map_element 'name', to: :attr, form: :qualified # Force prefix
|
|
1893
|
+
map_element 'name', to: :attr, form: :unqualified # Force no prefix
|
|
1894
|
+
end
|
|
1895
|
+
----
|
|
1896
|
+
|
|
1897
|
+
===== Example: Local elements in qualified schema
|
|
1898
|
+
|
|
1899
|
+
.Overriding element qualification with form
|
|
1900
|
+
[example]
|
|
1901
|
+
====
|
|
1902
|
+
[source,ruby]
|
|
1903
|
+
----
|
|
1904
|
+
class ReportNamespace < Lutaml::Model::XmlNamespace
|
|
1905
|
+
uri "http://example.com/reports"
|
|
1906
|
+
prefix_default "r"
|
|
1907
|
+
element_form_default :qualified # All elements qualified by default
|
|
1908
|
+
end
|
|
1909
|
+
|
|
1910
|
+
class Report < Lutaml::Model::Serializable
|
|
1911
|
+
attribute :title, :string
|
|
1912
|
+
attribute :metadata, :string
|
|
1913
|
+
|
|
1914
|
+
xml do
|
|
1915
|
+
element "report"
|
|
1916
|
+
namespace ReportNamespace
|
|
1917
|
+
|
|
1918
|
+
map_element "title", to: :title # Qualified (follows default)
|
|
1919
|
+
map_element "metadata", to: :metadata, form: :unqualified # Local override
|
|
1920
|
+
end
|
|
1921
|
+
end
|
|
1922
|
+
|
|
1923
|
+
report = Report.new(title: "Annual Report", metadata: "Internal use")
|
|
1924
|
+
puts report.to_xml(prefix: true)
|
|
1925
|
+
----
|
|
1926
|
+
|
|
1927
|
+
Output:
|
|
1928
|
+
|
|
1929
|
+
[source,xml]
|
|
1930
|
+
----
|
|
1931
|
+
<r:report xmlns:r="http://example.com/reports">
|
|
1932
|
+
<r:title>Annual Report</r:title>
|
|
1933
|
+
<metadata>Internal use</metadata> <!-- No prefix, local scope -->
|
|
1934
|
+
</r:report>
|
|
1935
|
+
----
|
|
1936
|
+
|
|
1937
|
+
NOTE: The `metadata` element is unqualified despite `element_form_default: :qualified`. The `form: :unqualified` override forces local scope.
|
|
1938
|
+
====
|
|
1939
|
+
|
|
1940
|
+
===== Priority order
|
|
1941
|
+
|
|
1942
|
+
Form takes **highest priority** in qualification decisions:
|
|
1943
|
+
|
|
1944
|
+
. `form: :unqualified` → Forces NO prefix (local scope)
|
|
1945
|
+
. `form: :qualified` → Forces prefix usage
|
|
1946
|
+
. `namespace: :inherit` → Uses parent namespace
|
|
1947
|
+
. Type namespace → Uses type's namespace
|
|
1948
|
+
. Schema `elementFormDefault` → Follows default
|
|
1949
|
+
. Unqualified → No namespace
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
==== XSD annotation (`documentation` method)
|
|
1953
|
+
|
|
1954
|
+
The `documentation` method adds
|
|
1955
|
+
human-readable description for XSD generation.
|
|
1956
|
+
|
|
1957
|
+
Syntax:
|
|
1958
|
+
|
|
1959
|
+
[source,ruby]
|
|
1960
|
+
----
|
|
1961
|
+
xml do
|
|
1962
|
+
element 'element-name'
|
|
1963
|
+
documentation 'Description text for XSD annotation'
|
|
1964
|
+
end
|
|
1965
|
+
----
|
|
1966
|
+
|
|
1967
|
+
Used in generated XSD `<xs:annotation>...<xs:documentation>` elements.
|
|
1968
|
+
|
|
1969
|
+
.Adding documentation to model
|
|
1970
|
+
[example]
|
|
1971
|
+
====
|
|
1972
|
+
[source,ruby]
|
|
1973
|
+
----
|
|
1974
|
+
class Product < Lutaml::Model::Serializable
|
|
1975
|
+
attribute :name, :string
|
|
1976
|
+
attribute :price, :float
|
|
1977
|
+
|
|
1978
|
+
xml do
|
|
1979
|
+
element 'product'
|
|
1980
|
+
documentation "Represents a product in the catalog"
|
|
1981
|
+
|
|
1982
|
+
map_element 'name', to: :name
|
|
1983
|
+
map_element 'price', to: :price
|
|
1984
|
+
end
|
|
1985
|
+
end
|
|
1986
|
+
|
|
1987
|
+
# When generating XSD from this model:
|
|
1988
|
+
# <xs:complexType name="ProductType">
|
|
1989
|
+
# <xs:annotation>
|
|
1990
|
+
# <xs:documentation>Represents a product in the catalog</xs:documentation>
|
|
1991
|
+
# </xs:annotation>
|
|
1992
|
+
# ...
|
|
1993
|
+
# </xs:complexType>
|
|
1994
|
+
----
|
|
1995
|
+
====
|
|
1996
|
+
|
|
1997
|
+
==== XSD type name declaration (`type_name` method)
|
|
1998
|
+
|
|
1999
|
+
The `type_name` method sets an explicit type name for XSD generation.
|
|
2000
|
+
|
|
2001
|
+
By default, type names are inferred as `{ClassName}Type`. This method is only
|
|
2002
|
+
to override that value.
|
|
2003
|
+
|
|
2004
|
+
This method is only useful for customizing a generated XSD schema file
|
|
2005
|
+
from the models, the XSD type name does not affect XML processing or the
|
|
2006
|
+
functioning of the resulting XSD schema.
|
|
2007
|
+
|
|
2008
|
+
Customizing the type name is typically used to make the XSD compatible with
|
|
2009
|
+
external schemas that define or reuse the same XSD type.
|
|
2010
|
+
|
|
2011
|
+
Syntax:
|
|
2012
|
+
|
|
2013
|
+
[source,ruby]
|
|
2014
|
+
----
|
|
2015
|
+
xml do
|
|
2016
|
+
element 'element-name'
|
|
2017
|
+
type_name 'CustomTypeName'
|
|
2018
|
+
end
|
|
2019
|
+
----
|
|
2020
|
+
|
|
2021
|
+
.Setting custom type name
|
|
2022
|
+
[example]
|
|
2023
|
+
====
|
|
2024
|
+
[source,ruby]
|
|
2025
|
+
----
|
|
2026
|
+
class Product < Lutaml::Model::Serializable
|
|
2027
|
+
attribute :name, :string
|
|
2028
|
+
|
|
2029
|
+
xml do
|
|
2030
|
+
element 'product'
|
|
2031
|
+
type_name 'CatalogItemType' # Override default 'ProductType'
|
|
2032
|
+
|
|
2033
|
+
map_element 'name', to: :name
|
|
2034
|
+
end
|
|
2035
|
+
end
|
|
2036
|
+
|
|
2037
|
+
# Generated XSD uses: <xs:complexType name="CatalogItemType">
|
|
2038
|
+
----
|
|
2039
|
+
====
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
==== XSD sequence requirements (`sequence` block)
|
|
2043
|
+
|
|
2044
|
+
Lutaml::Model supports the XSD notions of declaring structural requirements
|
|
2045
|
+
on XML elements and types.
|
|
2046
|
+
|
|
2047
|
+
Usage of these declarations allows for precise control over the structure and
|
|
2048
|
+
validation of XML documents. These notions directly translate to the XSD
|
|
2049
|
+
equivalents and is reflected in the corresponding XSD generated by Lutaml::Model
|
|
2050
|
+
as XML complex types.
|
|
2051
|
+
|
|
2052
|
+
The `sequence` directive specifies that the defined attributes must appear in a
|
|
2053
|
+
specified order in XML.
|
|
2054
|
+
|
|
2055
|
+
NOTE: Sequence only supports `map_element` mappings.
|
|
2056
|
+
|
|
2057
|
+
Syntax:
|
|
2058
|
+
|
|
2059
|
+
[source,ruby]
|
|
2060
|
+
----
|
|
2061
|
+
xml do
|
|
2062
|
+
sequence do
|
|
2063
|
+
map_element 'xml_element_name_1', to: :name_of_attribute_1
|
|
2064
|
+
map_element 'xml_element_name_2', to: :name_of_attribute_2
|
|
2065
|
+
# Add more map_element lines as needed to establish a complete sequence
|
|
2066
|
+
end
|
|
2067
|
+
end
|
|
2068
|
+
----
|
|
2069
|
+
|
|
2070
|
+
The appearance of the elements in the XML document must match the order defined
|
|
2071
|
+
in the `sequence` block. In this case, the `<xml_element_name_1>` element
|
|
2072
|
+
should appear before the `<xml_element_name_2>` element.
|
|
2073
|
+
|
|
2074
|
+
.Using the `sequence` keyword to define a set of elements in desired order.
|
|
2075
|
+
[example]
|
|
2076
|
+
====
|
|
2077
|
+
[source,ruby]
|
|
2078
|
+
----
|
|
2079
|
+
class Kiln < Lutaml::Model::Serializable
|
|
2080
|
+
attribute :id, :string
|
|
2081
|
+
attribute :name, :string
|
|
2082
|
+
attribute :type, :string
|
|
2083
|
+
attribute :color, :string
|
|
2084
|
+
|
|
2085
|
+
xml do
|
|
2086
|
+
sequence do
|
|
2087
|
+
map_element :id, to: :id
|
|
2088
|
+
map_element :name, to: :name
|
|
2089
|
+
map_element :type, to: :type
|
|
2090
|
+
map_element :color, to: :color
|
|
2091
|
+
end
|
|
2092
|
+
end
|
|
2093
|
+
end
|
|
2094
|
+
|
|
2095
|
+
class KilnCollection < Lutaml::Model::Serializable
|
|
2096
|
+
attribute :kiln, Kiln, collection: 1..2
|
|
2097
|
+
|
|
2098
|
+
xml do
|
|
2099
|
+
element "collection"
|
|
2100
|
+
map_element "kiln", to: :kiln
|
|
2101
|
+
end
|
|
2102
|
+
end
|
|
2103
|
+
----
|
|
2104
|
+
|
|
2105
|
+
[source,xml]
|
|
2106
|
+
----
|
|
2107
|
+
<collection>
|
|
2108
|
+
<kiln>
|
|
2109
|
+
<id>1</id>
|
|
2110
|
+
<name>Nick</name>
|
|
2111
|
+
<type>Hard</type>
|
|
2112
|
+
<color>Black</color>
|
|
2113
|
+
</kiln>
|
|
2114
|
+
<kiln>
|
|
2115
|
+
<id>2</id>
|
|
2116
|
+
<name>John</name>
|
|
2117
|
+
<type>Soft</type>
|
|
2118
|
+
<color>White</color>
|
|
2119
|
+
|
|
2120
|
+
----
|
|
2121
|
+
|
|
2122
|
+
[source,ruby]
|
|
2123
|
+
----
|
|
2124
|
+
> parsed = Kiln.from_xml(xml)
|
|
2125
|
+
# => [
|
|
2126
|
+
#<Kiln:0x0000000104ac7240 @id="1", @name="Nick", @type="Hard", @color="Black">,
|
|
2127
|
+
#<Kiln:0x0000000104ac7240 @id="2", @name="John", @type="Soft", @color="White">
|
|
2128
|
+
#]
|
|
2129
|
+
|
|
2130
|
+
> bad_xml = <<~HERE
|
|
2131
|
+
<collection>
|
|
2132
|
+
<kiln>
|
|
2133
|
+
<name>Nick</name>
|
|
2134
|
+
<id>1</id>
|
|
2135
|
+
<color>Black</color>
|
|
2136
|
+
<type>Hard</type>
|
|
2137
|
+
</kiln>
|
|
2138
|
+
</collection>
|
|
2139
|
+
HERE
|
|
2140
|
+
> parsed = Kiln.from_xml(bad_xml)
|
|
2141
|
+
# => Lutaml::Model::ValidationError: Element 'name' is out of order in 'kiln' element
|
|
2142
|
+
----
|
|
2143
|
+
====
|
|
2144
|
+
|
|
2145
|
+
NOTE: For importing model mappings inside a `sequence` block, refer to
|
|
2146
|
+
<<import-model-mappings-inside-sequence, Importing model mappings inside a `sequence`>>.
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
[[xml-schema-location]]
|
|
2150
|
+
==== Automatic support of `xsi:schemaLocation`
|
|
2151
|
+
|
|
2152
|
+
The
|
|
2153
|
+
https://www.w3.org/TR/xmlschema-1/#xsi_schemaLocation[W3C "XMLSchema-instance"]
|
|
2154
|
+
namespace describes a number of attributes that can be used to control the
|
|
2155
|
+
behavior of XML processors. One of these attributes is `xsi:schemaLocation`.
|
|
2156
|
+
|
|
2157
|
+
The `xsi:schemaLocation` attribute locates schemas for elements and attributes
|
|
2158
|
+
that are in a specified namespace. Its value consists of pairs of a namespace
|
|
2159
|
+
URI followed by a relative or absolute URL where the schema for that namespace
|
|
2160
|
+
can be found.
|
|
2161
|
+
|
|
2162
|
+
Usage of `xsi:schemaLocation` in an XML element depends on the declaration of
|
|
2163
|
+
the XML namespace of `xsi`, i.e.
|
|
2164
|
+
`xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`. Without this namespace
|
|
2165
|
+
LutaML will not be able to serialize the `xsi:schemaLocation` attribute.
|
|
2166
|
+
|
|
2167
|
+
NOTE: It is most commonly attached to the root element but can appear further
|
|
2168
|
+
down the tree.
|
|
2169
|
+
|
|
2170
|
+
The following snippet shows how `xsi:schemaLocation` is used in an XML document:
|
|
2171
|
+
|
|
2172
|
+
[source,xml]
|
|
2173
|
+
----
|
|
2174
|
+
<cera:Ceramicın
|
|
2175
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
2176
|
+
xmlns:cera="http://example.com/ceramic"
|
|
2177
|
+
xmlns:clr='http://example.com/color'
|
|
2178
|
+
xsi:schemaLocation=
|
|
2179
|
+
"http://example.com/ceramic http://example.com/ceramic.xsd
|
|
2180
|
+
http://example.com/color http://example.com/color.xsd"
|
|
2181
|
+
clr:color="navy-blue">
|
|
2182
|
+
<cera:Type>Porcelain</cera:Type>
|
|
2183
|
+
<Glaze>Clear</Glaze>
|
|
2184
|
+
</cera:Ceramicın>
|
|
2185
|
+
----
|
|
2186
|
+
|
|
2187
|
+
LutaML::Model supports the `xsi:schemaLocation` attribute in all XML
|
|
2188
|
+
serializations by default, through the `schema_location` attribute on the model
|
|
2189
|
+
instance object.
|
|
2190
|
+
|
|
2191
|
+
.Retrieving and setting the `xsi:schemaLocation` attribute in XML serialization
|
|
2192
|
+
[example]
|
|
2193
|
+
====
|
|
2194
|
+
In this example, the `xsi:schemaLocation` attribute will be automatically
|
|
2195
|
+
supplied without the explicit need to define in the model, and allows for
|
|
2196
|
+
round-trip serialization.
|
|
2197
|
+
|
|
2198
|
+
[source,ruby]
|
|
2199
|
+
----
|
|
2200
|
+
class ColorXmlNamespace < Lutaml::Model::XmlNamespace
|
|
2201
|
+
uri 'http://example.com/color'
|
|
2202
|
+
default_prefix 'clr'
|
|
2203
|
+
end
|
|
2204
|
+
|
|
2205
|
+
class Ceramic < Lutaml::Model::Serializable
|
|
2206
|
+
attribute :type, :string
|
|
2207
|
+
attribute :glaze, :string
|
|
2208
|
+
attribute :color, :string
|
|
2209
|
+
|
|
2210
|
+
xml do
|
|
2211
|
+
element 'Ceramic'
|
|
2212
|
+
namespace 'http://example.com/ceramic', 'cera'
|
|
2213
|
+
map_element 'Type', to: :type # Inherits parent namespace
|
|
2214
|
+
map_element 'Glaze', to: :glaze
|
|
2215
|
+
map_attribute 'color', to: :color # Per W3C, attributes don't inherit namespace
|
|
2216
|
+
end
|
|
2217
|
+
end
|
|
2218
|
+
|
|
2219
|
+
xml_content = <<~HERE
|
|
2220
|
+
<cera:Ceramic
|
|
2221
|
+
xmlns:cera="http://example.com/ceramic"
|
|
2222
|
+
xmlns:clr="http://example.com/color"
|
|
2223
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
2224
|
+
clr:color="navy-blue"
|
|
2225
|
+
xsi:schemaLocation="
|
|
2226
|
+
http://example.com/ceramic http://example.com/ceramic.xsd
|
|
2227
|
+
http://example.com/color http://example.com/color.xsd
|
|
2228
|
+
">
|
|
2229
|
+
<cera:Type>Porcelain</cera:Type>
|
|
2230
|
+
<Glaze>Clear</Glaze>
|
|
2231
|
+
</cera:Ceramic>
|
|
2232
|
+
HERE
|
|
2233
|
+
----
|
|
2234
|
+
|
|
2235
|
+
[source,ruby]
|
|
2236
|
+
----
|
|
2237
|
+
> c = Ceramic.from_xml(xml_content)
|
|
2238
|
+
=>
|
|
2239
|
+
#<Ceramic:0x00000001222bdd60
|
|
2240
|
+
...
|
|
2241
|
+
> schema_loc = c.schema_location
|
|
2242
|
+
#<Lutaml::Model::SchemaLocation:0x0000000122773760
|
|
2243
|
+
...
|
|
2244
|
+
> schema_loc
|
|
2245
|
+
=>
|
|
2246
|
+
#<Lutaml::Model::SchemaLocation:0x0000000122773760
|
|
2247
|
+
@namespace="http://www.w3.org/2001/XMLSchema-instance",
|
|
2248
|
+
@original_schema_location="http://example.com/ceramic http://example.com/ceramic.xsd http://example.com/color http://example.com/color.xsd",
|
|
2249
|
+
@prefix="xsi",
|
|
2250
|
+
@schema_location=
|
|
2251
|
+
[#<Lutaml::Model::Location:0x00000001222bd018 @location="http://example.com/ceramic.xsd", @namespace="http://example.com/ceramic">,
|
|
2252
|
+
#<Lutaml::Model::Location:0x00000001222bcfc8 @location="http://example.com/color.xsd", @namespace="http://example.com/color">]>
|
|
2253
|
+
> new_c = Ceramic.new(type: "Porcelain", glaze: "Clear", color: "navy-blue", schema_location: schema_loc).to_xml
|
|
2254
|
+
> puts new_c
|
|
2255
|
+
# <cera:Ceramic
|
|
2256
|
+
# xmlns:cera="http://example.com/ceramic"
|
|
2257
|
+
# xmlns:clr="http://example.com/color"
|
|
2258
|
+
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
2259
|
+
# clr:color="navy-blue"
|
|
2260
|
+
# xsi:schemaLocation="
|
|
2261
|
+
# http://example.com/ceramic http://example.com/ceramic.xsd
|
|
2262
|
+
# http://example.com/color http://example.com/color.xsd
|
|
2263
|
+
# ">
|
|
2264
|
+
# <cera:Type>Porcelain</cera:Type>
|
|
2265
|
+
# <cera:Glaze>Clear</cera:Glaze>
|
|
2266
|
+
# </cera:Ceramic>
|
|
2267
|
+
----
|
|
2268
|
+
====
|
|
2269
|
+
|
|
2270
|
+
NOTE: For details on `xsi:schemaLocation`, please refer to the
|
|
2271
|
+
https://www.w3.org/TR/xmlschema-1/#xsi_schemaLocation[W3C XML standard].
|
|
2272
|
+
|
|
2273
|
+
|
|
2274
|
+
== Namespace Aliases (URI Aliases)
|
|
2275
|
+
|
|
2276
|
+
Some XML schemas use multiple URI variants for the same logical namespace. For example,
|
|
2277
|
+
ReqIF schemas commonly use both `http://www.omg.org/spec/ReqIF/20110401/reqif.xsd` and
|
|
2278
|
+
`http://www.omg.org/spec/ReqIF/20110401/` as namespace URIs. Lutaml::Model supports
|
|
2279
|
+
this through the `uri_aliases` DSL method.
|
|
2280
|
+
|
|
2281
|
+
=== Defining URI Aliases
|
|
2282
|
+
|
|
2283
|
+
Use `uri_aliases` to declare additional URIs that should resolve to the same namespace class:
|
|
2284
|
+
|
|
2285
|
+
[source,ruby]
|
|
2286
|
+
----
|
|
2287
|
+
class ReqIfNamespace < Lutaml::Model::XmlNamespace
|
|
2288
|
+
uri "http://www.omg.org/spec/ReqIF/20110401/reqif.xsd"
|
|
2289
|
+
uri_aliases "http://www.omg.org/spec/ReqIF/20110401/"
|
|
2290
|
+
prefix_default "reqif"
|
|
2291
|
+
end
|
|
2292
|
+
----
|
|
2293
|
+
|
|
2294
|
+
The `uri_aliases` method accepts multiple alias URIs:
|
|
2295
|
+
|
|
2296
|
+
[source,ruby]
|
|
2297
|
+
----
|
|
2298
|
+
class MyNamespace < Lutaml::Model::XmlNamespace
|
|
2299
|
+
uri "http://example.com/schema/main.xsd"
|
|
2300
|
+
uri_aliases "http://example.com/schema/", "http://example.com/schema"
|
|
2301
|
+
prefix_default "ex"
|
|
2302
|
+
end
|
|
2303
|
+
----
|
|
2304
|
+
|
|
2305
|
+
=== How URI Aliases Work
|
|
2306
|
+
|
|
2307
|
+
When parsing XML, Lutaml::Model accepts either the canonical URI or any alias URI.
|
|
2308
|
+
When serializing, the original URI from the input XML is preserved for round-trip fidelity.
|
|
2309
|
+
|
|
2310
|
+
[cols="1,2"]
|
|
2311
|
+
|===
|
|
2312
|
+
| Method | Description
|
|
2313
|
+
|
|
2314
|
+
| `uri`
|
|
2315
|
+
| The canonical namespace URI (required)
|
|
2316
|
+
|
|
2317
|
+
| `uri_aliases`
|
|
2318
|
+
| Additional URIs that resolve to this namespace class
|
|
2319
|
+
|
|
2320
|
+
| `is_alias?(uri)`
|
|
2321
|
+
| Returns true if the URI is an alias of this namespace
|
|
2322
|
+
|
|
2323
|
+
| `all_uris`
|
|
2324
|
+
| Returns array of all URIs (canonical + aliases)
|
|
2325
|
+
|===
|
|
2326
|
+
|
|
2327
|
+
=== Parsing with Aliases
|
|
2328
|
+
|
|
2329
|
+
XML with either canonical or alias URIs parses successfully:
|
|
2330
|
+
|
|
2331
|
+
[source,ruby]
|
|
2332
|
+
----
|
|
2333
|
+
# Parse with canonical URI
|
|
2334
|
+
xml1 = '<Item xmlns="http://example.com/schema/main.xsd"><Name>Item1</Name></Item>'
|
|
2335
|
+
model1 = Item.from_xml(xml1)
|
|
2336
|
+
|
|
2337
|
+
# Parse with alias URI
|
|
2338
|
+
xml2 = '<Item xmlns="http://example.com/schema/"><Name>Item2</Name></Item>'
|
|
2339
|
+
model2 = Item.from_xml(xml2)
|
|
2340
|
+
----
|
|
2341
|
+
|
|
2342
|
+
Both parse successfully because both URIs resolve to the same namespace class.
|
|
2343
|
+
|
|
2344
|
+
=== Round-Trip Preservation
|
|
2345
|
+
|
|
2346
|
+
When you parse XML with an alias URI and serialize it back, the original alias URI is preserved:
|
|
2347
|
+
|
|
2348
|
+
[source,ruby]
|
|
2349
|
+
----
|
|
2350
|
+
xml = '<Item xmlns="http://example.com/schema/"><Name>Item1</Name></Item>'
|
|
2351
|
+
model = Item.from_xml(xml)
|
|
2352
|
+
|
|
2353
|
+
# Serialization preserves the alias URI from the original XML
|
|
2354
|
+
model.to_xml
|
|
2355
|
+
# => <Item xmlns="http://example.com/schema/"><Name>Item1</Name></Item>
|
|
2356
|
+
----
|
|
2357
|
+
|
|
2358
|
+
If you create a new model instance programmatically (without parsing from XML),
|
|
2359
|
+
the canonical URI is used:
|
|
2360
|
+
|
|
2361
|
+
[source,ruby]
|
|
2362
|
+
----
|
|
2363
|
+
model = Item.new(name: "New Item")
|
|
2364
|
+
model.to_xml
|
|
2365
|
+
# => <Item xmlns="http://example.com/schema/main.xsd"><Name>New Item</Name></Item>
|
|
2366
|
+
----
|
|
2367
|
+
|
|
2368
|
+
=== Mixed Content with Aliases
|
|
2369
|
+
|
|
2370
|
+
When a parent element uses one URI variant and a child element uses another variant
|
|
2371
|
+
for the same namespace class, both are correctly preserved during round-trip:
|
|
2372
|
+
|
|
2373
|
+
[source,ruby]
|
|
2374
|
+
----
|
|
2375
|
+
xml = <<~XML
|
|
2376
|
+
<p:Parent xmlns:p="http://example.com/parent/">
|
|
2377
|
+
<c:childName xmlns:c="http://example.com/child/">mixed content</c:childName>
|
|
2378
|
+
</p:Parent>
|
|
2379
|
+
XML
|
|
2380
|
+
|
|
2381
|
+
model = Parent.from_xml(xml)
|
|
2382
|
+
model.to_xml # Preserves original URIs
|
|
2383
|
+
# => <p:Parent xmlns:p="http://example.com/parent/">
|
|
2384
|
+
# <c:childName xmlns:c="http://example.com/child/">mixed content</c:childName>
|
|
2385
|
+
# </p:Parent>
|
|
2386
|
+
----
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
== Doubly-Defined Namespace Prefixes
|
|
2390
|
+
|
|
2391
|
+
In some XML documents, the same namespace URI appears with multiple different prefixes.
|
|
2392
|
+
For example, an element might be declared with both `xmlns:a="http://example.com/items"` and
|
|
2393
|
+
`xmlns:b="http://example.com/items"`. Lutaml::Model automatically handles this through
|
|
2394
|
+
the format preservation system.
|
|
2395
|
+
|
|
2396
|
+
=== How It Works
|
|
2397
|
+
|
|
2398
|
+
Lutaml::Model tracks the specific prefix used for each element during parsing. When
|
|
2399
|
+
serializing, it preserves:
|
|
2400
|
+
|
|
2401
|
+
1. The original prefix format (default or prefixed) from the input XML
|
|
2402
|
+
2. For doubly-defined namespaces, the specific prefix variant used at each element
|
|
2403
|
+
|
|
2404
|
+
[source,ruby]
|
|
2405
|
+
----
|
|
2406
|
+
# Input XML with doubly-defined prefixes
|
|
2407
|
+
xml = <<~XML
|
|
2408
|
+
<root xmlns:a="http://example.com/items" xmlns:b="http://example.com/items">
|
|
2409
|
+
<a:item>using a</a:item>
|
|
2410
|
+
<b:item>using b</b:item>
|
|
2411
|
+
</root>
|
|
2412
|
+
XML
|
|
2413
|
+
|
|
2414
|
+
model = ItemContainer.from_xml(xml)
|
|
2415
|
+
output = model.to_xml
|
|
2416
|
+
|
|
2417
|
+
# Output preserves both prefix declarations
|
|
2418
|
+
# => <root xmlns:a="http://example.com/items" xmlns:b="http://example.com/items">
|
|
2419
|
+
# <a:item>using a</a:item>
|
|
2420
|
+
# <b:item>using b</b:item>
|
|
2421
|
+
# </root>
|
|
2422
|
+
----
|
|
2423
|
+
|
|
2424
|
+
=== Prefix Independence
|
|
2425
|
+
|
|
2426
|
+
The parsing side is already prefix-independent (per W3C spec) - elements are matched by
|
|
2427
|
+
namespace URI, not prefix. So `<a:item>` and `<b:item>` both correctly map to the same
|
|
2428
|
+
attribute regardless of which prefix was used in the input.
|
|
2429
|
+
|
|
2430
|
+
=== Format Priority for Doubly-Defined Namespaces
|
|
2431
|
+
|
|
2432
|
+
When the same namespace URI appears with multiple prefix variants, the serialization uses
|
|
2433
|
+
the same prefix variant that was present in the original input:
|
|
2434
|
+
|
|
2435
|
+
[source,ruby]
|
|
2436
|
+
----
|
|
2437
|
+
# Elements parsed with prefix "a" serialize with prefix "a"
|
|
2438
|
+
# Elements parsed with prefix "b" serialize with prefix "b"
|
|
2439
|
+
# Elements parsed with default namespace serialize with default namespace
|
|
2440
|
+
----
|
|
2441
|
+
|
|
2442
|
+
This behavior is automatic and transparent - you don't need to configure anything in your
|
|
2443
|
+
model definitions. The system tracks which prefix was used for each element during parsing
|
|
2444
|
+
and preserves it during serialization.
|
|
2445
|
+
|
|
2446
|
+
|
|
2447
|
+
== Invalid Namespace Handling (Formal Public Identifiers)
|
|
2448
|
+
|
|
2449
|
+
=== The Problem
|
|
2450
|
+
|
|
2451
|
+
Some legacy XML documents use Formal Public Identifiers (FPIs) in namespace positions.
|
|
2452
|
+
FPIs are SGML-era identifiers like `-//OASIS//DTD XML Exchange Table Model 19990315//EN`
|
|
2453
|
+
used in DOCTYPE declarations, not valid XML namespace URIs.
|
|
2454
|
+
|
|
2455
|
+
WARNING: Using FPIs as namespace URIs is **invalid according to W3C XML Namespaces specification**.
|
|
2456
|
+
XML namespaces must be valid URIs - FPIs are not valid URIs and cannot be used in `xmlns:`
|
|
2457
|
+
declarations.
|
|
2458
|
+
|
|
2459
|
+
=== What Happens
|
|
2460
|
+
|
|
2461
|
+
When you parse XML that has an FPI in a namespace position, the parsing will succeed
|
|
2462
|
+
because the underlying XML parser can store the value. However, when serializing back to XML,
|
|
2463
|
+
the underlying parser (Nokogiri, Oga, Ox, REXML) will reject the FPI as an invalid
|
|
2464
|
+
namespace URI:
|
|
2465
|
+
|
|
2466
|
+
[source]
|
|
2467
|
+
----
|
|
2468
|
+
Canon::Error: Relative namespace URI not allowed: -//OASIS//DTD XML Exchange Table Model 19990315//EN
|
|
2469
|
+
----
|
|
2470
|
+
|
|
2471
|
+
=== How Lutaml::Model Handles This
|
|
2472
|
+
|
|
2473
|
+
Lutaml::Model automatically converts FPIs to valid URNs per RFC 3151 during serialization.
|
|
2474
|
+
This allows you to parse and serialize XML that contains FPI namespaces, even though the
|
|
2475
|
+
original XML is technically invalid.
|
|
2476
|
+
|
|
2477
|
+
==== FPI to URN Conversion
|
|
2478
|
+
|
|
2479
|
+
FPIs are converted to `urn:publicid:` URNs following RFC 3151:
|
|
2480
|
+
|
|
2481
|
+
[source]
|
|
2482
|
+
----
|
|
2483
|
+
FPI: -//OASIS//DTD XML Exchange Table Model 19990315//EN
|
|
2484
|
+
URN: urn:publicid:-//OASIS//DTD+XML+Exchange+Table+Model+19990315//EN
|
|
2485
|
+
----
|
|
2486
|
+
|
|
2487
|
+
Conversion rules:
|
|
2488
|
+
|
|
2489
|
+
1. Replace spaces with `+`
|
|
2490
|
+
2. Replace `//` with `:/` in the FPI body (after the leading `-//` or `+//`)
|
|
2491
|
+
3. Prepend `urn:publicid:`
|
|
2492
|
+
|
|
2493
|
+
==== Example
|
|
2494
|
+
|
|
2495
|
+
[source,ruby]
|
|
2496
|
+
----
|
|
2497
|
+
# XML with FPI namespace (invalid but parseable)
|
|
2498
|
+
xml = <<~XML
|
|
2499
|
+
<table xmlns="-//OASIS//DTD XML Exchange Table Model 19990315//EN">
|
|
2500
|
+
<entry>Data</entry>
|
|
2501
|
+
</table>
|
|
2502
|
+
XML
|
|
2503
|
+
|
|
2504
|
+
# Parsing succeeds
|
|
2505
|
+
model = Table.from_xml(xml)
|
|
2506
|
+
|
|
2507
|
+
# Serialization converts FPI to URN
|
|
2508
|
+
model.to_xml
|
|
2509
|
+
# => <table xmlns="urn:publicid:-//OASIS//DTD+XML+Exchange+Table+Model+19990315//EN">
|
|
2510
|
+
# <entry>Data</entry>
|
|
2511
|
+
# </table>
|
|
2512
|
+
----
|
|
2513
|
+
|
|
2514
|
+
=== Round-Trip Is Not Possible
|
|
2515
|
+
|
|
2516
|
+
Since FPIs in namespace positions are invalid XML, true round-trip (input = output) is
|
|
2517
|
+
**not possible**. The output will always use the URN form because:
|
|
2518
|
+
|
|
2519
|
+
1. The original FPI is not a valid namespace URI
|
|
2520
|
+
2. XML parsers reject FPIs during serialization
|
|
2521
|
+
3. The URN form is the valid representation of the FPI
|
|
2522
|
+
|
|
2523
|
+
This is expected behavior - the library converts invalid input to valid output.
|
|
2524
|
+
|
|
2525
|
+
=== DOCTYPE PUBLIC Identifiers Are Separate
|
|
2526
|
+
|
|
2527
|
+
Note that FPI handling is separate from DOCTYPE `PUBLIC` identifiers. The PUBLIC identifier
|
|
2528
|
+
in a DOCTYPE declaration correctly uses FPIs and is properly preserved during round-trip:
|
|
2529
|
+
|
|
2530
|
+
[source,xml]
|
|
2531
|
+
----
|
|
2532
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2533
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2534
|
+
----
|
|
2535
|
+
|
|
2536
|
+
The FPI `-//W3C//DTD XHTML 1.0 Transitional//EN` belongs in the DOCTYPE `PUBLIC` field,
|
|
2537
|
+
not in namespace declarations. Lutaml::Model correctly handles DOCTYPE preservation
|
|
2538
|
+
separately from namespace handling.
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
== Deprecated ways of working with namespaces
|
|
2542
|
+
|
|
2543
|
+
|
|
2544
|
+
[[custom-prefixes]]
|
|
2545
|
+
== Custom namespace prefixes
|
|
2546
|
+
|
|
2547
|
+
LutaML Model allows you to customize the namespace prefix used during XML serialization through the `prefix` option on `to_xml`.
|
|
2548
|
+
|
|
2549
|
+
=== Usage
|
|
2550
|
+
|
|
2551
|
+
The `prefix` option accepts three types of values:
|
|
2552
|
+
|
|
2553
|
+
String:: Use a custom prefix for serialization
|
|
2554
|
+
Boolean `true`:: Use the namespace's configured `prefix_default`
|
|
2555
|
+
Boolean `false`:: Use default namespace format (`xmlns="..."`, no prefix)
|
|
2556
|
+
|
|
2557
|
+
[source,ruby]
|
|
2558
|
+
----
|
|
2559
|
+
class Document < Lutaml::Model::Serializable
|
|
2560
|
+
attribute :title, :string
|
|
2561
|
+
|
|
2562
|
+
xml do
|
|
2563
|
+
namespace DocumentNamespace # has prefix_default "doc"
|
|
2564
|
+
element "Document"
|
|
2565
|
+
map_element "title", to: :title
|
|
2566
|
+
end
|
|
2567
|
+
end
|
|
2568
|
+
|
|
2569
|
+
doc = Document.new(title: "Example")
|
|
2570
|
+
|
|
2571
|
+
# Default format
|
|
2572
|
+
doc.to_xml
|
|
2573
|
+
# => <Document xmlns="http://example.com">...</Document>
|
|
2574
|
+
|
|
2575
|
+
# Use namespace's default prefix
|
|
2576
|
+
doc.to_xml(prefix: true)
|
|
2577
|
+
# => <doc:Document xmlns:doc="http://example.com">...</doc:Document>
|
|
2578
|
+
|
|
2579
|
+
# Use custom prefix
|
|
2580
|
+
doc.to_xml(prefix: "d")
|
|
2581
|
+
# => <d:Document xmlns:d="http://example.com">...</d:Document>
|
|
2582
|
+
----
|
|
2583
|
+
|
|
2584
|
+
=== Prefix inheritance
|
|
2585
|
+
|
|
2586
|
+
Custom prefixes are automatically inherited by child elements in the same namespace:
|
|
2587
|
+
|
|
2588
|
+
[source,ruby]
|
|
2589
|
+
----
|
|
2590
|
+
parent.to_xml(prefix: "custom")
|
|
2591
|
+
# All elements in same namespace use "custom:" prefix
|
|
2592
|
+
----
|
|
2593
|
+
|
|
2594
|
+
=== Namespace identity vs presentation
|
|
2595
|
+
|
|
2596
|
+
IMPORTANT: The `prefix` option controls *presentation* (default vs prefix format), not namespace *identity* (which URI). The same namespace URI with different prefixes is still the same namespace semantically.
|
|
2597
|
+
|
|
2598
|
+
|
|
2599
|
+
.(DEPRECATED) Setting default namespace at the root element
|
|
2600
|
+
[source,ruby]
|
|
2601
|
+
----
|
|
2602
|
+
xml do
|
|
2603
|
+
namespace 'http://example.com/namespace'
|
|
2604
|
+
end
|
|
2605
|
+
----
|
|
2606
|
+
|
|
2607
|
+
.(DEPRECATED) Setting a prefixed namespace at the root element
|
|
2608
|
+
[source,ruby]
|
|
2609
|
+
----
|
|
2610
|
+
xml do
|
|
2611
|
+
namespace 'http://example.com/namespace', 'prefix'
|
|
2612
|
+
end
|
|
2613
|
+
----
|