leptris 1.9.400.0-aarch64-linux → 1.9.401.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: a2750b147604dc164b40657df49b82263a2b9dbd8e0df6fefd1aca0adae5e55a
4
- data.tar.gz: 7bc50052800a5cc3687c653c7bc51ef10e181f2a0c9ac06d924177f1236e6b56
3
+ metadata.gz: 28cee108eff89db88bae48238982e8f2998b92e4ec8532f874473bc9f0e95d3b
4
+ data.tar.gz: f65f2f4c96a69eed0015d7a8f396b930c102bd1e8154b9364385e5de2fc2feaf
5
5
  SHA512:
6
- metadata.gz: 4a2277bbb18fc090fa562809c16b2cb81b03d686b1227167b8e29f9a97e516ee2bd0962cf57ac601c74321befed8450795c188c609076ff79251a77ff5bc9243
7
- data.tar.gz: 8e561a0aa0e59712aed4993473edaf2423f0defbf27f8122e4e227e06ec289eb0f5d02db1f0c98882c5b24452fd9209c418e4098051cd47560b82fa1f09e66b3
6
+ metadata.gz: fcbb2ed215849abc8e232ee019b32bb2e3e458c113a0e711fd65e07031a74254cf53a9d28dde100cbc741436e9723f24f2dad77fd390eb804922910748d32518
7
+ data.tar.gz: 2684009bd6dc0b44bf4e2b9249af0af6af37c41e36ee62fae3b9fb2b873e4b987b511a23c0d817b920308689ab8e2c5b81bea704550c48971545ccc47d9fd2d2
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.400"
11
+ LIBLEPTRIS_VERSION = "1.9.401"
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.400.0"
4
+ VERSION = "1.9.401.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.400
4
+ - libleptris v1.9.401
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.401] - 2026-11-01
4
+
5
+ ### Fixed
6
+
7
+ - **List value spaces collapse whitespace before the facets
8
+ (leptris#1936 stG010/stH005, PR #1945).** Caught by running the
9
+ REAL W3C suite documents (vendored in lutaml-xsd) through the
10
+ xmllint-arbiter harness: a list-derived restriction's
11
+ enumeration facet compared the RAW element content — stG010's
12
+ value arrives as newline-tab-CA-newline-spaces and never matched
13
+ enum "CA" — and a whole-list pattern had the same hole (stH005).
14
+ List value spaces are whitespace=collapse (Part 2): the value is
15
+ normalized before the pattern/enumeration/length family runs.
16
+ Suite 142/142; both documents validate. (xsd)
17
+
18
+
19
+
3
20
  ## [1.9.400] - 2026-11-01
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.400
6
+ VERSION 1.9.401
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -510,7 +510,41 @@ static int facet_check_body(const XsdSimple* s, const char* v,
510
510
  const char* terminal_base, int chain_is_list);
511
511
  static int facet_check(const XsdSimple* s, const char* v,
512
512
  const char* terminal_base, int chain_is_list) {
513
- int rc = facet_check_body(s, v, terminal_base, chain_is_list);
513
+ /* #1936 (stG010): a LIST value space is whitespace=collapse —
514
+ * element content arrives as "\n\tCA\n " and the enumeration
515
+ * /pattern facets must see the collapsed form ("CA"), not the
516
+ * raw text. */
517
+ int list_valued = chain_is_list || s->deriv == XSD_SIMPLE_LIST ||
518
+ (terminal_base &&
519
+ (strcmp(terminal_base, "xs:IDREFS") == 0 ||
520
+ strcmp(terminal_base, "xs:NMTOKENS") == 0 ||
521
+ strcmp(terminal_base, "xs:ENTITIES") == 0));
522
+ if (!list_valued)
523
+ return facet_check_body(s, v, terminal_base, chain_is_list);
524
+ while (*v == ' ' || *v == '\t' || *v == '\n' || *v == '\r') v++;
525
+ size_t n = strlen(v);
526
+ while (n > 0 && (v[n-1] == ' ' || v[n-1] == '\t' ||
527
+ v[n-1] == '\n' || v[n-1] == '\r'))
528
+ n--;
529
+ char* collapsed = (char*)malloc(n + 1);
530
+ if (!collapsed)
531
+ return facet_check_body(s, v, terminal_base, chain_is_list);
532
+ size_t o = 0;
533
+ int in_ws = 0;
534
+ for (size_t i = 0; i < n; i++) {
535
+ char ch = v[i];
536
+ if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') {
537
+ if (!in_ws && o) collapsed[o++] = ' ';
538
+ in_ws = 1;
539
+ } else {
540
+ collapsed[o++] = ch;
541
+ in_ws = 0;
542
+ }
543
+ }
544
+ if (o && collapsed[o-1] == ' ') o--;
545
+ collapsed[o] = 0;
546
+ int rc = facet_check_body(s, collapsed, terminal_base, chain_is_list);
547
+ free(collapsed);
514
548
  return rc;
515
549
  }
516
550
  static int facet_check_body(const XsdSimple* s, const char* v,
@@ -394,6 +394,29 @@ TEST(XsdDatatypes, LengthFacetCountsOctetsForHexBinary) {
394
394
  // an ANONYMOUS inline simpleType must validate the value against
395
395
  // that base before its own facets — length on a list-with-length-2
396
396
  // counts items, not characters of the whole lexical.
397
+ // leptris#1936 (stG010/stH005, the REAL suite documents): a list
398
+ // value space is whitespace=collapse — element content "\n\tCA\n "
399
+ // normalizes to "CA" before the enumeration/pattern facets run.
400
+ TEST(XsdDatatypes, ListValueSpaceCollapsesBeforeFacets) {
401
+ const char xsd[] =
402
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
403
+ "<xs:simpleType name=\"myToken\"><xs:list itemType=\"xs:NMTOKEN\"/>"
404
+ "</xs:simpleType>"
405
+ "<xs:simpleType name=\"fooType\"><xs:restriction base=\"myToken\">"
406
+ "<xs:enumeration value=\"CA\"/><xs:enumeration value=\"OR\"/>"
407
+ "</xs:restriction></xs:simpleType>"
408
+ "<xs:element name=\"r\" type=\"fooType\"/></xs:schema>";
409
+ LeptrisStatus st = LEPTRIS_OK;
410
+ LeptrisXsdSchema s = leptris_xsd_compile(xsd, strlen(xsd), &st);
411
+ ASSERT_EQ(st, LEPTRIS_OK);
412
+ ASSERT_NE(s, (LeptrisXsdSchema)0);
413
+ EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", "\n\tCA\n "), 1);
414
+ EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", "CA"), 1);
415
+ EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", " OR "), 1);
416
+ EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", "CA OR"), 0);
417
+ leptris_xsd_free(s);
418
+ }
419
+
397
420
  TEST(XsdDatatypes, RestrictionInlineBaseDrivesFacets) {
398
421
  const char xsd[] =
399
422
  "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
@@ -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.400",
4
+ "version": "1.9.401",
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.400.0
4
+ version: 1.9.401.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.