leptris 1.9.403.1-ppc64le-linux → 1.9.405.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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/ext/leptris/native/native.c +60 -0
  4. data/lib/leptris/version.rb +1 -1
  5. data/lib/leptris/xml/native.so +0 -0
  6. data/lib/leptris/xml/native_3_3.so +0 -0
  7. data/lib/libleptris.so +0 -0
  8. data/vendor-src/README.md +1 -1
  9. data/vendor-src/libleptris/CHANGELOG.md +147 -8
  10. data/vendor-src/libleptris/CMakeLists.txt +1 -1
  11. data/vendor-src/libleptris/src/leptris/descriptor/plan.c +98 -7
  12. data/vendor-src/libleptris/src/leptris/xsd/compile.c +200 -13
  13. data/vendor-src/libleptris/src/leptris/xsd/validate.c +133 -24
  14. data/vendor-src/libleptris/src/leptris/xsd/xsd_internal.h +15 -0
  15. data/vendor-src/libleptris/test/CMakeLists.txt +6 -0
  16. data/vendor-src/libleptris/test/abi/test_descriptor.cpp +232 -0
  17. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1957/instance.xml +2 -0
  18. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1957/schema.xsd +16 -0
  19. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1958/schF1.xml +14 -0
  20. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1958/schF1_a.xsd +28 -0
  21. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1958/schF1_b.xsd +14 -0
  22. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1958/schP2.xml +2 -0
  23. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1958/schP2_a.xsd +27 -0
  24. data/vendor-src/libleptris/test/xsd/libxml2-cases/i1958/schP2_b.xsd +12 -0
  25. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_fixed_empty/isdefault005.xml +1 -0
  26. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_fixed_empty/isdefault005.xsd +9 -0
  27. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_list_default/stZ072.xml +1 -0
  28. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_list_default/stZ072.xsd +12 -0
  29. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_mixed_particleless/ctA033.xml +1 -0
  30. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_mixed_particleless/ctA033.xsd +4 -0
  31. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025.red +8 -0
  32. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025.xml +15 -0
  33. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025.xsd +30 -0
  34. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025_base.xsd +7 -0
  35. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/addB104.xml +6 -0
  36. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/addB104.xsd +19 -0
  37. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/attO006.xml +4 -0
  38. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/attO006.xsd +15 -0
  39. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA033.xml +2 -0
  40. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA033.xsd +5 -0
  41. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA035.xml +2 -0
  42. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA035.xsd +5 -0
  43. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF025.red +8 -0
  44. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF025.xml +15 -0
  45. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF025.xsd +30 -0
  46. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF033.xml +12 -0
  47. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF033.xsd +23 -0
  48. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF033a.xsd +8 -0
  49. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF034.red +8 -0
  50. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF034.xml +15 -0
  51. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF034.xsd +30 -0
  52. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG018.xml +12 -0
  53. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG018.xsd +23 -0
  54. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG018a.xsd +8 -0
  55. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG019.red +8 -0
  56. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG019.xml +15 -0
  57. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG019.xsd +30 -0
  58. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG027.xml +12 -0
  59. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG027.xsd +23 -0
  60. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG027a.xsd +8 -0
  61. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG028.red +8 -0
  62. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG028.xml +15 -0
  63. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG028.xsd +30 -0
  64. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault002.xsd +12 -0
  65. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault004.xsd +12 -0
  66. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault005.xml +5 -0
  67. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault006.xml +5 -0
  68. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault025.xml +5 -0
  69. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault026.xml +5 -0
  70. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/stZ072.xml +1 -0
  71. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/stZ072.xsd +20 -0
  72. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/test95960_1.xml +4 -0
  73. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/test95960_1.xsd +12 -0
  74. data/vendor-src/libleptris/test/xsd/test_i1957_1958.cpp +90 -0
  75. data/vendor-src/libleptris/test/xsd/test_rs35_regression.cpp +127 -0
  76. data/vendor-src/libleptris/vcpkg.json +1 -1
  77. metadata +60 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 269815b40f880cadd0ad089ef7a5b088626d82c9b8902c279ae038feb34642dd
