moxml 0.1.14 → 0.1.16

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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +117 -66
  3. data/Gemfile +1 -0
  4. data/README.adoc +11 -9
  5. data/Rakefile +34 -1
  6. data/TODO.remaining/1-entity-reference-adapter-support.md +157 -0
  7. data/TODO.remaining/2-entity-restoration-model-driven.md +169 -0
  8. data/TODO.remaining/3-entity-reference-test-coverage.md +170 -0
  9. data/TODO.remaining/4-lenient-entities-mode.md +106 -0
  10. data/TODO.remaining/5-fixture-integrity.md +65 -0
  11. data/TODO.remaining/6-ox-element-ordering-bug.md +36 -0
  12. data/TODO.remaining/7-headed-ox-limitations.md +95 -0
  13. data/TODO.remaining/8-xpath-predicate-gaps.md +68 -0
  14. data/TODO.remaining/9-cleanup-hygiene.md +42 -0
  15. data/TODO.remaining/README.md +54 -0
  16. data/benchmarks/generate_report.rb +1 -1
  17. data/docs/_pages/configuration.adoc +22 -19
  18. data/docs/_tutorials/namespace-handling.adoc +5 -5
  19. data/lib/moxml/adapter/base.rb +22 -3
  20. data/lib/moxml/adapter/customized_libxml/declaration.rb +1 -1
  21. data/lib/moxml/adapter/customized_libxml/entity_reference.rb +23 -0
  22. data/lib/moxml/adapter/customized_libxml.rb +18 -0
  23. data/lib/moxml/adapter/customized_oga.rb +10 -0
  24. data/lib/moxml/adapter/customized_ox/entity_reference.rb +25 -0
  25. data/lib/moxml/adapter/customized_ox.rb +12 -0
  26. data/lib/moxml/adapter/customized_rexml/entity_reference.rb +19 -0
  27. data/lib/moxml/adapter/customized_rexml/formatter.rb +44 -20
  28. data/lib/moxml/adapter/customized_rexml.rb +11 -0
  29. data/lib/moxml/adapter/headed_ox.rb +37 -14
  30. data/lib/moxml/adapter/libxml.rb +233 -119
  31. data/lib/moxml/adapter/nokogiri.rb +22 -11
  32. data/lib/moxml/adapter/oga.rb +64 -25
  33. data/lib/moxml/adapter/ox.rb +198 -42
  34. data/lib/moxml/adapter/rexml.rb +64 -13
  35. data/lib/moxml/attribute.rb +3 -0
  36. data/lib/moxml/builder.rb +78 -24
  37. data/lib/moxml/config.rb +24 -7
  38. data/lib/moxml/declaration.rb +4 -2
  39. data/lib/moxml/document.rb +8 -1
  40. data/lib/moxml/document_builder.rb +44 -37
  41. data/lib/moxml/element.rb +18 -5
  42. data/lib/moxml/entity_registry.rb +51 -1
  43. data/lib/moxml/native_attachment.rb +65 -0
  44. data/lib/moxml/node.rb +39 -50
  45. data/lib/moxml/node_set.rb +43 -15
  46. data/lib/moxml/version.rb +1 -1
  47. data/lib/moxml/xml_utils.rb +1 -1
  48. data/lib/moxml/xpath/compiler.rb +4 -1
  49. data/lib/moxml.rb +1 -0
  50. data/scripts/format_xml.rb +16 -0
  51. data/scripts/pretty_format_xml.rb +14 -0
  52. data/spec/consistency/round_trip_spec.rb +3 -30
  53. data/spec/integration/all_adapters_spec.rb +1 -0
  54. data/spec/integration/headed_ox_integration_spec.rb +0 -2
  55. data/spec/integration/shared_examples/edge_cases.rb +7 -4
  56. data/spec/integration/shared_examples/integration_workflows.rb +3 -3
  57. data/spec/integration/shared_examples/node_wrappers/cdata_behavior.rb +1 -1
  58. data/spec/integration/shared_examples/node_wrappers/entity_reference_behavior.rb +224 -0
  59. data/spec/integration/shared_examples/node_wrappers/node_behavior.rb +1 -1
  60. data/spec/moxml/adapter/headed_ox_spec.rb +8 -8
  61. data/spec/moxml/adapter/oga_spec.rb +46 -0
  62. data/spec/moxml/adapter/shared_examples/adapter_contract.rb +1 -12
  63. data/spec/moxml/allocation_benchmark_spec.rb +96 -0
  64. data/spec/moxml/allocation_guard_spec.rb +282 -0
  65. data/spec/moxml/builder_spec.rb +256 -0
  66. data/spec/moxml/config_spec.rb +11 -11
  67. data/spec/moxml/doctype_spec.rb +41 -0
  68. data/spec/moxml/lazy_parse_spec.rb +115 -0
  69. data/spec/moxml/namespace_uri_validation_spec.rb +11 -3
  70. data/spec/moxml/node_cache_spec.rb +110 -0
  71. data/spec/moxml/node_set_cache_spec.rb +90 -0
  72. data/spec/moxml/xml_utils_spec.rb +32 -0
  73. data/spec/moxml/xpath/axes_spec.rb +1 -1
  74. data/spec/moxml/xpath/compiler_spec.rb +2 -2
  75. data/spec/moxml/xpath/functions/position_functions_spec.rb +5 -5
  76. data/spec/moxml/xpath/functions/special_functions_spec.rb +1 -1
  77. data/spec/performance/memory_usage_spec.rb +0 -4
  78. data/spec/support/allocation_helper.rb +165 -0
  79. data/spec/support/w3c_namespace_helpers.rb +2 -1
  80. metadata +29 -2
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.14
4
+ version: 0.1.16
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-04-20 00:00:00.000000000 Z
11
+ date: 2026-04-22 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
@@ -34,6 +34,16 @@ files:
34
34
  - LICENSE.md
