leptris 1.9.383.0 → 1.9.384.0

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: 69074392d41128cd6e99af9a1221dcac6d5e22d2d84f8ed2daa3edc948cafcfd
4
- data.tar.gz: 53f405eb1a927f1875d33029a98dcf759d99d40ee402c41a8c662abf136d6a02
3
+ metadata.gz: 7b61e04df94a447b4e6d0441407cfa9d6a22d2b0c2a672dfdc660d11acbb79f2
4
+ data.tar.gz: e782a0a58f547516238175a940fa1ce0dfab39a527f257442f62efc160bd63bb
5
5
  SHA512:
6
- metadata.gz: 9aea91ab62340411ddc1f1462afa46d4a27fc28d823c15ea120561460201ca28f15addbeca90bd46c6414d082b544b7249d0cb892183b2e96f063ebd1056717b
7
- data.tar.gz: 4f6f99fc2e67e7bf08b0f2878168396847a886c0ca2f2308251d86aba941edc8e84e1a452efe0e4152e4d486bb16e1d5927bdb69a727e96591341d775dfd5f8d
6
+ metadata.gz: a389283a1f7881902e029bba7722cf8eb39836b534395055399af001b72e08e463a7a18ed3d2bfb98f7c28bc4868e681a576cb0ac282f3b5d27eb4444ada0aa5
7
+ data.tar.gz: 6bb506aaecd5522b8401c15c840e5ca4957070fa082e2dbaa1c7dc3a7378cc91537dddfc0b00ac60a4b2d61a0241a1b6a6b797d320434df0399c23cf61532b7f
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.383"
11
+ LIBLEPTRIS_VERSION = "1.9.384"
12
12
  # Vendored alongside libleptris for fn:normalize-unicode (TODO
13
13
  # .restructure/20): built per platform with a RELOCATABLE @rpath
14
14
  # install name, loaded by ffi.rb before libleptris so the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.383.0"
4
+ VERSION = "1.9.384.0"
5
5
  end
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.383
4
+ - libleptris v1.9.384
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.384] - 2026-10-27
4
+
5
+ ### Fixed
6
+
7
+ - XPath: a parent step after an attribute step (`./@id/..`) yields
8
+ the OWNING element (XPath 1.0 section 2.2) — the VM parent axis
9
+ handled namespace/element/text contexts but attributes fell
10
+ through to the child-tree parent link (NULL for attributes), so
11
+ the step came back empty. Metanorma-standoc's SVG id
12
+ disambiguation drives exactly this shape and consumed the wrong
13
+ results downstream (#1867; the wrong-answer half of #1866).
14
+
15
+
16
+
3
17
  ## [1.9.383] - 2026-10-26
4
18
 
5
19
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.383
6
+ VERSION 1.9.384
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -768,6 +768,14 @@ struct leptris_xpath_result* vm_apply_axis_parent(XPathContext* ctx, XPathVM* vm
768
768
  if (in && (int)in->type == (int)LEPTRIS_NODE_NAMESPACE) {
769
769
  /* Namespace nodes' parent is the OWNER element (63). */
770
770
  parent = ((LeptrisNamespaceNode*)in)->owner;
771
+ } else if (in && (int)in->type == (int)LEPTRIS_NODE_ATTRIBUTE) {
772
+ /* Attribute nodes' parent is the OWNER element (XPath
773
+ * 1.0 §2.2: `../` after an attribute step names the
774
+ * element carrying the attribute). Attributes are not
775
+ * in the child tree, so the any-kind parent link below
776
+ * is NULL for them (leptris#1866, standoc svg cleanup:
777
+ * `./@id/..`). */
778
+ parent = ((LeptrisAttributeNode*)in)->owner;
771
779
  } else if (node_is_element(in)) {
772
780
  parent = leptris_element_get_parent((LeptrisElement)in);
773
781
  } else {
@@ -114,6 +114,42 @@ TEST(XPathBytecodeSpecializedAxes, AttributeNameMatches) {
114
114
  leptris_document_free(doc);
115
115
  }
116
116
 
117
+ TEST(XPathBytecodeSpecializedAxes, ParentAfterAttributeStep) {
118
+ const char xml[] =
119
+ "<root><child id=\"a\"><leaf/></child></root>";
120
+ LeptrisStatus st = LEPTRIS_OK;
121
+ LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
122
+ ASSERT_NE(doc, nullptr);
123
+
124
+ /* leptris#1866: `..` after an attribute step yields the OWNING
125
+ * element (XPath 1.0 §2.2). The VM parent axis handled
126
+ * namespace/element/text contexts but attributes fell through
127
+ * to the child-tree parent link (NULL for attrs) — the step
128
+ * came back empty (standoc svg cleanup: `./@id/..`). */
129
+ LeptrisXPathResult r1 = leptris_xpath_eval(
130
+ doc, nullptr, "count(//child/@id/..)");
131
+ ASSERT_NE(r1, nullptr);
132
+ EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r1), 1.0);
133
+ leptris_xpath_result_free(r1);
134
+
135
+ LeptrisXPathResult r2 = leptris_xpath_eval(
136
+ doc, nullptr, "name(//child/@id/..)");
137
+ ASSERT_NE(r2, nullptr);
138
+ char* s = leptris_xpath_result_string(r2);
139
+ EXPECT_STREQ(s, "child");
140
+ leptris_free_string(s);
141
+ leptris_xpath_result_free(r2);
142
+
143
+ /* a bare parent step on the element itself is unchanged */
144
+ LeptrisXPathResult r3 = leptris_xpath_eval(
145
+ doc, nullptr, "count(//leaf/..)");
146
+ ASSERT_NE(r3, nullptr);
147
+ EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r3), 1.0);
148
+ leptris_xpath_result_free(r3);
149
+
150
+ leptris_document_free(doc);
151
+ }
152
+
117
153
  TEST(XPathBytecodeSpecializedAxes, SelfAndParentAxes) {
118
154
  const char xml[] =
119
155
  "<root><child><leaf/></child></root>";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3
3
  "name": "leptris",
4
- "version": "1.9.383",
4
+ "version": "1.9.384",
5
5
  "description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
6
6
  "homepage": "https://github.com/leptris/leptris",
7
7
  "license": "MIT",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.383.0
4
+ version: 1.9.384.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-26 00:00:00.000000000 Z
11
+ date: 2026-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi