leptris 1.9.351.1-ppc64le-linux → 1.9.352.0-ppc64le-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: de247ddca14c60cfd69d9ed3292b78a66b86874d3cf24e0b07a2c758a85c3dfc
4
- data.tar.gz: cc0c378868c379d168fd14ea4ced6f0c845d8d6e566090c407e21acd4aca8f98
3
+ metadata.gz: eebca88c3afbfd0548849aa9f33b27a9b392e49b8e8dac2b76fd9d644d8fb7dc
4
+ data.tar.gz: ff8a8bcfa4dcefb277378c2aa17dc896298b5449e383c61758611154d3b9b18a
5
5
  SHA512:
6
- metadata.gz: 728c74ffbb26169a2c708924bdfbe35e17ca4203c4c3640b712ae2e4cb71d7b9c96a31b434da53f435ae533d4c71edb46eca5448f78ee13f3b581a708658f279
7
- data.tar.gz: e5869ab92030479def6d2d626ab3c7e5b7e57b44d88d0953e6019e295abedfc83a70c9404328c7502b8745c097689db9852c96a70eed446db3cf5e81e5145299
6
+ metadata.gz: 81d80ec3d1f3a5921fc715fbd334ccf3b94d9f7e71e67b20f0f1c86385d2e0fe408408df26ae308fd530e948317fc4a72b3fca8cb1b18ffbf83d9fb694dec639
7
+ data.tar.gz: 936cf9bd450fb449c1a9a68854ef0ead1ecaf13ea0d52790c5c65a6126c189e3ec3cac07a74458ae4f0a9d8fb43e9058b242ea5b6f5a8bdbbdb2309fa07a96c8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.9.352.0] - 2026-10-14
2
+
3
+ ### Fixed — engine sync (libleptris 1.9.352)
4
+
5
+ - **Instance type refs resolve across namespaces (#440 drawing
6
+ follow-up; libleptris 1.9.352, PR leptris/leptris#1687)**:
7
+ validating a WordprocessingML document with an inline image
8
+ reported six "type not found in the schema" errors — every
9
+ failing particle is typed by an a:-prefixed reference into the
10
+ drawingml main namespace (wp:extent -> a:CT_PositiveSize2D), and
11
+ the strict (ns, name) lookup answered with the ELEMENT's
12
+ namespace. Instance-side lookups now walk the reference ladder
13
+ (element ns -> unstamped -> name-only); #1665's element-namespace
14
+ priority and all compile-side strictness stay intact. Pinned at
15
+ the Ruby surface in xsd_chain_shapes_spec.rb.
16
+
1
17
  ## [1.9.351.0] - 2026-10-14
2
18
 
3
19
  ### Fixed — engine sync (libleptris 1.9.350/1.9.351)
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.351"
11
+ LIBLEPTRIS_VERSION = "1.9.352"
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.351.1"
4
+ VERSION = "1.9.352.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.351
4
+ - libleptris v1.9.352
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,37 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.352] - 2026-10-14
4
+
5
+ ### Fixed
6
+
7
+ - **XSD: instance type references resolve across namespaces
8
+ (leptris-ruby#440, PR #1687).** The 1.9.351.0 regression report
9
+ (6 "type not found" errors validating a WordprocessingML document
10
+ with an inline image, identical under chain and direct compile)
11
+ was not the fold — the referenced types ARE captured and stamped;
12
+ the LOOKUP was namespace-blind. The particles are typed by
13
+ a:-prefixed references into the drawingml main namespace
14
+ (wp:extent type="a:CT_PositiveSize2D", pic:cNvPr
15
+ type="a:CT_NonVisualDrawingProps", ...); capture strips prefixes,
16
+ and instance validation resolved the bare name with the strict
17
+ (ns, name) pair keyed on the ELEMENT's namespace, missing every
18
+ cross-namespace reference — which #1665's no-foreign-fallback
19
+ turns into the loud error. Reference resolution now walks a
20
+ namespace ladder: exact (ns, name) from the DECLARING unit's
21
+ targetNamespace first (the type reference lives in the schema's
22
+ namespace, not the element's), then the element's namespace, then
23
+ the unstamped fallback — never a foreign namespace that merely
24
+ declares the same local name. Same unmasking pattern as the
25
+ original #440: #1679's base_dir threading made the dml units load
26
+ in chain compiles, so their cross-namespace references became
27
+ checked for the first time.
28
+
29
+ ### Fixed
30
+
31
+ - instance type refs resolve across namespaces (reference ladder) (xsd)
32
+
33
+
34
+
3
35
  ## [1.9.351] - 2026-10-13
4
36
 
5
37
  ### Changed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.351
6
+ VERSION 1.9.352
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -2039,6 +2039,25 @@ XsdCm* xsd_find_complex_ns(struct leptris_xsd_schema* s,
2039
2039
  return xsd_find_complex(s, type_name);
2040
2040
  }
2041
2041
 
2042
+ /* leptris-ruby#440 (follow-up): a TYPE REFERENCE on an instance
2043
+ * element resolves against the namespace the REFERENCE declares —
2044
+ * OOXML's dml family types every wp:/pic: particle with
2045
+ * a:-prefixed main-namespace types (wp:extent -> a:CT_PositiveSize2D).
2046
+ * The capture strips prefixes (xsd_local_name), so the element's
2047
+ * own namespace is only the FIRST guess: try (element ns, name),
2048
+ * then unstamped entries, then the name-only spelling across the
2049
+ * merged table. The priority order keeps the #1665 guarantee where
2050
+ * it matters — when the element's own namespace declares the type,
2051
+ * a foreign same-name decl cannot win. Compile-side lookups
2052
+ * (extension bases, group refs) stay STRICT: derivation is
2053
+ * same-namespace by XSD rules. */
2054
+ XsdCm* xsd_find_complex_ref(struct leptris_xsd_schema* s,
2055
+ const char* type_name, const char* uri) {
2056
+ XsdCm* ct = xsd_find_complex_ns(s, type_name, uri);
2057
+ if (ct) return ct;
2058
+ return xsd_find_complex(s, type_name);
2059
+ }
2060
+
2042
2061
  const XsdSimple* xsd_find_simple_pub(struct leptris_xsd_schema* s,
2043
2062
  const char* name) {
2044
2063
  return xsd_find_simple(s, name);
@@ -40,6 +40,8 @@ extern const XsdElementDecl* xsd_find_element(
40
40
  struct leptris_xsd_schema* s, const char* name);
41
41
  extern XsdCm* xsd_find_complex_ns(struct leptris_xsd_schema* s,
42
42
  const char* type_name, const char* uri);
43
+ extern XsdCm* xsd_find_complex_ref(struct leptris_xsd_schema* s,
44
+ const char* type_name, const char* uri);
43
45
  XsdCm* xsd_find_complex(struct leptris_xsd_schema* s, const char* type_name);
44
46
  extern const XsdSimple* xsd_find_simple_ns_pub(
45
47
  struct leptris_xsd_schema* s, const char* name, const char* uri);
@@ -527,11 +529,15 @@ static void validate_local(struct xsd_validator* v,
527
529
  * from every imported namespace. */
528
530
  const char* euri = NULL;
529
531
  leptris_element_expanded_name(elem, NULL, NULL, &euri);
530
- XsdCm* ct = xsd_find_complex_ns(s, type, euri);
532
+ /* the type ref may name a FOREIGN namespace's type (OOXML:
533
+ * wp:extent -> a:CT_PositiveSize2D) — resolve through the
534
+ * reference ladder, not the element-ns-strict lookup */
535
+ XsdCm* ct = xsd_find_complex_ref(s, type, euri);
531
536
  if (ct) {
532
- validate_attributes(
533
- v, s, elem,
534
- xsd_find_type_attrs_ns(s, type, euri));
537
+ const XsdTypeAttrs* rows =
538
+ xsd_find_type_attrs_ns(s, type, euri);
539
+ if (!rows) rows = xsd_find_type_attrs(s, type);
540
+ validate_attributes(v, s, elem, rows);
535
541
  validate_children(v, s, elem, ct);
536
542
  /* XSD 1.1: the type's xs:assert list — context is the
537
543
  * element; evaluation errors are failures */
@@ -0,0 +1,12 @@
1
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2
+ xmlns="urn:a" targetNamespace="urn:a">
3
+ <xs:complexType name="CT_PositiveSize2D">
4
+ <xs:attribute name="cx" type="xs:unsignedLong" use="required"/>
5
+ <xs:attribute name="cy" type="xs:unsignedLong" use="required"/>
6
+ </xs:complexType>
7
+ <xs:complexType name="CT_NonVisualDrawingProps">
8
+ <xs:attribute name="id" type="xs:unsignedInt" use="required"/>
9
+ <xs:attribute name="name" type="xs:string" use="required"/>
10
+ </xs:complexType>
11
+ <xs:complexType name="CT_ShapeProperties"/>
12
+ </xs:schema>
@@ -0,0 +1,11 @@
1
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2
+ xmlns="urn:doc" targetNamespace="urn:doc"
3
+ xmlns:x="urn:wp">
4
+ <xs:import namespace="urn:wp" schemaLocation="wp.xsd"/>
5
+ <xs:complexType name="CT_Doc">
6
+ <xs:sequence>
7
+ <xs:element ref="x:inline"/>
8
+ </xs:sequence>
9
+ </xs:complexType>
10
+ <xs:element name="doc" type="CT_Doc"/>
11
+ </xs:schema>
@@ -0,0 +1,13 @@
1
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2
+ xmlns="urn:wp" targetNamespace="urn:wp"
3
+ xmlns:a="urn:a">
4
+ <xs:import namespace="urn:a" schemaLocation="main.xsd"/>
5
+ <xs:complexType name="CT_Inline">
6
+ <xs:sequence>
7
+ <xs:element name="extent" type="a:CT_PositiveSize2D"/>
8
+ <xs:element name="docPr" type="a:CT_NonVisualDrawingProps"/>
9
+ <xs:element name="spPr" type="a:CT_ShapeProperties" minOccurs="0"/>
10
+ </xs:sequence>
11
+ </xs:complexType>
12
+ <xs:element name="inline" type="CT_Inline"/>
13
+ </xs:schema>
@@ -291,6 +291,41 @@ TEST(XsdValidate, AttrTypeResolvesInDeclaringNamespace) {
291
291
  leptris_xsd_free(s);
292
292
  }
293
293
 
294
+ // leptris-ruby#440 (follow-up): a type reference on an instance
295
+ // element resolves in the namespace the REFERENCE declares, not
296
+ // the element's own — OOXML types every wp:/pic: particle with
297
+ // a:-prefixed main-namespace types (wp:extent ->
298
+ // a:CT_PositiveSize2D), and the strict (ns, name) lookup answered
299
+ // "type not found in the schema" for all six drawing particles.
300
+ // The reference ladder (element ns -> unstamped -> name-only)
301
+ // keeps #1665's priority: the element's own namespace still wins.
302
+ TEST(XsdValidate, CrossNamespaceTypeRefsResolve) {
303
+ LeptrisStatus st = LEPTRIS_OK;
304
+ LeptrisXsdSchema s = leptris_xsd_compile_file(
305
+ LEPTRIS_XSD_CASES_DIR "/xns_type_refs/root.xsd", &st);
306
+ ASSERT_NE(s, (LeptrisXsdSchema)0) << "status " << (int)st;
307
+ const char doc[] =
308
+ "<d:doc xmlns:d=\"urn:doc\" xmlns:x=\"urn:wp\">"
309
+ "<x:inline><x:extent cx=\"990600\" cy=\"792480\"/>"
310
+ "<x:docPr id=\"1\" name=\"pic\"/>"
311
+ "<x:spPr/></x:inline></d:doc>";
312
+ LeptrisDocument d = leptris_parse_string(doc, strlen(doc), &st);
313
+ ASSERT_NE(d, nullptr);
314
+ EXPECT_EQ(leptris_xsd_validate(s, d), 1);
315
+ leptris_document_free(d);
316
+ // Strictness survives: a bad lexical still fails through the
317
+ // foreign-namespace type.
318
+ const char bad[] =
319
+ "<d:doc xmlns:d=\"urn:doc\" xmlns:x=\"urn:wp\">"
320
+ "<x:inline><x:extent cx=\"nope\" cy=\"792480\"/>"
321
+ "<x:docPr id=\"1\" name=\"pic\"/></x:inline></d:doc>";
322
+ LeptrisDocument b = leptris_parse_string(bad, strlen(bad), &st);
323
+ ASSERT_NE(b, nullptr);
324
+ EXPECT_EQ(leptris_xsd_validate(s, b), 0);
325
+ leptris_document_free(b);
326
+ leptris_xsd_free(s);
327
+ }
328
+
294
329
  // leptris-ruby#434: the length family counts OCTETS for binary
295
330
  // bases (XML Schema Part 2: hexBinary/base64Binary length is in
296
331
  // bytes) — the wml ST_LongHexNumber shape (hexBinary + length 4)
@@ -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.351",
4
+ "version": "1.9.352",
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.351.1
4
+ version: 1.9.352.0
5
5
  platform: ppc64le-linux
6
6
  authors:
7
7
  - Ribose Inc.
@@ -1462,6 +1462,9 @@ files:
1462
1462
  - vendor-src/libleptris/test/xsd/libxml2-cases/vdv-first5_0.xsd
1463
1463
  - vendor-src/libleptris/test/xsd/libxml2-cases/vdv-simpleTypes.xsd
1464
1464
  - vendor-src/libleptris/test/xsd/libxml2-cases/xml.xsd
1465
+ - vendor-src/libleptris/test/xsd/libxml2-cases/xns_type_refs/main.xsd
1466
+ - vendor-src/libleptris/test/xsd/libxml2-cases/xns_type_refs/root.xsd
1467
+ - vendor-src/libleptris/test/xsd/libxml2-cases/xns_type_refs/wp.xsd
1465
1468
  - vendor-src/libleptris/test/xsd/libxml2-cases/xsd-list-itemType_0.xml
1466
1469
  - vendor-src/libleptris/test/xsd/libxml2-cases/xsd-list-itemType_0.xsd
1467
1470
  - vendor-src/libleptris/test/xsd/libxml2-cases/xsd-simpleType-varieties_0.xml