35
35
  - README.adoc
36
36
  - Rakefile
37
+ - TODO.remaining/1-entity-reference-adapter-support.md
38
+ - TODO.remaining/2-entity-restoration-model-driven.md
39
+ - TODO.remaining/3-entity-reference-test-coverage.md
40
+ - TODO.remaining/4-lenient-entities-mode.md
41
+ - TODO.remaining/5-fixture-integrity.md
42
+ - TODO.remaining/6-ox-element-ordering-bug.md
43
+ - TODO.remaining/7-headed-ox-limitations.md
44
+ - TODO.remaining/8-xpath-predicate-gaps.md
45
+ - TODO.remaining/9-cleanup-hygiene.md
46
+ - TODO.remaining/README.md
37
47
  - benchmarks/.gitignore
38
48
  - benchmarks/generate_report.rb
39
49
  - bin/console
@@ -99,18 +109,25 @@ files:
99
109
  - lib/moxml.rb
100
110
  - lib/moxml/adapter.rb
101
111
  - lib/moxml/adapter/base.rb
112
+ - lib/moxml/adapter/customized_libxml.rb
102
113
  - lib/moxml/adapter/customized_libxml/cdata.rb
103
114
  - lib/moxml/adapter/customized_libxml/comment.rb
104
115
  - lib/moxml/adapter/customized_libxml/declaration.rb
105
116
  - lib/moxml/adapter/customized_libxml/element.rb
117
+ - lib/moxml/adapter/customized_libxml/entity_reference.rb
106
118
  - lib/moxml/adapter/customized_libxml/node.rb
107
119
  - lib/moxml/adapter/customized_libxml/processing_instruction.rb
108
120
  - lib/moxml/adapter/customized_libxml/text.rb
121
+ - lib/moxml/adapter/customized_oga.rb
109
122
  - lib/moxml/adapter/customized_oga/xml_declaration.rb
110
123
  - lib/moxml/adapter/customized_oga/xml_generator.rb
124
+ - lib/moxml/adapter/customized_ox.rb
111
125
  - lib/moxml/adapter/customized_ox/attribute.rb
