leptris 1.9.37 → 1.9.39
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/CHANGELOG.md +41 -0
- data/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/sax/dom_dispatch.rb +36 -3
- 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: 21a0f9d2bf7f1c6758b6e2e31dcb66e0e5a11bf40580608cb02834cf80685785
|
|
4
|
+
data.tar.gz: a7581350e1b5838a4d3d2c35e4ed6b73b3944709b9ff8e171dcdcc0d1d67181c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a824a978fbe93bee62dd9cf760305e320dbf0c537a764be413368f2ff77203c777b33dc9e27fb09c6252e0583084e1b4488d91050a47204ce0c6963b01a80cc
|
|
7
|
+
data.tar.gz: e96ca075b15efc6dccc627ee01413cc4fb98be27ab351599e7e1348a1b833023fdc2ce04cae5fedf8ccd1b26b0066c140b831f89ccf9cc7e044ff988cd3d89ca
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,47 @@ All notable changes to Leptris will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.39] - 2026-08-29
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Namespace declarations return to SAX events (leptris-ruby#99,
|
|
13
|
+
critical)**: the DOM-backed dispatcher (1.9.36's #95 workaround)
|
|
14
|
+
built start_element pairs from the DOM attribute chain, which
|
|
15
|
+
excludes xmlns declarations — namespace-aware consumers went
|
|
16
|
+
blind (canon's namespace-declaration diffs came back empty). The
|
|
17
|
+
engine's streaming contract carries declarations among the
|
|
18
|
+
attribute pairs; the dispatcher now emits them first in
|
|
19
|
+
declaration order (default as `xmlns`, prefixed as
|
|
20
|
+
`xmlns:prefix`), then the attributes in source order with their
|
|
21
|
+
prefixed names preserved. The exact byte-level interleave of the
|
|
22
|
+
streaming path is unrecoverable from the DOM model and is the
|
|
23
|
+
one documented difference — a spec pins set-equality against
|
|
24
|
+
the engine transport per element.
|
|
25
|
+
|
|
26
|
+
## [1.9.38] - 2026-08-29
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- **libleptris 1.9.13 lockstep**: pin bumped; audit 250/250, no
|
|
31
|
+
new C surface. Engine: document-level whitespace now chains as
|
|
32
|
+
TEXT children of the document node with libxml2's exact rule
|
|
33
|
+
(leading prolog ws dropped, ws after a prolog PI dropped, ws
|
|
34
|
+
after a comment or the root kept, trailing tail trimmed) — a
|
|
35
|
+
spec pins the rule through `Document#children`; XSLT suite
|
|
36
|
+
180 -> 181/205.
|
|
37
|
+
- **Element-only SAX handlers ride the element batch** in the
|
|
38
|
+
DOM-backed dispatcher (round XXIII's path): handlers overriding
|
|
39
|
+
only element events skip the per-child get_type walk entirely —
|
|
40
|
+
text/comments/PIs are never fetched. The document node keeps the
|
|
41
|
+
typed walk (it is not an element handle).
|
|
42
|
+
|
|
43
|
+
### Meta
|
|
44
|
+
|
|
45
|
+
- Nokogiri-compat audit against moxml's adapter surface: no gaps
|
|
46
|
+
(remove_attribute, add_namespace_definition, replace,
|
|
47
|
+
add_previous/next_sibling all present).
|
|
48
|
+
|
|
8
49
|
## [1.9.37] - 2026-08-29
|
|
9
50
|
|
|
10
51
|
### Added
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
|
8
8
|
# Pin for `rake compile` and the platform-gem builds. Keep in lockstep
|
|
9
9
|
# with .github/workflows/build.yml (which calls `rake compile`) and the
|
|
10
10
|
# CHANGELOG when libleptris releases.
|
|
11
|
-
LIBLEPTRIS_VERSION = "1.9.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.13"
|
|
12
12
|
|
|
13
13
|
CMAKE_FLAGS = %w[
|
|
14
14
|
-DCMAKE_BUILD_TYPE=Release
|
data/lib/leptris/version.rb
CHANGED
|
@@ -29,7 +29,10 @@ module Leptris::XML::SAX::DomDispatch
|
|
|
29
29
|
def dispatch(handler, dispatched, doc)
|
|
30
30
|
handler.start_document if dispatched[:start_document]
|
|
31
31
|
doc_node = doc.node
|
|
32
|
-
|
|
32
|
+
if doc_node
|
|
33
|
+
visit_children(doc_node.c_ptr, doc, handler, dispatched,
|
|
34
|
+
element_parent: false)
|
|
35
|
+
end
|
|
33
36
|
handler.end_document if dispatched[:end_document]
|
|
34
37
|
self
|
|
35
38
|
end
|
|
@@ -41,10 +44,23 @@ module Leptris::XML::SAX::DomDispatch
|
|
|
41
44
|
CDATA = Leptris::XML::FFI::NODE_CDATA
|
|
42
45
|
PI = Leptris::XML::FFI::NODE_PI
|
|
43
46
|
|
|
44
|
-
def visit_children(c_ptr, doc, handler, dispatched)
|
|
47
|
+
def visit_children(c_ptr, doc, handler, dispatched, element_parent: true)
|
|
45
48
|
wants_text_kinds = dispatched[:characters] ||
|
|
46
49
|
dispatched[:comment] ||
|
|
47
50
|
dispatched[:cdata] || dispatched[:pi]
|
|
51
|
+
if element_parent && !wants_text_kinds
|
|
52
|
+
# Element-only handlers under an element: the element batch
|
|
53
|
+
# hands out element pointers with no per-child get_type
|
|
54
|
+
# (round XXIII's path) — text/comments/PIs are never fetched.
|
|
55
|
+
# (The document node is not an element handle — the typed
|
|
56
|
+
# walk serves it.)
|
|
57
|
+
Leptris::XML::FFI.fetch_element_children(c_ptr).each do |child_ptr|
|
|
58
|
+
visit_element(
|
|
59
|
+
Leptris::XML::Node.wrap(child_ptr, doc, node_type: ELEMENT),
|
|
60
|
+
handler, dispatched)
|
|
61
|
+
end
|
|
62
|
+
return
|
|
63
|
+
end
|
|
48
64
|
Leptris::XML::FFI.fetch_children(c_ptr).each do |child_ptr|
|
|
49
65
|
case Leptris::XML::FFI.leptris_node_get_type(child_ptr)
|
|
50
66
|
when ELEMENT
|
|
@@ -85,7 +101,7 @@ module Leptris::XML::SAX::DomDispatch
|
|
|
85
101
|
if dispatched[:start_element] == :one_arg
|
|
86
102
|
handler.start_element(qname)
|
|
87
103
|
else
|
|
88
|
-
handler.start_element(qname,
|
|
104
|
+
handler.start_element(qname, declared_pairs(element))
|
|
89
105
|
end
|
|
90
106
|
end
|
|
91
107
|
visit_children(element.c_ptr, element.document, handler, dispatched)
|
|
@@ -97,6 +113,23 @@ module Leptris::XML::SAX::DomDispatch
|
|
|
97
113
|
end
|
|
98
114
|
end
|
|
99
115
|
|
|
116
|
+
# start_element's pairs with xmlns declarations carried — the
|
|
117
|
+
# engine's streaming contract reports declarations among the
|
|
118
|
+
# attribute pairs (canon-style namespace-aware consumers split
|
|
119
|
+
# them). The DOM model stores declarations and attributes
|
|
120
|
+
# separately, so the exact byte-level interleave is unrecoverable
|
|
121
|
+
# here: declarations emit first in declaration order (default as
|
|
122
|
+
# "xmlns", prefixed as "xmlns:prefix"), then the attributes in
|
|
123
|
+
# source order (leptris-ruby#99).
|
|
124
|
+
def declared_pairs(element)
|
|
125
|
+
defs = element.namespace_definitions
|
|
126
|
+
return attr_pairs(element.c_ptr) if defs.empty?
|
|
127
|
+
pairs = defs.map do |ns|
|
|
128
|
+
[ns.prefix ? "xmlns:#{ns.prefix}" : "xmlns", ns.href]
|
|
129
|
+
end
|
|
130
|
+
pairs.concat(attr_pairs(element.c_ptr))
|
|
131
|
+
end
|
|
132
|
+
|
|
100
133
|
# [name, value] pairs in source order, read straight from the
|
|
101
134
|
# attribute chain — no Attr objects, no hash.
|
|
102
135
|
def attr_pairs(c_ptr)
|