ruby_rnv 0.5.1 → 0.5.2

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: 34b0a44425bf0b95c0b8eae8671e4236099e8812c4707242e23b9cf8d8493fa6
4
- data.tar.gz: 59089293248b1dc8684584cd4e3c821805dea555f8dfdc9351451aca0ce8ba94
3
+ metadata.gz: 4214fd7cf9852894c4b122a3d2d8bc15a87c4e0aa464bb3bcb359cfe0449c3a4
4
+ data.tar.gz: bbb487f231d7cf15affaaab7f794e656100f57a1022682994da12ceb0619b5fc
5
5
  SHA512:
6
- metadata.gz: 35bfea201f2bd6c4243cfdc1a645fb6434b1f02c49dd6ad00cf83470a8760fb0e47c6cfeb8b113c24c4a391539cd3db07e8945bc20c5d2137065849bdab82ac2
7
- data.tar.gz: 6deaced66f1ed6cf800cabf0c09f77f61d6239ef6aa28fc1472501f33d30f6c85bbfead13aa763e6b50e3728042762a01bc04cd1eb5ed677f4856029a3cf0514
6
+ metadata.gz: 0c4d44f5a42521cda63da8f2e4c51b05e7812896e778da25ec1795b69af5f55e60ed58e542c58f96715e40fc697da4063eda47bff4165f68823edd4919c08c91
7
+ data.tar.gz: 8c62a8ba7a327c7728b647617f66c4c116a85391b73a72597c29475b8c2e67aa74ab4c73e3b363002027b6390b769c174f0836df6060521ace149370cf54a24c
data/lib/rnv/error.rb CHANGED
@@ -91,6 +91,10 @@ module RNV
91
91
  "datatype #{e[-2]}:#{e.last}"
92
92
  when :rn_nc_qname
93
93
  with_ns ? "#{e.first}:#{e.last}" : e.last
94
+ when :rn_p_text
95
+ "text"
96
+ when :rn_p_after
97
+ "after"
94
98
  else
95
99
  "unknown #{e.first}"
96
100
  end
data/lib/rnv/validator.rb CHANGED
@@ -48,7 +48,8 @@ module RNV
48
48
  end
49
49
 
50
50
  while current.name
51
- xpath << "#{rev_namespaces[current.uri]&.first||"xmlns"}:#{current.name}[#{current.parent.children.select { |child| child.name == current.name }.index(current) + 1}]"
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.1
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: 2021-07-12 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler