leptris 1.9.321.0-arm-linux → 1.9.322.0-arm-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 +4 -4
- data/CHANGELOG.md +11 -0
- data/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +13 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/cli/commands/validate.c +45 -3
- data/vendor-src/libleptris/test/cli/test_cli.cpp +34 -0
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cee9b20f52c63091762472a30171a262ba68b07d224c185f0c2041ac5cbbb2c0
|
|
4
|
+
data.tar.gz: 2b46b0177ffcac4acc6cf72ea8c6ea74699e34ea52b4daf79d9717a79b1d2540
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8741467809869420f3acd9a29050873fdf08bec22cde580712fe36f9b5c16b4881bbc7c00f0dd9d9f35fe624471d0facbc0fabda86b40e3f1d7e2746ef685843
|
|
7
|
+
data.tar.gz: 0b34105f9ead345f1319c72e6dd9159b52ebf2cc0b49a015634e622b935a618574da5e526af4a0c0de5f1639e9601518165e2ecef4fb0e948497b16e4ed32e47
|
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.
|
|
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
|
data/lib/leptris/version.rb
CHANGED
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -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
|
|
@@ -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
|
|
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 =
|
|
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.
|
|
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",
|