4
- data.tar.gz: ae22791ef6189e2bdde8b117ce73a6769ab4205f7d44b46fe9c0a566599adee6
3
+ metadata.gz: 0042a554198c2efc15739b44007db641fda0ff3875d80ce6fde0134f17874a7a
4
+ data.tar.gz: 3f7eaf8a405730951796e38e3b5b342339017866f99580dc146e6017f4e6243f
5
5
  SHA512:
6
- metadata.gz: 8d1b853f583fedb98b7c82211d72805a8686b9d03162547b22bc0431a33c2c6d57db80fedda4c9cd3e91cf5843c925af9307a164fa3ce0c422c52217ae1adedd
7
- data.tar.gz: 364c64988e6a27ed89c754a116ecadbadb8c9e0307925b60f0e8712ce9c355cdf062cb0909ad6a52ec88fc4ccf26c94cf2a1c1f2786d14f8d4f6fa02644b34a4
6
+ metadata.gz: 9814a80867503c7fa0bd578ba6e4976acf748843c795fdb1f177ec13db7bd45af28cc72a90ba8200d815ec2cb8b09f69f712414a0c3627f12bad335638294c17
7
+ data.tar.gz: 2a34864769df4399c7957df0026418e092c09a8d648278ab822a279bcfefd29e146b0708d81a629efa87f7198724a575f91794187969ba9be9054052ec9bab30
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.403"
11
+ LIBLEPTRIS_VERSION = "1.9.405"
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
@@ -2782,6 +2782,64 @@ static VALUE nf_walk_columnar(VALUE self, VALUE root)
2782
2782
  return rb_ary_new3(3, names, handles, depths);
2783
2783
  }
2784
2784
 
