lutaml-model 0.8.122 → 0.8.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e03637604c66182f035beb46263658ef163d12a68ea51ae01b41588b3e4ac75
4
- data.tar.gz: 87a8a1ec59f18a88c9048953726ee74b63280d8fd8213081cbdf9b384df34d89
3
+ metadata.gz: 6d77a19ece999a4de97c03776b3f56bc31eb217fb14904362eef4c98b4623be6
4
+ data.tar.gz: b76ef3e5de721b3e94a02dbac605c61fe3ca44fe97388b8fca1ec4645c3ab494
5
5
  SHA512:
6
- metadata.gz: 1b26315984be056924feb9c5fc9da843251ae1f8e2e2ce31d96b704326fab82c23e68e2808c79e686856d45566f2aa041236ad9b67c488826e0a9d9bef1e209b
7
- data.tar.gz: 440237eb0b9ca07b8ee3e7c7a011cbfc080c1984c72d0b6cff99a4f06fa11bcc57b8bd6755efb3d79affc6412d9e12ef89cdc44043417911138faa22648b0e0c
6
+ metadata.gz: 3a03373b96d83e69500cbd2371557f5ced955e85964b3a92340e8bf3cb4da0b45ea3f83ed59fc6f47e410661c5a2e0ca0b9a5d2db6d890ce9d192ed35ccda2c1
7
+ data.tar.gz: 6675bdd426008a94d3e1367b584d3ce92e242b6d6e6e3a85c1e7afc544ab57cce7da847a7af53c9a3f11bd1bfb4f3b49cefb1032eb8157a5e2ddee32b4761545
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Model
5
- VERSION = "0.8.122"
5
+ VERSION = "0.8.123"
6
6
  end
7
7
  end
@@ -30,6 +30,7 @@ module Lutaml
30
30
  initialize_empty: true
31
31
  attribute :attribute_group, :attribute_group, collection: true,
32
32
  initialize_empty: true
33
+ attribute :any_attribute, :any_attribute
33
34
 
34
35
  xml do
35
36
  element "complexType"
@@ -50,6 +51,7 @@ module Lutaml
50
51
  map_element :attribute, to: :attribute
51
52
  map_element :annotation, to: :annotation
52
53
  map_element :attributeGroup, to: :attribute_group
54
+ map_element :anyAttribute, to: :any_attribute
53
55
  map_element :simpleContent, to: :simple_content
54
56
  map_element :complexContent, to: :complex_content
55
57
  end
@@ -31,7 +31,7 @@ module Lutaml
31
31
  map_element :sequence, to: :sequence
32
32
  map_element :attribute, to: :attribute
33
33
  map_element :annotation, to: :annotation
34
- map_element :any_attribute, to: :any_attribute
34
+ map_element :anyAttribute, to: :any_attribute
35
35
  map_element :attributeGroup, to: :attribute_group
36
36
  end
37
37
 
@@ -23,7 +23,7 @@ module Lutaml
23
23
  map_attribute :base, to: :base
24
24
  map_element :attribute, to: :attribute
25
25
  map_element :annotation, to: :annotation
26
- map_element :any_attribute, to: :any_attribute
26
+ map_element :anyAttribute, to: :any_attribute
27
27
  map_element :attributeGroup, to: :attribute_group
28
28
  end
29
29
 
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "spec_helper"
4
+
5
+ RSpec.describe "xs:anyAttribute mappings" do
6
+ it "maps anyAttribute on a complexType from the parsed XSD" do
7
+ xsd = <<~XSD
8
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
9
+ <xs:complexType name="t">
10
+ <xs:attribute name="a"/>
11
+ <xs:anyAttribute namespace="##other" processContents="strict"/>
12
+ </xs:complexType>
13
+ </xs:schema>
14
+ XSD
15
+
16
+ schema = Lutaml::Xml::Schema::Xsd.parse(xsd)
17
+ wildcard = schema.complex_type.first.any_attribute
18
+
19
+ expect(wildcard).not_to be_nil
20
+ expect(wildcard.namespace).to eq("##other")
21
+ expect(wildcard.process_contents).to eq("strict")
22
+ end
23
+
24
+ it "maps anyAttribute inside a simpleContent extension" do
25
+ xsd = <<~XSD
26
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
27
+ <xs:complexType name="t">
28
+ <xs:simpleContent>
29
+ <xs:extension base="xs:string">
30
+ <xs:anyAttribute namespace="##local"/>
31
+ </xs:extension>
32
+ </xs:simpleContent>
33
+ </xs:complexType>
34
+ </xs:schema>
35
+ XSD
36
+
37
+ schema = Lutaml::Xml::Schema::Xsd.parse(xsd)
38
+ extension = schema.complex_type.first.simple_content.extension
39
+ wildcard = extension.any_attribute
40
+
41
+ expect(wildcard).not_to be_nil
42
+ expect(wildcard.namespace).to eq("##local")
43
+ end
44
+
45
+ it "maps anyAttribute inside a complexContent extension" do
46
+ xsd = <<~XSD
47
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
48
+ <xs:complexType name="t">
49
+ <xs:complexContent>
50
+ <xs:extension base="xs:anyType">
51
+ <xs:anyAttribute namespace="##targetNamespace"/>
52
+ </xs:extension>
53
+ </xs:complexContent>
54
+ </xs:complexType>
55
+ </xs:schema>
56
+ XSD
57
+
58
+ schema = Lutaml::Xml::Schema::Xsd.parse(xsd)
59
+ extension = schema.complex_type.first.complex_content.extension
60
+ wildcard = extension.any_attribute
61
+
62
+ expect(wildcard).not_to be_nil
63
+ expect(wildcard.namespace).to eq("##targetNamespace")
64
+ end
65
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.122
4
+ version: 0.8.123
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-21 00:00:00.000000000 Z
11
+ date: 2026-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -2019,6 +2019,7 @@ files:
2019
2019
  - spec/lutaml/xml/schema/facet_round_trip_spec.rb
2020
2020
  - spec/lutaml/xml/schema/rnc_compiler_spec.rb
2021
2021
  - spec/lutaml/xml/schema/rng_compiler_spec.rb
2022
+ - spec/lutaml/xml/schema/xsd/any_attribute_spec.rb
2022
2023
  - spec/lutaml/xml/schema/xsd/errors/error_context_spec.rb
2023
2024
  - spec/lutaml/xml/schema/xsd/errors/suggestion_spec.rb
2024
2025
  - spec/lutaml/xml/schema/xsd/file_validation_result_spec.rb