xsd 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a5aa03e831e5cf4e88780b18a4ef57217eff54a14e2138669672f33486ba8bd
4
- data.tar.gz: b6a9ab392e47192a6a286ffa7dc97c5f624c78d9ab117bdea67e11f801c39363
3
+ metadata.gz: 73e87995baa341819126aaf56de8b4a865395423b6ea2f64c8a3aa8e702a611a
4
+ data.tar.gz: d330c3d390ff34c43d7988e0fe30b99d8538c62ff60205e0164d3119118ed1c4
5
5
  SHA512:
6
- metadata.gz: a031bc3a3947708a8f6f8e4add4040853f9f8b62cd3465de56421600d9fc2d2b7c45b163efe239c7486dce05bf0427d8f380e119673b644739f736b4598b5276
7
- data.tar.gz: ad7bbd0268373292a291935599749dc9937784438b398958acf592db4e1648967106f45c1dd402c82f3cdd534f2fe0e177a1250e91f65872fc3aa9d9a8b416a5
6
+ metadata.gz: 0bfc579e3376d04a72c4ac593d9c944c7739b0dc4ffe0ea94399fbdfb11771bb8f7a4d356609a257e47e5ff3fefa7bae6c34a0ac0cb76c1b149614b25fe58994
7
+ data.tar.gz: 2d44c024e3b658e2b907614a621db0d2367feac05e6abeb8c5e7bee027d830c3be6f4a438941141e17b1df626f3b5899793a9e7befc612bd28caae804812cf7b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [2.6.1] - 2024-04-12
2
+
3
+ - Correctly detect namespace for referenced elements
4
+
1
5
  ## [2.6.0] - 2024-04-12
2
6
 
3
7
  - Fix XSD boolean attributes
@@ -375,20 +375,19 @@ module XSD
375
375
  private
376
376
 
377
377
  def definition_match?(definition, query)
378
- actual_definition = definition.referenced? ? definition.reference : definition
379
-
378
+ # namespace included in query
380
379
  if query.start_with?('{')
381
380
  parts = query[1..].split('}')
382
381
  raise Error, "Invalid element/attribute query: #{query}" if parts.size != 2
383
382
 
384
383
  namespace, name = parts
385
384
 
386
- return false if namespace != actual_definition.namespace
385
+ return false if namespace != definition.namespace
387
386
  else
388
387
  name = query
389
388
  end
390
389
 
391
- name == '*' || actual_definition.name == name
390
+ name == '*' || definition.name == name
392
391
  end
393
392
  end
394
393
  end
@@ -8,8 +8,9 @@ module XSD
8
8
  class Group < BaseObject
9
9
  include MinMaxOccurs
10
10
  include Referenced
11
+ include Named
11
12
 
12
- # Optional. Specifies the name of the attribute. Name and ref attributes cannot both be present
13
+ # Optional. Specifies a name for the group. This attribute is used only when the schema element is the parent of this group element. Name and ref attributes cannot both be present
13
14
  # @!attribute name
14
15
  # @return String
15
16
  property :name, :string
@@ -5,7 +5,8 @@ module XSD
5
5
  # Get definition namespace
6
6
  # @return String
7
7
  def namespace
8
- schema.target_namespace
8
+ is_referenced = respond_to?(:referenced?)
9
+ is_referenced && referenced? ? reference.schema.target_namespace : schema.target_namespace
9
10
  end
10
11
 
11
12
  # Get absolute definition name
data/lib/xsd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XSD
4
- VERSION = '2.6.0'
4
+ VERSION = '2.6.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.arkhipov