2785
+ /* ---- Raw-address columnar walk (leptris-ruby#587) ----------------
2786
+ * The identity-free read lane: the preorder/depths contract of
2787
+ * walk_columnar (#527), but the handles lane carries RAW NODE
2788
+ * ADDRESSES as Integers instead of minted NativeNodes — addresses
2789
+ * are immediates in CRuby, so a whole-subtree read walk allocates
2790
+ * nothing per node beyond the three arrays, mints nothing, and
2791
+ * writes nothing into the per-document identity cache. Names are
2792
+ * interned fstrings exactly as walk_columnar produces them.
2793
+ *
2794
+ * Read-only consumers resolve everything through the address-keyed
2795
+ * faces (fast_name, fast_element_text, attribute_pairs, ...). A
2796
+ * consumer that later needs a mutable, identity-backed handle
2797
+ * mints it through the normal wrap path — the write lane is
2798
+ * unchanged. This is the shadow-binding read half: Ruby objects
2799
+ * exist only where the consumer holds state, never per visited
2800
+ * node. */
2801
+ static void walk_addresses_impl(void *node, int depth, VALUE names,
2802
+ VALUE addrs, VALUE depths)
2803
+ {
2804
+ int kind = f_node_type(node);
2805
+ void *c;
2806
+
2807
+ if (kind == WS_NODE_ELEMENT) {
2808
+ const char *name = f_elem_name(node);
2809
+ rb_ary_push(names, name
2810
+ ? rb_enc_interned_str(name, strlen(name),
2811
+ rb_utf8_encoding())
2812
+ : Qnil);
2813
+ rb_ary_push(addrs, ULL2NUM((uint64_t)(uintptr_t)node));
2814
+ rb_ary_push(depths, INT2NUM(depth));
2815
+ for (c = f_first_child(node); c; c = f_next_sibling(c)) {
2816
+ walk_addresses_impl(c, depth + 1, names, addrs, depths);
2817
+ }
2818
+ } else if (kind == WS_NODE_TEXT || kind == WS_NODE_COMMENT ||
2819
+ kind == WS_NODE_CDATA || kind == WS_NODE_PI) {
2820
+ rb_ary_push(names, Qnil);
2821
+ rb_ary_push(addrs, ULL2NUM((uint64_t)(uintptr_t)node));
2822
+ rb_ary_push(depths, INT2NUM(depth));
2823
+ } else if (kind == WS_NODE_DOCTYPE || kind == 9 /* DOCUMENT */) {
2824
+ for (c = f_first_child(node); c; c = f_next_sibling(c)) {
2825
+ walk_addresses_impl(c, depth, names, addrs, depths);
2826
+ }
2827
+ }
2828
+ }
2829
+
2830
+ static VALUE nf_walk_addresses(VALUE self, VALUE root)
2831
+ {
2832
+ struct native_node *n;
2833
+ VALUE names, addrs, depths;
2834
+ (void)self;
2835
+ TypedData_Get_Struct(root, struct native_node, &nn_type, n);
2836
+ names = rb_ary_new();
2837
+ addrs = rb_ary_new();
2838
+ depths = rb_ary_new();
2839
+ walk_addresses_impl(n->ptr, 0, names, addrs, depths);
2840
+ return rb_ary_new3(3, names, addrs, depths);
2841
+ }
2842
+
2785
2843
  /* ---- Struct plan executor (moxml "miles faster" round) ------------
2786
2844
  * The consumer's shape compiles to spec: name (interned String) ->
2787
2845
  * [Struct class, attrs Hash (name -> slot Symbol), text slot Symbol
@@ -4200,6 +4258,8 @@ static void leptris_native_setup(void)
4200
4258
  nf_snapshot_rows, 2);
4201
4259
  rb_define_module_function(m_native, "walk_columnar",
4202
4260
  nf_walk_columnar, 1);
4261
+ rb_define_module_function(m_native, "walk_addresses",
4262
+ nf_walk_addresses, 1);
4203
4263
  rb_define_module_function(m_native, "attribute_pairs",
4204
4264
  nf_attribute_pairs, 2);
4205
4265
  rb_define_module_function(m_native, "plan_structs",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.403.1"
4
+ VERSION = "1.9.405.0"
5
5
  end
Binary file
Binary file
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.403
4
+ - libleptris v1.9.405
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,17 +1,156 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.405] - 2026-11-03
4
+
5
+ ### Fixed
6
+
7
+ - **XSD: the leptris-rs#36 attribute leg** — an attribute with
8
+ `fixed` whose instance lexical differs only in whitespace was
9
+ rejected by the raw strcmp. The fixed constraint holds on the
10
+ TYPE's value (§3.2.3/§4.3.1.2): when the raw comparison fails,
11
+ both sides normalize per the type's whiteSpace and compare again
12
+ (addB104, attO006 — xsd:integer whitespace variants).
13
+
14
+ - **XSD: nested attributeGroup refs (leptris#1957)** — an inner
15
+ `attributeGroup ref` naming a group declared LATER expanded empty,
16
+ rejecting level-2 members under strict admission (attgD005..034,
17
+ attJ018). The pre-pass registers every def first and captures rows
18
+ in a second sweep; the ref expansion re-captures lazily through
19
+ the def's own element. A complexType whose content model is only
20
+ an attributeGroup ref + `mixed="true"` no longer reports "the
21
+ content model is empty".
22
+
23
+ - **XSD: multi-document component resolution (leptris#1958)** — an
24
+ import of a no-targetNamespace document kept the importer's tns
25
+ during capture (chameleon semantics are include-only, §4.2.3), so
26
+ its same-named complexType shadowed the importing namespace's own
27
+ declaration and swapped particle types (schF1). The content-model
28
+ child loop binds a no-namespace child to its own no-tns
29
+ declaration first; `xs:redefine` of a simpleType aliases the
30
+ original so the facet chain resolves to the redefinition (schP2's
31
+ minLength enforced).
32
+
33
+ - **Descriptor: retained captured sub-documents until schema
34
+ teardown** — the #1957 lazy attributeGroup expansion holds element
35
+ pointers into their own unit; freeing sub-documents at chase time
36
+ left them dangling (heap-use-after-free under ASAN in the corpus
37
+ sweep).
38
+
39
+
40
+
41
+ ## [1.9.404] - 2026-11-03
42
+
43
+ ### Fixed
44
+
45
+ - **XSD validation: the leptris-rs#35 regression wave** — four
46
+ strictness defects introduced/exposed by the 1.9.403 fixes, all
47
+ expected-VALID W3C cases that passed on 1.9.402:
48
+ - fixed + empty CHILD elements: particles capture `fixed`/`default`
49
+ and an empty element is satisfied BY the value (XSD 1.0
50
+ §3.12.2/§4.3.1.2) — the fill substitutes for the empty lexical at
51
+ every simple-type check site (isDefault005/006/025/026/060_1);
52
+ - `mixed="true"` on a particle-less complexType admits character
53
+ content (ctA033/ctA035);
54
+ - redefine composition with inline mixed children (idF025/033/034,
55
+ idG018/019/027/028) — the same root cause: the mixed flag now
56
+ survives capture;
57
+ - default-supplied content on an empty list-typed element (stZ072).
58
+ All fifteen issue cases run verbatim from the msData fixtures; the
59
+ capture fields are ASAN-leak clean.
60
+
61
+ - **Descriptor: the ops builder carries the emission namespace
62
+ bindings (leptris#1941)** — `leptris_plan_result_build` dropped the
63
+ `(ns_prefix, ns_uri)` bindings the walk stamps: root, scalar, and
64
+ attribute ops serialized bare names with no xmlns declarations.
65
+ Root ops bind the plan's prefix, scalar ops their row binding,
66
+ nested element ops inherit the CHILD plan's binding (explicit row
67
+ bindings win), and prefix-only rows fall back to the target plan's
68
+ URI. The serializer spells `prefix:local` for attributes from the
69
+ stored LOCAL name. Matching is untouched — the bindings are
70
+ emission-only.
71
+
72
+
73
+
3
74
  ## [1.9.403] - 2026-11-03
4
75
 
5
76
  ### Fixed
6
77
 
7
- - temporal enumeration compares by value, not lexically (leptris-rs#27) (xsd)
8
- - whiteSpace=collapse covers every non-string builtin (leptris-rs#29, elemZ002) (xsd)
9
- - a nilled element must have empty content - the model is not applied (leptris-rs#26) (xsd)
10
- - empty content satisfies a fixed value; -0 lexes for nonNegativeInteger (leptris-rs#25/#28) (xsd)
11
- - subtraction root cause, XSD \w excludes '_', empty content model (leptris#1936 reF39/reZ002/p2) (rng,xsd)
12
- - in-class builtin merge carries uni ranges and XML pins (leptris#1936 reZ003-006) (rng)
13
- - {n,} unbounded, empty branches, and REP over nullable bodies (leptris#1936 reC57/reE10/reD3) (rng)
14
- - regex-tail conformance - pattern disjunction, class grammar, empty content (leptris#1936 p16/reG) (xsd)
78
+ **XSD regex conformance: the #1936 family closes.** The
79
+ msMeta-classified W3C XSD suite divergences go from 104
80
+ engine-wrong rows to ZERO; the 22 remaining sweep divergences are
81
+ documented suite-stale dispositions (reJ x15 modern-Unicode,
82
+ reS/reT `queried` rows, Unicode-3.1 vintage, reDH7a whose suite
83
+ metadata contradicts its own annotation and the oracle).
84
+
85
+ - **Multiple `xs:pattern` facets are a disjunction** (p16: two
86
+ patterns accept a value matching ANY of them, "same as
87
+ `[abc]+|[123]+`") — the old last-pattern-wins capture
88
+ under-accepted every earlier pattern.
89
+ - **Pattern facets are validated at schema compile** (F.1
90
+ productions [14]/[17]-[22]): a standalone `-` is a class member
91
+ only at group start or end — mid-dash patterns
92
+ (`[a-c-1-4x-z-7-9]`, `[a-a-x-x]`, reG26-33/reH19) are grammar
93
+ errors and reject the schema. Empty patterns stay legal (reA1).
94
+ - **In-class negated builtins complement exactly** (reG21/23):
95
+ `[\D]+` matched `'1'` because the uppercase spellings built an
96
+ empty member set and the "complement" memset accepted every
97
+ byte. The positive class now rides the negm slot — exact across
98
+ bytes, uni ranges and categories.
99
+ - **charClassSub skipped only the `-`** before handing the stream
100
+ to the class parser, which expects entry PAST the `[` — the
101
+ subtrahend's `[` parsed as a literal member and a leading `^`
102
+ was dropped, so `[a-z-[^a]]` matched a-z minus `{a}` instead of
103
+ `{a}` (reF39). The subtraction also composes AFTER the
104
+ negCharGroup flip (`[^cde-[ag]]`, RegexTest_430).
105
+ - **`\w` excludes ALL of `\p{P}`** — Pc too: `'_'` is NOT a word
106
+ char (reZ002: `first_last` fails `[\w\-\.]+@.*`; Perl's `\w`
107
+ includes it, XSD's does not).
108
+ - **`{n,}` stays unbounded** (the `{n}`-exact fix collapsed every
109
+ comma form to `{n,n}` — reC57); **an empty branch is legal**
110
+ and matches only the empty string (reE10); **a REP over a
111
+ nullable body** pins each counted iteration to consume
112
+ (reD3-6: `((boy|(girl))...?)|(man|woman)...` under `woman1y`).
113
+ - **The in-class builtin merge carries uni ranges and the XML 1.0
114
+ explicit-list pins** (reZ003-006): U+1369-1371 (legacy Nd) in
115
+ `[\d]`, U+212E (BaseChar) in `\i`/`\c`, U+06DD/U+06DE
116
+ (Mn-in-3.1 demotions) and U+00B7/U+0387 (Extender's explicit Po
117
+ members) in `\c`.
118
+ - **Empty content faces simple-type facets** (reG17: `''` fails
119
+ the pattern and is not a valid `xs:integer`); the fixed-value
120
+ check fires with no text node.
121
+ - **An attributes-only complexType has EMPTY content** —
122
+ character content violates it (p2: `<elem>abc</elem>`
123
+ [invalid]; whitespace-only too, per the oracle).
124
+
125
+ **leptris-rs#25-29 validation-semantics wave** (found by the
126
+ binding audit):
127
+
128
+ - **rs#25 (regression in 1.9.402)**: an element with a fixed
129
+ value and EMPTY instance content is VALID — the fixed value
130
+ supplies the content (XSD §3.12.2; nine W3C rows flipped on the
131
+ 402 ride: isDefault001/002/076, ctZ013a, elemQ019, stE065/066/
132
+ 096, particlesZ040). Only differing non-empty content violates;
133
+ whitespace-only counts as empty.
134
+ - **rs#26**: a NILLED element has neither character nor element
135
+ content — the content model is not applied
136
+ (particlesIa002/QFE1700g2). Attributes are unaffected and still
137
+ validate.
138
+ - **rs#27**: temporal enumeration compares by VALUE, not
139
+ lexically — dateTime by instant (App. E: `+00:00` equals `Z` of
140
+ the same instant), time/date/gMonth normalize only the
141
+ zero-timezone spellings (the timezone is part of the value).
142
+ - **rs#28**: `-0` is a valid nonNegativeInteger lexical (§3.3.20:
143
+ zero may carry a negative sign); positiveInteger keeps
144
+ excluding it.
145
+ - **rs#29**: whiteSpace=collapse is FIXED on every builtin except
146
+ string (preserve) and normalizedString (replace) — the xsi:type
147
+ override path now collapses integer content like the declared
148
+ path (elemZ002).
149
+
150
+ All fixes are red-first in the test suite (158 XSD specs green in
151
+ both the utf8proc and no-utf8proc configs) and verified against
152
+ the vendored W3C corpus documents; rng/sch/dtd/xpath/libxslt
153
+ suites unchanged (204 + 1 standing skip).
15
154
 
16
155
 
17
156
 
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.403
6
+ VERSION 1.9.405
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -1521,11 +1521,23 @@ static int dp_emit_element_open(const struct leptris_plan_result* v,
1521
1521
  }
1522
1522
  }
1523
1523
  for (size_t a = 0; a < v->attr_count; a++) {
1524
- if (!dp_sb_putn(b, " ", 1) || !dp_sb_puts(b, v->attr_names[a]) ||
1525
- !dp_sb_puts(b, "=\"") ||
1526
- !dp_sb_escape(b, v->attr_values[a], 1) ||
1527
- !dp_sb_putn(b, "\"", 1))
1528
- return 0;
1524
+ /* leptris#1941: a row with an emission binding spells
1525
+ * "prefix:local" (dp_wrapper_name's element contract);
1526
+ * the stored name stays the LOCAL name for host lookups. */
1527
+ char* qn = NULL;
1528
+ const char* nm = v->attr_names[a];
1529
+ if (v->attr_ns_prefixes && v->attr_ns_prefixes[a] && nm) {
1530
+ const char* colon = strchr(nm, ':');
1531
+ qn = dp_join_colon(v->attr_ns_prefixes[a],
1532
+ colon ? colon + 1 : nm);
1533
+ nm = qn;
1534
+ }
1535
+ int ok = nm && dp_sb_putn(b, " ", 1) && dp_sb_puts(b, nm) &&
1536
+ dp_sb_puts(b, "=\"") &&
1537
+ dp_sb_escape(b, v->attr_values[a], 1) &&
1538
+ dp_sb_putn(b, "\"", 1);
1539
+ free(qn);
1540
+ if (!ok) return 0;
1529
1541
  }
