leptris 1.9.38 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6a20a13a634924317b339a27ecae165e6998c4d3de38854edd48d6ca68fa963
4
- data.tar.gz: 87fdd1085af203af496cb625f02406073a000c1e5d6f1bcce046222fcc8d9a74
3
+ metadata.gz: 21a0f9d2bf7f1c6758b6e2e31dcb66e0e5a11bf40580608cb02834cf80685785
4
+ data.tar.gz: a7581350e1b5838a4d3d2c35e4ed6b73b3944709b9ff8e171dcdcc0d1d67181c
5
5
  SHA512:
6
- metadata.gz: c635bbd6bff75845204d2e34665003f9652b68dfe834f1484b5da84dd26e4db5992b14bb9b5d51e5cb03d9ee2b8e4ca64d6190aeb3fffa631011fbf9b1316625
7
- data.tar.gz: fdef1ebde1f5770b0379242ae258ef8fcc1331353bc25f0ad283a6c13fea23d0df9508fb4623ffd0dffd798298b3b324efc7d92dae3131063436682fa6762d7c
6
+ metadata.gz: 5a824a978fbe93bee62dd9cf760305e320dbf0c537a764be413368f2ff77203c777b33dc9e27fb09c6252e0583084e1b4488d91050a47204ce0c6963b01a80cc
7
+ data.tar.gz: e96ca075b15efc6dccc627ee01413cc4fb98be27ab351599e7e1348a1b833023fdc2ce04cae5fedf8ccd1b26b0066c140b831f89ccf9cc7e044ff988cd3d89ca
data/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ 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
+
8
26
  ## [1.9.38] - 2026-08-29
9
27
 
10
28
  ### Changed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.38"
4
+ VERSION = "1.9.39"
5
5
  end
@@ -101,7 +101,7 @@ module Leptris::XML::SAX::DomDispatch
101
101
  if dispatched[:start_element] == :one_arg
102
102
  handler.start_element(qname)
103
103
  else
104
- handler.start_element(qname, attr_pairs(element.c_ptr))
104
+ handler.start_element(qname, declared_pairs(element))
105
105
  end
106
106
  end
107
107
  visit_children(element.c_ptr, element.document, handler, dispatched)
@@ -113,6 +113,23 @@ module Leptris::XML::SAX::DomDispatch
113
113
  end
114
114
  end
115
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
+
116
133
  # [name, value] pairs in source order, read straight from the
117
134
  # attribute chain — no Attr objects, no hash.
118
135
  def attr_pairs(c_ptr)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.38
4
+ version: 1.9.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.