leptris 1.9.321.0-aarch64-linux → 1.9.322.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: db9055121618343dff8b5e698e7c92d47dbd434db73fe6d8339dc46a0be73c82
4
- data.tar.gz: 3e7cf86ffa532fff238034f21f55dbc7117a85398fd1aed4bf3ade5d0c7c3b4e
3
+ metadata.gz: 7cff747c994e40643b0cc1a8ac9eed34824664b6e88888195ec4a2f4191dca78
4
+ data.tar.gz: bbd9e7ed63e8e24d383368399d0da9fc401e664b9377411ffaecb646486e70a3
5
5
  SHA512:
6
- metadata.gz: 3a625fa0c0ef2ac0e64244b09872d64e6f2f6c9a0610c8b65a1c931b69006755e7ce6afe380a0a0a4c8980916e2aeb57dfebbf9b0fde1baf7a5d298dfb866c36
7
- data.tar.gz: 4607ae9d6d1952a36f2d9b100417e97c77bca875aeee0dafa5736168d3b6a2966f6ead5a59d1384d8f8ec3adebd542ff05e41ce2fc632767fa466fcf539538cb
6
+ metadata.gz: dfd0aa551baa98ecdd243f7bf8ba3d88583ebb1ae1b880fad72e9337963971cd46898550b0aea73da6c6f4299d350a04f2a92f8d835f068624a3ca234c344e65
7
+ data.tar.gz: 6bf7ecfe8511c5567a17643220f651fb2c560f5d8f178e1fd3af370e40f52d1bad67ad7eb102175525f9192a810872ad8a85a0f9cec0a92a8c995765e3528849
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [1.9.322.0] - 2026-10-08
2
+
3
+ ### Engine sync (libleptris 1.9.322)
4
+
5
+ - `leptris validate --xsd FILE` rides the CLI's validate command
6
+ (compile error detail, every accumulated instance error,
7
+ non-zero exit) — CLI-only, no binding surface; audit 381/380
8
+ unchanged. The inline-anonymous complexType capture fix
9
+ (leptris#1592, engine PR #1596) merged after this tag and ships
10
+ with the engine's next release — the binding pin follows there.
11
+
1
12
  ## [1.9.321.0] - 2026-10-08
2
13
 
3
14
  ### Added — engine sync (libleptris 1.9.321)
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.321"
11
+ LIBLEPTRIS_VERSION = "1.9.322"
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.321.0"
4
+ VERSION = "1.9.322.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.321
4
+ - libleptris v1.9.322
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,18 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.322] - 2026-10-08
4
+
5
+ ### Added
6
+
7
+ - **`leptris validate --xsd FILE` (#1075, PR #1593).** The compiled
8
+ XSD surface rides the same validate command as `--dtd`/`--rng`/
9
+ `--schematron`: compile failures report the schema's own error
10
+ detail (compile returns error-carrying handles — the status keys
11
+ the failure); invalid documents print every accumulated error and
12
+ exit non-zero.
13
+
14
+
15
+
3
16
  ## [1.9.321] - 2026-10-08
4
17
 
5
18
  ### Added
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.321
6
+ VERSION 1.9.322
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -156,6 +156,7 @@ static int run_schematron(const char* path, const char* phase,
156
156
 
157
157
  static cli_result_t validate_execute(int argc, char** argv) {
158
158
  const char* rng_path = NULL;
159
+ const char* xsd_path = NULL;
159
160
  const char* sch_path = NULL;
160
161
  const char* dtd_path = NULL;
161
162
  const char* phase = NULL;
@@ -164,6 +165,8 @@ static cli_result_t validate_execute(int argc, char** argv) {
164
165
  for (int i = 1; i < argc; i++) {
165
166
  if (strcmp(argv[i], "--rng") == 0 && i + 1 < argc) {
166
167
  rng_path = argv[++i];
168
+ } else if (strcmp(argv[i], "--xsd") == 0 && i + 1 < argc) {
169
+ xsd_path = argv[++i];
167
170
  } else if ((strcmp(argv[i], "--schematron") == 0 ||
168
171
  strcmp(argv[i], "-s") == 0) &&
169
172
  i + 1 < argc) {
@@ -184,6 +187,7 @@ static cli_result_t validate_execute(int argc, char** argv) {
184
187
  printf("Options:\n");
185
188
  printf(" --dtd FILE External DTD\n");
186
189
  printf(" --rng FILE RELAX NG schema\n");
190
+ printf(" --xsd FILE W3C XML Schema (XSD)\n");
187
191
  printf(" --schematron FILE ISO Schematron schema\n");
188
192
  printf(" --phase ID Schematron phase to");
189
193
  printf(" select\n");
@@ -205,8 +209,8 @@ static cli_result_t validate_execute(int argc, char** argv) {
205
209
  cli_error("validate requires an XML document");
206
210
  return CLI_ERROR_ARGS;
207
211
  }
208
- if (!rng_path && !sch_path && !dtd_path) {
209
- cli_error("validate needs --dtd and/or --rng and/or --schematron");
212
+ if (!rng_path && !sch_path && !dtd_path && !xsd_path) {
213
+ cli_error("validate needs --dtd/--rng/--schematron/--xsd");
210
214
  return CLI_ERROR_ARGS;
211
215
  }
212
216
  LeptrisDocument doc = read_doc(xml_path);
@@ -261,6 +265,43 @@ static cli_result_t validate_execute(int argc, char** argv) {
261
265
  }
262
266
  leptris_rng_free(rng);
263
267
  }
268
+ if (xsd_path) {
269
+ size_t xsd_len = 0;
270
+ char* xsd_content = read_file(xsd_path, &xsd_len);
271
+ if (!xsd_content) {
272
+ cli_error("cannot read XSD: %s", xsd_path);
273
+ leptris_document_free(doc);
274
+ return CLI_ERROR_IO;
275
+ }
276
+ LeptrisStatus st = LEPTRIS_OK;
277
+ LeptrisXsdSchema xsd =
278
+ leptris_xsd_compile(xsd_content, xsd_len, &st);
279
+ free(xsd_content);
280
+ /* compile returns an error-carrying handle on failure — the
281
+ * status, not the pointer, says whether it succeeded. */
282
+ if (st != LEPTRIS_OK) {
283
+ const char* detail =
284
+ xsd ? leptris_xsd_error(xsd)
285
+ : leptris_status_string(st);
286
+ cli_error("XSD compile failed: %s",
287
+ detail ? detail : leptris_status_string(st));
288
+ if (xsd) leptris_xsd_free(xsd);
289
+ leptris_document_free(doc);
290
+ return CLI_ERROR_IO;
291
+ }
292
+ if (leptris_xsd_validate(xsd, doc)) {
293
+ printf("xsd: valid\n");
294
+ } else {
295
+ printf("xsd: invalid\n");
296
+ size_t n = leptris_xsd_error_count(xsd);
297
+ for (size_t i = 0; i < n; i++) {
298
+ const char* e = leptris_xsd_error_at(xsd, i);
299
+ if (e) printf(" %s\n", e);
300
+ }
301
+ invalid = 1;
302
+ }
303
+ leptris_xsd_free(xsd);
304
+ }
264
305
  if (sch_path) {
265
306
  cli_result_t r = run_schematron(
266
307
  sch_path, phase, want_svrl, doc, &invalid);
@@ -276,7 +317,8 @@ static cli_result_t validate_execute(int argc, char** argv) {
276
317
 
277
318
  static cli_command_t validate_command = {
278
319
  .name = "validate",
279
- .description = "Validate XML against RELAX NG / Schematron",
320
+ .description =
321
+ "Validate XML against RELAX NG / Schematron / XSD",
280
322
  .execute = validate_execute,
281
323
  .print_help = NULL
282
324
  };
@@ -552,3 +552,37 @@ TEST(CliValidate, MissingDtdIsIoError) {
552
552
  }
553
553
 
554
554
  #endif /* !_WIN32 */
555
+
556
+ // ---- validate --xsd (#1075 slice 5) ---------------------------------
557
+ // The compiled XSD surface rides the same validate command as
558
+ // dtd/rng/schematron. Windows runners: same harness limitation as
559
+ // CliDiff (path + tmp semantics).
560
+ #ifndef _WIN32
561
+ TEST(CliValidateXsd, ValidDocumentExitsZero) {
562
+ write_file("leptris_cli_xsd.tmp",
563
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
564
+ "<xs:element name=\"r\" type=\"xs:integer\"/></xs:schema>");
565
+ auto r = run_cli({"validate", "--xsd", "leptris_cli_xsd.tmp",
566
+ "-"}, "<r>7</r>");
567
+ EXPECT_EQ(r.exit_code, 0) << "stderr: " << r.err;
568
+ EXPECT_NE(r.out.find("xsd: valid"), std::string::npos);
569
+ }
570
+
571
+ TEST(CliValidateXsd, InvalidDocumentReportsAndExitsNonzero) {
572
+ write_file("leptris_cli_xsd2.tmp",
573
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
574
+ "<xs:element name=\"r\" type=\"xs:integer\"/></xs:schema>");
575
+ auto r = run_cli({"validate", "--xsd", "leptris_cli_xsd2.tmp",
576
+ "-"}, "<r>nope</r>");
577
+ EXPECT_NE(r.exit_code, 0);
578
+ EXPECT_NE(r.out.find("xsd: invalid"), std::string::npos);
579
+ }
580
+
581
+ TEST(CliValidateXsd, CompileFailureIsReported) {
582
+ write_file("leptris_cli_xsd3.tmp", "<not-a-schema/>");
583
+ auto r = run_cli({"validate", "--xsd", "leptris_cli_xsd3.tmp",
584
+ "-"}, "<r>7</r>");
585
+ EXPECT_NE(r.exit_code, 0);
586
+ EXPECT_NE(r.err.find("XSD compile failed"), std::string::npos);
587
+ }
588
+ #endif
@@ -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.321",
4
+ "version": "1.9.322",
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.321.0
4
+ version: 1.9.322.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.