126
+ - lib/moxml/adapter/customized_ox/entity_reference.rb
112
127
  - lib/moxml/adapter/customized_ox/namespace.rb
113
128
  - lib/moxml/adapter/customized_ox/text.rb
129
+ - lib/moxml/adapter/customized_rexml.rb
130
+ - lib/moxml/adapter/customized_rexml/entity_reference.rb
114
131
  - lib/moxml/adapter/customized_rexml/formatter.rb
115
132
  - lib/moxml/adapter/headed_ox.rb
116
133
  - lib/moxml/adapter/libxml.rb
@@ -133,6 +150,7 @@ files:
133
150
  - lib/moxml/entity_registry.rb
134
151
  - lib/moxml/error.rb
135
152
  - lib/moxml/namespace.rb
153
+ - lib/moxml/native_attachment.rb
136
154
  - lib/moxml/node.rb
137
155
  - lib/moxml/node_set.rb
138
156
  - lib/moxml/processing_instruction.rb
@@ -158,6 +176,8 @@ files:
158
176
  - lib/moxml/xpath/ruby/node.rb
159
177
  - moxml.gemspec
160
178
  - old-specs/moxml/adapter/customized_libxml/.gitkeep
179
+ - scripts/format_xml.rb
180
+ - scripts/pretty_format_xml.rb
161
181
  - sig/moxml.rbs
162
182
  - spec/consistency/README.md
163
183
  - spec/consistency/adapter_parity_spec.rb
@@ -270,6 +290,7 @@ files:
270
290
  - spec/integration/shared_examples/node_wrappers/doctype_behavior.rb
271
291
  - spec/integration/shared_examples/node_wrappers/document_behavior.rb
272
292
  - spec/integration/shared_examples/node_wrappers/element_behavior.rb
293
+ - spec/integration/shared_examples/node_wrappers/entity_reference_behavior.rb
273
294
  - spec/integration/shared_examples/node_wrappers/namespace_behavior.rb
274
295
  - spec/integration/shared_examples/node_wrappers/node_behavior.rb
275
296
  - spec/integration/shared_examples/node_wrappers/node_set_behavior.rb
@@ -290,6 +311,8 @@ files:
290
311
  - spec/moxml/adapter/shared_examples/.gitkeep
291
312
  - spec/moxml/adapter/shared_examples/adapter_contract.rb
292
313
  - spec/moxml/adapter_spec.rb
314
+ - spec/moxml/allocation_benchmark_spec.rb
315
+ - spec/moxml/allocation_guard_spec.rb
293
316
  - spec/moxml/attribute_spec.rb
294
317
  - spec/moxml/builder_spec.rb
295
318
  - spec/moxml/cdata_spec.rb
@@ -304,9 +327,12 @@ files:
304
327
  - spec/moxml/element_spec.rb
305
328
  - spec/moxml/entity_registry_spec.rb
306
329
  - spec/moxml/error_spec.rb
330
+ - spec/moxml/lazy_parse_spec.rb
307
331
  - spec/moxml/moxml_spec.rb
308
332
  - spec/moxml/namespace_spec.rb
309
333
  - spec/moxml/namespace_uri_validation_spec.rb
334
+ - spec/moxml/node_cache_spec.rb
335
+ - spec/moxml/node_set_cache_spec.rb
310
336
  - spec/moxml/node_set_spec.rb
311
337
  - spec/moxml/node_spec.rb
312
338
  - spec/moxml/processing_instruction_spec.rb
@@ -342,6 +368,7 @@ files:
342
368
  - spec/performance/thread_safety_spec.rb
343
369
  - spec/performance/xpath_benchmark_spec.rb
344
370
  - spec/spec_helper.rb
371
+ - spec/support/allocation_helper.rb
345
372
  - spec/support/w3c_namespace_helpers.rb
346
373
  - spec/support/xml_matchers.rb
347
374
  - spec/unit/rexml_isolated_test.rb