1530
1542
  return 1;
1531
1543
  }
@@ -1948,8 +1960,48 @@ static struct leptris_plan_result* plan_result_build_windowed(
1948
1960
  if (op->row_index != UINT32_MAX) {
1949
1961
  const leptris_child_plan* cr =
1950
1962
  &cp->child_plans[op->row_index];
1951
- v->ns_prefix = dp_strdup(cr->ns_prefix);
1952
- v->ns_uri = dp_strdup(cr->ns_uri);
1963
+ /* leptris#1941 emission inheritance (the DOM
1964
+ * lane's Namespaces planner contract): a row
1965
+ * without its own binding inherits the CHILD
1966
+ * plan's binding (nested rows spell the child's
1967
+ * namespace), else the row's OWN plan's binding
1968
+ * (rows of a namespaced plan spell the plan's
1969
+ * namespace). Explicit row bindings win. The URI
1970
+ * follows the prefix's plan. */
1971
+ const dp_plan* ns_src = NULL;
1972
+ if (cr->ns_prefix) {
1973
+ v->ns_prefix = dp_strdup(cr->ns_prefix);
1974
+ const dp_plan* tp =
1975
+ (cr->child_plan_index >= 0 &&
1976
+ cr->child_plan_index < (int32_t)pool->plan_count)
1977
+ ? &pool->plans[cr->child_plan_index]
1978
+ : NULL;
1979
+ v->ns_uri = dp_strdup(cr->ns_uri ? cr->ns_uri
1980
+ : tp->ns_uri);
1981
+ if (!v->ns_prefix || !v->ns_uri) goto oom;
1982
+ } else if (cr->child_plan_index >= 0 &&
1983
+ cr->child_plan_index <
1984
+ (int32_t)pool->plan_count &&
1985
+ pool->plans[cr->child_plan_index].ns_prefix &&
1986
+ pool->plans[cr->child_plan_index].ns_form ==
1987
+ LEPTRIS_PLAN_NS_EXACT) {
1988
+ ns_src = &pool->plans[cr->child_plan_index];
1989
+ } else if (cp->ns_prefix &&
1990
+ cp->ns_form == LEPTRIS_PLAN_NS_EXACT) {
1991
+ ns_src = cp;
1992
+ }
1993
+ if (ns_src) {
1994
+ v->ns_prefix = dp_strdup(ns_src->ns_prefix);
1995
+ v->ns_uri = dp_strdup(ns_src->ns_uri);
1996
+ if (!v->ns_prefix || !v->ns_uri) goto oom;
1997
+ }
1998
+ } else if (cp->ns_prefix &&
1999
+ cp->ns_form == LEPTRIS_PLAN_NS_EXACT) {
2000
+ /* leptris#1941: the root op binds the plan's own
2001
+ * emission prefix — the walk's stamp (#1551). */
2002
+ v->ns_prefix = dp_strdup(cp->ns_prefix);
2003
+ v->ns_uri = dp_strdup(cp->ns_uri);
2004
+ if (!v->ns_prefix || !v->ns_uri) goto oom;
1953
2005
  }
1954
2006
  if (sp == 0) {
1955
2007
  if (root) {
@@ -1995,6 +2047,28 @@ static struct leptris_plan_result* plan_result_build_windowed(
1995
2047
  if (op->row_index < cp->child_count)
1996
2048
  v->name = dp_strdup(
1997
2049
  cp->child_plans[op->row_index].wire_name);
2050
+ /* leptris#1941: scalar rows are their own wrapper
2051
+ * element — the row's emission binding rides the
2052
+ * value, same as ELEMENT ops (#1551); rows without a
2053
+ * binding inherit the plan's namespace. */
2054
+ if (op->row_index < cp->child_count) {
2055
+ const leptris_child_plan* cr =
2056
+ &cp->child_plans[op->row_index];
2057
+ const dp_plan* ns_src = NULL;
2058
+ if (cr->ns_prefix) {
2059
+ v->ns_prefix = dp_strdup(cr->ns_prefix);
2060
+ v->ns_uri = dp_strdup(cr->ns_uri);
2061
+ if (!v->ns_prefix || !v->ns_uri) goto oom;
2062
+ } else if (cp->ns_prefix &&
2063
+ cp->ns_form == LEPTRIS_PLAN_NS_EXACT) {
2064
+ ns_src = cp;
2065
+ }
2066
+ if (ns_src) {
2067
+ v->ns_prefix = dp_strdup(ns_src->ns_prefix);
2068
+ v->ns_uri = dp_strdup(ns_src->ns_uri);
2069
+ if (!v->ns_prefix || !v->ns_uri) goto oom;
2070
+ }
2071
+ }
1998
2072
  if (!dp_value_set_str(v, op->value ? op->value : "",
1999
2073
  op->value ? op->value_len : 0))
2000
2074
  dp_value_set_str(v, "", 0);
@@ -2066,6 +2140,23 @@ static struct leptris_plan_result* plan_result_build_windowed(
2066
2140
  op->value ? op->value_len : 0);
2067
2141
  gp[el->attr_count] = NULL;
2068
2142
  gu[el->attr_count] = NULL;
2143
+ /* leptris#1941: the attr row's emission binding —
2144
+ * ns_form EXACT rows spell "prefix:local" (#1551).
2145
+ * row_index out of range (host-synthesized attrs) has
2146
+ * no plan row: the fields stay NULL. */
2147
+ if (op->plan_index < pool->plan_count &&
2148
+ op->row_index <
2149
+ pool->plans[op->plan_index].attribute_count) {
2150
+ const leptris_attr_plan* ap =
2151
+ &pool->plans[op->plan_index]
2152
+ .attribute_plans[op->row_index];
2153
+ if (ap->ns_prefix) {
2154
+ gp[el->attr_count] = dp_strdup(ap->ns_prefix);
2155
+ gu[el->attr_count] = dp_strdup(ap->ns_uri);
2156
+ if (!gp[el->attr_count] || !gu[el->attr_count])
2157
+ goto oom;
2158
+ }
2159
+ }
2069
2160
  if (!gn[el->attr_count] || !gv[el->attr_count])
2070
2161
  goto oom;
2071
2162
  el->attr_count++;