lutaml-model 0.7.7 → 0.8.15

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.
Files changed (1700) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dependent-repos.json +10 -0
  3. data/.github/workflows/dependent-tests.yml +9 -0
  4. data/.github/workflows/docs.yml +59 -0
  5. data/.github/workflows/downstream-performance.yml +153 -0
  6. data/.github/workflows/opal.yml +31 -0
  7. data/.github/workflows/performance.yml +33 -0
  8. data/.github/workflows/rake.yml +13 -0
  9. data/.github/workflows/release.yml +5 -0
  10. data/.gitignore +27 -1
  11. data/.rspec-opal +5 -0
  12. data/.rubocop.yml +32 -2
  13. data/.rubocop_todo.yml +463 -88
  14. data/Gemfile +15 -9
  15. data/README.adoc +14117 -6914
  16. data/RELEASE_NOTES.adoc +53 -2
  17. data/Rakefile +2 -0
  18. data/bench/baselines/.gitkeep +0 -0
  19. data/bench/bench_all.rb +52 -0
  20. data/bench/bench_common.rb +147 -0
  21. data/bench/bench_compare.rb +195 -0
  22. data/bench/bench_mml.rb +53 -0
  23. data/bench/bench_niso.rb +54 -0
  24. data/bench/bench_sts.rb +49 -0
  25. data/bench/bench_unitsml.rb +43 -0
  26. data/bench/bench_xmi.rb +51 -0
  27. data/bench/gate_config.rb +120 -0
  28. data/benchmark/quick_benchmark.rb +297 -0
  29. data/benchmark/serialization_benchmark.rb +619 -0
  30. data/docs/.rubocop.yml +1 -0
  31. data/docs/.rubocop_todo.yml +7 -0
  32. data/docs/Gemfile +13 -0
  33. data/docs/PERFORMANCE_METHODOLOGY.md +645 -0
  34. data/docs/_config.yml +145 -0
  35. data/docs/_guides/advanced-mapping.adoc +564 -0
  36. data/docs/_guides/character-encoding.adoc +342 -0
  37. data/docs/_guides/collection-serialization.adoc +349 -0
  38. data/docs/_guides/creating-xsd.adoc +1221 -0
  39. data/docs/_guides/document-validation.adoc +303 -0
  40. data/docs/_guides/index.adoc +94 -0
  41. data/docs/_guides/jsonld-serialization.adoc +219 -0
  42. data/docs/_guides/keyvalue-serialization.adoc +1156 -0
  43. data/docs/_guides/liquid-templates.adoc +505 -0
  44. data/docs/_guides/missing-values-handling.adoc +1531 -0
  45. data/docs/_guides/ooxml-examples.adoc +755 -0
  46. data/docs/_guides/opal.adoc +221 -0
  47. data/docs/_guides/rdf-serialization.adoc +430 -0
  48. data/docs/{schema_generation.adoc → _guides/schema-generation.adoc} +5 -0
  49. data/docs/{schema_import.adoc → _guides/schema-import.adoc} +276 -4
  50. data/docs/_guides/turtle-serialization.adoc +237 -0
  51. data/docs/_guides/value-transformations.adoc +1388 -0
  52. data/docs/_guides/xml/namespace-presentation.adoc +476 -0
  53. data/docs/_guides/xml/namespace-semantics.adoc +677 -0
  54. data/docs/_guides/xml/reusable-mapping-classes.adoc +181 -0
  55. data/docs/_guides/xml/schema-location.adoc +245 -0
  56. data/docs/_guides/xml/type-namespaces.adoc +1011 -0
  57. data/docs/_guides/xml-mapping.adoc +1861 -0
  58. data/docs/_guides/xml-mappings-guide.adoc +21 -0
  59. data/docs/_guides/xml-namespace-declarations.adoc +662 -0
  60. data/docs/_guides/xml-namespace-qualification.adoc +720 -0
  61. data/docs/_guides/xml-namespaces.adoc +2613 -0
  62. data/docs/_guides/xml_mappings/01_introduction.adoc +65 -0
  63. data/docs/_guides/xml_mappings/02_core_concepts.adoc +177 -0
  64. data/docs/_guides/xml_mappings/03_architecture.adoc +205 -0
  65. data/docs/_guides/xml_mappings/04_xml_namespace_class.adoc +1754 -0
  66. data/docs/_guides/xml_mappings/05_common_patterns.adoc +1803 -0
  67. data/docs/_guides/xml_mappings/06_migration_guide.adoc +523 -0
  68. data/docs/_guides/xml_mappings/07_best_practices.adoc +996 -0
  69. data/docs/_guides/xml_mappings/08_troubleshooting.adoc +1023 -0
  70. data/docs/_migrations/0-1-0-migrate-from-shale.adoc +304 -0
  71. data/docs/_migrations/0-8-0-namespace-restructuring.adoc +1662 -0
  72. data/docs/_migrations/0-8-0-xsd-features.adoc +729 -0
  73. data/docs/_migrations/index.adoc +18 -0
  74. data/docs/_migrations/xsd-type-migration.adoc +1294 -0
  75. data/docs/_pages/attributes.adoc +1156 -0
  76. data/docs/_pages/breaking-changes.adoc +154 -0
  77. data/docs/_pages/collections.adoc +1670 -0
  78. data/docs/_pages/comparison-with-shale.adoc +139 -0
  79. data/docs/_pages/configuration.adoc +311 -0
  80. data/docs/_pages/consolidation-mapping.adoc +252 -0
  81. data/docs/_pages/importable_models.adoc +592 -0
  82. data/docs/_pages/index.adoc +47 -0
  83. data/docs/_pages/installation.adoc +35 -0
  84. data/docs/_pages/models.adoc +332 -0
  85. data/docs/_pages/quick-start.adoc +124 -0
  86. data/docs/_pages/serialization_adapters.adoc +351 -0
  87. data/docs/_pages/troubleshooting.adoc +104 -0
  88. data/docs/_pages/validation.adoc +171 -0
  89. data/docs/_pages/value_types.adoc +1514 -0
  90. data/docs/_pages/xml-conformance.adoc +143 -0
  91. data/docs/_references/architecture.adoc +189 -0
  92. data/docs/{custom_adapters.adoc → _references/custom_adapters.adoc} +6 -1
  93. data/docs/_references/custom_registers.adoc +1026 -0
  94. data/docs/_references/data-modeling-in-a-nutshell.adoc +207 -0
  95. data/docs/_references/format-independent-features.adoc +713 -0
  96. data/docs/_references/index.adoc +48 -0
  97. data/docs/_references/instance-serialization.adoc +120 -0
  98. data/docs/_references/lutaml-namespace-planning.md +120 -0
  99. data/docs/_references/parent-root-context.adoc +122 -0
  100. data/docs/_references/rdf-namespaces.adoc +243 -0
  101. data/docs/_references/reference_type.adoc +302 -0
  102. data/docs/_references/serialization-model-mappings.adoc +102 -0
  103. data/docs/_references/three-phase-namespace-architecture.adoc +470 -0
  104. data/docs/_references/xml-w3c-namespace-qualification.adoc +66 -0
  105. data/docs/_references/xsd-generation-with-namespace-support.adoc +449 -0
  106. data/docs/_references/xsd-schema-parsing.adoc +1260 -0
  107. data/docs/_references/xsd-type-architecture.adoc +534 -0
  108. data/docs/_tutorials/basic-model-definition.adoc +157 -0
  109. data/docs/_tutorials/custom-types-tutorial.adoc +258 -0
  110. data/docs/_tutorials/first-json-serialization.adoc +192 -0
  111. data/docs/_tutorials/first-xml-serialization.adoc +223 -0
  112. data/docs/_tutorials/index.adoc +60 -0
  113. data/docs/_tutorials/lutaml-xml-architecture.adoc +1359 -0
  114. data/docs/_tutorials/polymorphic-models-tutorial.adoc +253 -0
  115. data/docs/_tutorials/schema-compiler-module-namespaces.adoc +497 -0
  116. data/docs/_tutorials/validation-basics.adoc +232 -0
  117. data/docs/_tutorials/working-with-collections.adoc +201 -0
  118. data/docs/_tutorials/xml-element-attribute-namespace-guide.adoc +279 -0
  119. data/docs/_tutorials/xml-namespaces-basics.adoc +315 -0
  120. data/docs/_tutorials/xml-schema-primer-style-guide.adoc +1394 -0
  121. data/docs/architecture.md +424 -0
  122. data/docs/bugreports/BUGREPORT_element_order_render_empty.md +99 -0
  123. data/docs/cli_compare.adoc +249 -0
  124. data/docs/collection_validation.adoc +366 -0
  125. data/docs/index.adoc +110 -0
  126. data/docs/key_value_data_model.adoc +1229 -0
  127. data/docs/model_transforms.adoc +769 -0
  128. data/docs/namespace-management.adoc +1051 -0
  129. data/docs/xml-schema-qualification.md +171 -0
  130. data/docs/yamls_sequence.adoc +335 -0
  131. data/lib/lutaml/{model/hash_adapter → hash_format/adapter}/document.rb +3 -4
  132. data/lib/lutaml/hash_format/adapter/mapping.rb +17 -0
  133. data/lib/lutaml/hash_format/adapter/mapping_rule.rb +9 -0
  134. data/lib/lutaml/{model/hash_adapter → hash_format/adapter}/standard_adapter.rb +3 -3
  135. data/lib/lutaml/hash_format/adapter/transform.rb +9 -0
  136. data/lib/lutaml/hash_format/adapter.rb +13 -0
  137. data/lib/lutaml/hash_format/type/serializers.rb +24 -0
  138. data/lib/lutaml/hash_format.rb +29 -0
  139. data/lib/lutaml/{model/json → json/adapter}/document.rb +3 -3
  140. data/lib/lutaml/json/adapter/mapping.rb +17 -0
  141. data/lib/lutaml/json/adapter/mapping_rule.rb +9 -0
  142. data/lib/lutaml/json/adapter/multi_json_adapter.rb +40 -0
  143. data/lib/lutaml/json/adapter/oj_adapter.rb +40 -0
  144. data/lib/lutaml/json/adapter/standard_adapter.rb +36 -0
  145. data/lib/lutaml/json/adapter/transform.rb +9 -0
  146. data/lib/lutaml/json/adapter.rb +20 -0
  147. data/lib/lutaml/json/schema/json_schema.rb +62 -0
  148. data/lib/lutaml/json/schema.rb +9 -0
  149. data/lib/lutaml/json/type/serializers.rb +72 -0
  150. data/lib/lutaml/json.rb +62 -0
  151. data/lib/lutaml/{model/jsonl → jsonl/adapter}/document.rb +2 -2
  152. data/lib/lutaml/jsonl/adapter/mapping.rb +17 -0
  153. data/lib/lutaml/jsonl/adapter/mapping_rule.rb +9 -0
  154. data/lib/lutaml/{model/jsonl → jsonl/adapter}/standard_adapter.rb +5 -4
  155. data/lib/lutaml/jsonl/adapter/transform.rb +26 -0
  156. data/lib/lutaml/jsonl/adapter.rb +13 -0
  157. data/lib/lutaml/jsonl.rb +21 -0
  158. data/lib/lutaml/jsonld/adapter.rb +23 -0
  159. data/lib/lutaml/jsonld/context.rb +69 -0
  160. data/lib/lutaml/jsonld/term_definition.rb +39 -0
  161. data/lib/lutaml/jsonld/transform.rb +251 -0
  162. data/lib/lutaml/jsonld.rb +23 -0
  163. data/lib/lutaml/key_value/adapter/hash/document.rb +13 -0
  164. data/lib/lutaml/key_value/adapter/hash/mapping.rb +17 -0
  165. data/lib/lutaml/key_value/adapter/hash/mapping_rule.rb +9 -0
  166. data/lib/lutaml/key_value/adapter/hash/standard_adapter.rb +19 -0
  167. data/lib/lutaml/key_value/adapter/hash/transform.rb +10 -0
  168. data/lib/lutaml/key_value/adapter/hash.rb +15 -0
  169. data/lib/lutaml/key_value/adapter/json/document.rb +16 -0
  170. data/lib/lutaml/key_value/adapter/json/mapping.rb +22 -0
  171. data/lib/lutaml/key_value/adapter/json/mapping_rule.rb +14 -0
  172. data/lib/lutaml/key_value/adapter/json/multi_json_adapter.rb +45 -0
  173. data/lib/lutaml/key_value/adapter/json/oj_adapter.rb +45 -0
  174. data/lib/lutaml/key_value/adapter/json/standard_adapter.rb +41 -0
  175. data/lib/lutaml/key_value/adapter/json/transform.rb +14 -0
  176. data/lib/lutaml/key_value/adapter/json.rb +24 -0
  177. data/lib/lutaml/key_value/adapter/jsonl/document.rb +16 -0
  178. data/lib/lutaml/key_value/adapter/jsonl/mapping.rb +17 -0
  179. data/lib/lutaml/key_value/adapter/jsonl/mapping_rule.rb +9 -0
  180. data/lib/lutaml/key_value/adapter/jsonl/standard_adapter.rb +36 -0
  181. data/lib/lutaml/key_value/adapter/jsonl/transform.rb +26 -0
  182. data/lib/lutaml/key_value/adapter/jsonl.rb +17 -0
  183. data/lib/lutaml/key_value/adapter/toml/document.rb +13 -0
  184. data/lib/lutaml/key_value/adapter/toml/mapping.rb +26 -0
  185. data/lib/lutaml/key_value/adapter/toml/mapping_rule.rb +9 -0
  186. data/lib/lutaml/key_value/adapter/toml/toml_rb_adapter.rb +40 -0
  187. data/lib/lutaml/key_value/adapter/toml/tomlib_adapter.rb +46 -0
  188. data/lib/lutaml/key_value/adapter/toml/transform.rb +10 -0
  189. data/lib/lutaml/key_value/adapter/toml.rb +21 -0
  190. data/lib/lutaml/key_value/adapter/yaml/document.rb +12 -0
  191. data/lib/lutaml/key_value/adapter/yaml/mapping.rb +17 -0
  192. data/lib/lutaml/key_value/adapter/yaml/mapping_rule.rb +9 -0
  193. data/lib/lutaml/key_value/adapter/yaml/standard_adapter.rb +41 -0
  194. data/lib/lutaml/key_value/adapter/yaml/transform.rb +10 -0
  195. data/lib/lutaml/key_value/adapter/yaml.rb +17 -0
  196. data/lib/lutaml/key_value/adapter/yamls/document.rb +16 -0
  197. data/lib/lutaml/key_value/adapter/yamls/mapping.rb +17 -0
  198. data/lib/lutaml/key_value/adapter/yamls/mapping_rule.rb +9 -0
  199. data/lib/lutaml/key_value/adapter/yamls/standard_adapter.rb +37 -0
  200. data/lib/lutaml/key_value/adapter/yamls/transform.rb +26 -0
  201. data/lib/lutaml/key_value/adapter/yamls.rb +17 -0
  202. data/lib/lutaml/key_value/adapter.rb +14 -0
  203. data/lib/lutaml/key_value/data_model/element.rb +222 -0
  204. data/lib/lutaml/key_value/data_model.rb +14 -0
  205. data/lib/lutaml/{model/key_value_document.rb → key_value/document.rb} +2 -2
  206. data/lib/lutaml/key_value/mapping.rb +290 -0
  207. data/lib/lutaml/{model/mapping/key_value_mapping_rule.rb → key_value/mapping_rule.rb} +9 -10
  208. data/lib/lutaml/{model/transform/key_value_transform.rb → key_value/transform.rb} +114 -68
  209. data/lib/lutaml/key_value/transformation/collection_serializer.rb +589 -0
  210. data/lib/lutaml/key_value/transformation/rule_compiler.rb +294 -0
  211. data/lib/lutaml/key_value/transformation/value_serializer.rb +268 -0
  212. data/lib/lutaml/key_value/transformation.rb +1081 -0
  213. data/lib/lutaml/key_value/transformation_builder.rb +30 -0
  214. data/lib/lutaml/key_value.rb +24 -0
  215. data/lib/lutaml/model/adapter_resolver.rb +405 -0
  216. data/lib/lutaml/model/adapter_scope.rb +64 -0
  217. data/lib/lutaml/model/attribute.rb +536 -123
  218. data/lib/lutaml/model/attribute_validator.rb +290 -0
  219. data/lib/lutaml/model/cached_type_resolver/concurrent_map_cache.rb +46 -0
  220. data/lib/lutaml/model/cached_type_resolver/mutex_hash_cache.rb +51 -0
  221. data/lib/lutaml/model/cached_type_resolver.rb +145 -0
  222. data/lib/lutaml/model/choice.rb +230 -13
  223. data/lib/lutaml/model/cli.rb +75 -121
  224. data/lib/lutaml/model/collection.rb +511 -44
  225. data/lib/lutaml/model/collection_handler.rb +106 -0
  226. data/lib/lutaml/model/comparable_model.rb +21 -13
  227. data/lib/lutaml/model/comparable_nil.rb +0 -2
  228. data/lib/lutaml/model/compiled_rule.rb +208 -0
  229. data/lib/lutaml/model/config.rb +111 -80
  230. data/lib/lutaml/model/configuration.rb +91 -0
  231. data/lib/lutaml/model/consolidation/attribute_grouper.rb +44 -0
  232. data/lib/lutaml/model/consolidation/dispatcher.rb +45 -0
  233. data/lib/lutaml/model/consolidation/engine.rb +33 -0
  234. data/lib/lutaml/model/consolidation/pattern_chunker.rb +87 -0
  235. data/lib/lutaml/model/consolidation_map.rb +68 -0
  236. data/lib/lutaml/model/consolidation_rule/dispatch_block.rb +34 -0
  237. data/lib/lutaml/model/consolidation_rule/gather_rule.rb +17 -0
  238. data/lib/lutaml/model/consolidation_rule/pattern_content_rule.rb +15 -0
  239. data/lib/lutaml/model/consolidation_rule/pattern_element_rule.rb +17 -0
  240. data/lib/lutaml/model/consolidation_rule.rb +27 -0
  241. data/lib/lutaml/model/constants.rb +5 -3
  242. data/lib/lutaml/model/context_registry.rb +208 -0
  243. data/lib/lutaml/model/deep_dupable.rb +16 -0
  244. data/lib/lutaml/model/error/element_count_out_of_range_error.rb +13 -7
  245. data/lib/lutaml/model/error/format_adapter_not_specified_error.rb +25 -0
  246. data/lib/lutaml/model/error/invalid_attribute_type_error.rb +98 -0
  247. data/lib/lutaml/model/error/invalid_format_error.rb +11 -0
  248. data/lib/lutaml/model/error/liquid_class_not_found_error.rb +9 -0
  249. data/lib/lutaml/model/error/liquid_drop_already_registered_error.rb +11 -0
  250. data/lib/lutaml/model/error/mapping_already_exists_error.rb +6 -0
  251. data/lib/lutaml/model/error/mapping_attribute_missing_error.rb +6 -0
  252. data/lib/lutaml/model/error/mapping_attribute_type_error.rb +6 -0
  253. data/lib/lutaml/model/error/mixed_content_collection_error.rb +17 -0
  254. data/lib/lutaml/model/error/no_attributes_defined_liquid_error.rb +9 -0
  255. data/lib/lutaml/model/error/no_mapping_found_error.rb +9 -0
  256. data/lib/lutaml/model/error/no_root_mapping_error.rb +6 -5
  257. data/lib/lutaml/model/error/no_root_namespace_error.rb +6 -5
  258. data/lib/lutaml/model/error/ordered_content_mapping_error.rb +17 -0
  259. data/lib/lutaml/model/error/required_attribute_missing_error.rb +9 -0
  260. data/lib/lutaml/model/error/reverse_transform_block_not_defined_error.rb +6 -0
  261. data/lib/lutaml/model/error/reverse_transformation_declaration_error.rb +6 -0
  262. data/lib/lutaml/model/error/sorting_configuration_conflict_error.rb +9 -0
  263. data/lib/lutaml/model/error/transform_block_not_defined_error.rb +6 -0
  264. data/lib/lutaml/model/error/type.rb +17 -0
  265. data/lib/lutaml/model/error/type_only_mapping_error.rb +13 -0
  266. data/lib/lutaml/model/error/type_only_namespace_error.rb +12 -0
  267. data/lib/lutaml/model/error/undefined_attribute_error.rb +9 -0
  268. data/lib/lutaml/model/error/unknown_adapter_type_error.rb +82 -3
  269. data/lib/lutaml/model/error/unknown_type_error.rb +25 -2
  270. data/lib/lutaml/model/error/unresolvable_type_error.rb +27 -0
  271. data/lib/lutaml/model/error.rb +2 -33
  272. data/lib/lutaml/model/errors.rb +4 -2
  273. data/lib/lutaml/model/finalization_cache.rb +51 -0
  274. data/lib/lutaml/model/format_registry.rb +181 -9
  275. data/lib/lutaml/model/global_context.rb +447 -0
  276. data/lib/lutaml/model/global_register.rb +106 -5
  277. data/lib/lutaml/model/hash.rb +15 -0
  278. data/lib/lutaml/model/import_registry.rb +250 -0
  279. data/lib/lutaml/model/instrumentation.rb +304 -0
  280. data/lib/lutaml/model/json.rb +17 -13
  281. data/lib/lutaml/model/jsonl.rb +7 -13
  282. data/lib/lutaml/model/liquefiable.rb +112 -18
  283. data/lib/lutaml/model/liquid/indexed_access.rb +33 -0
  284. data/lib/lutaml/model/liquid/mapping.rb +30 -0
  285. data/lib/lutaml/model/liquid.rb +10 -0
  286. data/lib/lutaml/model/mapping/listener.rb +126 -0
  287. data/lib/lutaml/model/mapping/mapping.rb +113 -1
  288. data/lib/lutaml/model/mapping/mapping_rule.rb +188 -23
  289. data/lib/lutaml/model/mapping/model_mapping.rb +133 -0
  290. data/lib/lutaml/model/mapping/model_mapping_rule.rb +57 -0
  291. data/lib/lutaml/model/mapping_hash.rb +4 -2
  292. data/lib/lutaml/model/model_transformer.rb +101 -0
  293. data/lib/lutaml/model/one_entry_cache.rb +57 -0
  294. data/lib/lutaml/model/organization.rb +29 -0
  295. data/lib/lutaml/model/register/model_tree_importer.rb +88 -0
  296. data/lib/lutaml/model/register/namespace_binding.rb +92 -0
  297. data/lib/lutaml/model/register.rb +500 -35
  298. data/lib/lutaml/model/registrable.rb +2 -0
  299. data/lib/lutaml/model/render_policy.rb +148 -0
  300. data/lib/lutaml/model/runtime_compatibility.rb +94 -0
  301. data/lib/lutaml/model/schema/base_schema.rb +1 -3
  302. data/lib/lutaml/model/schema/decorators/attribute.rb +3 -1
  303. data/lib/lutaml/model/schema/decorators/choices.rb +0 -2
  304. data/lib/lutaml/model/schema/decorators/class_definition.rb +4 -5
  305. data/lib/lutaml/model/schema/decorators/definition_collection.rb +7 -7
  306. data/lib/lutaml/model/schema/decorators.rb +15 -0
  307. data/lib/lutaml/model/schema/generator/definition.rb +4 -3
  308. data/lib/lutaml/model/schema/generator/definitions_collection.rb +4 -3
  309. data/lib/lutaml/model/schema/generator/properties_collection.rb +7 -5
  310. data/lib/lutaml/model/schema/generator/property.rb +5 -1
  311. data/lib/lutaml/model/schema/generator.rb +15 -0
  312. data/lib/lutaml/model/schema/helpers.rb +11 -0
  313. data/lib/lutaml/model/schema/json_schema.rb +9 -53
  314. data/lib/lutaml/model/schema/renderer.rb +19 -17
  315. data/lib/lutaml/model/schema/schema_builder/nokogiri.rb +41 -0
  316. data/lib/lutaml/model/schema/schema_builder/oga.rb +92 -0
  317. data/lib/lutaml/model/schema/shared_methods.rb +2 -2
  318. data/lib/lutaml/model/schema/xml_compiler/attribute.rb +33 -12
  319. data/lib/lutaml/model/schema/xml_compiler/attribute_group.rb +3 -1
  320. data/lib/lutaml/model/schema/xml_compiler/choice.rb +4 -2
  321. data/lib/lutaml/model/schema/xml_compiler/complex_type.rb +73 -36
  322. data/lib/lutaml/model/schema/xml_compiler/element.rb +18 -1
  323. data/lib/lutaml/model/schema/xml_compiler/group.rb +20 -4
  324. data/lib/lutaml/model/schema/xml_compiler/registry_generator.rb +127 -0
  325. data/lib/lutaml/model/schema/xml_compiler/restriction.rb +5 -2
  326. data/lib/lutaml/model/schema/xml_compiler/sequence.rb +6 -4
  327. data/lib/lutaml/model/schema/xml_compiler/simple_content.rb +7 -3
  328. data/lib/lutaml/model/schema/xml_compiler/simple_type.rb +127 -51
  329. data/lib/lutaml/model/schema/xml_compiler/xml_namespace_class.rb +110 -0
  330. data/lib/lutaml/model/schema/xml_compiler.rb +261 -87
  331. data/lib/lutaml/model/schema/yaml_schema.rb +10 -50
  332. data/lib/lutaml/model/schema.rb +49 -14
  333. data/lib/lutaml/model/schema_location.rb +12 -60
  334. data/lib/lutaml/model/sequence.rb +104 -30
  335. data/lib/lutaml/model/serializable.rb +1 -3
  336. data/lib/lutaml/model/serialization_adapter.rb +2 -0
  337. data/lib/lutaml/model/serialize/attribute_definition.rb +229 -0
  338. data/lib/lutaml/model/serialize/builder.rb +169 -0
  339. data/lib/lutaml/model/serialize/deserialization_context.rb +50 -0
  340. data/lib/lutaml/model/serialize/enum_handling.rb +124 -0
  341. data/lib/lutaml/model/serialize/format_conversion.rb +353 -0
  342. data/lib/lutaml/model/serialize/initialization.rb +432 -0
  343. data/lib/lutaml/model/serialize/model_import.rb +357 -0
  344. data/lib/lutaml/model/serialize/transformation_builder.rb +127 -0
  345. data/lib/lutaml/model/serialize/value_mapping.rb +200 -0
  346. data/lib/lutaml/model/serialize.rb +172 -578
  347. data/lib/lutaml/model/services/base.rb +2 -0
  348. data/lib/lutaml/model/services/default_value_resolver.rb +60 -0
  349. data/lib/lutaml/model/services/logger.rb +10 -7
  350. data/lib/lutaml/model/services/rule_value_extractor.rb +23 -36
  351. data/lib/lutaml/model/services/transformer.rb +95 -19
  352. data/lib/lutaml/model/services/type/validator/string.rb +3 -2
  353. data/lib/lutaml/model/services/type/validator/symbol.rb +30 -0
  354. data/lib/lutaml/model/services/type/validator.rb +5 -2
  355. data/lib/lutaml/model/services/type.rb +9 -0
  356. data/lib/lutaml/model/services/validator.rb +1 -3
  357. data/lib/lutaml/model/services.rb +12 -5
  358. data/lib/lutaml/model/store.rb +181 -0
  359. data/lib/lutaml/model/toml.rb +24 -18
  360. data/lib/lutaml/model/transform/xml_transform.rb +4 -227
  361. data/lib/lutaml/model/transform.rb +99 -19
  362. data/lib/lutaml/model/transformation.rb +84 -0
  363. data/lib/lutaml/model/transformation_builder.rb +55 -0
  364. data/lib/lutaml/model/transformation_registry.rb +314 -0
  365. data/lib/lutaml/model/type/base64_binary.rb +58 -0
  366. data/lib/lutaml/model/type/boolean.rb +9 -16
  367. data/lib/lutaml/model/type/date.rb +49 -9
  368. data/lib/lutaml/model/type/date_time.rb +30 -18
  369. data/lib/lutaml/model/type/decimal.rb +28 -9
  370. data/lib/lutaml/model/type/duration.rb +82 -0
  371. data/lib/lutaml/model/type/float.rb +12 -13
  372. data/lib/lutaml/model/type/hash.rb +19 -22
  373. data/lib/lutaml/model/type/hex_binary.rb +56 -0
  374. data/lib/lutaml/model/type/integer.rb +19 -1
  375. data/lib/lutaml/model/type/qname.rb +85 -0
  376. data/lib/lutaml/model/type/reference.rb +76 -0
  377. data/lib/lutaml/model/type/string.rb +18 -35
  378. data/lib/lutaml/model/type/symbol.rb +67 -0
  379. data/lib/lutaml/model/type/time.rb +19 -22
  380. data/lib/lutaml/model/type/time_without_date.rb +18 -18
  381. data/lib/lutaml/model/type/uninitialized_class_guard.rb +36 -0
  382. data/lib/lutaml/model/type/uri.rb +51 -0
  383. data/lib/lutaml/model/type/value.rb +52 -5
  384. data/lib/lutaml/model/type.rb +98 -13
  385. data/lib/lutaml/model/type_context.rb +285 -0
  386. data/lib/lutaml/model/type_registry.rb +165 -0
  387. data/lib/lutaml/model/type_resolver.rb +180 -0
  388. data/lib/lutaml/model/type_substitution.rb +117 -0
  389. data/lib/lutaml/model/uninitialized_class.rb +12 -6
  390. data/lib/lutaml/model/utils.rb +144 -19
  391. data/lib/lutaml/model/validation/concerns/has_issues.rb +27 -0
  392. data/lib/lutaml/model/validation/context.rb +36 -0
  393. data/lib/lutaml/model/validation/issue.rb +62 -0
  394. data/lib/lutaml/model/validation/layer_result.rb +34 -0
  395. data/lib/lutaml/model/validation/profile.rb +66 -0
  396. data/lib/lutaml/model/validation/registry.rb +60 -0
  397. data/lib/lutaml/model/validation/remediation.rb +33 -0
  398. data/lib/lutaml/model/validation/remediation_result.rb +20 -0
  399. data/lib/lutaml/model/validation/report.rb +39 -0
  400. data/lib/lutaml/model/validation/rule.rb +59 -0
  401. data/lib/lutaml/model/validation.rb +59 -9
  402. data/lib/lutaml/model/validation_framework.rb +77 -0
  403. data/lib/lutaml/model/value_transformer.rb +25 -0
  404. data/lib/lutaml/model/version.rb +1 -1
  405. data/lib/lutaml/model/yaml.rb +7 -13
  406. data/lib/lutaml/model/yamls.rb +7 -13
  407. data/lib/lutaml/model.rb +243 -25
  408. data/lib/lutaml/rdf/error.rb +7 -0
  409. data/lib/lutaml/rdf/iri.rb +44 -0
  410. data/lib/lutaml/rdf/language_tagged.rb +11 -0
  411. data/lib/lutaml/rdf/literal.rb +62 -0
  412. data/lib/lutaml/rdf/mapping.rb +86 -0
  413. data/lib/lutaml/rdf/mapping_rule.rb +52 -0
  414. data/lib/lutaml/rdf/member_rule.rb +55 -0
  415. data/lib/lutaml/rdf/namespace.rb +58 -0
  416. data/lib/lutaml/rdf/namespace_set.rb +69 -0
  417. data/lib/lutaml/rdf/namespaces/dcterms_namespace.rb +12 -0
  418. data/lib/lutaml/rdf/namespaces/owl_namespace.rb +12 -0
  419. data/lib/lutaml/rdf/namespaces/rdf_namespace.rb +14 -0
  420. data/lib/lutaml/rdf/namespaces/rdfs_namespace.rb +12 -0
  421. data/lib/lutaml/rdf/namespaces/skos_namespace.rb +12 -0
  422. data/lib/lutaml/rdf/namespaces/xsd_namespace.rb +12 -0
  423. data/lib/lutaml/rdf/namespaces.rb +14 -0
  424. data/lib/lutaml/rdf/transform.rb +45 -0
  425. data/lib/lutaml/rdf.rb +19 -0
  426. data/lib/lutaml/{model/toml → toml/adapter}/document.rb +3 -4
  427. data/lib/lutaml/toml/adapter/mapping.rb +26 -0
  428. data/lib/lutaml/toml/adapter/mapping_rule.rb +9 -0
  429. data/lib/lutaml/toml/adapter/toml_rb_adapter.rb +38 -0
  430. data/lib/lutaml/toml/adapter/tomlib_adapter.rb +54 -0
  431. data/lib/lutaml/toml/adapter/transform.rb +9 -0
  432. data/lib/lutaml/toml/adapter.rb +19 -0
  433. data/lib/lutaml/toml/type/serializers.rb +71 -0
  434. data/lib/lutaml/toml.rb +48 -0
  435. data/lib/lutaml/turtle/adapter.rb +35 -0
  436. data/lib/lutaml/turtle/mapping.rb +7 -0
  437. data/lib/lutaml/turtle/transform.rb +249 -0
  438. data/lib/lutaml/turtle.rb +22 -0
  439. data/lib/lutaml/xml/adapter/adapter_helpers.rb +108 -0
  440. data/lib/lutaml/xml/adapter/base_adapter.rb +249 -0
  441. data/lib/lutaml/xml/adapter/namespace_data.rb +56 -0
  442. data/lib/lutaml/xml/adapter/namespace_uri_collector.rb +71 -0
  443. data/lib/lutaml/xml/adapter/nokogiri_adapter.rb +16 -0
  444. data/lib/lutaml/xml/adapter/oga_adapter.rb +16 -0
  445. data/lib/lutaml/xml/adapter/ox_adapter.rb +16 -0
  446. data/lib/lutaml/xml/adapter/plan_based_builder.rb +929 -0
  447. data/lib/lutaml/xml/adapter/rexml_adapter.rb +21 -0
  448. data/lib/lutaml/xml/adapter/xml_parser.rb +86 -0
  449. data/lib/lutaml/xml/adapter/xml_serializer.rb +311 -0
  450. data/lib/lutaml/xml/adapter.rb +23 -0
  451. data/lib/lutaml/xml/adapter_element.rb +215 -0
  452. data/lib/lutaml/xml/adapter_loader.rb +53 -0
  453. data/lib/lutaml/xml/attribute_namespace_resolver.rb +139 -0
  454. data/lib/lutaml/xml/blank_namespace.rb +51 -0
  455. data/lib/lutaml/xml/blank_namespace_handler.rb +50 -0
  456. data/lib/lutaml/xml/builder/base.rb +253 -0
  457. data/lib/lutaml/xml/builder/nokogiri.rb +10 -0
  458. data/lib/lutaml/xml/builder/oga.rb +13 -0
  459. data/lib/lutaml/xml/builder/ox.rb +13 -0
  460. data/lib/lutaml/xml/builder/rexml.rb +13 -0
  461. data/lib/lutaml/xml/builder.rb +17 -0
  462. data/lib/lutaml/xml/configurable.rb +215 -0
  463. data/lib/lutaml/xml/data_model.rb +279 -0
  464. data/lib/lutaml/xml/decisions/decision.rb +103 -0
  465. data/lib/lutaml/xml/decisions/decision_context.rb +225 -0
  466. data/lib/lutaml/xml/decisions/decision_engine.rb +67 -0
  467. data/lib/lutaml/xml/decisions/decision_rule.rb +54 -0
  468. data/lib/lutaml/xml/decisions/element_prefix_resolver.rb +85 -0
  469. data/lib/lutaml/xml/decisions/rules/attribute_usage_rule.rb +37 -0
  470. data/lib/lutaml/xml/decisions/rules/default_preference_rule.rb +62 -0
  471. data/lib/lutaml/xml/decisions/rules/element_form_default_rule.rb +66 -0
  472. data/lib/lutaml/xml/decisions/rules/element_form_default_unqualified_rule.rb +73 -0
  473. data/lib/lutaml/xml/decisions/rules/element_form_option_rule.rb +83 -0
  474. data/lib/lutaml/xml/decisions/rules/explicit_option_rule.rb +57 -0
  475. data/lib/lutaml/xml/decisions/rules/format_preservation_rule.rb +74 -0
  476. data/lib/lutaml/xml/decisions/rules/hoisted_on_parent_rule.rb +60 -0
  477. data/lib/lutaml/xml/decisions/rules/inherit_from_parent_rule.rb +52 -0
  478. data/lib/lutaml/xml/decisions/rules/inherit_parent_prefix_rule.rb +69 -0
  479. data/lib/lutaml/xml/decisions/rules/namespace_scope_rule.rb +54 -0
  480. data/lib/lutaml/xml/decisions/rules/reuse_parent_prefix_rule.rb +78 -0
  481. data/lib/lutaml/xml/decisions/rules/used_prefix_rule.rb +70 -0
  482. data/lib/lutaml/xml/decisions/rules.rb +39 -0
  483. data/lib/lutaml/xml/decisions.rb +15 -0
  484. data/lib/lutaml/xml/declaration_handler.rb +115 -0
  485. data/lib/lutaml/xml/declaration_plan/attribute_node.rb +81 -0
  486. data/lib/lutaml/xml/declaration_plan/element_node.rb +101 -0
  487. data/lib/lutaml/xml/declaration_plan.rb +480 -0
  488. data/lib/lutaml/xml/declaration_plan_query.rb +105 -0
  489. data/lib/lutaml/xml/declaration_planner.rb +1848 -0
  490. data/lib/lutaml/xml/doctype_extractor.rb +51 -0
  491. data/lib/lutaml/xml/document.rb +385 -0
  492. data/lib/lutaml/xml/element.rb +102 -0
  493. data/lib/lutaml/xml/element_prefix_resolver.rb +50 -0
  494. data/lib/lutaml/xml/encoding_normalizer.rb +54 -0
  495. data/lib/lutaml/xml/error/invalid_namespace_error.rb +46 -0
  496. data/lib/lutaml/xml/error/invalid_xsd_type_error.rb +43 -0
  497. data/lib/lutaml/xml/error/namespace_mismatch_error.rb +53 -0
  498. data/lib/lutaml/xml/error/xml_configuration_error.rb +17 -0
  499. data/lib/lutaml/xml/error/xml_error.rb +21 -0
  500. data/lib/lutaml/xml/format_chooser.rb +214 -0
  501. data/lib/lutaml/xml/hoisting_algorithm.rb +234 -0
  502. data/lib/lutaml/xml/listener.rb +33 -0
  503. data/lib/lutaml/xml/mapping.rb +1479 -0
  504. data/lib/lutaml/xml/mapping_rule.rb +578 -0
  505. data/lib/lutaml/xml/model_transform.rb +984 -0
  506. data/lib/lutaml/xml/namespace.rb +435 -0
  507. data/lib/lutaml/xml/namespace_class_registry.rb +144 -0
  508. data/lib/lutaml/xml/namespace_collector.rb +611 -0
  509. data/lib/lutaml/xml/namespace_declaration.rb +202 -0
  510. data/lib/lutaml/xml/namespace_declaration_builder.rb +67 -0
  511. data/lib/lutaml/xml/namespace_declaration_data.rb +179 -0
  512. data/lib/lutaml/xml/namespace_inheritance_resolver.rb +142 -0
  513. data/lib/lutaml/xml/namespace_inheritance_strategy.rb +26 -0
  514. data/lib/lutaml/xml/namespace_needs.rb +213 -0
  515. data/lib/lutaml/xml/namespace_resolution_strategy.rb +230 -0
  516. data/lib/lutaml/xml/namespace_resolver.rb +219 -0
  517. data/lib/lutaml/xml/namespace_scope_config.rb +110 -0
  518. data/lib/lutaml/xml/namespace_type_resolver.rb +135 -0
  519. data/lib/lutaml/xml/namespace_usage.rb +121 -0
  520. data/lib/lutaml/xml/nokogiri/element.rb +34 -0
  521. data/lib/lutaml/xml/nokogiri.rb +10 -0
  522. data/lib/lutaml/xml/oga/element.rb +15 -0
  523. data/lib/lutaml/xml/oga.rb +10 -0
  524. data/lib/lutaml/xml/ox/element.rb +15 -0
  525. data/lib/lutaml/xml/ox.rb +10 -0
  526. data/lib/lutaml/xml/parsed_namespace_declaration.rb +129 -0
  527. data/lib/lutaml/xml/parsed_namespace_set.rb +149 -0
  528. data/lib/lutaml/xml/polymorphic_value_handler.rb +41 -0
  529. data/lib/lutaml/xml/qualified_inheritance_strategy.rb +27 -0
  530. data/lib/lutaml/xml/rexml/element.rb +15 -0
  531. data/lib/lutaml/xml/rexml.rb +10 -0
  532. data/lib/lutaml/xml/schema/builder/nokogiri.rb +41 -0
  533. data/lib/lutaml/xml/schema/builder/oga.rb +92 -0
  534. data/lib/lutaml/xml/schema/builder.rb +59 -0
  535. data/lib/lutaml/xml/schema/builtin_types.rb +112 -0
  536. data/lib/lutaml/{model → xml}/schema/relaxng_schema.rb +9 -4
  537. data/lib/lutaml/xml/schema/xsd/all.rb +31 -0
  538. data/lib/lutaml/xml/schema/xsd/annotation.rb +31 -0
  539. data/lib/lutaml/xml/schema/xsd/any.rb +33 -0
  540. data/lib/lutaml/xml/schema/xsd/any_attribute.rb +29 -0
  541. data/lib/lutaml/xml/schema/xsd/appinfo.rb +25 -0
  542. data/lib/lutaml/xml/schema/xsd/attribute.rb +78 -0
  543. data/lib/lutaml/xml/schema/xsd/attribute_group.rb +89 -0
  544. data/lib/lutaml/xml/schema/xsd/base.rb +270 -0
  545. data/lib/lutaml/xml/schema/xsd/choice.rb +68 -0
  546. data/lib/lutaml/xml/schema/xsd/complex_content.rb +39 -0
  547. data/lib/lutaml/xml/schema/xsd/complex_type.rb +157 -0
  548. data/lib/lutaml/xml/schema/xsd/documentation.rb +26 -0
  549. data/lib/lutaml/xml/schema/xsd/element.rb +117 -0
  550. data/lib/lutaml/xml/schema/xsd/enumeration.rb +25 -0
  551. data/lib/lutaml/xml/schema/xsd/errors/enhanced_error.rb +142 -0
  552. data/lib/lutaml/xml/schema/xsd/errors/error_context.rb +67 -0
  553. data/lib/lutaml/xml/schema/xsd/errors/message_builder.rb +103 -0
  554. data/lib/lutaml/xml/schema/xsd/errors/suggestion.rb +67 -0
  555. data/lib/lutaml/xml/schema/xsd/errors/troubleshooters/namespace_troubleshooter.rb +96 -0
  556. data/lib/lutaml/xml/schema/xsd/errors/troubleshooters/troubleshooting_handler.rb +70 -0
  557. data/lib/lutaml/xml/schema/xsd/errors.rb +148 -0
  558. data/lib/lutaml/xml/schema/xsd/extension_complex_content.rb +63 -0
  559. data/lib/lutaml/xml/schema/xsd/extension_simple_content.rb +48 -0
  560. data/lib/lutaml/xml/schema/xsd/field.rb +25 -0
  561. data/lib/lutaml/xml/schema/xsd/file_validation_result.rb +55 -0
  562. data/lib/lutaml/xml/schema/xsd/fraction_digits.rb +29 -0
  563. data/lib/lutaml/xml/schema/xsd/glob.rb +105 -0
  564. data/lib/lutaml/xml/schema/xsd/group.rb +79 -0
  565. data/lib/lutaml/xml/schema/xsd/import.rb +33 -0
  566. data/lib/lutaml/xml/schema/xsd/include.rb +31 -0
  567. data/lib/lutaml/xml/schema/xsd/key.rb +32 -0
  568. data/lib/lutaml/xml/schema/xsd/keyref.rb +33 -0
  569. data/lib/lutaml/xml/schema/xsd/length.rb +27 -0
  570. data/lib/lutaml/xml/schema/xsd/list.rb +28 -0
  571. data/lib/lutaml/xml/schema/xsd/max_exclusive.rb +25 -0
  572. data/lib/lutaml/xml/schema/xsd/max_inclusive.rb +23 -0
  573. data/lib/lutaml/xml/schema/xsd/max_length.rb +25 -0
  574. data/lib/lutaml/xml/schema/xsd/min_exclusive.rb +25 -0
  575. data/lib/lutaml/xml/schema/xsd/min_inclusive.rb +23 -0
  576. data/lib/lutaml/xml/schema/xsd/min_length.rb +25 -0
  577. data/lib/lutaml/xml/schema/xsd/namespace_mapping.rb +37 -0
  578. data/lib/lutaml/xml/schema/xsd/namespace_uri_remapping.rb +79 -0
  579. data/lib/lutaml/xml/schema/xsd/notation.rb +31 -0
  580. data/lib/lutaml/xml/schema/xsd/pattern.rb +25 -0
  581. data/lib/lutaml/xml/schema/xsd/redefine.rb +35 -0
  582. data/lib/lutaml/xml/schema/xsd/restriction_complex_content.rb +56 -0
  583. data/lib/lutaml/xml/schema/xsd/restriction_simple_content.rb +84 -0
  584. data/lib/lutaml/xml/schema/xsd/restriction_simple_type.rb +64 -0
  585. data/lib/lutaml/xml/schema/xsd/schema.rb +376 -0
  586. data/lib/lutaml/xml/schema/xsd/schema_file_validation_results.rb +55 -0
  587. data/lib/lutaml/xml/schema/xsd/schema_location_mapping.rb +74 -0
  588. data/lib/lutaml/xml/schema/xsd/schema_name_resolver.rb +32 -0
  589. data/lib/lutaml/xml/schema/xsd/schema_path.rb +202 -0
  590. data/lib/lutaml/xml/schema/xsd/schema_validator.rb +259 -0
  591. data/lib/lutaml/xml/schema/xsd/selector.rb +27 -0
  592. data/lib/lutaml/xml/schema/xsd/sequence.rb +68 -0
  593. data/lib/lutaml/xml/schema/xsd/serialized_schema.rb +185 -0
  594. data/lib/lutaml/xml/schema/xsd/simple_content.rb +61 -0
  595. data/lib/lutaml/xml/schema/xsd/simple_type.rb +37 -0
  596. data/lib/lutaml/xml/schema/xsd/total_digits.rb +29 -0
  597. data/lib/lutaml/xml/schema/xsd/type_index_entry.rb +40 -0
  598. data/lib/lutaml/xml/schema/xsd/type_resolution_result.rb +112 -0
  599. data/lib/lutaml/xml/schema/xsd/union.rb +30 -0
  600. data/lib/lutaml/xml/schema/xsd/unique.rb +31 -0
  601. data/lib/lutaml/xml/schema/xsd/validation_error.rb +48 -0
  602. data/lib/lutaml/xml/schema/xsd/validation_result.rb +86 -0
  603. data/lib/lutaml/xml/schema/xsd/version.rb +11 -0
  604. data/lib/lutaml/xml/schema/xsd/white_space.rb +27 -0
  605. data/lib/lutaml/xml/schema/xsd.rb +166 -0
  606. data/lib/lutaml/xml/schema/xsd_namespace.rb +29 -0
  607. data/lib/lutaml/xml/schema/xsd_schema.rb +536 -0
  608. data/lib/lutaml/xml/schema.rb +16 -0
  609. data/lib/lutaml/xml/schema_location.rb +155 -0
  610. data/lib/lutaml/xml/serialization/collection_ext.rb +61 -0
  611. data/lib/lutaml/xml/serialization/format_conversion.rb +380 -0
  612. data/lib/lutaml/xml/serialization/instance_methods.rb +298 -0
  613. data/lib/lutaml/xml/serialization/model_import_ext.rb +40 -0
  614. data/lib/lutaml/xml/serialization.rb +15 -0
  615. data/lib/lutaml/xml/shared_dsl.rb +119 -0
  616. data/lib/lutaml/xml/transform.rb +6 -0
  617. data/lib/lutaml/xml/transformation/custom_method_wrapper.rb +241 -0
  618. data/lib/lutaml/xml/transformation/element_builder.rb +588 -0
  619. data/lib/lutaml/xml/transformation/ordered_applier.rb +373 -0
  620. data/lib/lutaml/xml/transformation/rule_applier.rb +379 -0
  621. data/lib/lutaml/xml/transformation/rule_compiler.rb +543 -0
  622. data/lib/lutaml/xml/transformation/skip_logic.rb +70 -0
  623. data/lib/lutaml/xml/transformation/value_serializer.rb +137 -0
  624. data/lib/lutaml/xml/transformation.rb +379 -0
  625. data/lib/lutaml/xml/transformation_builder.rb +28 -0
  626. data/lib/lutaml/xml/transformation_support.rb +14 -0
  627. data/lib/lutaml/xml/type/configurable.rb +153 -0
  628. data/lib/lutaml/xml/type/serializers.rb +98 -0
  629. data/lib/lutaml/xml/type/value_xml_mapping.rb +94 -0
  630. data/lib/lutaml/xml/type_namespace/collector.rb +101 -0
  631. data/lib/lutaml/xml/type_namespace/declaration.rb +61 -0
  632. data/lib/lutaml/xml/type_namespace/planner.rb +121 -0
  633. data/lib/lutaml/xml/type_namespace/reference.rb +71 -0
  634. data/lib/lutaml/xml/type_namespace/resolver.rb +43 -0
  635. data/lib/lutaml/xml/type_namespace.rb +13 -0
  636. data/lib/lutaml/xml/type_namespace_resolver.rb +76 -0
  637. data/lib/lutaml/xml/unqualified_inheritance_strategy.rb +34 -0
  638. data/lib/lutaml/xml/w3c/registration.rb +66 -0
  639. data/lib/lutaml/xml/w3c.rb +398 -0
  640. data/lib/lutaml/xml/xml_attribute.rb +38 -0
  641. data/lib/lutaml/xml/xml_element.rb +460 -0
  642. data/lib/lutaml/xml/xml_namespace.rb +72 -0
  643. data/lib/lutaml/xml/xml_orderable.rb +17 -0
  644. data/lib/lutaml/xml.rb +290 -0
  645. data/lib/lutaml/{model/yaml → yaml/adapter}/document.rb +3 -3
  646. data/lib/lutaml/yaml/adapter/mapping.rb +17 -0
  647. data/lib/lutaml/yaml/adapter/mapping_rule.rb +9 -0
  648. data/lib/lutaml/yaml/adapter/standard_adapter.rb +39 -0
  649. data/lib/lutaml/yaml/adapter/transform.rb +9 -0
  650. data/lib/lutaml/yaml/adapter.rb +13 -0
  651. data/lib/lutaml/yaml/schema/yaml_schema.rb +65 -0
  652. data/lib/lutaml/yaml/schema.rb +9 -0
  653. data/lib/lutaml/yaml/type/serializers.rb +60 -0
  654. data/lib/lutaml/yaml.rb +30 -0
  655. data/lib/lutaml/{model/yamls → yamls/adapter}/document.rb +2 -2
  656. data/lib/lutaml/yamls/adapter/mapping.rb +30 -0
  657. data/lib/lutaml/yamls/adapter/mapping_rule.rb +9 -0
  658. data/lib/lutaml/yamls/adapter/standard_adapter.rb +56 -0
  659. data/lib/lutaml/yamls/adapter/transform.rb +124 -0
  660. data/lib/lutaml/yamls/adapter/yamls_sequence.rb +20 -0
  661. data/lib/lutaml/yamls/adapter/yamls_sequence_rule.rb +48 -0
  662. data/lib/lutaml/yamls/adapter.rb +15 -0
  663. data/lib/lutaml/yamls.rb +21 -0
  664. data/lib/tasks/benchmark_runner.rb +161 -0
  665. data/lib/tasks/memory_profile.rb +176 -0
  666. data/lib/tasks/performance.rake +75 -0
  667. data/lib/tasks/performance_benchmark.rb +499 -0
  668. data/lib/tasks/performance_comparator.rb +114 -0
  669. data/lib/tasks/performance_helpers.rb +149 -0
  670. data/lib/tasks/xml_compiler_benchmark.rb +226 -0
  671. data/lib/tasks/xml_optimization_benchmark.rb +178 -0
  672. data/lutaml-model.gemspec +10 -1
  673. data/reference-docs/XML Entity Definitions for Characters (3rd Edition).html +595 -0
  674. data/scripts-xmi-profile/profile_xmi.rb +192 -0
  675. data/scripts-xmi-profile/profile_xmi_simple.rb +210 -0
  676. data/spec/address_person_spec.rb +436 -0
  677. data/spec/address_spec.rb +20 -18
  678. data/spec/ceramic_spec.rb +25 -7
  679. data/spec/fixtures/address.rb +2 -2
  680. data/spec/fixtures/ceramic.rb +6 -2
  681. data/spec/fixtures/geolexica_v2_concept.rb +136 -0
  682. data/spec/fixtures/geolexica_v2_sample.yaml +36 -0
  683. data/spec/fixtures/geolexica_v2_sample2.yaml +38 -0
  684. data/spec/fixtures/person.rb +14 -13
  685. data/spec/fixtures/sample_model.rb +3 -3
  686. data/spec/fixtures/vase.rb +3 -3
  687. data/spec/fixtures/xml/address_example_260.xsd +8 -4
  688. data/spec/fixtures/xml/examples/nested_categories.xml +45 -51
  689. data/spec/fixtures/xml/examples/valid_catalog.xml +27 -41
  690. data/spec/fixtures/xml/math_document_schema.xsd +7 -5
  691. data/spec/fixtures/xml/product_catalog.xsd +19 -138
  692. data/spec/fixtures/xml/schema/xsd/build_test_package.rb +19 -0
  693. data/spec/fixtures/xml/schema/xsd/citygml/2.0/cityGMLBase.xsd +339 -0
  694. data/spec/fixtures/xml/schema/xsd/citygml/appearance/2.0/appearance.xsd +332 -0
  695. data/spec/fixtures/xml/schema/xsd/citygml/bridge/2.0/bridge.xsd +578 -0
  696. data/spec/fixtures/xml/schema/xsd/citygml/building/2.0/building.xsd +535 -0
  697. data/spec/fixtures/xml/schema/xsd/citygml/cityfurniture/2.0/cityFurniture.xsd +57 -0
  698. data/spec/fixtures/xml/schema/xsd/citygml/cityobjectgroup/2.0/cityObjectGroup.xsd +84 -0
  699. data/spec/fixtures/xml/schema/xsd/citygml/examples/2.0/ade/noise-ade/CityGML-NoiseADE.xsd +174 -0
  700. data/spec/fixtures/xml/schema/xsd/citygml/examples/2.0/ade/robotics-ade/stdOp.xsd +46 -0
  701. data/spec/fixtures/xml/schema/xsd/citygml/examples/2.0/ade/robotics-ade/unr.xsd +46 -0
  702. data/spec/fixtures/xml/schema/xsd/citygml/generics/2.0/generics.xsd +184 -0
  703. data/spec/fixtures/xml/schema/xsd/citygml/landuse/2.0/landUse.xsd +50 -0
  704. data/spec/fixtures/xml/schema/xsd/citygml/profiles/base/2.0/CityGML.xsd +30 -0
  705. data/spec/fixtures/xml/schema/xsd/citygml/relief/2.0/relief.xsd +186 -0
  706. data/spec/fixtures/xml/schema/xsd/citygml/texturedsurface/2.0/texturedSurface.xsd +157 -0
  707. data/spec/fixtures/xml/schema/xsd/citygml/transportation/2.0/transportation.xsd +224 -0
  708. data/spec/fixtures/xml/schema/xsd/citygml/tunnel/2.0/tunnel.xsd +530 -0
  709. data/spec/fixtures/xml/schema/xsd/citygml/vegetation/2.0/vegetation.xsd +108 -0
  710. data/spec/fixtures/xml/schema/xsd/citygml/waterbody/2.0/waterBody.xsd +171 -0
  711. data/spec/fixtures/xml/schema/xsd/citygml/xAL/xAL.xsd +1680 -0
  712. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/basicTypes.xsd +262 -0
  713. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coordinateOperations.xsd +519 -0
  714. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coordinateReferenceSystems.xsd +367 -0
  715. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coordinateSystems.xsd +291 -0
  716. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/coverage.xsd +287 -0
  717. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/datums.xsd +281 -0
  718. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/defaultStyle.xsd +447 -0
  719. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/deprecatedTypes.xsd +1128 -0
  720. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/dictionary.xsd +84 -0
  721. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/direction.xsd +78 -0
  722. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/dynamicFeature.xsd +103 -0
  723. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/feature.xsd +88 -0
  724. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryAggregates.xsd +191 -0
  725. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryBasic0d1d.xsd +271 -0
  726. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryBasic2d.xsd +118 -0
  727. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryComplexes.xsd +89 -0
  728. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/geometryPrimitives.xsd +841 -0
  729. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/gml.xsd +15 -0
  730. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/gmlBase.xsd +179 -0
  731. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/grids.xsd +58 -0
  732. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/measures.xsd +63 -0
  733. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/observation.xsd +90 -0
  734. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/referenceSystems.xsd +64 -0
  735. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/temporal.xsd +263 -0
  736. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/temporalReferenceSystems.xsd +183 -0
  737. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/temporalTopology.xsd +113 -0
  738. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/topology.xsd +380 -0
  739. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/units.xsd +156 -0
  740. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/gml/3.2.1/valueObjects.xsd +199 -0
  741. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gco/basicTypes.xsd +429 -0
  742. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gco/gco.xsd +12 -0
  743. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gco/gcoBase.xsd +61 -0
  744. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/applicationSchema.xsd +42 -0
  745. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/citation.xsd +275 -0
  746. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/constraints.xsd +106 -0
  747. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/content.xsd +188 -0
  748. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/dataQuality.xsd +554 -0
  749. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/distribution.xsd +202 -0
  750. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/extent.xsd +205 -0
  751. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/freeText.xsd +122 -0
  752. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/gmd.xsd +12 -0
  753. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/identification.xsd +348 -0
  754. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/maintenance.xsd +86 -0
  755. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/metadataApplication.xsd +175 -0
  756. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/metadataEntity.xsd +70 -0
  757. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/metadataExtension.xsd +99 -0
  758. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/portrayalCatalogue.xsd +36 -0
  759. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/referenceSystem.xsd +100 -0
  760. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmd/spatialRepresentation.xsd +237 -0
  761. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/catalogues.xsd +112 -0
  762. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/codelistItem.xsd +168 -0
  763. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/crsItem.xsd +1030 -0
  764. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/extendedTypes.xsd +75 -0
  765. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/gmx.xsd +2 -0
  766. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/gmxUsage.xsd +127 -0
  767. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gmx/uomItem.xsd +162 -0
  768. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gsr/gsr.xsd +12 -0
  769. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gsr/spatialReferencing.xsd +24 -0
  770. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gss/geometry.xsd +35 -0
  771. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gss/gss.xsd +12 -0
  772. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gts/gts.xsd +12 -0
  773. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/iso/19139/20070417/gts/temporalObjects.xsd +34 -0
  774. data/spec/fixtures/xml/schema/xsd/codesynthesis-gml-3.2.1/xlink/1.0.0/xlinks.xsd +122 -0
  775. data/spec/fixtures/xml/schema/xsd/i-ur/urbanFunction.xsd +2772 -0
  776. data/spec/fixtures/xml/schema/xsd/i-ur/urbanObject.xsd +3344 -0
  777. data/spec/fixtures/xml/schema/xsd/import-without-location.xsd +9 -0
  778. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2/baseTypes.xsd +775 -0
  779. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2/gco.xsd +17 -0
  780. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2.0/baseTypes.xsd +775 -0
  781. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gco/1.2.0/gco.xsd +17 -0
  782. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2/extendedTypes.xsd +151 -0
  783. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2/gcx.xsd +16 -0
  784. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2.0/extendedTypes.xsd +151 -0
  785. data/spec/fixtures/xml/schema/xsd/isotc211/19103/-/gcx/1.2.0/gcx.xsd +16 -0
  786. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/coordinateGeometry.xsd +1078 -0
  787. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometricAggregates.xsd +141 -0
  788. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometricComplex.xsd +177 -0
  789. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometricPrimative.xsd +526 -0
  790. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometry.xsd +9 -0
  791. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/geometryRoot.xsd +59 -0
  792. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/gss.xsd +26 -0
  793. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topoComplex.xsd +33 -0
  794. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topoPrimative.xsd +432 -0
  795. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topoRoot.xsd +9 -0
  796. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/1.0.0/topology.xsd +15 -0
  797. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/coordinates.xsd +15 -0
  798. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/curves.xsd +22 -0
  799. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/geometry.xsd +41 -0
  800. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/gss.xsd +21 -0
  801. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/simplicialGeometry.xsd +63 -0
  802. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/solids.xsd +21 -0
  803. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/surfaces.xsd +15 -0
  804. data/spec/fixtures/xml/schema/xsd/isotc211/19107/-/gss/2.0.0/topology.xsd +21 -0
  805. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.1.0/abstract.xsd +47 -0
  806. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.1.0/fcc.xsd +12 -0
  807. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2/abstract.xsd +45 -0
  808. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2/fcc.xsd +11 -0
  809. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2.0/abstract.xsd +45 -0
  810. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/fcc/2.2.0/fcc.xsd +11 -0
  811. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/1.0/gfc.xsd +497 -0
  812. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.1.0/featureCatalogue.xsd +673 -0
  813. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.1.0/gfc.xsd +19 -0
  814. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2/featureCatalogue.xsd +798 -0
  815. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2/gfc.xsd +19 -0
  816. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2.0/featureCatalogue.xsd +798 -0
  817. data/spec/fixtures/xml/schema/xsd/isotc211/19110/-/gfc/2.2.0/gfc.xsd +19 -0
  818. data/spec/fixtures/xml/schema/xsd/isotc211/19110/fcc/1.0/abstract.xsd +49 -0
  819. data/spec/fixtures/xml/schema/xsd/isotc211/19110/fcc/1.0/fcc.xsd +9 -0
  820. data/spec/fixtures/xml/schema/xsd/isotc211/19110/gfc/1.1/featureCatalogue.xsd +671 -0
  821. data/spec/fixtures/xml/schema/xsd/isotc211/19110/gfc/1.1/gfc.xsd +13 -0
  822. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1/rbc.xsd +13 -0
  823. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1/rbcStubs.xsd +195 -0
  824. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.0/rbc.xsd +13 -0
  825. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.0/rbcStubs.xsd +195 -0
  826. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/AbstractCommonClasses.xsd +282 -0
  827. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/commonClasses.xsd +127 -0
  828. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordOps.xsd +676 -0
  829. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordRefSys.xsd +498 -0
  830. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordSys.xsd +844 -0
  831. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/coordinates.xsd +101 -0
  832. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/datum.xsd +474 -0
  833. data/spec/fixtures/xml/schema/xsd/isotc211/19111/-/rbc/3.1.1/rbc.xsd +18 -0
  834. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3/cit.xsd +12 -0
  835. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3/citation.xsd +445 -0
  836. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3.0/cit.xsd +12 -0
  837. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/cit/1.3.0/citation.xsd +445 -0
  838. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3/extent.xsd +243 -0
  839. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3/gex.xsd +16 -0
  840. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.0/extent.xsd +243 -0
  841. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.0/gex.xsd +16 -0
  842. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.1/extent.xsd +244 -0
  843. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/gex/1.3.1/gex.xsd +15 -0
  844. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3/lan.xsd +13 -0
  845. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3/language.xsd +152 -0
  846. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3.0/lan.xsd +13 -0
  847. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/lan/1.3.0/language.xsd +152 -0
  848. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3/applicationSchema.xsd +58 -0
  849. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3/mas.xsd +16 -0
  850. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3.0/applicationSchema.xsd +58 -0
  851. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mas/1.3.0/mas.xsd +16 -0
  852. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3/AbstractCommonClasses.xsd +378 -0
  853. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3/commonClasses.xsd +205 -0
  854. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3/mcc.xsd +12 -0
  855. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3.0/AbstractCommonClasses.xsd +378 -0
  856. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3.0/commonClasses.xsd +205 -0
  857. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mcc/1.3.0/mcc.xsd +12 -0
  858. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3/constraints.xsd +171 -0
  859. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3/mco.xsd +14 -0
  860. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3.0/constraints.xsd +171 -0
  861. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mco/1.3.0/mco.xsd +14 -0
  862. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3/mda.xsd +13 -0
  863. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3/metadataApplication.xsd +207 -0
  864. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.0/mda.xsd +13 -0
  865. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.0/metadataApplication.xsd +207 -0
  866. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.1/mda.xsd +13 -0
  867. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mda/1.3.1/metadataApplication.xsd +247 -0
  868. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3/mdb.xsd +11 -0
  869. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3/metadataBase.xsd +117 -0
  870. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3/metadataBaseMDAerror.xsd +116 -0
  871. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.0/mdb.xsd +11 -0
  872. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.0/metadataBase.xsd +117 -0
  873. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.0/metadataBaseMDAerror.xsd +116 -0
  874. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.1/mdb.xsd +11 -0
  875. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mdb/1.3.1/metadataBase.xsd +144 -0
  876. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3/metadataExtension.xsd +138 -0
  877. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3/mex.xsd +15 -0
  878. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3.0/metadataExtension.xsd +138 -0
  879. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mex/1.3.0/mex.xsd +15 -0
  880. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3/maintenance.xsd +70 -0
  881. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3/mmi.xsd +14 -0
  882. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3.0/maintenance.xsd +70 -0
  883. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mmi/1.3.0/mmi.xsd +14 -0
  884. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3/mpc.xsd +14 -0
  885. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3/portrayalCatalogue.xsd +40 -0
  886. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3.0/mpc.xsd +14 -0
  887. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mpc/1.3.0/portrayalCatalogue.xsd +40 -0
  888. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3/content.xsd +368 -0
  889. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3/mrc.xsd +19 -0
  890. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.0/content.xsd +368 -0
  891. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.0/mrc.xsd +19 -0
  892. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.1/content.xsd +366 -0
  893. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrc/1.3.1/mrc.xsd +13 -0
  894. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3/distribution.xsd +232 -0
  895. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3/mrd.xsd +13 -0
  896. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3.0/distribution.xsd +232 -0
  897. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrd/1.3.0/mrd.xsd +13 -0
  898. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3/identification.xsd +425 -0
  899. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3/mri.xsd +16 -0
  900. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3.0/identification.xsd +425 -0
  901. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mri/1.3.0/mri.xsd +16 -0
  902. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3/lineage.xsd +130 -0
  903. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3/mrl.xsd +15 -0
  904. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3.0/lineage.xsd +130 -0
  905. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrl/1.3.0/mrl.xsd +15 -0
  906. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3/mrs.xsd +16 -0
  907. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3/referenceSystem.xsd +67 -0
  908. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.0/mrs.xsd +16 -0
  909. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.0/referenceSystem.xsd +67 -0
  910. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.1/mrs.xsd +16 -0
  911. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/mrs/1.3.1/referenceSystem.xsd +66 -0
  912. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3/msr.xsd +17 -0
  913. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3/spatialRepresentation.xsd +326 -0
  914. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.0/msr.xsd +17 -0
  915. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.0/spatialRepresentation.xsd +326 -0
  916. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.1/msr.xsd +15 -0
  917. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/msr/1.3.1/spatialRepresentation.xsd +326 -0
  918. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3/serviceInformation.xsd +252 -0
  919. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3/srv.xsd +14 -0
  920. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3.0/serviceInformation.xsd +252 -0
  921. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-1/srv/1.3.0/srv.xsd +14 -0
  922. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/acquisitionInformation.xsd +415 -0
  923. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/contentInformation.xsd +147 -0
  924. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/dataQualityInformation.xsd +214 -0
  925. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/gmi.xsd +23 -0
  926. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/metadataEntitySet.xsd +43 -0
  927. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.0/spatialRepresentationInformation.xsd +140 -0
  928. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/acquisitionInformation.xsd +415 -0
  929. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/contentInformation.xsd +147 -0
  930. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/dataQualityInformation.xsd +214 -0
  931. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/gmi.xsd +24 -0
  932. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/metadataEntitySet.xsd +43 -0
  933. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/gmi/1.1/spatialRepresentationInformation.xsd +142 -0
  934. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2/acquisitionInformationImagery.xsd +796 -0
  935. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2/mac.xsd +11 -0
  936. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.0/acquisitionInformationImagery.xsd +796 -0
  937. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.0/mac.xsd +11 -0
  938. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.1/acquisitionInformationImagery.xsd +799 -0
  939. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mac/2.2.1/mac.xsd +10 -0
  940. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrc/2.2/contentInformationImagery.xsd +161 -0
  941. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrc/2.2.0/contentInformationImagery.xsd +161 -0
  942. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrc/2.2.1/contentInformationImagery.xsd +159 -0
  943. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrl/2.2/lineageImagery.xsd +312 -0
  944. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/mrl/2.2.0/lineageImagery.xsd +312 -0
  945. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/msr/2.2/spatialRepresentationImagery.xsd +138 -0
  946. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/msr/2.2.0/spatialRepresentationImagery.xsd +138 -0
  947. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-2/msr/2.2.1/spatialRepresentationImagery.xsd +145 -0
  948. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/cat.xsd +16 -0
  949. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/catalogues.xsd +59 -0
  950. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/codelistItem.xsd +63 -0
  951. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/crsItem.xsd +188 -0
  952. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cat/1.0/uomItem.xsd +45 -0
  953. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/1.0/cit.xsd +11 -0
  954. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/1.0/citation.xsd +400 -0
  955. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/2.0/cit.xsd +11 -0
  956. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/cit/2.0/citation.xsd +402 -0
  957. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gco/1.0/baseTypes.xsd +532 -0
  958. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gco/1.0/baseTypes2014.xsd +531 -0
  959. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gco/1.0/gco.xsd +16 -0
  960. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gcx/1.0/extendedTypes.xsd +97 -0
  961. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gcx/1.0/gcx.xsd +11 -0
  962. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gex/1.0/extent.xsd +207 -0
  963. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gex/1.0/gex.xsd +15 -0
  964. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gmw/1.0/gmlWrapperTypes.xsd +147 -0
  965. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gmw/1.0/gmlWrapperTypes2014.xsd +147 -0
  966. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/gmw/1.0/gmw.xsd +17 -0
  967. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/lan/1.0/lan.xsd +13 -0
  968. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/lan/1.0/language.xsd +141 -0
  969. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/1.0/acquisitionInformationImagery.xsd +424 -0
  970. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/1.0/mac.xsd +14 -0
  971. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/acquisitionInformationImagery.xsd +473 -0
  972. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/event.xsd +106 -0
  973. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/mac.xsd +15 -0
  974. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mac/2.0/metadataEntitySet.xsd +46 -0
  975. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mas/1.0/applicationSchema.xsd +53 -0
  976. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mas/1.0/mas.xsd +15 -0
  977. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mcc/1.0/AbstractCommonClasses.xsd +362 -0
  978. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mcc/1.0/commonClasses.xsd +179 -0
  979. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mcc/1.0/mcc.xsd +12 -0
  980. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mco/1.0/constraints.xsd +152 -0
  981. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mco/1.0/mco.xsd +13 -0
  982. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/1.0/md1.xsd +19 -0
  983. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/1.0/metadataWExtendedType.xsd +10 -0
  984. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/2.0/md1.xsd +19 -0
  985. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md1/2.0/metadataWExtendedType.xsd +10 -0
  986. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/1.0/md2.xsd +27 -0
  987. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/1.0/metadataWithExtensions.xsd +10 -0
  988. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/2.0/md2.xsd +27 -0
  989. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/md2/2.0/metadataWithExtensions.xsd +10 -0
  990. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/1.0/mda.xsd +13 -0
  991. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/1.0/metadataApplication.xsd +188 -0
  992. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/2.0/mda.xsd +13 -0
  993. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mda/2.0/metadataApplication.xsd +189 -0
  994. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/1.0/mdb.xsd +23 -0
  995. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/1.0/metadataBase.xsd +97 -0
  996. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/2.0/mdb.xsd +23 -0
  997. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdb/2.0/metadataBase.xsd +105 -0
  998. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/1.0/mds.xsd +59 -0
  999. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/1.0/metadataDataServices.xsd +10 -0
  1000. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/2.0/mds.xsd +44 -0
  1001. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mds/2.0/metadataDataServices.xsd +10 -0
  1002. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/1.0/mdt.xsd +17 -0
  1003. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/1.0/metadataTransfer.xsd +121 -0
  1004. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/2.0/mdt.xsd +17 -0
  1005. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mdt/2.0/metadataTransfer.xsd +121 -0
  1006. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mex/1.0/metadataExtension.xsd +122 -0
  1007. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mex/1.0/mex.xsd +13 -0
  1008. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mmi/1.0/maintenance.xsd +63 -0
  1009. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mmi/1.0/mmi.xsd +13 -0
  1010. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mpc/1.0/mpc.xsd +13 -0
  1011. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mpc/1.0/portrayalCatalogue.xsd +35 -0
  1012. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/1.0/content.xsd +330 -0
  1013. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/1.0/contentInformationImagery.xsd +160 -0
  1014. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/1.0/mrc.xsd +18 -0
  1015. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/2.0/content.xsd +334 -0
  1016. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/2.0/contentInformationImagery.xsd +143 -0
  1017. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrc/2.0/mrc.xsd +21 -0
  1018. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrd/1.0/distribution.xsd +212 -0
  1019. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrd/1.0/mrd.xsd +13 -0
  1020. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mri/1.0/identification.xsd +385 -0
  1021. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mri/1.0/mri.xsd +15 -0
  1022. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/1.0/lineage.xsd +117 -0
  1023. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/1.0/lineageImagery.xsd +168 -0
  1024. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/1.0/mrl.xsd +14 -0
  1025. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/2.0/lineage.xsd +118 -0
  1026. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/2.0/lineageImagery.xsd +250 -0
  1027. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrl/2.0/mrl.xsd +14 -0
  1028. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrs/1.0/mrs.xsd +13 -0
  1029. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/mrs/1.0/referenceSystem.xsd +47 -0
  1030. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/1.0/msr.xsd +16 -0
  1031. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/1.0/spatialRepresentation.xsd +288 -0
  1032. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/1.0/spatialRepresentationImagery.xsd +113 -0
  1033. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/2.0/msr.xsd +16 -0
  1034. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/2.0/spatialRepresentation.xsd +296 -0
  1035. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/msr/2.0/spatialRepresentationImagery.xsd +114 -0
  1036. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.0/serviceInformation.xsd +217 -0
  1037. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.0/srv.xsd +14 -0
  1038. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.1/serviceInformation.xsd +220 -0
  1039. data/spec/fixtures/xml/schema/xsd/isotc211/19115/-3/srv/2.1/srv.xsd +14 -0
  1040. data/spec/fixtures/xml/schema/xsd/isotc211/19119/-/srv/1.0/serviceMetadata.xsd +204 -0
  1041. data/spec/fixtures/xml/schema/xsd/isotc211/19119/-/srv/1.0/serviceModel.xsd +230 -0
  1042. data/spec/fixtures/xml/schema/xsd/isotc211/19119/-/srv/1.0/srv.xsd +13 -0
  1043. data/spec/fixtures/xml/schema/xsd/isotc211/19119/srv/serviceMetadata.xsd +204 -0
  1044. data/spec/fixtures/xml/schema/xsd/isotc211/19119/srv/serviceModel.xsd +238 -0
  1045. data/spec/fixtures/xml/schema/xsd/isotc211/19119/srv/srv.xsd +13 -0
  1046. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1/cis-0.xsd +17 -0
  1047. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1/codeLists.xsd +68 -0
  1048. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1/gridPoint.xsd +47 -0
  1049. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1.0/cis-0.xsd +17 -0
  1050. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1.0/codeLists.xsd +68 -0
  1051. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/1.1.0/gridPoint.xsd +47 -0
  1052. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/3.1.0/codeLists.xsd +68 -0
  1053. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-/cis/3.1.0/gridPoint.xsd +47 -0
  1054. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.0/coverage.xsd +185 -0
  1055. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.0/gmlcovAll.xsd +21 -0
  1056. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.0/grids.xsd +115 -0
  1057. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1/coverage.xsd +188 -0
  1058. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1/gmlcovAll.xsd +25 -0
  1059. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1/grids.xsd +119 -0
  1060. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1.0/coverage.xsd +188 -0
  1061. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1.0/gmlcovAll.xsd +25 -0
  1062. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/1.1.0/grids.xsd +119 -0
  1063. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/3.1.0/coverage.xsd +188 -0
  1064. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/3.1.0/gmlcovAll.xsd +23 -0
  1065. data/spec/fixtures/xml/schema/xsd/isotc211/19123/-2/cis/3.1.0/grids.xsd +119 -0
  1066. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/codeList.xsd +134 -0
  1067. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/groundControlPoints.xsd +239 -0
  1068. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/nonPhysicalSensorModel.xsd +321 -0
  1069. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/physicalSensorModel.xsd +62 -0
  1070. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/sensorModel.xsd +65 -0
  1071. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/sensorParameters.xsd +762 -0
  1072. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.0/spatialElements.xsd +497 -0
  1073. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/codeList.xsd +129 -0
  1074. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/groundControlPoints.xsd +235 -0
  1075. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/nonPhysicalSensorModel.xsd +321 -0
  1076. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/physicalSensorModel.xsd +62 -0
  1077. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/sensorModel.xsd +65 -0
  1078. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/sensorParameters.xsd +762 -0
  1079. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-1/smi/1.1.1/spatialElements.xsd +496 -0
  1080. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/codeList.xsd +349 -0
  1081. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/sensorModel.xsd +53 -0
  1082. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/sensorParameters.xsd +681 -0
  1083. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.0/spatialElements.xsd +902 -0
  1084. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/codeList.xsd +344 -0
  1085. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/sensorModel.xsd +49 -0
  1086. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/sensorParameters.xsd +676 -0
  1087. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-2/smi/1.1.1/spatialElements.xsd +897 -0
  1088. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-3/smi/1.1/smi.xsd +42 -0
  1089. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-3/smi/1.1.0/smi.xsd +42 -0
  1090. data/spec/fixtures/xml/schema/xsd/isotc211/19130/-3/smi/1.1.1/smi.xsd +42 -0
  1091. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.0/dps.xsd +1344 -0
  1092. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.0.0/dps.xsd +1344 -0
  1093. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.2/dps.xsd +1522 -0
  1094. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.2.0/dps.xsd +1522 -0
  1095. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-/dps/2.2.1/dps.xsd +1522 -0
  1096. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-1/dps/2.0/dps.xsd +1339 -0
  1097. data/spec/fixtures/xml/schema/xsd/isotc211/19131/-1/dps/2.2.0/dps.xsd +1540 -0
  1098. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/core.xsd +349 -0
  1099. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/extended.xsd +1074 -0
  1100. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/hierarchy.xsd +57 -0
  1101. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.0/pir.xsd +13 -0
  1102. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/core.xsd +344 -0
  1103. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/extended.xsd +1076 -0
  1104. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/hierarchy.xsd +58 -0
  1105. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1/pir.xsd +15 -0
  1106. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/core.xsd +344 -0
  1107. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/extended.xsd +1076 -0
  1108. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/hierarchy.xsd +58 -0
  1109. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-1/pir/1.1.0/pir.xsd +15 -0
  1110. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.0/abstract.xsd +42 -0
  1111. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.0/pre.xsd +4 -0
  1112. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.2.0/abstract.xsd +44 -0
  1113. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/pre/1.2.0/pre.xsd +11 -0
  1114. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.0/reg.xsd +8 -0
  1115. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.0/registration.xsd +562 -0
  1116. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.2.0/reg.xsd +22 -0
  1117. data/spec/fixtures/xml/schema/xsd/isotc211/19135/-2/reg/1.2.0/registration.xsd +590 -0
  1118. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/basicTypes.xsd +275 -0
  1119. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coordinateOperations.xsd +534 -0
  1120. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coordinateReferenceSystems.xsd +379 -0
  1121. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coordinateSystems.xsd +303 -0
  1122. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/coverage.xsd +298 -0
  1123. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/datums.xsd +293 -0
  1124. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/defaultStyle.xsd +462 -0
  1125. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/deprecatedTypes.xsd +1139 -0
  1126. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/dictionary.xsd +95 -0
  1127. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/direction.xsd +90 -0
  1128. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/dynamicFeature.xsd +114 -0
  1129. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/feature.xsd +99 -0
  1130. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryAggregates.xsd +203 -0
  1131. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryBasic0d1d.xsd +283 -0
  1132. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryBasic2d.xsd +130 -0
  1133. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryComplexes.xsd +101 -0
  1134. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/geometryPrimitives.xsd +852 -0
  1135. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/gml.xsd +25 -0
  1136. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/gmlBase.xsd +191 -0
  1137. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/grids.xsd +70 -0
  1138. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/measures.xsd +74 -0
  1139. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/observation.xsd +100 -0
  1140. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/referenceSystems.xsd +78 -0
  1141. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/temporal.xsd +274 -0
  1142. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/temporalReferenceSystems.xsd +194 -0
  1143. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/temporalTopology.xsd +124 -0
  1144. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/topology.xsd +391 -0
  1145. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/units.xsd +168 -0
  1146. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-/gml/1.0/valueObjects.xsd +210 -0
  1147. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1/gmlWrapperTypes.xsd +160 -0
  1148. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1/gmw.xsd +27 -0
  1149. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1.0/gmlWrapperTypes.xsd +160 -0
  1150. data/spec/fixtures/xml/schema/xsd/isotc211/19136/-1/gmw/1.1.0/gmw.xsd +27 -0
  1151. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/cat.xsd +18 -0
  1152. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/catalogues.xsd +63 -0
  1153. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/codelistItem.xsd +64 -0
  1154. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/crsItem.xsd +200 -0
  1155. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2/uomItem.xsd +49 -0
  1156. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/cat.xsd +18 -0
  1157. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/catalogues.xsd +63 -0
  1158. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/codelistItem.xsd +64 -0
  1159. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/crsItem.xsd +200 -0
  1160. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/cat/1.2.0/uomItem.xsd +49 -0
  1161. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gco/1.0/basicTypes.xsd +439 -0
  1162. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gco/1.0/gco.xsd +18 -0
  1163. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gco/1.0/gcoBase.xsd +71 -0
  1164. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/applicationSchema.xsd +50 -0
  1165. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/citation.xsd +283 -0
  1166. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/constraints.xsd +114 -0
  1167. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/content.xsd +197 -0
  1168. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/dataQuality.xsd +563 -0
  1169. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/distribution.xsd +210 -0
  1170. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/extent.xsd +216 -0
  1171. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/freeText.xsd +130 -0
  1172. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/gmd.xsd +18 -0
  1173. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/identification.xsd +356 -0
  1174. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/maintenance.xsd +95 -0
  1175. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/metadataApplication.xsd +183 -0
  1176. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/metadataEntity.xsd +78 -0
  1177. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/metadataExtension.xsd +107 -0
  1178. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/portrayalCatalogue.xsd +44 -0
  1179. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/referenceSystem.xsd +108 -0
  1180. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmd/1.0/spatialRepresentation.xsd +246 -0
  1181. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/catalogues.xsd +121 -0
  1182. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/codelistItem.xsd +179 -0
  1183. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/crsItem.xsd +1041 -0
  1184. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/extendedTypes.xsd +83 -0
  1185. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/gmx.xsd +18 -0
  1186. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/gmxUsage.xsd +136 -0
  1187. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gmx/1.0/uomItem.xsd +173 -0
  1188. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gsr/1.0/gsr.xsd +18 -0
  1189. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gsr/1.0/spatialReferencing.xsd +34 -0
  1190. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gss/1.0/geometry.xsd +45 -0
  1191. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gss/1.0/gss.xsd +18 -0
  1192. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gts/1.0/gts.xsd +18 -0
  1193. data/spec/fixtures/xml/schema/xsd/isotc211/19139/-/gts/1.0/temporalObjects.xsd +44 -0
  1194. data/spec/fixtures/xml/schema/xsd/isotc211/19155/gpi/1.0/gpi.xsd +16 -0
  1195. data/spec/fixtures/xml/schema/xsd/isotc211/19155/gpi/1.0/placeIdentifier.xsd +75 -0
  1196. data/spec/fixtures/xml/schema/xsd/isotc211/19155/gpi/1.0/sampleGMLApplicationSchema.xsd +83 -0
  1197. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2/abstract.xsd +44 -0
  1198. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2/dqc.xsd +16 -0
  1199. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2.0/abstract.xsd +44 -0
  1200. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqc/1.2.0/dqc.xsd +16 -0
  1201. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2/dqm.xsd +19 -0
  1202. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2/qualityMeasures.xsd +332 -0
  1203. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2.0/dqm.xsd +19 -0
  1204. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/dqm/1.2.0/qualityMeasures.xsd +332 -0
  1205. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityElement.xsd +583 -0
  1206. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityEvaluation.xsd +199 -0
  1207. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityImagery.xsd +75 -0
  1208. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/dataQualityResult.xsd +213 -0
  1209. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/mdq.xsd +22 -0
  1210. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2/metaquality.xsd +93 -0
  1211. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityElement.xsd +583 -0
  1212. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityEvaluation.xsd +199 -0
  1213. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityImagery.xsd +75 -0
  1214. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/dataQualityResult.xsd +213 -0
  1215. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/mdq.xsd +22 -0
  1216. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-/mdq/1.2.0/metaquality.xsd +93 -0
  1217. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.0/dataQualityCommon.xsd +33 -0
  1218. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.0/dqc.xsd +14 -0
  1219. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.1/dataQualityCommon.xsd +43 -0
  1220. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqc/1.0.1/dqc.xsd +17 -0
  1221. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.0/dataQualityMeasure.xsd +376 -0
  1222. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.0/dqm.xsd +11 -0
  1223. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.1/dataQualityMeasure.xsd +367 -0
  1224. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/dqm/1.0.1/dqm.xsd +11 -0
  1225. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/dataQuality.xsd +570 -0
  1226. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/dataQualityEvaluation.xsd +227 -0
  1227. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/dataQualityResult.xsd +191 -0
  1228. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/mdq.xsd +14 -0
  1229. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.0/metaquality.xsd +106 -0
  1230. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/dataQuality.xsd +581 -0
  1231. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/dataQualityEvaluation.xsd +227 -0
  1232. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/dataQualityResult.xsd +198 -0
  1233. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/mdq.xsd +14 -0
  1234. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-1/mdq/1.0.1/metaquality.xsd +102 -0
  1235. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqc/1.0/abstract.xsd +43 -0
  1236. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqc/1.0/dqc.xsd +15 -0
  1237. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqm/1.0/dqm.xsd +15 -0
  1238. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/dqm/1.0/qualityMeasures.xsd +303 -0
  1239. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityElement.xsd +554 -0
  1240. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityEvaluation.xsd +182 -0
  1241. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityImagery.xsd +72 -0
  1242. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/dataQualityResult.xsd +140 -0
  1243. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/mdq.xsd +21 -0
  1244. data/spec/fixtures/xml/schema/xsd/isotc211/19157/-2/mdq/1.0/metaquality.xsd +89 -0
  1245. data/spec/fixtures/xml/schema/xsd/isotc211/19160/-4/patdl/2.7.3/PATDL.v.2.7.3.xsd +517 -0
  1246. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/IE_Imagery.xsd +520 -0
  1247. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/IE_ImageryAndGriddedData.xsd +222 -0
  1248. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/IE_ThematicGriddedData.xsd +117 -0
  1249. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1/igd.xsd +14 -0
  1250. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/IE_Imagery.xsd +520 -0
  1251. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/IE_ImageryAndGriddedData.xsd +222 -0
  1252. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/IE_ThematicGriddedData.xsd +117 -0
  1253. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.0/igd.xsd +14 -0
  1254. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/IE_Imagery.xsd +518 -0
  1255. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/IE_ImageryAndGriddedData.xsd +213 -0
  1256. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/IE_ThematicGriddedData.xsd +116 -0
  1257. data/spec/fixtures/xml/schema/xsd/isotc211/19163/-1/igd/1.1.1/igd.xsd +15 -0
  1258. data/spec/fixtures/xml/schema/xsd/isotc211/19165/-1/gpm/1.0.0/geospatialPreservationMetadata.xsd +872 -0
  1259. data/spec/fixtures/xml/schema/xsd/isotc211/19165/-1/gpm/1.0.0/gpm.xsd +11 -0
  1260. data/spec/fixtures/xml/schema/xsd/isotc211/19165/gpm/1.0/geospatialPreservationMetadata.xsd +385 -0
  1261. data/spec/fixtures/xml/schema/xsd/isotc211/19165/gpm/1.0/gpm.xsd +8 -0
  1262. data/spec/fixtures/xml/schema/xsd/metaschema-datatypes.xsd +263 -0
  1263. data/spec/fixtures/xml/schema/xsd/metaschema-markup-line.xsd +9 -0
  1264. data/spec/fixtures/xml/schema/xsd/metaschema-markup-multiline.xsd +135 -0
  1265. data/spec/fixtures/xml/schema/xsd/metaschema-meta-constraints.xsd +39 -0
  1266. data/spec/fixtures/xml/schema/xsd/metaschema-prose-base.xsd +82 -0
  1267. data/spec/fixtures/xml/schema/xsd/metaschema-prose-module.xsd +5 -0
  1268. data/spec/fixtures/xml/schema/xsd/metaschema.xsd +1344 -0
  1269. data/spec/fixtures/xml/schema/xsd/omml_schema.xsd +1528 -0
  1270. data/spec/fixtures/xml/schema/xsd/smil20/rdf.xsd +16 -0
  1271. data/spec/fixtures/xml/schema/xsd/smil20/smil20-AccessKeyTiming.xsd +33 -0
  1272. data/spec/fixtures/xml/schema/xsd/smil20/smil20-AudioLayout.xsd +32 -0
  1273. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicAnimation.xsd +35 -0
  1274. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicContentControl.xsd +49 -0
  1275. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicInlineTiming.xsd +34 -0
  1276. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicLayout.xsd +34 -0
  1277. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicLinking.xsd +34 -0
  1278. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicMedia.xsd +39 -0
  1279. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicTimeContainers.xsd +37 -0
  1280. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BasicTransitions.xsd +36 -0
  1281. data/spec/fixtures/xml/schema/xsd/smil20/smil20-BrushMedia.xsd +32 -0
  1282. data/spec/fixtures/xml/schema/xsd/smil20/smil20-CustomTestAttributes.xsd +33 -0
  1283. data/spec/fixtures/xml/schema/xsd/smil20/smil20-EventTiming.xsd +33 -0
  1284. data/spec/fixtures/xml/schema/xsd/smil20/smil20-ExclTimeContainers.xsd +37 -0
  1285. data/spec/fixtures/xml/schema/xsd/smil20/smil20-FillDefault.xsd +32 -0
  1286. data/spec/fixtures/xml/schema/xsd/smil20/smil20-HierarchicalLayout.xsd +46 -0
  1287. data/spec/fixtures/xml/schema/xsd/smil20/smil20-HostLanguage.xsd +85 -0
  1288. data/spec/fixtures/xml/schema/xsd/smil20/smil20-InlineTransitions.xsd +35 -0
  1289. data/spec/fixtures/xml/schema/xsd/smil20/smil20-IntegrationSet.xsd +72 -0
  1290. data/spec/fixtures/xml/schema/xsd/smil20/smil20-LinkingAttributes.xsd +40 -0
  1291. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaAccessibility.xsd +34 -0
  1292. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaClipMarkers.xsd +35 -0
  1293. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaClipping.xsd +35 -0
  1294. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaDescription.xsd +35 -0
  1295. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaMarkerTiming.xsd +33 -0
  1296. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MediaParam.xsd +34 -0
  1297. data/spec/fixtures/xml/schema/xsd/smil20/smil20-Metainformation.xsd +33 -0
  1298. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MinMaxTiming.xsd +33 -0
  1299. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MultiArcTiming.xsd +33 -0
  1300. data/spec/fixtures/xml/schema/xsd/smil20/smil20-MultiWindowLayout.xsd +32 -0
  1301. data/spec/fixtures/xml/schema/xsd/smil20/smil20-ObjectLinking.xsd +33 -0
  1302. data/spec/fixtures/xml/schema/xsd/smil20/smil20-PrefetchControl.xsd +31 -0
  1303. data/spec/fixtures/xml/schema/xsd/smil20/smil20-RepeatTiming.xsd +34 -0
  1304. data/spec/fixtures/xml/schema/xsd/smil20/smil20-RepeatValueTiming.xsd +33 -0
  1305. data/spec/fixtures/xml/schema/xsd/smil20/smil20-RestartDefault.xsd +32 -0
  1306. data/spec/fixtures/xml/schema/xsd/smil20/smil20-RestartTiming.xsd +32 -0
  1307. data/spec/fixtures/xml/schema/xsd/smil20/smil20-SkipContentControl.xsd +32 -0
  1308. data/spec/fixtures/xml/schema/xsd/smil20/smil20-SplineAnimation.xsd +34 -0
  1309. data/spec/fixtures/xml/schema/xsd/smil20/smil20-Structure.xsd +34 -0
  1310. data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncBehavior.xsd +33 -0
  1311. data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncBehaviorDefault.xsd +33 -0
  1312. data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncMaster.xsd +32 -0
  1313. data/spec/fixtures/xml/schema/xsd/smil20/smil20-SyncbaseTiming.xsd +33 -0
  1314. data/spec/fixtures/xml/schema/xsd/smil20/smil20-TimeContainerAttributes.xsd +35 -0
  1315. data/spec/fixtures/xml/schema/xsd/smil20/smil20-TimeManipulations.xsd +35 -0
  1316. data/spec/fixtures/xml/schema/xsd/smil20/smil20-TransitionModifiers.xsd +37 -0
  1317. data/spec/fixtures/xml/schema/xsd/smil20/smil20-WallclockTiming.xsd +33 -0
  1318. data/spec/fixtures/xml/schema/xsd/smil20/smil20-animate.xsd +229 -0
  1319. data/spec/fixtures/xml/schema/xsd/smil20/smil20-content.xsd +148 -0
  1320. data/spec/fixtures/xml/schema/xsd/smil20/smil20-language.xsd +834 -0
  1321. data/spec/fixtures/xml/schema/xsd/smil20/smil20-layout.xsd +211 -0
  1322. data/spec/fixtures/xml/schema/xsd/smil20/smil20-linking.xsd +117 -0
  1323. data/spec/fixtures/xml/schema/xsd/smil20/smil20-media.xsd +175 -0
  1324. data/spec/fixtures/xml/schema/xsd/smil20/smil20-meta.xsd +44 -0
  1325. data/spec/fixtures/xml/schema/xsd/smil20/smil20-struct.xsd +47 -0
  1326. data/spec/fixtures/xml/schema/xsd/smil20/smil20-timemanip.xsd +34 -0
  1327. data/spec/fixtures/xml/schema/xsd/smil20/smil20-timing.xsd +344 -0
  1328. data/spec/fixtures/xml/schema/xsd/smil20/smil20-transitions.xsd +138 -0
  1329. data/spec/fixtures/xml/schema/xsd/smil20/smil20-utility.xsd +57 -0
  1330. data/spec/fixtures/xml/schema/xsd/smil20/smil20.xsd +86 -0
  1331. data/spec/fixtures/xml/schema/xsd/smil20/xml-mod.xsd +25 -0
  1332. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/advanced_encodings.xsd +186 -0
  1333. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/basic_types.xsd +147 -0
  1334. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/block_components.xsd +163 -0
  1335. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/choice_components.xsd +56 -0
  1336. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/examples/security.xsd +15 -0
  1337. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/record_components.xsd +95 -0
  1338. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/simple_components.xsd +536 -0
  1339. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/simple_encodings.xsd +93 -0
  1340. data/spec/fixtures/xml/schema/xsd/sweCommon/2.0.1/swe.xsd +14 -0
  1341. data/spec/fixtures/xml/schema/xsd/test_schema.lxr +0 -0
  1342. data/spec/fixtures/xml/schema/xsd/test_schema.xsd +24 -0
  1343. data/spec/fixtures/xml/schema/xsd/unitsml-v1.0-csd03.xsd +1333 -0
  1344. data/spec/fixtures/xml/schema/xsd/unitsml-v1.0-csd04.xsd +1334 -0
  1345. data/spec/fixtures/xml/schema/xsd/validation_config.yml +14 -0
  1346. data/spec/fixtures/xml/special_char.xml +3 -4
  1347. data/spec/fixtures/xml/user.xsd +14 -10
  1348. data/spec/fixtures/yamls_range_concept.rb +139 -0
  1349. data/spec/lutaml/integration/edge_cases_spec.rb +109 -0
  1350. data/spec/lutaml/integration/multi_format_spec.rb +106 -0
  1351. data/spec/lutaml/integration/round_trip_spec.rb +170 -0
  1352. data/spec/lutaml/jsonld/adapter_spec.rb +46 -0
  1353. data/spec/lutaml/jsonld/context_spec.rb +114 -0
  1354. data/spec/lutaml/jsonld/term_definition_spec.rb +55 -0
  1355. data/spec/lutaml/jsonld/transform_spec.rb +597 -0
  1356. data/spec/lutaml/key_value/transformation/collection_serializer_spec.rb +213 -0
  1357. data/spec/lutaml/key_value/transformation/rule_compiler_spec.rb +229 -0
  1358. data/spec/lutaml/key_value/transformation/value_serializer_spec.rb +216 -0
  1359. data/spec/lutaml/key_value/transformation_spec.rb +292 -0
  1360. data/spec/lutaml/model/attribute_collection_spec.rb +10 -7
  1361. data/spec/lutaml/model/attribute_default_cache_spec.rb +58 -0
  1362. data/spec/lutaml/model/attribute_form_default_spec.rb +252 -0
  1363. data/spec/lutaml/model/attribute_spec.rb +335 -56
  1364. data/spec/lutaml/model/cached_type_resolver_spec.rb +362 -0
  1365. data/spec/lutaml/model/cdata_spec.rb +180 -102
  1366. data/spec/lutaml/model/choice_spec.rb +37 -7
  1367. data/spec/lutaml/model/cli_spec.rb +452 -0
  1368. data/spec/lutaml/model/collection_index_spec.rb +347 -0
  1369. data/spec/lutaml/model/collection_mutation_spec.rb +124 -0
  1370. data/spec/lutaml/model/collection_spec.rb +580 -155
  1371. data/spec/lutaml/model/collection_validation_spec.rb +736 -0
  1372. data/spec/lutaml/model/comparable_model_spec.rb +75 -0
  1373. data/spec/lutaml/model/compiled_rule_spec.rb +364 -0
  1374. data/spec/lutaml/model/consolidation_spec.rb +295 -0
  1375. data/spec/lutaml/model/context_registry_spec.rb +269 -0
  1376. data/spec/lutaml/model/custom_bibtex_adapter_spec.rb +21 -7
  1377. data/spec/lutaml/model/custom_collection_spec.rb +324 -30
  1378. data/spec/lutaml/model/custom_model_spec.rb +13 -10
  1379. data/spec/lutaml/model/custom_serialization_spec.rb +12 -14
  1380. data/spec/lutaml/model/custom_vobject_adapter_spec.rb +36 -16
  1381. data/spec/lutaml/model/default_register_spec.rb +852 -0
  1382. data/spec/lutaml/model/defaults_spec.rb +57 -6
  1383. data/spec/lutaml/model/delegation_spec.rb +187 -120
  1384. data/spec/lutaml/model/derived_attribute_serialization_spec.rb +33 -0
  1385. data/spec/lutaml/model/dynamic_attribute_spec.rb +112 -0
  1386. data/spec/lutaml/model/encoding_spec.rb +281 -0
  1387. data/spec/lutaml/model/enum_spec.rb +46 -2
  1388. data/spec/lutaml/model/except_spec.rb +240 -0
  1389. data/spec/lutaml/model/finalization_cache_spec.rb +88 -0
  1390. data/spec/lutaml/model/global_context_spec.rb +421 -0
  1391. data/spec/lutaml/model/global_register_spec.rb +153 -36
  1392. data/spec/lutaml/model/group_spec.rb +203 -64
  1393. data/spec/lutaml/model/hash/adapter_spec.rb +5 -3
  1394. data/spec/lutaml/model/import_registry_spec.rb +295 -0
  1395. data/spec/lutaml/model/included_spec.rb +10 -17
  1396. data/spec/lutaml/model/inheritance_spec.rb +6 -6
  1397. data/spec/lutaml/model/json_adapter_spec.rb +13 -6
  1398. data/spec/lutaml/model/json_spec.rb +33 -0
  1399. data/spec/lutaml/model/key_value_data_model/key_value_element_spec.rb +320 -0
  1400. data/spec/lutaml/model/key_value_mapping_spec.rb +12 -2
  1401. data/spec/lutaml/model/lazy_collection_spec.rb +208 -0
  1402. data/spec/lutaml/model/liquefiable_spec.rb +281 -26
  1403. data/spec/lutaml/model/liquid/indexed_access_spec.rb +135 -0
  1404. data/spec/lutaml/model/liquid_compatibility_spec.rb +442 -0
  1405. data/spec/lutaml/model/logger_spec.rb +68 -0
  1406. data/spec/lutaml/model/map_all_spec.rb +36 -11
  1407. data/spec/lutaml/model/map_content_spec.rb +4 -4
  1408. data/spec/lutaml/model/mapping_rule_perf_guard_spec.rb +71 -0
  1409. data/spec/lutaml/model/mixed_content_spec.rb +481 -171
  1410. data/spec/lutaml/model/model_transformer_spec.rb +678 -0
  1411. data/spec/lutaml/model/multiple_mapping_spec.rb +71 -39
  1412. data/spec/lutaml/model/namespace_versioning_spec.rb +390 -0
  1413. data/spec/lutaml/model/one_entry_cache_spec.rb +114 -0
  1414. data/spec/lutaml/model/opal_smoke_spec.rb +117 -0
  1415. data/spec/lutaml/model/optimization_spec.rb +228 -0
  1416. data/spec/lutaml/model/ordered_content_spec.rb +116 -25
  1417. data/spec/lutaml/model/polymorphic_spec.rb +29 -6
  1418. data/spec/lutaml/model/processing_instruction_spec.rb +375 -0
  1419. data/spec/lutaml/model/{register/key_value_spec.rb → register_key_value_spec.rb} +57 -5
  1420. data/spec/lutaml/model/register_methods_spec.rb +149 -0
  1421. data/spec/lutaml/model/register_spec.rb +235 -5
  1422. data/spec/lutaml/model/render_empty_spec.rb +143 -6
  1423. data/spec/lutaml/model/render_nil_spec.rb +15 -10
  1424. data/spec/lutaml/model/root_mappings_spec.rb +16 -6
  1425. data/spec/lutaml/model/rule_value_extractor_spec.rb +13 -44
  1426. data/spec/lutaml/model/runtime_compatibility_spec.rb +36 -0
  1427. data/spec/lutaml/model/schema/generator/definitions_collection_spec.rb +4 -0
  1428. data/spec/lutaml/model/schema/json_schema_spec.rb +7 -1
  1429. data/spec/lutaml/model/schema/relaxng_schema_spec.rb +1 -1
  1430. data/spec/lutaml/model/schema/renderer_spec.rb +128 -0
  1431. data/spec/lutaml/model/schema/xsd_schema_spec.rb +1 -1
  1432. data/spec/lutaml/model/sequence_spec.rb +460 -15
  1433. data/spec/lutaml/model/serializable_spec.rb +212 -12
  1434. data/spec/lutaml/model/serializable_validation_spec.rb +3 -2
  1435. data/spec/lutaml/model/serialize_perf_guard_spec.rb +100 -0
  1436. data/spec/lutaml/model/services/default_value_resolver_spec.rb +162 -0
  1437. data/spec/lutaml/model/services/transformer_spec.rb +43 -0
  1438. data/spec/lutaml/model/simple_model_spec.rb +4 -4
  1439. data/spec/lutaml/model/store_spec.rb +315 -0
  1440. data/spec/lutaml/model/toml_adapter_spec.rb +11 -4
  1441. data/spec/lutaml/model/toml_spec.rb +46 -2
  1442. data/spec/lutaml/model/transform_cache_spec.rb +104 -0
  1443. data/spec/lutaml/model/transform_dynamic_attributes_spec.rb +41 -0
  1444. data/spec/lutaml/model/transformation_builder_spec.rb +283 -0
  1445. data/spec/lutaml/model/transformation_spec.rb +165 -236
  1446. data/spec/lutaml/model/type/base64_binary_spec.rb +202 -0
  1447. data/spec/lutaml/model/type/date_spec.rb +132 -0
  1448. data/spec/lutaml/model/type/date_time_spec.rb +54 -2
  1449. data/spec/lutaml/model/type/decimal_spec.rb +1 -1
  1450. data/spec/lutaml/model/type/duration_spec.rb +185 -0
  1451. data/spec/lutaml/model/type/hex_binary_spec.rb +225 -0
  1452. data/spec/lutaml/model/type/integer_spec.rb +1 -1
  1453. data/spec/lutaml/model/type/qname_spec.rb +246 -0
  1454. data/spec/lutaml/model/type/reference_integration_spec.rb +532 -0
  1455. data/spec/lutaml/model/type/reference_spec.rb +293 -0
  1456. data/spec/lutaml/model/type/symbol_spec.rb +322 -0
  1457. data/spec/lutaml/model/type/time_spec.rb +6 -5
  1458. data/spec/lutaml/model/type/time_without_date_spec.rb +1 -1
  1459. data/spec/lutaml/model/type/uninitialized_class_spec.rb +110 -0
  1460. data/spec/lutaml/model/type/uri_spec.rb +176 -0
  1461. data/spec/lutaml/model/type/value_xml_mapping_spec.rb +162 -0
  1462. data/spec/lutaml/model/type_context_spec.rb +370 -0
  1463. data/spec/lutaml/model/type_registry_spec.rb +313 -0
  1464. data/spec/lutaml/model/type_resolver_spec.rb +278 -0
  1465. data/spec/lutaml/model/type_spec.rb +7 -8
  1466. data/spec/lutaml/model/type_substitution_spec.rb +172 -0
  1467. data/spec/lutaml/model/uninitialized_class_deep_dup_spec.rb +39 -0
  1468. data/spec/lutaml/model/uninitialized_class_spec.rb +14 -2
  1469. data/spec/lutaml/model/utils_spec.rb +39 -24
  1470. data/spec/lutaml/model/validation/concerns/has_issues_spec.rb +76 -0
  1471. data/spec/lutaml/model/validation/context_spec.rb +60 -0
  1472. data/spec/lutaml/model/validation/issue_spec.rb +77 -0
  1473. data/spec/lutaml/model/validation/layer_result_spec.rb +66 -0
  1474. data/spec/lutaml/model/validation/profile_spec.rb +134 -0
  1475. data/spec/lutaml/model/validation/registry_spec.rb +94 -0
  1476. data/spec/lutaml/model/validation/remediation_result_spec.rb +23 -0
  1477. data/spec/lutaml/model/validation/remediation_spec.rb +72 -0
  1478. data/spec/lutaml/model/validation/report_spec.rb +58 -0
  1479. data/spec/lutaml/model/validation/rule_spec.rb +134 -0
  1480. data/spec/lutaml/model/validation/uninitialized_class_validate_spec.rb +29 -0
  1481. data/spec/lutaml/model/validation/validation_error_spec.rb +29 -0
  1482. data/spec/lutaml/model/validation/validation_framework_spec.rb +110 -0
  1483. data/spec/lutaml/model/value_map_spec.rb +2 -2
  1484. data/spec/lutaml/model/value_transformation_comprehensive_spec.rb +676 -0
  1485. data/spec/lutaml/model/with_child_mapping_spec.rb +1 -1
  1486. data/spec/lutaml/model/xml_decoupling_spec.rb +436 -0
  1487. data/spec/lutaml/model/xsd_form_default_patterns_spec.rb +664 -0
  1488. data/spec/lutaml/model/xsd_patterns_spec.rb +277 -0
  1489. data/spec/lutaml/model/xsd_type_spec.rb +345 -0
  1490. data/spec/lutaml/model/xsd_type_validation_spec.rb +442 -0
  1491. data/spec/lutaml/model/yamls/standard_adapter_spec.rb +2 -2
  1492. data/spec/lutaml/model/yamls_range_spec.rb +393 -0
  1493. data/spec/lutaml/model/yamls_sequence_spec.rb +245 -0
  1494. data/spec/lutaml/rdf/graph_serialization_spec.rb +137 -0
  1495. data/spec/lutaml/rdf/iri_spec.rb +73 -0
  1496. data/spec/lutaml/rdf/literal_spec.rb +98 -0
  1497. data/spec/lutaml/rdf/mapping_rule_spec.rb +97 -0
  1498. data/spec/lutaml/rdf/mapping_spec.rb +298 -0
  1499. data/spec/lutaml/rdf/member_rule_spec.rb +160 -0
  1500. data/spec/lutaml/rdf/namespace_set_spec.rb +115 -0
  1501. data/spec/lutaml/rdf/namespace_spec.rb +241 -0
  1502. data/spec/lutaml/rdf/rdf_transform_spec.rb +148 -0
  1503. data/spec/lutaml/turtle/adapter_spec.rb +47 -0
  1504. data/spec/lutaml/turtle/mapping_spec.rb +123 -0
  1505. data/spec/lutaml/turtle/transform_spec.rb +732 -0
  1506. data/spec/lutaml/xml/adapter/base_adapter_regression_spec.rb +151 -0
  1507. data/spec/lutaml/xml/adapter/nokogiri_adapter_spec.rb +130 -0
  1508. data/spec/lutaml/xml/adapter/oga_adapter_spec.rb +135 -0
  1509. data/spec/lutaml/xml/adapter/order_spec.rb +150 -0
  1510. data/spec/lutaml/xml/adapter/ox_adapter_spec.rb +101 -0
  1511. data/spec/lutaml/xml/adapter/rexml_adapter_spec.rb +101 -0
  1512. data/spec/lutaml/xml/adapter/xml_namespace_spec.rb +531 -0
  1513. data/spec/lutaml/xml/builder/builder_spec.rb +216 -0
  1514. data/spec/lutaml/xml/clear_parse_state_spec.rb +146 -0
  1515. data/spec/lutaml/xml/compiled_rule_namespace_spec.rb +405 -0
  1516. data/spec/lutaml/xml/conformance/xml_namespaces_spec.rb +580 -0
  1517. data/spec/lutaml/xml/conformance/xml_schema_instance_spec.rb +266 -0
  1518. data/spec/lutaml/xml/content_model_validation_spec.rb +159 -0
  1519. data/spec/lutaml/xml/data_model_spec.rb +282 -0
  1520. data/spec/lutaml/xml/decisions/decision_engine_spec.rb +242 -0
  1521. data/spec/lutaml/xml/decisions/decision_spec.rb +217 -0
  1522. data/spec/lutaml/xml/decisions/element_prefix_resolver_spec.rb +198 -0
  1523. data/spec/lutaml/xml/declaration_planner_spec.rb +524 -0
  1524. data/spec/lutaml/xml/default_namespace_spec.rb +190 -0
  1525. data/spec/lutaml/{model/xml → xml}/derived_attributes_spec.rb +2 -2
  1526. data/spec/lutaml/xml/doctype_preservation_spec.rb +323 -0
  1527. data/spec/lutaml/xml/doubly_defined_namespace_spec.rb +413 -0
  1528. data/spec/lutaml/xml/dual_namespace_element_spec.rb +181 -0
  1529. data/spec/lutaml/xml/element_spec.rb +28 -0
  1530. data/spec/lutaml/xml/encoding_normalizer_spec.rb +215 -0
  1531. data/spec/lutaml/xml/enhanced_mapping_spec.rb +693 -0
  1532. data/spec/lutaml/xml/entity_fragmentation_spec.rb +583 -0
  1533. data/spec/lutaml/xml/format_chooser_spec.rb +0 -0
  1534. data/spec/lutaml/xml/fpi_namespace_spec.rb +145 -0
  1535. data/spec/lutaml/{model/xml/namespace_spec.rb → xml/general_namespace_spec.rb} +6 -5
  1536. data/spec/lutaml/xml/indent_spec.rb +109 -0
  1537. data/spec/lutaml/xml/line_ending_spec.rb +66 -0
  1538. data/spec/lutaml/xml/mapping_finalization_guard_spec.rb +83 -0
  1539. data/spec/lutaml/xml/mapping_rule_spec.rb +98 -0
  1540. data/spec/lutaml/xml/mapping_spec.rb +1152 -0
  1541. data/spec/lutaml/xml/model_transform_guard_spec.rb +126 -0
  1542. data/spec/lutaml/{model/xml → xml}/namespace/nested_with_explicit_namespace_spec.rb +8 -5
  1543. data/spec/lutaml/xml/namespace/w3c_reserved_warning_spec.rb +152 -0
  1544. data/spec/lutaml/xml/namespace_alias_prefix_root_spec.rb +130 -0
  1545. data/spec/lutaml/xml/namespace_alias_spec.rb +263 -0
  1546. data/spec/lutaml/xml/namespace_aware_parsing_spec.rb +219 -0
  1547. data/spec/lutaml/xml/namespace_backward_compatibility_spec.rb +48 -0
  1548. data/spec/lutaml/xml/namespace_bound_element_roundtrip_spec.rb +433 -0
  1549. data/spec/lutaml/xml/namespace_constant_spec.rb +383 -0
  1550. data/spec/lutaml/xml/namespace_force_prefix_spec.rb +113 -0
  1551. data/spec/lutaml/xml/namespace_format_preservation_spec.rb +49 -0
  1552. data/spec/lutaml/xml/namespace_inheritance_deep_spec.rb +162 -0
  1553. data/spec/lutaml/xml/namespace_inheritance_override_spec.rb +316 -0
  1554. data/spec/lutaml/xml/namespace_inheritance_resolver_spec.rb +0 -0
  1555. data/spec/lutaml/xml/namespace_inheritance_spec.rb +966 -0
  1556. data/spec/lutaml/xml/namespace_integration_spec.rb +277 -0
  1557. data/spec/lutaml/xml/namespace_missing_prefix_spec.rb +178 -0
  1558. data/spec/lutaml/xml/namespace_no_hoisting_spec.rb +172 -0
  1559. data/spec/lutaml/xml/namespace_placement_spec.rb +265 -0
  1560. data/spec/lutaml/xml/namespace_preservation_spec.rb +427 -0
  1561. data/spec/lutaml/xml/namespace_principles_spec.rb +909 -0
  1562. data/spec/lutaml/xml/namespace_resolution_strategy_spec.rb +273 -0
  1563. data/spec/lutaml/xml/namespace_scope_declare_spec.rb +205 -0
  1564. data/spec/lutaml/xml/namespace_scope_spec.rb +389 -0
  1565. data/spec/lutaml/xml/namespace_scope_vcard_spec.rb +616 -0
  1566. data/spec/lutaml/xml/namespace_spec.rb +712 -0
  1567. data/spec/lutaml/xml/namespace_three_phase_spec.rb +310 -0
  1568. data/spec/lutaml/xml/nil_optional_element_namespace_spec.rb +84 -0
  1569. data/spec/lutaml/xml/ooxml_namespace_spec.rb +177 -0
  1570. data/spec/lutaml/xml/opal_xml_spec.rb +145 -0
  1571. data/spec/lutaml/xml/ordered_method_spec.rb +109 -0
  1572. data/spec/lutaml/xml/pipeline_integration_spec.rb +145 -0
  1573. data/spec/lutaml/xml/prefix_control_spec.rb +286 -0
  1574. data/spec/lutaml/{model/register/xml_spec.rb → xml/register_spec.rb} +75 -21
  1575. data/spec/lutaml/xml/reusable_mapping_spec.rb +148 -0
  1576. data/spec/lutaml/xml/reused_elements_namespace_spec.rb +85 -0
  1577. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/attribute_group_spec.rb +9 -3
  1578. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/attribute_spec.rb +11 -7
  1579. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/choice_spec.rb +5 -2
  1580. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/complex_content_restriction_spec.rb +7 -2
  1581. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/complex_content_spec.rb +5 -1
  1582. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/complex_type_spec.rb +49 -20
  1583. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/element_spec.rb +9 -4
  1584. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/group_spec.rb +9 -5
  1585. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/restriction_spec.rb +1 -0
  1586. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/sequence_spec.rb +10 -4
  1587. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/simple_content_spec.rb +9 -3
  1588. data/spec/lutaml/{model/schema/xml_compiler → xml/schema/compiler}/simple_type_spec.rb +10 -7
  1589. data/spec/lutaml/{model/schema/xml_compiler_spec.rb → xml/schema/compiler_spec.rb} +268 -137
  1590. data/spec/lutaml/xml/schema/xsd/errors/error_context_spec.rb +65 -0
  1591. data/spec/lutaml/xml/schema/xsd/errors/suggestion_spec.rb +77 -0
  1592. data/spec/lutaml/xml/schema/xsd/file_validation_result_spec.rb +131 -0
  1593. data/spec/lutaml/xml/schema/xsd/glob_spec.rb +330 -0
  1594. data/spec/lutaml/xml/schema/xsd/liquid_methods/attribute_and_group_spec.rb +76 -0
  1595. data/spec/lutaml/xml/schema/xsd/liquid_methods/complex_type_spec.rb +159 -0
  1596. data/spec/lutaml/xml/schema/xsd/liquid_methods/containers_spec.rb +104 -0
  1597. data/spec/lutaml/xml/schema/xsd/liquid_methods/element_spec.rb +139 -0
  1598. data/spec/lutaml/xml/schema/xsd/liquid_methods/schema_spec.rb +75 -0
  1599. data/spec/lutaml/xml/schema/xsd/liquid_methods/simple_content_spec.rb +79 -0
  1600. data/spec/lutaml/xml/schema/xsd/namespace_uri_remapping_spec.rb +246 -0
  1601. data/spec/lutaml/xml/schema/xsd/schema_helper_methods_spec.rb +237 -0
  1602. data/spec/lutaml/xml/schema/xsd/schema_mapping_spec.rb +777 -0
  1603. data/spec/lutaml/xml/schema/xsd/schema_validator_spec.rb +228 -0
  1604. data/spec/lutaml/xml/schema/xsd/spec_helper.rb +27 -0
  1605. data/spec/lutaml/xml/schema/xsd/validation_error_spec.rb +189 -0
  1606. data/spec/lutaml/xml/schema/xsd/validation_result_spec.rb +276 -0
  1607. data/spec/lutaml/xml/schema/xsd/xsd_spec.rb +51 -0
  1608. data/spec/lutaml/xml/schema_primer_spec.rb +393 -0
  1609. data/spec/lutaml/xml/serializable_namespace_spec.rb +125 -0
  1610. data/spec/lutaml/xml/transformation/custom_method_wrapper_spec.rb +247 -0
  1611. data/spec/lutaml/xml/transformation_spec.rb +439 -0
  1612. data/spec/lutaml/xml/type_namespace/collector_spec.rb +212 -0
  1613. data/spec/lutaml/xml/type_namespace/planner_spec.rb +270 -0
  1614. data/spec/lutaml/xml/type_namespace_examples_spec.rb +521 -0
  1615. data/spec/lutaml/xml/type_namespace_integration_spec.rb +332 -0
  1616. data/spec/lutaml/xml/type_namespace_prefix_spec.rb +370 -0
  1617. data/spec/lutaml/xml/type_namespace_resolver_spec.rb +0 -0
  1618. data/spec/lutaml/xml/type_namespace_roundtrip_spec.rb +580 -0
  1619. data/spec/lutaml/xml/w3c_types_spec.rb +376 -0
  1620. data/spec/lutaml/{model → xml}/xml_adapter_spec.rb +64 -17
  1621. data/spec/lutaml/xml/xml_declaration_spec.rb +568 -0
  1622. data/spec/lutaml/xml/xml_element_guard_spec.rb +138 -0
  1623. data/spec/lutaml/{model/xml → xml}/xml_element_spec.rb +1 -1
  1624. data/spec/lutaml/xml/xml_lang_spec.rb +441 -0
  1625. data/spec/lutaml/xml/xml_space_spec.rb +247 -0
  1626. data/spec/lutaml/xml/xml_space_type_spec.rb +161 -0
  1627. data/spec/lutaml/xml/xml_spec.rb +173 -0
  1628. data/spec/parent_root_spec.rb +63 -0
  1629. data/spec/person_spec.rb +9 -9
  1630. data/spec/spec_helper.rb +69 -6
  1631. data/spec/support/opal.rb +6 -0
  1632. data/spec/support/test_adapter_config.rb +101 -0
  1633. data/spec/support/test_namespaces.rb +185 -0
  1634. data/spec/support/trace_helper.rb +0 -0
  1635. data/spec/support/xml/schema_helper.rb +15 -0
  1636. data/spec/support/xml/xsd/code_example_validator.rb +393 -0
  1637. data/spec/support/xml_mapping_namespaces.rb +176 -0
  1638. metadata +1576 -101
  1639. data/docs/custom_registers.adoc +0 -228
  1640. data/lib/lutaml/model/hash_adapter/mapping.rb +0 -19
  1641. data/lib/lutaml/model/hash_adapter/mapping_rule.rb +0 -9
  1642. data/lib/lutaml/model/hash_adapter/transform.rb +0 -8
  1643. data/lib/lutaml/model/hash_adapter.rb +0 -21
  1644. data/lib/lutaml/model/json/mapping.rb +0 -19
  1645. data/lib/lutaml/model/json/mapping_rule.rb +0 -9
  1646. data/lib/lutaml/model/json/multi_json_adapter.rb +0 -18
  1647. data/lib/lutaml/model/json/standard_adapter.rb +0 -25
  1648. data/lib/lutaml/model/json/transform.rb +0 -8
  1649. data/lib/lutaml/model/jsonl/mapping.rb +0 -19
  1650. data/lib/lutaml/model/jsonl/mapping_rule.rb +0 -9
  1651. data/lib/lutaml/model/jsonl/transform.rb +0 -19
  1652. data/lib/lutaml/model/mapping/key_value_mapping.rb +0 -227
  1653. data/lib/lutaml/model/schema/xsd_schema.rb +0 -62
  1654. data/lib/lutaml/model/toml/mapping.rb +0 -27
  1655. data/lib/lutaml/model/toml/mapping_rule.rb +0 -9
  1656. data/lib/lutaml/model/toml/toml_rb_adapter.rb +0 -18
  1657. data/lib/lutaml/model/toml/tomlib_adapter.rb +0 -19
  1658. data/lib/lutaml/model/toml/transform.rb +0 -8
  1659. data/lib/lutaml/model/xml/builder/nokogiri.rb +0 -101
  1660. data/lib/lutaml/model/xml/builder/oga.rb +0 -183
  1661. data/lib/lutaml/model/xml/builder/ox.rb +0 -121
  1662. data/lib/lutaml/model/xml/document.rb +0 -477
  1663. data/lib/lutaml/model/xml/element.rb +0 -32
  1664. data/lib/lutaml/model/xml/mapping.rb +0 -471
  1665. data/lib/lutaml/model/xml/mapping_rule.rb +0 -149
  1666. data/lib/lutaml/model/xml/nokogiri_adapter.rb +0 -234
  1667. data/lib/lutaml/model/xml/oga/document.rb +0 -20
  1668. data/lib/lutaml/model/xml/oga/element.rb +0 -123
  1669. data/lib/lutaml/model/xml/oga_adapter.rb +0 -172
  1670. data/lib/lutaml/model/xml/ox_adapter.rb +0 -229
  1671. data/lib/lutaml/model/xml/transform.rb +0 -8
  1672. data/lib/lutaml/model/xml/xml_attribute.rb +0 -37
  1673. data/lib/lutaml/model/xml/xml_element.rb +0 -167
  1674. data/lib/lutaml/model/xml/xml_namespace.rb +0 -49
  1675. data/lib/lutaml/model/xml.rb +0 -31
  1676. data/lib/lutaml/model/xml_adapter/element.rb +0 -18
  1677. data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +0 -15
  1678. data/lib/lutaml/model/xml_adapter/oga_adapter.rb +0 -21
  1679. data/lib/lutaml/model/xml_adapter/ox_adapter.rb +0 -18
  1680. data/lib/lutaml/model/xml_adapter.rb +0 -7
  1681. data/lib/lutaml/model/yaml/mapping.rb +0 -19
  1682. data/lib/lutaml/model/yaml/mapping_rule.rb +0 -9
  1683. data/lib/lutaml/model/yaml/standard_adapter.rb +0 -28
  1684. data/lib/lutaml/model/yaml/transform.rb +0 -8
  1685. data/lib/lutaml/model/yamls/mapping.rb +0 -19
  1686. data/lib/lutaml/model/yamls/mapping_rule.rb +0 -9
  1687. data/lib/lutaml/model/yamls/standard_adapter.rb +0 -34
  1688. data/lib/lutaml/model/yamls/transform.rb +0 -19
  1689. data/spec/benchmarks/xml_parsing_benchmark_spec.rb +0 -74
  1690. data/spec/fixtures/liquid_templates/_ceramics.liquid +0 -3
  1691. data/spec/fixtures/xml/advanced_test_schema.xsd +0 -134
  1692. data/spec/lutaml/model/namespace_spec.rb +0 -57
  1693. data/spec/lutaml/model/xml_adapter/nokogiri_adapter_spec.rb +0 -56
  1694. data/spec/lutaml/model/xml_adapter/oga_adapter_spec.rb +0 -60
  1695. data/spec/lutaml/model/xml_adapter/ox_adapter_spec.rb +0 -61
  1696. data/spec/lutaml/model/xml_adapter/xml_namespace_spec.rb +0 -368
  1697. data/spec/lutaml/model/xml_mapping_rule_spec.rb +0 -158
  1698. data/spec/lutaml/model/xml_mapping_spec.rb +0 -1318
  1699. data/spec/lutaml/model/xml_spec.rb +0 -63
  1700. /data/spec/lutaml/{model/xml → xml}/root_mappings/nested_child_mappings_spec.rb +0 -0
