leptris 1.9.336.0-aarch64-linux → 1.9.337.0-aarch64-linux

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: e5ca17e7bb06179053b45d100782fbd8e1d25b620798350ebe25a521d8bea4fe
4
- data.tar.gz: 7c1e49be225b993272478cf62fdc34f2fcf72e815e8a80fe82a29c6f1e7d1897
3
+ metadata.gz: e05dcbb1b6483f06a83e6fca3f84db611a3e37b484f713a5e8bcaf9aec9ad021
4
+ data.tar.gz: 59a2cf7e7d7816f823a8db40b77259b898c5c83b393248d6b943f67194ccd943
5
5
  SHA512:
6
- metadata.gz: 288d9e358d5528c3c41a369fcff10edbf473198092ec721ea86386aa8f3199c9f79972e5d03faf7373035333431cd768de335370586750978394add97a6087fd
7
- data.tar.gz: c9032f82ac049477ee2467fef3b5c59e9e9bd2994372b01421c659b6d36e88a2965f66accfa48ec86a1fba196fbb26a14eef904a54dcc62fae493961e6803c8a
6
+ metadata.gz: 7a9ac987cc2dc6d91b3ae06c982d23eb2842a1fe66959cbdb1a96f79034ec9a56bdceb4fadf510f0eb1b4175610e780ab335da590b2bab2c34c0447cced12d03
7
+ data.tar.gz: 96574fb45a9c84dcbccbf91a112a7231f8f762a5b9d7dbcf19dee982b13ff66c05d8645d9e0679842a1586d6534a68101b04fdbca1a331f387b64d2c7a102788
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## [1.9.337.0] - 2026-10-11
2
+
3
+ ### Added — engine sync (libleptris 1.9.337)
4
+
5
+ - **XSD instance errors carry the owning element and source
6
+ position (#419, engine PR #1632)**: the libxml2/Nokogiri-
7
+ presentable shape — `element 'pgMar' @2:22: attribute 'header':
8
+ required but absent` — across attribute rows (required-absent,
9
+ fixed mismatch, strict-undeclared), strict elements, unresolved
10
+ types, and content-model failures (the #1626 culprit naming
11
+ rides along). Position from the recorded parse-time source
12
+ stamp; prior form for skipped-position parses and
13
+ `simple_valid`. Pinned for attribute and content shapes.
14
+
15
+ ## [1.9.336.0] - 2026-10-11
16
+
17
+ ### Fixed — engine sync (libleptris 1.9.336)
18
+
19
+ - **build_result members emit in op order on every platform
20
+ (#1625, engine PR #1629)**: the serializer's byte-position
21
+ qsort broke ties on unspecified libc behavior and REVERSED
22
+ builder-created members on Windows (x64 and arm64). Builder
23
+ values carry a dense insertion rank now — the comparator is a
24
+ total order and platform-independent. Pinned with the
25
+ four-member out-of-row-order shape (the Windows CI legs
26
+ enforce it); walk output undisturbed.
27
+
1
28
  ## [1.9.335.0] - 2026-10-11
2
29
 
3
30
  ### Fixed — engine sync (libleptris 1.9.335)
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.336"
11
+ LIBLEPTRIS_VERSION = "1.9.337"
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.336.0"
4
+ VERSION = "1.9.337.0"
5
5
  end
data/lib/libleptris.so CHANGED
Binary file
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.336
4
+ - libleptris v1.9.337
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,22 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.337] - 2026-10-11
4
+
5
+ ### Added
6
+
7
+ - **XSD instance errors carry the owning element and source
8
+ position (leptris-ruby#419, PR #1632).** In the libxml2/Nokogiri
9
+ shape consumers present: `element 'pgMar' @2:3: attribute
10
+ 'header': required but absent`. Applied to attribute rows
11
+ (required-absent, fixed mismatch, strict-undeclared), strict
12
+ elements, unresolved types, and content-model failures — the
13
+ #1626 culprit naming rides along. The position comes from the
14
+ recorded parse-time source stamp and falls back to the prior
15
+ form for skipped-positions parses and the public `simple_valid`
16
+ face. Compile-time schema errors are unchanged.
17
+
18
+
19
+
3
20
  ## [1.9.336] - 2026-10-10
4
21
 
5
22
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.336
6
+ VERSION 1.9.337
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -86,6 +86,38 @@ static void verrf(struct xsd_validator* v, const char* what,
86
86
  verr_push(v, buf);
87
87
  }
88
88
 
89
+ /* leptris-ruby#419: instance-side errors carry the owning element
90
+ * and its source position (libxml2/Nokogiri shape). The element's
91
+ * own name rides the prefix; the position comes from the recorded
92
+ * source stamp (0 = unlocated — a skipped-positions parse). */
93
+ static void verrf_at(struct xsd_validator* v, LeptrisElement elem,
94
+ const char* what, const char* name,
95
+ const char* detail) {
96
+ char buf[320];
97
+ const char* el = NULL;
98
+ leptris_element_expanded_name(elem, &el, NULL, NULL);
99
+ if (!el) el = "?";
100
+ int line = 0, col = 0;
101
+ {
102
+ LeptrisSourcePosition pos;
103
+ leptris_node_source_position((LeptrisNodeRef)elem, &pos);
104
+ line = pos.line;
105
+ col = pos.col_start;
106
+ }
107
+ int w;
108
+ if (line > 0)
109
+ w = snprintf(buf, sizeof(buf),
110
+ "element '%s' @%d:%d: %s '%s': %s", el, line,
111
+ col, what, name ? name : "?",
112
+ detail ? detail : "invalid");
113
+ else
114
+ w = snprintf(buf, sizeof(buf), "element '%s': %s '%s': %s",
115
+ el, what, name ? name : "?",
116
+ detail ? detail : "invalid");
117
+ (void)w;
118
+ verr_push(v, buf);
119
+ }
120
+
89
121
  /* ---- lexical helpers ---------------------------------------------- */
90
122
 
91
123
  static int simple_is_numeric(struct leptris_xsd_schema* s,
@@ -106,7 +138,12 @@ static int text_valid(struct xsd_validator* v,
106
138
  r = xsd_simple_valid_chain(s, st, lexical);
107
139
  }
108
140
  if (r == 0) {
109
- verrf(v, what, name, "lexical value does not match its type");
141
+ if (elem)
142
+ verrf_at(v, elem, what, name,
143
+ "lexical value does not match its type");
144
+ else
145
+ verrf(v, what, name,
146
+ "lexical value does not match its type");
110
147
  return 0;
111
148
  }
112
149
  /* XSD 1.1 xs:assertion facet (document validation only):
@@ -255,7 +292,7 @@ static void validate_children(struct xsd_validator* v,
255
292
  ? "children do not match the content model (at '%s')"
256
293
  : "children do not match the content model",
257
294
  culprit ? culprit : "");
258
- verrf(v, "element", local, msg);
295
+ verrf_at(v, elem, "element", local, msg);
259
296
  free(names);
260
297
  free(uris);
261
298
  }
@@ -384,13 +421,14 @@ static void validate_attributes(struct xsd_validator* v,
384
421
  }
385
422
  if (!val) {
386
423
  if (a->required)
387
- verrf(v, "attribute", a->name, "required but absent");
424
+ verrf_at(v, elem, "attribute", a->name,
425
+ "required but absent");
388
426
  continue;
389
427
  }
390
428
  text_valid(v, s, a->type, val, "attribute", a->name, elem);
391
429
  if (a->fixed && strcmp(val, a->fixed) != 0)
392
- verrf(v, "attribute", a->name,
393
- "value does not match the fixed value");
430
+ verrf_at(v, elem, "attribute", a->name,
431
+ "value does not match the fixed value");
394
432
  }
395
433
  /* strict: every instance attribute must be declared (or pass
396
434
  * the type's xs:anyAttribute grammar). Namespace declarations
@@ -416,7 +454,8 @@ static void validate_attributes(struct xsd_validator* v,
416
454
  xsd_target_ns(s)))
417
455
  continue;
418
456
  }
419
- verrf(v, "attribute", local, "not declared (strict)");
457
+ verrf_at(v, elem, "attribute", local,
458
+ "not declared (strict)");
420
459
  }
421
460
  }
422
461
 
@@ -431,7 +470,7 @@ static void validate_element(struct xsd_validator* v,
431
470
  if (!d) {
432
471
  /* strict: the instance uses an element the schema never
433
472
  * declared (a local particle would have typed it) */
434
- verrf(v, "element", local, "not declared (strict)");
473
+ verrf_at(v, elem, "element", local, "not declared (strict)");
435
474
  return;
436
475
  }
437
476
 
@@ -510,7 +549,8 @@ static void validate_local(struct xsd_validator* v,
510
549
  }
511
550
  /* neither complex nor simple nor builtin: the schema is
512
551
  * incomplete — loud, never a silent accept (#1615 class) */
513
- verrf(v, "element", local, "type not found in the schema");
552
+ verrf_at(v, elem, "element", local,
553
+ "type not found in the schema");
514
554
  }
515
555
 
516
556
  /* ---- slice 6: identity constraints -------------------------------- */
@@ -1624,3 +1624,62 @@ TEST(XsdImport1626, MisorderReportsOnceNamed) {
1624
1624
  }
1625
1625
 
1626
1626
  } // namespace
