leptris 1.9.49 → 1.9.51

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: a3f69c02324f1c8c4c356069184a5416f49de6cc9e46f78a8118550da939f06e
4
- data.tar.gz: 8e697a83de590b2d63953b3814569e34497954309ed33190628e515ff47ed70c
3
+ metadata.gz: aab0b795d90effa39a4670c8359fc2808267a48e7d93c7c1c314c3dfebb415f0
4
+ data.tar.gz: 52bc50c5d171632e1a45b787d22bb9a94763d1f1df885e8c8197867cb4fc6673
5
5
  SHA512:
6
- metadata.gz: b4b8a5eaa7341402bd16cbc96aff21add36100b19c4cfaa68b49c96d907f267fe53a038233e5b55668d6e8602d26222221e8bfdd82fda0da6bfefd4ff6dacd45
7
- data.tar.gz: '0639b5e34c277344f86a72a7286388128c82b85abf2d8c6555b064df1c4ad45495ee46d43f85ba29d1d905a7f0ea92dbe7f2061f56feffbd2ba30cbb139cce76'
6
+ metadata.gz: 0efb45ab3367594bc1781d5d88a9a9db7f2d14af84b73b844cc9a8f08ad81eed03f6bd70a14d04d21240f8fdd592dc4a725c706f5277c10536ab0189333db6eb
7
+ data.tar.gz: 33150488d60668fe10d62c6f00ab4129abb37816d5a940238b97283113f7cf04c4158a2b8d41e6fd8c73610242484a96bd92f35540033c7407d76cefdf1bd9d8
data/CHANGELOG.md CHANGED
@@ -5,6 +5,61 @@ 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.51] - 2026-09-01
9
+
10
+ ### Changed
11
+
12
+ - **Lockstep with libleptris 1.9.36** (1.9.33 → 1.9.36; no new C
13
+ surface — the audit holds at 255/255 attached == exported):
14
+ - 1.9.33: `xsl:mode/@on-no-match`, all six dispositions.
15
+ - 1.9.34: XQuery-only syntax in XPath expression attributes
16
+ (`order by`, `try/catch`, map constructors) now raises instead
17
+ of compiling silently wrong (leptris/leptris#692).
18
+ - 1.9.35: `xsl:sequence`, `xsl:perform-sort`; fn:-catalog
19
+ slices (sequences, `math:`, regex trio, top-level comma
20
+ sequences).
21
+ - 1.9.36: fn: catalog grows — `fn:format-integer` (decimal,
22
+ 0-padding, bijective base-26, roman numerals, English words),
23
+ strings/QNames/URIs slice (leptris/leptris#691).
24
+ - **Standalone XPath grew a 2/3.1 expression subset**: `let …
25
+ return`, `for … return`, `if/then/else`, sequence literals,
26
+ ranges, the `=>` arrow, `!` simple-map, and `||` concat now
27
+ evaluate through `Document#xpath`/`Element#xpath` directly —
28
+ specced. Still out (engine grammar, tracked in
29
+ leptris/leptris#683): value comparators (`eq`/`ne`/…),
30
+ quantifiers, sequence types (`instance of`/`castable`),
31
+ `intersect`/`except`, string templates; XQuery-only syntax
32
+ raises (#692). Known edge: `for`-return's scalar items come
33
+ back as opaque result nodes — read them through an aggregate
34
+ (`count(...)`, `string-join(...)`) until the engine
35
+ materializes readable sequence items.
36
+
37
+ ### Fixed
38
+
39
+ - **`shallow-skip`/`text-only-copy` drop unmatched subtrees**
40
+ (libleptris engine, filed as leptris/leptris#705): the built-in
41
+ initial descent fires matched child templates but discards
42
+ unmatched siblings wholesale, so both modes emit nothing without
43
+ a user root template. `shallow-copy`, `deep-copy`, `deep-skip`,
44
+ and `fail` behave per spec and are specced; the broken pair is
45
+ specced as pending against #705.
46
+
47
+ ## [1.9.50] - 2026-09-01
48
+
49
+ ### Fixed
50
+
51
+ - **Copies keep comment and PI children (leptris-ruby#115)**:
52
+ `leptris_element_copy` silently drops COMMENT and PI children —
53
+ the C child-copy loop reads `/* Skip COMMENT and PI nodes for
54
+ now */` (engine-side, filed as leptris/leptris#696 with the
55
+ line). Blast radius in the binding: `Element#dup/#clone` and the
56
+ element indent-unit path both composed through the C copy. Both
57
+ now round through serialization instead — the serializer
58
+ preserves every child kind, prefixed names, and namespace
59
+ declarations, and re-parsing rebuilds them all; `dup` returns a
60
+ tree in a NEW document (unchanged contract), detached from the
61
+ original (spec-pinned).
62
+
8
63
  ## [1.9.49] - 2026-09-01
9
64
 
10
65
  ### 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.32"
11
+ LIBLEPTRIS_VERSION = "1.9.36"
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.49"
4
+ VERSION = "1.9.51"
5
5
  end
@@ -251,10 +251,14 @@ 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 silently drops COMMENT and PI children
256
+ # (leptris/leptris#696, leptris-ruby#115) — the serializer
257
+ # preserves every child kind, prefixed names, and namespace
258
+ # declarations, and re-parsing rebuilds them all.
254
259
  def dup
255
- copy_ptr = Leptris::XML::FFI.leptris_element_copy(@c_ptr, @document.c_ptr)
256
- raise Leptris::XML::Error, "leptris_element_copy failed" if copy_ptr.null?
257
- Leptris::XML::Node.wrap(copy_ptr, @document)
260
+ ensure_alive!
261
+ Leptris::XML::Document.parse(to_xml).root
258
262
  end
259
263
  alias_method :clone, :dup
260
264
 
@@ -369,13 +369,16 @@ 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 silently drops
374
+ # COMMENT and PI children (leptris/leptris#696, leptris-ruby#115)
375
+ # — the serializer preserves every child kind, prefixed names,
376
+ # and namespace declarations, and re-parsing rebuilds them all.
372
377
  def dup
373
378
  ensure_alive!
374
379
  elem_ptr = Leptris::XML::FFI.leptris_node_as_element(@c_ptr)
375
380
  raise Leptris::XML::Error, "dup is only supported for element nodes" if elem_ptr.null?
376
- copy_ptr = Leptris::XML::FFI.leptris_element_copy(elem_ptr, @document.c_ptr)
377
- raise Leptris::XML::Error, "leptris_element_copy failed" if copy_ptr.null?
378
- Leptris::XML::Node.wrap(copy_ptr, @document)
381
+ Leptris::XML::Document.parse(to_xml).root
379
382
  end
380
383
  alias_method :clone, :dup
381
384
 
@@ -97,19 +97,15 @@ 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
- # copies the element into a fresh document (C-side copy, one
101
- # pool allocation), serializes that document without a
102
- # declaration, and returns the subtree — identical output to the
103
- # element serializer for the standard layout, with the unit.
100
+ # rounds the subtree through serialization into a fresh document
101
+ # (leptris_element_copy drops COMMENT/PI children —
102
+ # leptris/leptris#696, leptris-ruby#115) and serializes that
103
+ # document without a declaration — identical output to the
104
+ # element serializer for the standard layout, with the unit and
105
+ # every child kind intact.
104
106
  def self.to_xml_element_unit(element, unit, indent: 0)
105
- document = Leptris::XML::Document.create
107
+ document = Leptris::XML::Document.parse(element.to_xml)
106
108
  begin
107
- copy_ptr = Leptris::XML::FFI.leptris_element_copy(
108
- element.c_ptr, document.c_ptr)
109
- if copy_ptr.null?
110
- raise Leptris::XML::Error, "leptris_element_copy failed"
111
- end
112
- document.root = Leptris::XML::Node.wrap(copy_ptr, document)
113
109
  to_xml_indent_unit(document.c_ptr, unit,
114
110
  indent: indent, no_decl: true)
115
111
  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.49
4
+ version: 1.9.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.