moxml 0.1.18 → 0.1.20
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/.rubocop_todo.yml +181 -11
- data/README.adoc +24 -1
- data/docs/_guides/node-api-consistency.adoc +4 -0
- data/lib/moxml/adapter/base.rb +6 -1
- data/lib/moxml/adapter/customized_ox/text.rb +15 -2
- data/lib/moxml/adapter/customized_rexml/formatter.rb +1 -0
- data/lib/moxml/adapter/libxml.rb +7 -2
- data/lib/moxml/adapter/oga.rb +6 -2
- data/lib/moxml/adapter/ox.rb +15 -8
- data/lib/moxml/builder.rb +12 -5
- data/lib/moxml/config.rb +1 -1
- data/lib/moxml/entity_registry.rb +1 -0
- data/lib/moxml/native_attachment/native.rb +69 -0
- data/lib/moxml/native_attachment/opal.rb +34 -0
- data/lib/moxml/native_attachment.rb +16 -46
- data/lib/moxml/text.rb +4 -0
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml/xpath/compiler.rb +2 -1
- data/spec/integration/shared_examples/edge_cases.rb +4 -2
- data/spec/integration/shared_examples/entity_reference_whitespace.rb +1 -1
- data/spec/integration/shared_examples/high_level/document_builder_behavior.rb +3 -1
- data/spec/integration/shared_examples/node_wrappers/entity_reference_behavior.rb +10 -4
- data/spec/integration/shared_examples/node_wrappers/node_set_behavior.rb +1 -1
- data/spec/moxml/adapter/headed_ox_spec.rb +1 -1
- data/spec/moxml/lazy_parse_spec.rb +1 -1
- data/spec/moxml/moxml_spec.rb +6 -40
- data/spec/moxml/native_attachment/native_spec.rb +57 -0
- data/spec/moxml/native_attachment/opal_spec.rb +29 -0
- data/spec/moxml/native_attachment/shared_examples.rb +43 -0
- data/spec/moxml/native_attachment_spec.rb +184 -0
- data/spec/moxml/text_spec.rb +23 -0
- data/spec/moxml/xpath/functions/node_functions_spec.rb +3 -2
- data/spec/performance/benchmark_spec.rb +1 -1
- metadata +8 -2
|
@@ -127,7 +127,7 @@ RSpec.describe "XPath Node Functions" do
|
|
|
127
127
|
it "inherits language from parent element" do
|
|
128
128
|
ast = Moxml::XPath::Parser.parse('lang("en")')
|
|
129
129
|
proc = Moxml::XPath::Compiler.compile_with_cache(ast)
|
|
130
|
-
child = doc_with_lang.root.children.first
|
|
130
|
+
child = doc_with_lang.root.children.grep(Moxml::Element).first
|
|
131
131
|
result = proc.call(child)
|
|
132
132
|
|
|
133
133
|
expect(result).to be true
|
|
@@ -136,7 +136,8 @@ RSpec.describe "XPath Node Functions" do
|
|
|
136
136
|
it "uses closest xml:lang attribute" do
|
|
137
137
|
ast = Moxml::XPath::Parser.parse('lang("fr")')
|
|
138
138
|
proc = Moxml::XPath::Compiler.compile_with_cache(ast)
|
|
139
|
-
|
|
139
|
+
elements = doc_with_lang.root.children.grep(Moxml::Element)
|
|
140
|
+
other = elements[1]
|
|
140
141
|
result = proc.call(other)
|
|
141
142
|
|
|
142
143
|
expect(result).to be true
|
|
@@ -30,7 +30,7 @@ RSpec.shared_examples "Performance Examples" do
|
|
|
30
30
|
rexml: { parser: 0, serializer: 5 },
|
|
31
31
|
ox: { parser: 2, serializer: 1000 },
|
|
32
32
|
headed_ox: { parser: 2, serializer: 1000 },
|
|
33
|
-
libxml: { parser:
|
|
33
|
+
libxml: { parser: 2, serializer: 3 },
|
|
34
34
|
}
|
|
35
35
|
end
|
|
36
36
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moxml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
Moxml is a unified XML manipulation library that provides a common API
|
|
@@ -141,6 +141,8 @@ files:
|
|
|
141
141
|
- lib/moxml/error.rb
|
|
142
142
|
- lib/moxml/namespace.rb
|
|
143
143
|
- lib/moxml/native_attachment.rb
|
|
144
|
+
- lib/moxml/native_attachment/native.rb
|
|
145
|
+
- lib/moxml/native_attachment/opal.rb
|
|
144
146
|
- lib/moxml/node.rb
|
|
145
147
|
- lib/moxml/node_set.rb
|
|
146
148
|
- lib/moxml/processing_instruction.rb
|
|
@@ -325,6 +327,10 @@ files:
|
|
|
325
327
|
- spec/moxml/moxml_spec.rb
|
|
326
328
|
- spec/moxml/namespace_spec.rb
|
|
327
329
|
- spec/moxml/namespace_uri_validation_spec.rb
|
|
330
|
+
- spec/moxml/native_attachment/native_spec.rb
|
|
331
|
+
- spec/moxml/native_attachment/opal_spec.rb
|
|
332
|
+
- spec/moxml/native_attachment/shared_examples.rb
|
|
333
|
+
- spec/moxml/native_attachment_spec.rb
|
|
328
334
|
- spec/moxml/node_cache_spec.rb
|
|
329
335
|
- spec/moxml/node_set_cache_spec.rb
|
|
330
336
|
- spec/moxml/node_set_spec.rb
|