ruby_rnv 0.5.1 → 0.5.2
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 +4 -4
- data/lib/rnv/error.rb +4 -0
- data/lib/rnv/validator.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4214fd7cf9852894c4b122a3d2d8bc15a87c4e0aa464bb3bcb359cfe0449c3a4
|
|
4
|
+
data.tar.gz: bbb487f231d7cf15affaaab7f794e656100f57a1022682994da12ceb0619b5fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c4d44f5a42521cda63da8f2e4c51b05e7812896e778da25ec1795b69af5f55e60ed58e542c58f96715e40fc697da4063eda47bff4165f68823edd4919c08c91
|
|
7
|
+
data.tar.gz: 8c62a8ba7a327c7728b647617f66c4c116a85391b73a72597c29475b8c2e67aa74ab4c73e3b363002027b6390b769c174f0836df6060521ace149370cf54a24c
|
data/lib/rnv/error.rb
CHANGED
data/lib/rnv/validator.rb
CHANGED
|
@@ -48,7 +48,8 @@ module RNV
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
while current.name
|
|
51
|
-
|
|
51
|
+
current_name_with_ns = "#{rev_namespaces[current.uri]&.first||"xmlns"}:#{current.name}"
|
|
52
|
+
xpath << "#{current_name_with_ns}[#{current.parent.children.select { |child| child.name == current.name }.index(current) + 1}]"
|
|
52
53
|
current = current.parent
|
|
53
54
|
end
|
|
54
55
|
[xpath.reverse, namespaces]
|
|
@@ -75,16 +76,15 @@ module RNV
|
|
|
75
76
|
namespaces[n.first || "xmlns"] = n.last
|
|
76
77
|
end
|
|
77
78
|
@xpath_tree = @xpath_tree.add_child(name, uri, namespaces)
|
|
78
|
-
|
|
79
79
|
update_line_col
|
|
80
80
|
@document.start_tag(@pre_processor.tag(tag_name), @pre_processor.attributes(tag_attrs))
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def end_element_namespace(name, prefix = nil, uri = nil)
|
|
84
|
-
@xpath_tree = @xpath_tree.parent
|
|
85
84
|
tag_name = uri ? "#{uri}:#{name}" : name
|
|
86
85
|
update_line_col
|
|
87
86
|
@document.end_tag(@pre_processor.tag(tag_name))
|
|
87
|
+
@xpath_tree = @xpath_tree.parent
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
def characters(value)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_rnv
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julien Boulnois
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|