@@ -0,0 +1,1861 @@
1
+ ---
2
+ title: XML Serialization Mapping
3
+ nav_order: 1
4
+ ---
5
+
6
+ = XML Serialization Mapping
7
+ :toc:
8
+ :toclevels: 3
9
+
10
+ [[mapping-xml]]
11
+ == General
12
+
13
+ === General
14
+
15
+ XML is a widely used structured serialization format standardized by the W3C.
16
+
17
+ At a high level, XML defines the following primitives:
18
+
19
+ * XML element (`<element-name>content</element-name>`)
20
+ * XML attribute (`<element-name ... attribute-name="attribute value">`)
21
+ * XML namespace (`xmlns='namespace-uri'`)
22
+ * XSD (XML Schema) constructs:
23
+ ** XML simple type: primitive values (`xs:...`)
24
+ ** XML complex type: structural definition (an element can require a complex
25
+ type, complex types can be constructed from other types)
26
+ ** XML complex type declaration definitions: sequence, order, etc.
27
+
28
+ It is **imperative** that the developer fully understands these concepts before
29
+ embarking on developing XML mappings for models.
30
+
31
+
32
+ === XML namespace
33
+
34
+ ==== General
35
+
36
+ == XML elements and XML types
37
+
38
+ === XML elements and XML types (for Lutaml::Model)
39
+
40
+ ==== General
41
+
42
+ In Lutaml::Model, XML serialization mappings are defined using the `xml` block.
43
+
44
+ Syntax:
45
+
46
+ [source,ruby]
47
+ ----
48
+ class Example < Lutaml::Model::Serializable
49
+ xml do
50
+ # Type-level methods
51
+
52
+ # Mapping methods
53
+ end
54
+ end
55
+ ----
56
+
57
+ [TIP]
58
+ ====
59
+ For sharing XML mappings across multiple model classes, see
60
+ link:xml/reusable-mapping-classes[Reusable XML Mapping Classes].
61
+ ====
62
+
63
+ ==== Defining element name (`element`)
64
+
65
+ The `element` method is the primary way to declare the XML element name
66
+ ("tag name") for an XML element.
67
+
68
+ NOTE: The `root` method was previously used for the same purpose as `element`,
69
+ and is now an alias to `element`. It is considered deprecated usage due to
70
+ more accurate naming of `element`.
71
+
72
+ An XML mapping that does not use the `element` declaration means it is an "XML
73
+ type".
74
+
75
+ NOTE: If `element` is not given, but used as a root of an XML element without
76
+ a tag name defined (an ad-hoc tag name can be defined in a mapping), then the
77
+ snake-cased class name will be used as the tag name.
78
+
79
+ [example]
80
+ `element 'example'` sets the tag name for in XML as `<example>...</example>`.
81
+
82
+ Syntax:
83
+
84
+ [source,ruby]
85
+ ----
86
+ xml do
87
+ element 'element-name'
88
+ end
89
+ ----
90
+
91
+ .Setting the element name to `example`
92
+ [example]
93
+ ====
94
+ [source,ruby]
95
+ ----
96
+ class Example < Lutaml::Model::Serializable
97
+ xml do
98
+ element 'example'
99
+ end
100
+ end
101
+ ----
102
+
103
+ [source,ruby]
104
+ ----
105
+ > Example.new.to_xml
106
+ > #<example></example>
107
+ ----
108
+ ====
109
+
110
+
111
+ .Setting ad-hoc element names in a mapping
112
+ [example]
113
+ ====
114
+ [source,ruby]
115
+ ----
116
+ class Ceramic < Lutaml::Model::Serializable
117
+ attribute :type, :string
118
+
119
+ xml do
120
+ element 'ceramic'
121
+ map_element 'type', to: :type
122
+ end
123
+ end
124
+
125
+ puts Ceramic.new(type: "Porcelain").to_xml
126
+ # => <ceramic><type>Porcelain</type></ceramic>
127
+ ----
128
+ ====
129
+
130
+
131
+ The `root` method is maintained as a backward-compatible alias to `element` that
132
+ also supports the `mixed:` and `ordered:` options.
133
+
134
+ [WARNING]
135
+ ====
136
+ In v0.8.0 onwards, the `mixed:` and `ordered:` options on `root()` are deprecated.
137
+ Use the dedicated `mixed_content` and `ordered` methods instead:
138
+
139
+ * Use `mixed_content` method instead of `mixed: true`
140
+ * Use `ordered` method instead of `ordered: true`
141
+
142
+ Note: `sequence do` is different from `ordered` - `sequence` enforces and validates
143
+ order, while `ordered` only preserves order without validation.
144
+ ====
145
+
146
+ ==== (DEPRECATED) Root method with options
147
+
148
+ [WARNING]
149
+ ====
150
+ This syntax is deprecated. Use the `mixed_content` and `ordered` methods instead.
151
+ ====
152
+
153
+ Syntax (deprecated):
154
+
155
+ [source,ruby]
156
+ ----
157
+ xml do
158
+ root 'element-name', mixed: false, ordered: false # DEPRECATED
159
+ end
160
+ ----
161
+
162
+ Values:
163
+
164
+ `mixed`::: (deprecated) `true` to enable mixed content (text + elements). Use `mixed_content` method instead.
165
+ `ordered`::: (deprecated) `true` to preserve element order. Use `ordered` method instead.
166
+
167
+ .Deprecated: Using `root` with options (use `mixed_content` method instead)
168
+ [example]
169
+ ====
170
+ [source,ruby]
171
+ ----
172
+ class Paragraph < Lutaml::Model::Serializable
173
+ attribute :bold, :string, collection: true
174
+ attribute :italic, :string
175
+
176
+ xml do
177
+ element 'p'
178
+ mixed_content # DEPRECATED - use mixed_content method instead
179
+ map_element 'bold', to: :bold
180
+ map_element 'i', to: :italic
181
+ end
182
+ end
183
+ ----
184
+ ====
185
+
186
+
187
+
188
+ ==== Declaring an XML type (`element` omitted)
189
+
190
+ For XML type-only models (models used only as embedded types without their own
191
+ element), simply omit the `element` declaration.
192
+
193
+ Syntax:
194
+
195
+ [source,ruby]
196
+ ----
197
+ class Address < Lutaml::Model::Serializable
198
+ xml do
199
+ # No element() or root() call - this is a type-only model
200
+ sequence do
201
+ map_element 'street', to: :street
202
+ map_element 'city', to: :city
203
+ end
204
+ end
205
+ end
206
+ ----
207
+
208
+ NOTE: Type-only models can only be parsed when embedded in parent models, not
209
+ standalone. Attempting to call `Address.from_xml(xml)` will raise
210
+ `TypeOnlyMappingError`.
211
+
212
+ // TODO: This understanding is wrong -- a type can declare attributes,
213
+ // we need to fix this.
214
+
215
+ The modern pattern is to omit the `element` declaration entirely for
216
+ type-only models. The `no_root` method is deprecated.
217
+
218
+ .Syntax for type-only models (modern pattern)
219
+ [source,ruby]
220
+ ----
221
+ class Address < Lutaml::Model::Serializable
222
+ xml do
223
+ # No element declaration - type-only model
224
+ map_element 'street', to: :street
225
+ end
226
+ end
227
+ ----
228
+
229
+ .Syntax for `no_root` method (deprecated)
230
+ [source,ruby]
231
+ ----
232
+ class Address < Lutaml::Model::Serializable
233
+ xml do
234
+ no_root # DEPRECATED - omit element declaration instead
235
+ map_element 'street', to: :street
236
+ end
237
+ end
238
+ ----
239
+
240
+ When a model has no element declaration, only `map_element` can be used
241
+ because without a root element there cannot be attributes.
242
+
243
+ [example]
244
+ ====
245
+ [source,ruby]
246
+ ----
247
+ class NameAndCode < Lutaml::Model::Serializable
248
+ attribute :name, :string
249
+ attribute :code, :string
250
+
251
+ xml do
252
+ # Type-only model - no element declaration needed
253
+ map_element "code", to: :code
254
+ map_element "name", to: :name
255
+ end
256
+ end
257
+ ----
258
+
259
+ [source,xml]
260
+ ----
261
+ <name>Name</name>
262
+ <code>ID-001</code>
263
+ ----
264
+
265
+ [source,ruby]
266
+ ----
267
+ > parsed = NameAndCode.from_xml(xml)
268
+ > # <NameAndCode:0x0000000107a3ca70 @code="ID-001", @name="Name">
269
+ > parsed.to_xml
270
+ > # <code>ID-001</code><name>Name</name>
271
+ ----
272
+ ====
273
+
274
+ [[mixed-content]]
275
+ ==== Mixed content elements (`mixed_content` method)
276
+
277
+ The `mixed_content` method explicitly enables mixed content mode.
278
+
279
+ Mixed content means that the XML element or type contains **interleaved text
280
+ and child elements** whose order must be preserved during round-trip
281
+ serialization.
282
+
283
+ This is most typically used for encoding rich-text or semantically-tagged text.
284
+
285
+ [example]
286
+ ====
287
+ [source,xml]
288
+ ----
289
+ <description><p>My name is <bold>John Doe</bold>, and I'm <i>28</i> years old</p></description>
290
+ ----
291
+ ====
292
+
293
+
294
+ A mixed content mode:
295
+
296
+ * Preserves text nodes interspersed with elements
297
+ * Automatically enables ordered mode (`@ordered = true`)
298
+ * Required for rich text content and round-trip fidelity
299
+
300
+ Syntax:
301
+
302
+ [source,ruby]
303
+ ----
304
+ xml do
305
+ element 'element-name'
306
+ mixed_content # Enables mixed content + ordered
307
+ end
308
+ ----
309
+
310
+ [TIP]
311
+ ====
312
+ When a model has `mixed_content`, use `map_content` with `collection: true`
313
+ to capture the multiple text segments between child elements.
314
+ Without `collection: true`, a `MixedContentCollectionError` is raised at
315
+ finalization time.
316
+ ====
317
+
318
+ .Complete round-trip with `mixed_content` and `map_content collection: true`
319
+ [example]
320
+ ====
321
+ [source,ruby]
322
+ ----
323
+ class MathExpression < Lutaml::Model::Serializable
324
+ attribute :content, :string
325
+
326
+ xml do
327
+ element "math"
328
+ map_content to: :content
329
+ end
330
+ end
331
+
332
+ class Paragraph < Lutaml::Model::Serializable
333
+ attribute :text, :string, collection: true # <1>
334
+ attribute :stem, MathExpression, collection: true
335
+
336
+ xml do
337
+ element 'p'
338
+ mixed_content # <2>
339
+
340
+ map_content to: :text
341
+ map_element 'stem', to: :stem
342
+ end
343
+ end
344
+ ----
345
+ <1> `collection: true` is required -- mixed content produces multiple text segments
346
+ <2> `mixed_content` enables ordered round-trip via `element_order` tracking
347
+
348
+ Input XML:
349
+
350
+ [source,xml]
351
+ ----
352
+ <p>Temperature <stem>T</stem> minus <stem>T<sub>90</sub></stem></p>
353
+ ----
354
+
355
+ Round-trip preserves interleaving:
356
+
357
+ [source,ruby]
358
+ ----
359
+ parsed = Paragraph.from_xml(xml)
360
+ parsed.text
361
+ # => ["Temperature ", " minus "]
362
+ parsed.stem.map(&:content)
363
+ # => ["T", "T90"]
364
+
365
+ # Serialize back -- text and elements appear in their original positions
366
+ serialized = parsed.to_xml
367
+ # => "<p>Temperature <stem>T</stem> minus <stem>T<sub>90</sub></stem></p>"
368
+
369
+ # Iterate in document order to access text and elements interleaved
370
+ parsed.each_mixed_content do |node|
371
+ case node
372
+ when String
373
+ puts "Text: #{node.inspect}"
374
+ when MathExpression
375
+ puts "Math: #{node.content}"
376
+ end
377
+ end
378
+ # Output:
379
+ # Text: "Temperature "
380
+ # Math: T
381
+ # Text: " minus "
382
+ # Math: T90
383
+ ----
384
+ ====
385
+
386
+ .Using `mixed_content` explicitly
387
+ [example]
388
+ ====
389
+ [source,ruby]
390
+ ----
391
+ class RichText < Lutaml::Model::Serializable
392
+ attribute :bold, :string, collection: true
393
+ attribute :italic, :string, collection: true
394
+
395
+ xml do
396
+ element 'text'
397
+ mixed_content # Explicit mixed content declaration
398
+
399
+ map_element 'b', to: :bold
400
+ map_element 'i', to: :italic
401
+ end
402
+ end
403
+
404
+ xml_input = "<text>This is <b>bold</b> and <i>italic</i> text</text>"
405
+ parsed = RichText.from_xml(xml_input)
406
+ # Preserves: "This is ", "<b>bold</b>", " and ", "<i>italic</i>", " text"
407
+ ----
408
+ ====
409
+
410
+ ===== When to use `mixed_content`
411
+
412
+ Use `mixed_content` when an XML element contains **both text nodes and child
413
+ elements in arbitrary order**. Common patterns include:
414
+
415
+ * Rich text with inline formatting (`<p>text <b>bold</b> more text</p>`)
416
+ * Scientific notation with inline math (`Temperature <stem>T</stem> minus ...`)
417
+ * Annotation elements interspersed with prose
418
+
419
+ Without `mixed_content`, serialization groups all text first then all elements
420
+ (or vice versa), losing the original interleaving. This is the most common
421
+ cause of XML round-trip failures in document-processing applications.
422
+
423
+ ===== Iterating mixed content with index
424
+
425
+ `each_mixed_content` returns an `Enumerator` when called without a block,
426
+ so you can chain standard Ruby methods like `with_index`, `select`, `map`:
427
+
428
+ [source,ruby]
429
+ ----
430
+ parsed.each_mixed_content.with_index do |node, index|
431
+ puts "#{index}: #{node.inspect}"
432
+ end
433
+ # 0: "Temperature "
434
+ # 1: #<MathExpression content="T">
435
+ # 2: " minus "
436
+ # 3: #<MathExpression content="T90">
437
+ ----
438
+
439
+ ==== (DEPRECATED) Mixed content declaration (`root` method with `mixed:`)
440
+
441
+ To map this to Lutaml::Model we can use the `mixed` option in either way:
442
+
443
+ * when defining the model;
444
+ * when referencing the model.
445
+
446
+ NOTE: This feature is not supported by Shale.
447
+
448
+
449
+ To specify mixed content, the `mixed: true` option needs to be set at the
450
+ `xml` block's `root` method.
451
+
452
+ (DEPRECATED) Syntax:
453
+
454
+ [source,ruby]
455
+ ----
456
+ xml do
457
+ element 'xml_element_name'
458
+ mixed_content
459
+ end
460
+ ----
461
+
462
+ .Applying `mixed` to treat root as mixed content
463
+ [example]
464
+ ====
465
+ [source,ruby]
466
+ ----
467
+ class Paragraph < Lutaml::Model::Serializable
468
+ attribute :bold, :string, collection: true # allows multiple bold tags
469
+ attribute :italic, :string
470
+
471
+ xml do
472
+ element 'p'
473
+ mixed_content
474
+
475
+ map_element 'bold', to: :bold
476
+ map_element 'i', to: :italic
477
+ end
478
+ end
479
+ ----
480
+
481
+ [source,ruby]
482
+ ----
483
+ > Paragraph.from_xml("<p>My name is <bold>John Doe</bold>, and I'm <i>28</i> years old</p>")
484
+ > #<Paragraph:0x0000000104ac7240 @bold="John Doe", @italic="28">
485
+ > Paragraph.new(bold: "John Doe", italic: "28").to_xml
486
+ > #<p>My name is <bold>John Doe</bold>, and I'm <i>28</i> years old</p>
487
+ ----
488
+ ====
489
+
490
+ // TODO: How to create mixed content from `#new`?
491
+
492
+
493
+ [[ordered-content]]
494
+ ==== Ordered content (`ordered` method)
495
+
496
+ The `ordered` method preserves the order of **XML Elements** during round-trip
497
+ serialization without validation.
498
+
499
+ Use `ordered` when:
500
+ * Element order matters for your application
501
+ * You need to preserve input order exactly
502
+ * You DON'T want to validate/enforce a specific order
503
+
504
+ Use `sequence` when you need strict order validation (see <<Sequence patterns>>).
505
+
506
+ [IMPORTANT]
507
+ ====
508
+ `ordered` models element-only content -- `map_content` is not allowed.
509
+ If you need to capture text content between elements, use `mixed_content`
510
+ instead (see <<mixed-content>>).
511
+ ====
512
+
513
+ Syntax:
514
+
515
+ [source,ruby]
516
+ ----
517
+ xml do
518
+ element 'xml_element_name'
519
+ ordered # Enable ordered content
520
+ end
521
+ ----
522
+
523
+ .Using `ordered` method to preserve element order
524
+ [example]
525
+ ====
526
+
527
+ [source,ruby]
528
+ ----
529
+ class RootOrderedContent < Lutaml::Model::Serializable
530
+ attribute :bold, :string
531
+ attribute :italic, :string
532
+ attribute :underline, :string
533
+
534
+ xml do
535
+ element "RootOrderedContent"
536
+ ordered # Enable ordered content
537
+
538
+ map_element :bold, to: :bold
539
+ map_element :italic, to: :italic
540
+ map_element :underline, to: :underline
541
+ end
542
+ end
543
+ ----
544
+
545
+ [source,xml]
546
+ ----
547
+ <RootOrderedContent>
548
+ <underline>Moon</underline>
549
+ <italic>384,400 km</italic>
550
+ <bold>bell</bold>
551
+ </RootOrderedContent>
552
+ ----
553
+
554
+ [source,ruby]
555
+ ----
556
+ > instance = RootOrderedContent.from_xml(xml)
557
+ > # <RootOrderedContent:0x0000000104ac7240 @bold="bell", @italic="384,400 km", @underline="Moon">
558
+ > instance.to_xml
559
+ > # <RootOrderedContent>
560
+ # <underline>Moon</underline>
561
+ # <italic>384,400 km</italic>
562
+ # <bold>bell</bold>
563
+ # </RootOrderedContent>
564
+ ----
565
+
566
+ **Without `ordered` (default behavior):**
567
+
568
+ [source,ruby]
569
+ ----
570
+ class RootOrderedContent < Lutaml::Model::Serializable
571
+ attribute :bold, :string
572
+ attribute :italic, :string
573
+ attribute :underline, :string
574
+
575
+ xml do
576
+ element "RootOrderedContent"
577
+ # No ordered method - order follows attribute declaration
578
+ map_element :bold, to: :bold
579
+ map_element :italic, to: :italic
580
+ map_element :underline, to: :underline
581
+ end
582
+ end
583
+ ----
584
+
585
+ [source,xml]
586
+ ----
587
+ <RootOrderedContent>
588
+ <underline>Moon</underline>
589
+ <italic>384,400 km</italic>
590
+ <bold>bell</bold>
591
+ </RootOrderedContent>
592
+ ----
593
+
594
+ [source,ruby]
595
+ ----
596
+ > instance = RootOrderedContent.from_xml(xml)
597
+ > # <RootOrderedContent:0x0000000104ac7240 @bold="bell", @italic="384,400 km", @underline="Moon">
598
+ > instance.to_xml # The order now follows attribute declaration order
599
+ > # <RootOrderedContent>
600
+ # <bold>bell</bold>
601
+ # <italic>384,400 km</italic>
602
+ # <underline>Moon</underline>
603
+ # </RootOrderedContent>
604
+ ----
605
+ ====
606
+
607
+ ==== (DEPRECATED) Ordered content declaration (`root` method with `ordered:`)
608
+
609
+ [WARNING]
610
+ ====
611
+ This syntax is deprecated. Use the `ordered` method instead:
612
+
613
+ [source,ruby]
614
+ ----
615
+ xml do
616
+ element 'element-name'
617
+ ordered # Enable ordered content
618
+ end
619
+ ----
620
+ ====
621
+
622
+ (DEPRECATED) Syntax:
623
+
624
+ [source,ruby]
625
+ ----
626
+ xml do
627
+ root 'xml_element_name', ordered: true
628
+ end
629
+ ----
630
+
631
+ == XML content mapping
632
+
633
+ === XML content mapping
634
+
635
+
636
+ ==== Mapping elements
637
+
638
+ ===== General
639
+
640
+ The `map_element` method maps an XML element to a data model attribute.
641
+
642
+ [example]
643
+ To handle the `<name>` tag in `<example><name>John Doe</name></example>`.
644
+ The value will be set to `John Doe`.
645
+
646
+ Syntax:
647
+
648
+ [source,ruby]
649
+ ----
650
+ xml do
651
+ map_element 'xml_element_name', to: :name_of_attribute
652
+ end
653
+ ----
654
+
655
+ .Mapping the `name` tag to the `name` attribute
656
+ [example]
657
+ ====
658
+ [source,ruby]
659
+ ----
660
+ class Example < Lutaml::Model::Serializable
661
+ attribute :name, :string
662
+
663
+ xml do
664
+ element "example"
665
+ map_element 'name', to: :name
666
+ end
667
+ end
668
+ ----
669
+
670
+ [source,xml]
671
+ ----
672
+ <example><name>John Doe</name></example>
673
+ ----
674
+
675
+ [source,ruby]
676
+ ----
677
+ > Example.from_xml(xml)
678
+ > #<Example:0x0000000104ac7240 @name="John Doe">
679
+ > Example.new(name: "John Doe").to_xml
680
+ > #<example><name>John Doe</name></example>
681
+ ----
682
+ ====
683
+
684
+ If an element is mapped to a model object with the XML `root` tag name set, the
685
+ mapped tag name will be used as the root name, overriding the root name.
686
+
687
+ .The mapped tag name is used as the root name
688
+ [example]
689
+ ====
690
+ [source,ruby]
691
+ ----
692
+ class RecordDate < Lutaml::Model::Serializable
693
+ attribute :content, :string
694
+
695
+ xml do
696
+ element "recordDate"
697
+ map_content to: :content
698
+ end
699
+ end
700
+
701
+ class OriginInfo < Lutaml::Model::Serializable
702
+ attribute :date_issued, RecordDate, collection: true
703
+
704
+ xml do
705
+ element "originInfo"
706
+ map_element "dateIssued", to: :date_issued
707
+ end
708
+ end
709
+ ----
710
+
711
+ [source,ruby]
712
+ ----
713
+ > RecordDate.new(date: "2021-01-01").to_xml
714
+ > #<recordDate>2021-01-01</recordDate>
715
+ > OriginInfo.new(date_issued: [RecordDate.new(date: "2021-01-01")]).to_xml
716
+ > #<originInfo><dateIssued>2021-01-01</dateIssued></originInfo>
717
+ ----
718
+ ====
719
+
720
+ ===== Using elements in different namespaces
721
+
722
+ ====== General
723
+
724
+ When elements need different namespaces, create separate model classes for
725
+ each namespace.
726
+ The `namespace:` parameter on `map_element` and `map_attribute` has been
727
+ removed.
728
+ See the
729
+ link:../_migrations/0-9-0-namespace-api-migration.adoc[migration guide]
730
+ for details.
731
+
732
+
733
+ ====== Elements with different namespaces
734
+
735
+ Create child model classes for elements in different namespaces:
736
+
737
+ [source,ruby]
738
+ ----
739
+ xml do
740
+ # Parent model namespace
741
+ namespace ParentNamespace
742
+ map_element 'child', to: :child # Child type determines namespace
743
+ end
744
+ ----
745
+
746
+
747
+ .Using different namespaces for elements
748
+ [example]
749
+ ====
750
+ [source,ruby]
751
+ ----
752
+ class CeramicNamespace < Lutaml::Model::XmlNamespace
753
+ uri 'https://example.com/ceramic'
754
+ prefix_default 'cer'
755
+ end
756
+
757
+ class GlazeNamespace < Lutaml::Model::XmlNamespace
758
+ uri 'https://example.com/glaze'
759
+ prefix_default 'glz'
760
+ end
761
+
762
+ # Child model with its own namespace
763
+ class Glaze < Lutaml::Model::Serializable
764
+ attribute :value, :string
765
+
766
+ xml do
767
+ element 'glaze'
768
+ namespace GlazeNamespace # Model-level namespace
769
+ map_content to: :value
770
+ end
771
+ end
772
+
773
+ class Ceramic < Lutaml::Model::Serializable
774
+ attribute :type, :string
775
+ attribute :glaze, Glaze # Typed attribute
776
+
777
+ xml do
778
+ element 'ceramic'
779
+ namespace CeramicNamespace
780
+
781
+ # This element uses parent namespace (follows element_form_default)
782
+ map_element 'type', to: :type
783
+
784
+ # This element uses Glaze's namespace (GlazeNamespace)
785
+ map_element 'glaze', to: :glaze
786
+ end
787
+ end
788
+
789
+ puts Ceramic.new(type: "Porcelain", glaze: Glaze.new(value: "Celadon")).to_xml
790
+ # => <cer:ceramic xmlns:cer="https://example.com/ceramic"
791
+ # xmlns:glz="https://example.com/glaze">
792
+ # <cer:type>Porcelain</cer:type>
793
+ # <glz:glaze>Celadon</glz:glaze>
794
+ # </cer:ceramic>
795
+ ----
796
+ ====
797
+
798
+ [[namespace-inherit]]
799
+ ====== Inheriting parent namespace
800
+
801
+ Use `element_form_default :qualified` on the namespace class to make child
802
+ elements inherit the parent namespace.
803
+
804
+ .Syntax:
805
+ [source,ruby]
806
+ ----
807
+ class MyNamespace < Lutaml::Model::XmlNamespace
808
+ uri 'https://example.com/my'
809
+ prefix_default 'my'
810
+ element_form_default :qualified # Children inherit namespace
811
+ end
812
+ ----
813
+
814
+
815
+ .Using `element_form_default :qualified` for namespace inheritance
816
+ [example]
817
+ ====
818
+ [source,ruby]
819
+ ----
820
+ class CeramicNamespace < Lutaml::Model::XmlNamespace
821
+ uri 'https://example.com/ceramic'
822
+ prefix_default 'cer'
823
+ element_form_default :qualified # All child elements inherit namespace
824
+ end
825
+
826
+ class Ceramic < Lutaml::Model::Serializable
827
+ attribute :type, :string
828
+ attribute :special_type, :string
829
+
830
+ xml do
831
+ element 'ceramic'
832
+ namespace CeramicNamespace
833
+
834
+ # Both elements inherit parent namespace (qualified)
835
+ map_element 'type', to: :type
836
+ map_element 'specialType', to: :special_type
837
+ end
838
+ end
839
+
840
+ puts Ceramic.new(type: "Porcelain", special_type: "Fine").to_xml
841
+ # => <cer:ceramic xmlns:cer="https://example.com/ceramic">
842
+ # <cer:type>Porcelain</cer:type>
843
+ # <cer:specialType>Fine</cer:specialType>
844
+ # </cer:ceramic>
845
+ ----
846
+ ====
847
+
848
+
849
+
850
+ ==== Mapping attributes
851
+
852
+ ===== General
853
+
854
+ The `map_attribute` method maps an XML attribute to a data model attribute.
855
+
856
+ Syntax:
857
+
858
+ [source,ruby]
859
+ ----
860
+ xml do
861
+ map_attribute 'xml_attribute_name', to: :name_of_attribute
862
+ end
863
+ ----
864
+
865
+ .Using `map_attribute` to map the `value` attribute
866
+ [example]
867
+ ====
868
+ The following class will parse the XML snippet below:
869
+
870
+ [source,ruby]
871
+ ----
872
+ class Example < Lutaml::Model::Serializable
873
+ attribute :value, :integer
874
+
875
+ xml do
876
+ element "example"
877
+ map_attribute 'value', to: :value
878
+ end
879
+ end
880
+ ----
881
+
882
+ [source,xml]
883
+ ----
884
+ <example value="12"><name>John Doe</name></example>
885
+ ----
886
+
887
+ [source,ruby]
888
+ ----
889
+ > Example.from_xml(xml)
890
+ > #<Example:0x0000000104ac7240 @value=12>
891
+ > Example.new(value: 12).to_xml
892
+ > #<example value="12"></example>
893
+ ----
894
+ ====
895
+
896
+ The `map_attribute` method does not inherit the root element's namespace.
897
+ To specify a namespace for an attribute, please explicitly declare the
898
+ *namespace* and *prefix* in the `map_attribute` method.
899
+
900
+ [example]
901
+ ====
902
+ The following class will parse the XML snippet below:
903
+
904
+ [source,ruby]
905
+ ----
906
+ class TechXmiXmlNamespace < Lutaml::Model::Xml::Namespace
907
+ uri "http://www.tech.co/XMI"
908
+ default_prefix "xl"
909
+ end
910
+
911
+ class TechXmiIntegerType < Lutaml::Model::Value::String
912
+ xml_namespace TechXmiXmlNamespace
913
+ end
914
+
915
+ class Attribute < Lutaml::Model::Serializable
916
+ attribute :value, TechXmiIntegerType
917
+
918
+ xml do
919
+ element "example"
920
+ map_attribute 'value', to: :value
921
+ end
922
+ end
923
+ ----
924
+
925
+ [source,xml]
926
+ ----
927
+ <example xl:value="20" xmlns:xl="http://www.tech.co/XMI"></example>
928
+ ----
929
+
930
+ [source,ruby]
931
+ ----
932
+ > Attribute.from_xml(xml)
933
+ > #<Attribute:0x0000000109436db8 @value=20>
934
+ > Attribute.new(value: 20).to_xml
935
+ > #<example xmlns:xl=\"http://www.tech.co/XMI\" xl:value=\"20\"/>
936
+ ----
937
+ ====
938
+
939
+ ===== Namespace on attribute
940
+
941
+ If the namespace is defined on a model attribute that already has a namespace,
942
+ the mapped namespace will be given priority over the one defined in the class.
943
+
944
+ Syntax (with reuseable `XmlNamespace`):
945
+
946
+ [source,ruby]
947
+ ----
948
+ xml do
949
+ map_element 'xml_element_name', to: :name_of_attribute,
950
+ namespace: ExampleXmlNamespaceClass
951
+ end
952
+ ----
953
+
954
+ Where:
955
+
956
+ `namespace`:: The XML namespace used by this element, as an XmlNamespace class
957
+
958
+ Syntax (ad-hoc definition of namespace, results in an anonymous `XmlNamespace`
959
+ class):
960
+
961
+ [source,ruby]
962
+ ----
963
+ xml do
964
+ map_element 'xml_element_name', to: :name_of_attribute,
965
+ namespace: 'http://example.com/namespace',
966
+ prefix: 'prefix'
967
+ end
968
+ ----
969
+
970
+ Where:
971
+
972
+ `namespace`:: The XML namespace used by this element, as a URI string
973
+ `prefix`:: The XML namespace prefix used by this element (optional)
974
+
975
+ .Using the `namespace` option to set the namespace for an element
976
+ [example]
977
+ ====
978
+ In this example, `glz` will be used for `Glaze` if it is added inside the
979
+ `Ceramic` class, and `glaze` will be used otherwise.
980
+
981
+ [source,ruby]
982
+ ----
983
+ class GlazeXmlNamespace < Lutaml::Model::XmlNamespace
984
+ uri 'http://example.com/glaze'
985
+ default_prefix 'glz'
986
+ end
987
+
988
+ class CeramicXmlNamespace < Lutaml::Model::XmlNamespace
989
+ uri 'http://example.com/ceramic'
990
+ default_prefix 'cera'
991
+ end
992
+
993
+ class OldGlazeXmlNamespace < Lutaml::Model::XmlNamespace
994
+ uri 'http://example.com/old_glaze'
995
+ default_prefix 'glaze'
996
+ end
997
+
998
+ class Ceramic < Lutaml::Model::Serializable
999
+ attribute :type, :string
1000
+ attribute :glaze, Glaze
1001
+
1002
+ xml do
1003
+ element 'Ceramic'
1004
+ namespace CeramicXmlNamespace
1005
+
1006
+ map_element 'Type', to: :type
1007
+ # This will use the GlazeXmlNamespace through the Glaze class
1008
+ map_element 'Glaze', to: :glaze
1009
+ end
1010
+ end
1011
+
1012
+ class Glaze < Lutaml::Model::Serializable
1013
+ attribute :color, :string
1014
+ attribute :temperature, :integer
1015
+
1016
+ xml do
1017
+ element 'Glaze'
1018
+ namespace OldGlazeXmlNamespace
1019
+
1020
+ map_element 'color', to: :color
1021
+ map_element 'temperature', to: :temperature
1022
+ end
1023
+ end
1024
+ ----
1025
+
1026
+ [source,xml]
1027
+ ----
1028
+ <Ceramic xmlns='http://example.com/ceramic'>
1029
+ <Type>Porcelain</Type>
1030
+ <glz:Glaze xmlns='http://example.com/glaze'>
1031
+ <color>Clear</color>
1032
+ <temperature>1050</temperature>
1033
+ </glz:Glaze>
1034
+ </Ceramic>
1035
+ ----
1036
+
1037
+ [source,ruby]
1038
+ ----
1039
+ > # Using the original Glaze class namespace
1040
+ > Glaze.new(color: "Clear", temperature: 1050).to_xml
1041
+ > #<glaze:Glaze xmlns="http://example.com/old_glaze"><color>Clear</color><temperature>1050</temperature></glaze:Glaze>
1042
+
1043
+ > # Using the Ceramic class namespace for Glaze
1044
+ > Ceramic.from_xml(xml_file)
1045
+ > #<Ceramic:0x0000000104ac7240 @type="Porcelain", @glaze=#<Glaze:0x0000000104ac7240 @color="Clear", @temperature=1050>>
1046
+ > Ceramic.new(type: "Porcelain", glaze: Glaze.new(color: "Clear", temperature: 1050)).to_xml
1047
+ > #<Ceramic xmlns="http://example.com/ceramic"><Type>Porcelain</Type><glz:Glaze xmlns="http://example.com/glaze"><color>Clear</color><temperature>1050</temperature></glz:Glaze></Ceramic>
1048
+ ----
1049
+ ====
1050
+
1051
+
1052
+ ==== Mapping content
1053
+
1054
+ Content represents the text inside an XML element, inclusive of whitespace.
1055
+
1056
+ The `map_content` method maps an XML element's content to a data model
1057
+ attribute.
1058
+
1059
+ Syntax:
1060
+
1061
+ [source,ruby]
1062
+ ----
1063
+ xml do
1064
+ map_content to: :name_of_attribute
1065
+ end
1066
+ ----
1067
+
1068
+ .Using `map_content` to map content of the `description` tag
1069
+ [example]
1070
+ ====
1071
+ The following class will parse the XML snippet below:
1072
+
1073
+ [source,ruby]
1074
+ ----
1075
+ class Example < Lutaml::Model::Serializable
1076
+ attribute :description, :string
1077
+
1078
+ xml do
1079
+ element "example"
1080
+ map_content to: :description
1081
+ end
1082
+ end
1083
+ ----
1084
+
1085
+ [source,xml]
1086
+ ----
1087
+ <example>John Doe is my moniker.</example>
1088
+ ----
1089
+
1090
+ [source,ruby]
1091
+ ----
1092
+ > Example.from_xml(xml)
1093
+ > #<Example:0x0000000104ac7240 @description="John Doe is my moniker.">
1094
+ > Example.new(description: "John Doe is my moniker.").to_xml
1095
+ > #<example>John Doe is my moniker.</example>
1096
+ ----
1097
+ ====
1098
+
1099
+
1100
+ [[xml-map-all]]
1101
+ ==== Mapping entire XML element into an attribute
1102
+
1103
+ The `map_all` tag in XML mapping captures and maps all content within an XML
1104
+ element into a single attribute in the target Ruby object.
1105
+
1106
+ The use case for `map_all` is to tell Lutaml::Model to not parse the content of
1107
+ the XML element at all, and instead handle it as an XML string.
1108
+
1109
+ NOTE: The corresponding method for key-value formats is at <<key-value-map-all>>.
1110
+
1111
+ WARNING: Notice that usage of mapping all will lead to incompatibility between
1112
+ serialization formats, i.e. the raw string content will not be portable as
1113
+ objects are across different formats.
1114
+
1115
+ This is useful in the case where the content of an XML element is not to be
1116
+ handled by a Lutaml::Model::Serializable object.
1117
+
1118
+ This feature is commonly used with custom methods or a custom model object to
1119
+ handle the content.
1120
+
1121
+ This includes:
1122
+
1123
+ * nested tags
1124
+ * attributes
1125
+ * text nodes
1126
+
1127
+ The `map_all` tag is **exclusive** and cannot be combined with other mappings
1128
+ (`map_element`, `map_content`) except for `map_attribute` for the same element,
1129
+ ensuring it captures the entire inner XML content.
1130
+
1131
+ NOTE: An error is raised if `map_all` is defined alongside any other mapping in
1132
+ the same XML mapping context.
1133
+
1134
+ Syntax:
1135
+
1136
+ [source,ruby]
1137
+ ----
1138
+ xml do
1139
+ map_all to: :name_of_attribute
1140
+ end
1141
+ ----
1142
+
1143
+ .Mapping all the content using `map_all`
1144
+ [example]
1145
+ ====
1146
+ [source,ruby]
1147
+ ----
1148
+ class ExampleMapping < Lutaml::Model::Serializable
1149
+ attribute :description, :string
1150
+
1151
+ xml do
1152
+ map_all to: :description
1153
+ end
1154
+ end
1155
+ ----
1156
+
1157
+ [source,xml]
1158
+ ----
1159
+ <ExampleMapping>Content with <b>tags</b> and <i>formatting</i>.</ExampleMapping>
1160
+ ----
1161
+
1162
+ [source,ruby]
1163
+ ----
1164
+ > parsed = ExampleMapping.from_xml(xml)
1165
+ > puts parsed.all_content
1166
+ # "Content with <b>tags</b> and <i>formatting</i>."
1167
+ ----
1168
+ ====
1169
+
1170
+
1171
+ ==== Mapping CDATA nodes
1172
+
1173
+ CDATA is an XML feature that allows the inclusion of text that may contain
1174
+ characters that are unescaped in XML.
1175
+
1176
+ While CDATA is not preferred in XML, it is sometimes necessary to handle CDATA
1177
+ nodes for both input and output.
1178
+
1179
+ NOTE: The W3C XML Recommendation explicitly encourages escaping characters over
1180
+ usage of CDATA.
1181
+
1182
+ Lutaml::Model supports the handling of CDATA nodes in XML in the following
1183
+ behavior:
1184
+
1185
+ . When an attribute contains a CDATA node with no text:
1186
+ ** On reading: The node (CDATA or text) is read as its value.
1187
+ ** On writing: The value is written as its native type.
1188
+
1189
+ . When an XML mapping sets `cdata: true` on `map_element` or `map_content`:
1190
+ ** On reading: The node (CDATA or text) is read as its value.
1191
+ ** On writing: The value is written as a CDATA node.
1192
+
1193
+ . When an XML mapping sets `cdata: false` on `map_element` or `map_content`:
1194
+ ** On reading: The node (CDATA or text) is read as its value.
1195
+ ** On writing: The value is written as a text node (string).
1196
+
1197
+
1198
+ Syntax:
1199
+
1200
+ [source,ruby]
1201
+ ----
1202
+ xml do
1203
+ map_content to: :name_of_attribute, cdata: (true | false)
1204
+ map_element :name, to: :name, cdata: (true | false)
1205
+ end
1206
+ ----
1207
+
1208
+ .Using `cdata` to map CDATA content
1209
+ [example]
1210
+ ====
1211
+ The following class will parse the XML snippet below:
1212
+
1213
+ [source,ruby]
1214
+ ----
1215
+ class Example < Lutaml::Model::Serializable
1216
+ attribute :name, :string
1217
+ attribute :description, :string
1218
+ attribute :title, :string
1219
+ attribute :note, :string
1220
+
1221
+ xml do
1222
+ element "example"
1223
+ map_element :name, to: :name, cdata: true
1224
+ map_content to: :description, cdata: true
1225
+ map_element :title, to: :title, cdata: false
1226
+ map_element :note, to: :note, cdata: false
1227
+ end
1228
+ end
1229
+ ----
1230
+
1231
+ [source,xml]
1232
+ ----
1233
+ <example><name><![CDATA[John]]></name><![CDATA[here is the description]]><title><![CDATA[Lutaml]]></title><note>Careful</note></example>
1234
+ ----
1235
+
1236
+ [source,ruby]
1237
+ ----
1238
+ > Example.from_xml(xml)
1239
+ > #<Example:0x0000000104ac7240 @name="John" @description="here is the description" @title="Lutaml" @note="Careful">
1240
+ > Example.new(name: "John", description: "here is the description", title: "Lutaml", note: "Careful").to_xml
1241
+ > #<example><name><![CDATA[John]]></name><![CDATA[here is the description]]><title>Lutaml</title><note>Careful</note></example>
1242
+ ====
1243
+
1244
+ [[xml-map-processing-instruction]]
1245
+ ==== Mapping processing instructions (`map_processing_instruction`)
1246
+
1247
+ Processing Instructions (PIs) are XML nodes of the form
1248
+ `<?target content?>` that appear before the root element. They are used
1249
+ by XML applications to pass application-specific information.
1250
+
1251
+ Common use cases include:
1252
+
1253
+ * xml2rfc PIs: `<?rfc strict="yes"?>`, `<?rfc compact="yes"?>`
1254
+ * xml-stylesheet PIs: `<?xml-stylesheet href="style.xsl"?>`
1255
+ * DocBook PIs: `<?db toc="yes"?>`
1256
+
1257
+ ===== Hash mode (default)
1258
+
1259
+ When the mapped attribute is a `:hash`, each PI matching the target
1260
+ generates one key-value pair. Multiple PIs with the same target are
1261
+ merged into a single hash.
1262
+
1263
+ This mode is extensible -- adding a new PI key does not require model
1264
+ changes.
1265
+
1266
+ [source,ruby]
1267
+ ----
1268
+ xml do
1269
+ element "rfc"
1270
+ map_element "title", to: :title
1271
+ map_processing_instruction "rfc", to: :pi_settings
1272
+ end
1273
+ ----
1274
+
1275
+ With `pi_settings = { "strict" => "yes", "compact" => "yes" }`, this
1276
+ generates:
1277
+
1278
+ [source,xml]
1279
+ ----
1280
+ <?rfc strict="yes"?>
1281
+ <?rfc compact="yes"?>
1282
+ <rfc><title>...</title></rfc>
1283
+ ----
1284
+
1285
+ During deserialization, PIs with matching target are parsed into the
1286
+ hash attribute:
1287
+
1288
+ [source,ruby]
1289
+ ----
1290
+ doc = RfcDoc.from_xml('<?rfc strict="yes"?><?rfc compact="no"?><rfc><title>Test</title></rfc>')
1291
+ doc.pi_settings # => {"strict"=>"yes", "compact"=>"no"}
1292
+ ----
1293
+
1294
+ ===== Multiple PI targets
1295
+
1296
+ Multiple `map_processing_instruction` calls can map different PI targets
1297
+ to different attributes:
1298
+
1299
+ [source,ruby]
1300
+ ----
1301
+ xml do
1302
+ element "doc"
1303
+ map_processing_instruction "rfc", to: :rfc_pis
1304
+ map_processing_instruction "xml-stylesheet", to: :stylesheet_pis
1305
+ end
1306
+ ----
1307
+
1308
+ ===== Array mode
1309
+
1310
+ When the mapped attribute is a `:string` collection, each PI's raw
1311
+ content string is stored as-is:
1312
+
1313
+ [source,ruby]
1314
+ ----
1315
+ attribute :rfc_pis, :string, collection: true
1316
+
1317
+ xml do
1318
+ element "rfc"
1319
+ map_processing_instruction "rfc", to: :rfc_pis
1320
+ end
1321
+ ----
1322
+
1323
+ With input `<?rfc strict="yes"?><?rfc compact="no"?>`:
1324
+
1325
+ [source,ruby]
1326
+ ----
1327
+ doc.rfc_pis # => ['strict="yes"', 'compact="no"']
1328
+ ----
1329
+
1330
+ ===== Limitations (Phase 1)
1331
+
1332
+ * Only document-level PIs (before the root element) are supported.
1333
+ * Inline PIs within element content are not yet supported (requires
1334
+ mixed_content integration).
1335
+
1336
+ ==== Example for mapping
1337
+
1338
+ [example]
1339
+ ====
1340
+ The following class will parse the XML snippet below:
1341
+
1342
+ [source,ruby]
1343
+ ----
1344
+ class Ceramic < Lutaml::Model::Serializable
1345
+ attribute :name, :string
1346
+ attribute :description, :string
1347
+ attribute :temperature, :integer
1348
+
1349
+ xml do
1350
+ element "ceramic"
1351
+ map_element 'name', to: :name
1352
+ map_attribute 'temperature', to: :temperature
1353
+ map_content to: :description
1354
+ end
1355
+ end
1356
+ ----
1357
+
1358
+ [source,xml]
1359
+ ----
1360
+ <ceramic temperature="1200"><name>Porcelain Vase</name> with celadon glaze.</ceramic>
1361
+ ----
1362
+
1363
+ [source,ruby]
1364
+ ----
1365
+ > Ceramic.from_xml(xml)
1366
+ > #<Ceramic:0x0000000104ac7240 @name="Porcelain Vase", @description=" with celadon glaze.", @temperature=1200>
1367
+ > Ceramic.new(name: "Porcelain Vase", description: " with celadon glaze.", temperature: 1200).to_xml
1368
+ > #<ceramic temperature="1200"><name>Porcelain Vase</name> with celadon glaze.</ceramic>
1369
+ ----
1370
+ ====
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1377
+ === XML types (for Lutaml::Model::Value)
1378
+
1379
+ ==== General
1380
+
1381
+ LutaML provides a number of methods to customize the XML role of custom Values.
1382
+
1383
+ ==== Value namespaces
1384
+
1385
+ Type-level namespaces are particularly useful for:
1386
+
1387
+ * Reusable types that belong to specific namespaces (e.g., Dublin Core properties, custom XSD types)
1388
+ * Multi-namespace document structures (e.g., Office Open XML, Dublin Core metadata)
1389
+ * XSD schema generation with proper namespace imports
1390
+ * W3C-compliant round-trip serialization and deserialization
1391
+
1392
+ ==== Value `xml` block (unified API)
1393
+
1394
+ Custom value types declare their XML configuration using the unified `xml do ... end` block.
1395
+
1396
+ Syntax:
1397
+
1398
+ [source,ruby]
1399
+ ----
1400
+ class CustomType < Lutaml::Model::Type::Value
1401
+ xml do # <1>
1402
+ namespace CustomNamespace # <2>
1403
+ xsd_type 'CustomType' # <3>
1404
+ end
1405
+
1406
+ def self.cast(value)
1407
+ # Type conversion logic
1408
+ end
1409
+ end
1410
+ ----
1411
+ <1> The `xml` block provides unified XML configuration (same API as Model classes)
1412
+ <2> The `namespace` directive associates an `XmlNamespace` class
1413
+ <3> The `xsd_type` directive sets the XSD type name for schema generation
1414
+
1415
+ Where,
1416
+
1417
+ `namespace`:: Directive inside `xml` block that accepts an `XmlNamespace` class.
1418
+ This namespace will be applied to any element or attribute using this type,
1419
+ unless overridden by explicit mapping namespace. Works for both serialization
1420
+ and deserialization.
1421
+
1422
+ `xsd_type`:: Directive inside `xml` block that sets the XSD type name. If not
1423
+ specified, defaults to `default_xsd_type` from the parent class (e.g.,
1424
+ `xs:string` for `Type::String`).
1425
+
1426
+ NOTE: The old class-level `xml_namespace` and `xsd_type` directives are deprecated.
1427
+ Use the unified `xml do ... end` block for new code.
1428
+
1429
+
1430
+ Type-level namespaces are resolved during both serialization and deserialization:
1431
+
1432
+ **During serialization (`to_xml`):**
1433
+
1434
+ * When an element or attribute uses a custom type with namespace
1435
+ * The type's namespace is consulted if no explicit mapping namespace exists
1436
+ * Namespace declarations are added to the XML document root
1437
+ * Elements/attributes are prefixed according to namespace resolution priority
1438
+
1439
+ **During deserialization (`from_xml`):**
1440
+
1441
+ * Namespace-qualified elements/attributes are matched against type namespaces
1442
+ * Both prefixed (`dc:title`) and default namespace elements are handled
1443
+ * Type namespaces work with `namespace: :inherit` and explicit mappings
1444
+
1445
+ .Using namespace directive with a custom type (unified API)
1446
+ [example]
1447
+ ====
1448
+ [source,ruby]
1449
+ ----
1450
+ class EmailNamespace < Lutaml::Model::XmlNamespace
1451
+ uri 'https://example.com/types/email'
1452
+ prefix_default 'email'
1453
+ end
1454
+
1455
+ class EmailType < Lutaml::Model::Type::String
1456
+ xml do
1457
+ namespace EmailNamespace
1458
+ xsd_type 'EmailAddress'
1459
+ end
1460
+
1461
+ def self.cast(value)
1462
+ email = super(value)
1463
+ unless email.match?(/\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i)
1464
+ raise Lutaml::Model::TypeError, "Invalid email: #{email}"
1465
+ end
1466
+ email.downcase
1467
+ end
1468
+ end
1469
+
1470
+ class Contact < Lutaml::Model::Serializable
1471
+ attribute :email, EmailType
1472
+
1473
+ xml do
1474
+ element "contact"
1475
+ map_element 'email', to: :email # Uses EmailNamespace automatically
1476
+ end
1477
+ end
1478
+
1479
+ # Serialization output:
1480
+ contact = Contact.new(email: "user@example.com")
1481
+ puts contact.to_xml
1482
+ # => <contact xmlns:email="https://example.com/types/email">
1483
+ # <email:email>user@example.com</email:email>
1484
+ # </contact>
1485
+
1486
+ # Deserialization (round-trip):
1487
+ parsed = Contact.from_xml(contact.to_xml)
1488
+ parsed.email # => "user@example.com"
1489
+ parsed === contact # => true
1490
+ ----
1491
+ ====
1492
+
1493
+
1494
+
1495
+
1496
+ === Instance serialization
1497
+
1498
+ ==== General
1499
+
1500
+ XML serialization is controlled via the `to_xml` method on
1501
+ `Lutaml::Model::Serializable` and `Lutaml::Model::Value` objects.
1502
+ instances.
1503
+
1504
+ Syntax:
1505
+
1506
+ [source,ruby]
1507
+ ----
1508
+ instance.to_xml(options)
1509
+ ----
1510
+
1511
+ Where,
1512
+
1513
+ `options`:: Hash of serialization options (see below for details)
1514
+
1515
+
1516
+
1517
+ ==== Namespace prefix behavior
1518
+
1519
+ ===== General
1520
+
1521
+ The `prefix:` option in `to_xml` controls whether the root element's namespace
1522
+ is rendered as a default namespace (no prefix) or with a prefix.
1523
+
1524
+ This is a _serialization-time decision_ that allows the same model to output
1525
+ clean W3C-compliant XML (default namespace) or prefixed XML for legacy system
1526
+ compatibility.
1527
+
1528
+ IMPORTANT: Only the **root element's own namespace** can be set as default.
1529
+ Other namespaces in scope MUST use their defined prefixes.
1530
+
1531
+
1532
+ ===== Default behavior: clean XML with default namespace
1533
+
1534
+ By default, `to_xml` renders the root element's namespace as a default namespace
1535
+ (`xmlns="..."`) with no prefix. This produces clean, W3C-compliant XML.
1536
+
1537
+ NOTE: A namespace is only rendered **if and only if** the element itself
1538
+ is assigned an XML namespace.
1539
+
1540
+ Syntax:
1541
+
1542
+ [source,ruby]
1543
+ ----
1544
+ instance.to_xml # <1>
1545
+ ----
1546
+ <1> No `prefix:` option uses default namespace (no prefix)
1547
+
1548
+ .Default namespace output (no prefix)
1549
+ [example]
1550
+ ====
1551
+ [source,ruby]
1552
+ ----
1553
+ class AppNamespace < Lutaml::Model::XmlNamespace
1554
+ uri 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'
1555
+ prefix_default 'app'
1556
+ end
1557
+
1558
+ class Properties < Lutaml::Model::Serializable
1559
+ attribute :template, :string
1560
+
1561
+ xml do
1562
+ element "Properties"
1563
+ namespace AppNamespace
1564
+ map_element "Template", to: :template
1565
+ end
1566
+ end
1567
+
1568
+ props = Properties.new(template: "Normal.dotm")
1569
+ puts props.to_xml
1570
+ ----
1571
+
1572
+ Output:
1573
+
1574
+ [source,xml]
1575
+ ----
1576
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
1577
+ <Template>Normal.dotm</Template>
1578
+ </Properties>
1579
+ ----
1580
+
1581
+ NOTE: Clean XML with no prefixes. The namespace is declared as default
1582
+ (`xmlns="..."`).
1583
+ ====
1584
+
1585
+ ===== Using defined default prefix
1586
+
1587
+ To use the prefix defined in `XmlNamespace.prefix_default` of the element, pass
1588
+ `prefix: true`:
1589
+
1590
+ Syntax:
1591
+
1592
+ [source,ruby]
1593
+ ----
1594
+ instance.to_xml(prefix: true) # <1>
1595
+ ----
1596
+ <1> Uses `prefix_default` from XmlNamespace class
1597
+
1598
+ .Output with defined default prefix
1599
+ [example]
1600
+ ====
1601
+ [source,ruby]
1602
+ ----
1603
+ props = Properties.new(template: "Normal.dotm")
1604
+ puts props.to_xml(prefix: true)
1605
+ ----
1606
+
1607
+ Output:
1608
+
1609
+ [source,xml]
1610
+ ----
1611
+ <app:Properties xmlns:app="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
1612
+ <app:Template>Normal.dotm</app:Template>
1613
+ </app:Properties>
1614
+ ----
1615
+
1616
+ NOTE: All elements in the same namespace use the "app" prefix.
1617
+ ====
1618
+
1619
+ ===== Using custom prefix
1620
+
1621
+ To use a specific custom prefix (overriding `prefix_default`), pass a string:
1622
+
1623
+ Syntax:
1624
+
1625
+ [source,ruby]
1626
+ ----
1627
+ instance.to_xml(prefix: "custom") # <1>
1628
+ ----
1629
+ <1> Uses provided custom prefix string
1630
+
1631
+ .Output with custom prefix
1632
+ [example]
1633
+ ====
1634
+ [source,ruby]
1635
+ ----
1636
+ props = Properties.new(template: "Normal.dotm")
1637
+ puts props.to_xml(prefix: "extended")
1638
+ ----
1639
+
1640
+ Output:
1641
+
1642
+ [source,xml]
1643
+ ----
1644
+ <extended:Properties xmlns:extended="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
1645
+ <extended:Template>Normal.dotm</extended:Template>
1646
+ </extended:Properties>
1647
+ ----
1648
+
1649
+ NOTE: Custom prefix of `"extended"` used instead of the original `"app"`.
1650
+ ====
1651
+
1652
+
1653
+ ===== `to_xml` method `prefix:` option values
1654
+
1655
+ The `prefix:` option accepts the following values:
1656
+
1657
+ [cols="1,3"]
1658
+ |===
1659
+ | Value | Behavior
1660
+
1661
+ | (not specified) or `nil` or `false`
1662
+ | Use default namespace (xmlns="...") with no prefix. This is the default behavior.
1663
+
1664
+ | `true`
1665
+ | Use `prefix_default` from XmlNamespace class
1666
+
1667
+ | `"string"`
1668
+ | Use the provided custom prefix string
1669
+
1670
+ |===
1671
+
1672
+
1673
+
1674
+ [[element-attribute-qualification]]
1675
+ === Element and attribute qualification
1676
+
1677
+ ==== General
1678
+
1679
+ XML namespace qualification determines whether elements and attributes in
1680
+ instance documents must include namespace prefixes.
1681
+ Following W3C XML Schema specifications, qualification is controlled at three
1682
+ levels:
1683
+
1684
+ . Namespace-level defaults via `element_form_default` and `attribute_form_default`
1685
+ . Element/attribute-level overrides via `form:` option
1686
+ . Global elements/attributes (always qualified when in a namespace)
1687
+
1688
+ ==== Qualification rules
1689
+
1690
+ ===== W3C qualification semantics
1691
+
1692
+ Per W3C XML Schema specification:
1693
+
1694
+ * **Global elements** (declared at schema root): Always qualified when in a
1695
+ namespace
1696
+ * **Local elements** (declared within a type): Follow `elementFormDefault`
1697
+ * **Global attributes** (declared at schema root): Always qualified when in a
1698
+ namespace
1699
+ * **Local attributes** (declared within a type): Follow `attributeFormDefault`
1700
+
1701
+ ===== Default behavior
1702
+
1703
+ The default behavior follows W3C conventions:
1704
+
1705
+ * `element_form_default`: `:unqualified` (local elements not prefixed)
1706
+ * `attribute_form_default`: `:unqualified` (local attributes not prefixed)
1707
+
1708
+ This means child elements and attributes are not namespace-qualified by default,
1709
+ even when the parent element is.
1710
+
1711
+ .Default qualification behavior
1712
+ [example]
1713
+ ====
1714
+ [source,ruby]
1715
+ ----
1716
+ class CeramicNamespace < Lutaml::Model::XmlNamespace
1717
+ uri 'https://example.com/ceramic'
1718
+ prefix_default 'cer'
1719
+ # element_form_default defaults to :unqualified
1720
+ # attribute_form_default defaults to :unqualified
1721
+ end
1722
+
1723
+ class Ceramic < Lutaml::Model::Serializable
1724
+ attribute :type, :string
1725
+ attribute :glaze, :string
1726
+
1727
+ xml do
1728
+ element 'ceramic'
1729
+ namespace CeramicNamespace
1730
+
1731
+ map_element 'type', to: :type
1732
+ map_attribute 'glaze', to: :glaze
1733
+ end
1734
+ end
1735
+
1736
+ puts Ceramic.new(type: "Porcelain", glaze: "Clear").to_xml
1737
+ # => <cer:ceramic xmlns:cer="https://example.com/ceramic" glaze="Clear">
1738
+ # <type>Porcelain</type>
1739
+ # </cer:ceramic>
1740
+
1741
+ # NOTE: <cer:ceramic> is qualified (global element)
1742
+ # <type> is unqualified (local element, elementFormDefault=unqualified)
1743
+ # glaze="" is unqualified (local attribute, attributeFormDefault=unqualified)
1744
+ ----
1745
+ ====
1746
+
1747
+ ==== Namespace-level qualification control
1748
+
1749
+ Set qualification defaults for all local elements and attributes in the
1750
+ namespace.
1751
+
1752
+ .Qualifying all local elements
1753
+ [example]
1754
+ ====
1755
+ [source,ruby]
1756
+ ----
1757
+ class CeramicNamespace < Lutaml::Model::XmlNamespace
1758
+ uri 'https://example.com/ceramic'
1759
+ prefix_default 'cer'
1760
+ element_form_default :qualified # All local elements must be qualified
1761
+ end
1762
+
1763
+ class Ceramic < Lutaml::Model::Serializable
1764
+ attribute :type, :string
1765
+ attribute :color, :string
1766
+
1767
+ xml do
1768
+ element 'ceramic'
1769
+ namespace CeramicNamespace
1770
+
1771
+ map_element 'type', to: :type
1772
+ map_element 'color', to: :color
1773
+ end
1774
+ end
1775
+
1776
+ puts Ceramic.new(type: "Porcelain", color: "White").to_xml
1777
+ # => <cer:ceramic xmlns:cer="https://example.com/ceramic">
1778
+ # <cer:type>Porcelain</cer:type>
1779
+ # <cer:color>White</cer:color>
1780
+ # </cer:ceramic>
1781
+
1782
+ # Now <cer:type> and <cer:color> are qualified
1783
+ ----
1784
+ ====
1785
+
1786
+ ==== Element/attribute-level qualification override
1787
+
1788
+ Override namespace defaults using the `form:` option on individual mappings.
1789
+
1790
+ Syntax:
1791
+
1792
+ [source,ruby]
1793
+ ----
1794
+ xml do
1795
+ map_element 'name', to: :name, form: :qualified # or :unqualified
1796
+ map_attribute 'id', to: :id, form: :qualified # or :unqualified
1797
+ end
1798
+ ----
1799
+
1800
+ .Overriding qualification per element/attribute
1801
+ [example]
1802
+ ====
1803
+ [source,ruby]
1804
+ ----
1805
+ class CeramicNamespace < Lutaml::Model::XmlNamespace
1806
+ uri 'https://example.com/ceramic'
1807
+ prefix_default 'cer'
1808
+ element_form_default :unqualified # Default: no prefix on local elements
1809
+ end
1810
+
1811
+ class Ceramic < Lutaml::Model::Serializable
1812
+ attribute :type, :string
1813
+ attribute :glaze, :string
1814
+ attribute :id, :string
1815
+
1816
+ xml do
1817
+ element 'ceramic'
1818
+ namespace CeramicNamespace
1819
+
1820
+ # Override specific element to be qualified
1821
+ map_element 'type', to: :type, form: :qualified
1822
+
1823
+ # This element follows namespace default (unqualified)
1824
+ map_element 'glaze', to: :glaze
1825
+
1826
+ # Force attribute to be qualified (unusual but supported)
1827
+ map_attribute 'id', to: :id, form: :qualified
1828
+ end
1829
+ end
1830
+
1831
+ puts Ceramic.new(type: "Porcelain", glaze: "Clear", id: "C001").to_xml
1832
+ # => <cer:ceramic xmlns:cer="https://example.com/ceramic" cer:id="C001">
1833
+ # <cer:type>Porcelain</cer:type>
1834
+ # <glaze>Clear</glaze>
1835
+ # </cer:ceramic>
1836
+
1837
+ # NOTE: <cer:type> qualified via form: :qualified override
1838
+ # <glaze> unqualified via namespace default
1839
+ # cer:id qualified via form: :qualified override
1840
+ ----
1841
+ ====
1842
+
1843
+ ==== Use cases for qualification
1844
+
1845
+ **Qualified elements** (`:qualified`):
1846
+
1847
+ * Ensures elements are unambiguous across namespace boundaries
1848
+ * Required when mixing elements from multiple namespaces
1849
+ * Common in complex, multi-namespace schemas
1850
+
1851
+ **Unqualified elements** (`:unqualified`):
1852
+
1853
+ * Simpler, more readable XML for single-namespace documents
1854
+ * Reduces verbosity when namespace context is clear
1855
+ * W3C default for local elements
1856
+
1857
+ **Qualified attributes** (unusual):
1858
+
1859
+ * Rarely needed in practice
1860
+ * Only when attributes are from different namespace than parent element
1861
+ * Most schemas use `:unqualified` for attributes