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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/xsd/base_object.rb +8 -4
- data/lib/xsd/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f0d2e114fa193dacc2ad0d9d74bbc173cbd3ebebcbae3d5a86152cc05abdc9
|
4
|
+
data.tar.gz: f806f42ee894bd5a14704842d4e2f6da61559d006edce27e3dcb6d29568ab54b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ecb651c68e56eac792410385234e8ef48a366d2534978885e2f89023080b6d5de54d6e3d5ad53fe30d6d6eee074a46a1095dec87549bb11a78dea9ef5787773
|
7
|
+
data.tar.gz: 9d43d08a7281787b1d32f572339718620d1e88eff4f208b4d80fdb753086c4d996c7fb0d7b9277f5f00dcae9ff3bd13660d1207891e9c61265888575e48f7aad
|
data/CHANGELOG.md
CHANGED
data/lib/xsd/base_object.rb
CHANGED
@@ -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
|
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(
|
85
|
+
elsif (import = schema.import_by_namespace(ns))
|
82
86
|
[import.imported_schema]
|
83
87
|
else
|
84
|
-
raise Error, "Schema not found for 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.
|
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
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.
|
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:
|
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.
|
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.
|