xsd 2.4.1 → 2.4.3

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: 786af29254baeee14f0dbe25030ea93f11b13cbc65809a6b74eec7dac9c3e964
4
- data.tar.gz: 8a57b93cbd03ffb4cc176dee9ef9acec5ee37da68bcba6c0dd29bfb9450cd71c
3
+ metadata.gz: 07f0d2e114fa193dacc2ad0d9d74bbc173cbd3ebebcbae3d5a86152cc05abdc9
4
+ data.tar.gz: f806f42ee894bd5a14704842d4e2f6da61559d006edce27e3dcb6d29568ab54b
5
5
  SHA512:
6
- metadata.gz: 96c8d9f3e1905cab35ab23446c7ab6b14b6d60a352fc603a520851f7669a5ae0fad5f61256cc95ee1077aade09a3fb8d12aeee28721f003d615d01233d0d190c
7
- data.tar.gz: b5214a02de3b5b196d37eacddd6afb987fdd3ff23bb0a4660204fbac91875d61e266089e84f183a64fae5b8a2eba3a47e65cd0813babec74e8e45842243a2bd1
6
+ metadata.gz: 5ecb651c68e56eac792410385234e8ef48a366d2534978885e2f89023080b6d5de54d6e3d5ad53fe30d6d6eee074a46a1095dec87549bb11a78dea9ef5787773
7
+ data.tar.gz: 9d43d08a7281787b1d32f572339718620d1e88eff4f208b4d80fdb753086c4d996c7fb0d7b9277f5f00dcae9ff3bd13660d1207891e9c61265888575e48f7aad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.4.3] - 2024-04-04
4
+
5
+ - Fix detecting types and refs when namespaces are overidden per element
6
+ - Fix documentation encoding issue with no XML declaration
7
+
3
8
  ## [2.4.1] - 2023-11-13
4
9
 
5
10
  - Fix attribute value existence check
@@ -76,12 +76,16 @@ module XSD
76
76
  # @param [String, nil] ns_or_prefix
77
77
  # @return Array<Schema>
78
78
  def schemas_for_namespace(ns_or_prefix)
79
- if schema.targets_namespace?(ns_or_prefix)
79
+ # resolve namespace for current node if prefix was provided
80
+ prefix = node.namespaces["xmlns:#{ns_or_prefix}"]
81
+ ns = prefix || ns_or_prefix
82
+
83
+ if schema.targets_namespace?(ns)
80
84
  [schema, *schema.includes.map(&:imported_schema)]
81
- elsif (import = schema.import_by_namespace(ns_or_prefix))
85
+ elsif (import = schema.import_by_namespace(ns))
82
86
  [import.imported_schema]
83
87
  else
84
- raise Error, "Schema not found for namespace '#{ns_or_prefix}' in '#{schema.id || schema.target_namespace}'"
88
+ raise Error, "Schema not found for namespace '#{ns}' in '#{schema.id || schema.target_namespace}'"
85
89
  end
86
90
  end
87
91
 
@@ -193,7 +197,7 @@ module XSD
193
197
  # @param [Nokogiri::XML::Node] node
194
198
  # @return Array<String>
195
199
  def documentation_for(node)
196
- node.xpath('./xs:annotation/xs:documentation/text()', { 'xs' => XML_SCHEMA }).map { |x| x.to_s.strip }
200
+ node.xpath('./xs:annotation/xs:documentation/text()', { 'xs' => XML_SCHEMA }).map { |x| x.text.strip }
197
201
  end
198
202
 
199
203
  # Get all available elements on the current stack level
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.4.1'
4
+ VERSION = '2.4.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.arkhipov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-13 00:00:00.000000000 Z
11
+ date: 2024-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.4.10
137
+ rubygems_version: 3.5.5
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: The Ruby XSD library is an XML Schema implementation for Ruby.