leptris 1.9.53 → 1.9.54

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: 69c544dd0ba17ed0a5b5792e39ac9eb31f1f3d6ebb6e13b4bc31efb9ec0046ea
4
- data.tar.gz: 5e37895d36680daa6657ad8dcc5c7c1f36eba854519f4f15a815afb94744692c
3
+ metadata.gz: '028bd827a38f7d8caceadedb1bc882ff6a0bb3ae15151914abe5047c8668ed60'
4
+ data.tar.gz: 45a28f45bfe6546c24cbf8c83800d0883d82d1f486a0169c55ca78a992e05432
5
5
  SHA512:
6
- metadata.gz: beebbe2f1d0a908394e42da8318c8b3672ea5f773d64510e088caa5d7130e6c06f4aad1efc766df95e4dea4d870643956cb7755a01460a7d8f0cdeb2927734bc
7
- data.tar.gz: a11675dfee638e7ecee7ea209e939c0aa9c08ef3f49404c7c6d826f845841fb9dc7473c2b09ed2022c255049fd47ac105a6c7205fe51d28b37377aeb135bbea3
6
+ metadata.gz: 5c47e9fbc105d04e4f4504e56d0ab2584492ddb3f613e95e776eb527982858648ebbe3d05c95c7864e9676b1385def4d7fe5b6314567baf03b0a2c52dc05af41
7
+ data.tar.gz: 65b68638bad6fcea08332875c21222b81467a074dbc5426a1e2f3596fb0cc84214895c5ed336b677288860d34566758b4bc83018365d7ca400f10deb027e0787
data/CHANGELOG.md CHANGED
@@ -5,6 +5,41 @@ 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.54] - 2026-09-02
9
+
10
+ ### Changed
11
+
12
+ - **Lockstep with libleptris 1.9.49** (1.9.47 → 1.9.49; no new C
13
+ surface — the audit holds at 255/255 attached == exported):
14
+ - 1.9.47: `leptris_element_copy` keeps namespaces (#721) —
15
+ prefixes, declarations, and resolution on the copied subtree;
16
+ sequence-use `xsl:key` (#720, use-after-free + each item
17
+ indexes).
18
+ - 1.9.48: `xsl:on-completion` sees the final iterate params
19
+ (#729); merge-level `xsl:merge-key` fallback (#731); #730/#732
20
+ triaged against Saxon (quoted `xpath="'$p'"` is the dynamic
21
+ with-param form; multi-top-level results serialize fully —
22
+ libxslt parity).
23
+ - 1.9.49: `xs:` atomic constructors (`xs:integer`/`xs:double`/
24
+ `xs:decimal`/`xs:boolean`/`xs:string`/`xs:anyURI`) resolve in
25
+ any expression — standalone `#xpath` included, specced against
26
+ the Saxon ground truth (`xs:integer('42') + 1` = 43).
27
+ - All three pending specs un-pending (#729/#730/#731); #730
28
+ rewritten as the Saxon-correct pair (quoted form evaluates,
29
+ unquoted raises); sequence-use keys and the constructors
30
+ specced.
31
+
32
+ ### Changed
33
+
34
+ - **`dup` reverted to the C copy** (the payoff of #721's fix):
35
+ `Node#dup`/`Element#dup` and the element indent-unit path drop
36
+ the serialize → re-parse round-trip adopted in 1.9.50 — the C
37
+ copy now preserves every child kind, prefixed names, and
38
+ namespace declarations byte-for-byte, and is attached as the
39
+ fresh document's root so the tree is fully navigable (~436 µs
40
+ vs ~1.2 ms per dup of a 300-element subtree on this bench).
41
+ A new C-level spec pins the namespace fidelity.
42
+
8
43
  ## [1.9.53] - 2026-09-02
9
44
 
10
45
  ### Changed
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.46"
11
+ LIBLEPTRIS_VERSION = "1.9.49"
12
12
 
13
13
  CMAKE_FLAGS = %w[
14
14
  -DCMAKE_BUILD_TYPE=Release
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.53"
4
+ VERSION = "1.9.54"
5
5
  end
@@ -251,15 +251,16 @@ class Leptris::XML::Element < Leptris::XML::Node
251
251
  self
252
252
  end
253
253
 
254
- # Deep copy in a NEW document, via serialization round-trip:
255
- # leptris_element_copy drops namespace prefixes and declarations
256
- # outright (leptris/leptris#721; its comment/PI child drop was
257
- # #696, fixed upstream in 1.9.39) the serializer preserves
258
- # every child kind, prefixed names, and namespace declarations,
259
- # and re-parsing rebuilds them all.
254
+ # Deep copy in a NEW document via the C copy (both engine gaps
255
+ # closed: comment/PI children in 1.9.39, namespaces in 1.9.47 —
256
+ # leptris/leptris#696, #721), attached as the fresh document's
257
+ # root so the tree is fully navigable.
260
258
  def dup
261
259
  ensure_alive!
262
- Leptris::XML::Document.parse(to_xml).root
260
+ new_doc = Leptris::XML::Document.create
261
+ copy = Leptris::XML::FFI.leptris_element_copy(@c_ptr, new_doc.c_ptr)
262
+ raise Leptris::XML::Error, "leptris_element_copy failed" if copy.null?
263
+ new_doc.root = Leptris::XML::Node.wrap(copy, new_doc)
263
264
  end
264
265
  alias_method :clone, :dup
265
266
 
@@ -369,17 +369,18 @@ class Leptris::XML::Node
369
369
  result
370
370
  end
371
371
 
372
- # Deep copy in a NEW document. Rounds through serialization
373
- # rather than leptris_element_copy: the C copy drops namespace
374
- # prefixes and declarations outright (leptris/leptris#721; the
375
- # comment/PI child drop was #696, fixed upstream in 1.9.39) —
376
- # the serializer preserves every child kind, prefixed names, and
377
- # namespace declarations, and re-parsing rebuilds them all.
372
+ # Deep copy in a NEW document via the C copy (both engine gaps
373
+ # closed: comment/PI children in 1.9.39, namespaces in 1.9.47 —
374
+ # leptris/leptris#696, #721). The copy is attached as the fresh
375
+ # document's root so the tree is fully navigable.
378
376
  def dup
379
377
  ensure_alive!
380
378
  elem_ptr = Leptris::XML::FFI.leptris_node_as_element(@c_ptr)
381
379
  raise Leptris::XML::Error, "dup is only supported for element nodes" if elem_ptr.null?
382
- Leptris::XML::Document.parse(to_xml).root
380
+ new_doc = Leptris::XML::Document.create
381
+ copy = Leptris::XML::FFI.leptris_element_copy(elem_ptr, new_doc.c_ptr)
382
+ raise Leptris::XML::Error, "leptris_element_copy failed" if copy.null?
383
+ new_doc.root = Leptris::XML::Node.wrap(copy, new_doc)
383
384
  end
384
385
  alias_method :clone, :dup
385
386
 
@@ -97,14 +97,17 @@ module Leptris::XML::Serialization
97
97
 
98
98
  # Element-face indent unit (leptris-ruby#109 residual 2): no
99
99
  # element-level ext-serialize entry exists yet, so the unit path
100
- # rounds the subtree through serialization into a fresh document
101
- # (leptris_element_copy drops namespacesleptris/leptris#721)
102
- # and serializes that document without a declaration — identical
103
- # output to the element serializer for the standard layout, with
104
- # the unit and every child kind intact.
100
+ # C-copies the subtree into a fresh document (the copy keeps
101
+ # every child kind and namespace since leptris 1.9.47 — #696,
102
+ # #721) and serializes that document without a declaration —
103
+ # identical output to the element serializer for the standard
104
+ # layout, with the unit and every child kind intact.
105
105
  def self.to_xml_element_unit(element, unit, indent: 0)
106
- document = Leptris::XML::Document.parse(element.to_xml)
106
+ document = Leptris::XML::Document.create
107
107
  begin
108
+ copy = Leptris::XML::FFI.leptris_element_copy(element.c_ptr, document.c_ptr)
109
+ raise Leptris::XML::Error, "leptris_element_copy failed" if copy.null?
110
+ document.root = Leptris::XML::Node.wrap(copy, document)
108
111
  to_xml_indent_unit(document.c_ptr, unit,
109
112
  indent: indent, no_decl: true)
110
113
  ensure
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.53
4
+ version: 1.9.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.