1627
+
1628
+ // ---- leptris-ruby#419: error context (element + location) -------
1629
+ namespace {
1630
+
1631
+ TEST(XsdErrorContext, AttributeErrorCarriesElementAndPosition) {
1632
+ const char* x =
1633
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
1634
+ "<xs:complexType name=\"CT_PgMar\">"
1635
+ "<xs:attribute name=\"header\" type=\"xs:integer\""
1636
+ " use=\"required\"/>"
1637
+ "<xs:attribute name=\"gutter\" type=\"xs:integer\""
1638
+ " use=\"required\"/>"
1639
+ "</xs:complexType>"
1640
+ "<xs:element name=\"pgMar\" type=\"CT_PgMar\"/>"
1641
+ "</xs:schema>";
1642
+ LeptrisStatus st = LEPTRIS_OK;
1643
+ LeptrisXsdSchema s = leptris_xsd_compile(x, strlen(x), &st);
1644
+ ASSERT_NE(s, (LeptrisXsdSchema)0);
1645
+ const char* doc =
1646
+ "\n <pgMar/>\n";
1647
+ LeptrisDocument d = leptris_parse_string(doc, strlen(doc), &st);
1648
+ ASSERT_NE(d, nullptr);
1649
+ EXPECT_EQ(leptris_xsd_validate(s, d), 0);
1650
+ size_t n = leptris_xsd_error_count(s);
1651
+ ASSERT_GE(n, 1u);
1652
+ const char* e = leptris_xsd_error_at(s, 0);
1653
+ ASSERT_NE(e, nullptr);
1654
+ EXPECT_NE(strstr(e, "pgMar"), nullptr) << e;
1655
+ EXPECT_NE(strstr(e, "@2:"), nullptr) << e;
1656
+ leptris_document_free(d);
1657
+ leptris_xsd_free(s);
1658
+ }
1659
+
1660
+ TEST(XsdErrorContext, ContentModelErrorCarriesPosition) {
1661
+ const char* x =
1662
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
1663
+ "<xs:complexType name=\"T\">"
1664
+ "<xs:sequence>"
1665
+ "<xs:element name=\"a\" type=\"xs:token\"/>"
1666
+ "<xs:element name=\"b\" type=\"xs:token\"/>"
1667
+ "</xs:sequence>"
1668
+ "</xs:complexType>"
1669
+ "<xs:element name=\"r\" type=\"T\"/>"
1670
+ "</xs:schema>";
1671
+ LeptrisStatus st = LEPTRIS_OK;
1672
+ LeptrisXsdSchema s = leptris_xsd_compile(x, strlen(x), &st);
1673
+ ASSERT_NE(s, (LeptrisXsdSchema)0);
1674
+ const char* doc = "<r>\n <a/>\n <b/>\n <c/>\n</r>\n";
1675
+ LeptrisDocument d = leptris_parse_string(doc, strlen(doc), &st);
1676
+ ASSERT_NE(d, nullptr);
1677
+ EXPECT_EQ(leptris_xsd_validate(s, d), 0);
1678
+ const char* e = leptris_xsd_error_at(s, 0);
1679
+ ASSERT_NE(e, nullptr);
1680
+ EXPECT_NE(strstr(e, "@1:"), nullptr) << e;
1681
+ leptris_document_free(d);
1682
+ leptris_xsd_free(s);
1683
+ }
1684
+
1685
+ } // namespace
@@ -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.336",
4
+ "version": "1.9.337",
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.336.0
4
+ version: 1.9.337.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-10 00:00:00.000000000 Z
11
+ date: 2026-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi