xsd 2.4.2 → 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 +7 -3
- data/lib/xsd/version.rb +1 -1
- metadata +1 -1
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
|
|
data/lib/xsd/version.rb
CHANGED