leptris 1.9.403.0-arm-linux → 1.9.404.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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +18 -1
  3. data/ext/leptris/native/extconf.rb +6 -0
  4. data/ext/leptris/native/native.c +28 -7
  5. data/lib/leptris/version.rb +1 -1
  6. data/lib/leptris/xml/descriptor.rb +12 -3
  7. data/lib/leptris/xml/native.so +0 -0
  8. data/lib/leptris/xml/native_3_3.so +0 -0
  9. data/lib/libleptris.so +0 -0
  10. data/vendor-src/README.md +1 -1
  11. data/vendor-src/libleptris/CHANGELOG.md +109 -8
  12. data/vendor-src/libleptris/CMakeLists.txt +1 -1
  13. data/vendor-src/libleptris/src/leptris/descriptor/plan.c +98 -7
  14. data/vendor-src/libleptris/src/leptris/xsd/compile.c +20 -0
  15. data/vendor-src/libleptris/src/leptris/xsd/validate.c +40 -16
  16. data/vendor-src/libleptris/src/leptris/xsd/xsd_internal.h +10 -0
  17. data/vendor-src/libleptris/test/CMakeLists.txt +3 -0
  18. data/vendor-src/libleptris/test/abi/test_descriptor.cpp +232 -0
  19. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_fixed_empty/isdefault005.xml +1 -0
  20. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_fixed_empty/isdefault005.xsd +9 -0
  21. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_list_default/stZ072.xml +1 -0
  22. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_list_default/stZ072.xsd +12 -0
  23. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_mixed_particleless/ctA033.xml +1 -0
  24. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_mixed_particleless/ctA033.xsd +4 -0
  25. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025.red +8 -0
  26. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025.xml +15 -0
  27. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025.xsd +30 -0
  28. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_redefine_ext/idF025_base.xsd +7 -0
  29. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA033.xml +2 -0
  30. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA033.xsd +5 -0
  31. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA035.xml +2 -0
  32. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/ctA035.xsd +5 -0
  33. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF025.red +8 -0
  34. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF025.xml +15 -0
  35. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF025.xsd +30 -0
  36. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF033.xml +12 -0
  37. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF033.xsd +23 -0
  38. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF033a.xsd +8 -0
  39. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF034.red +8 -0
  40. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF034.xml +15 -0
  41. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idF034.xsd +30 -0
  42. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG018.xml +12 -0
  43. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG018.xsd +23 -0
  44. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG018a.xsd +8 -0
  45. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG019.red +8 -0
  46. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG019.xml +15 -0
  47. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG019.xsd +30 -0
  48. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG027.xml +12 -0
  49. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG027.xsd +23 -0
  50. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG027a.xsd +8 -0
  51. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG028.red +8 -0
  52. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG028.xml +15 -0
  53. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/idG028.xsd +30 -0
  54. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault002.xsd +12 -0
  55. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault004.xsd +12 -0
  56. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault005.xml +5 -0
  57. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault006.xml +5 -0
  58. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault025.xml +5 -0
  59. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/isdefault026.xml +5 -0
  60. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/stZ072.xml +1 -0
  61. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/stZ072.xsd +20 -0
  62. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/test95960_1.xml +4 -0
  63. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/test95960_1.xsd +12 -0
  64. data/vendor-src/libleptris/test/xsd/test_rs35_regression.cpp +116 -0
  65. data/vendor-src/libleptris/vcpkg.json +1 -1
  66. metadata +47 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d437d99c3ca2fd8c8ceb700ded511bfb862251c0eddb9f39d824e69960742a8
4
- data.tar.gz: 7ea22b9ffa53ec0153711716157af630cb32d9e82e73b34cb59d0d69318147c7
3
+ metadata.gz: 5e6cb1bf19ae12f5689e974874b7694860cd0e28c678664b4c4e029ed1b0abdd
4
+ data.tar.gz: 51770d059d1a1030fea0658f723f981246f455d8db0643fc3de483ae223e25b2
5
5
  SHA512:
6
- metadata.gz: f067598fa8743421010f38b56e91e7e292af4f443687a9695a712d126eb12ad92a96da3f8c8f94e0f9364deaf7b610964228f31ab1fd7b1a49689603aad23162
7
- data.tar.gz: dbafef1c715fb7a800b7cccd20ccab3bfff8b42ae31f03dbe023bc36dc3ff4732857582e8ccb6709cc820a202ca74f27fbf4149fe9abc8ffa4c1318b026daf3d
6
+ metadata.gz: f344e40ab5ac78a324163ab8fc0db59fac78462f6216af73bdaf27cd0769164b1a67e0974b6860d11f2d2445e7df382ab30c8b6a744f960c667c69bd4ac5d955
7
+ data.tar.gz: 86bd63fe04d1f25ab0ad61846115bc4be1df91caa4d0707a1c45f6f0c4121357c4dd08a736def05bfabae08df23306348660fc459c7ea6126f1c5b82a87b876c
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.404"
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
@@ -273,6 +273,23 @@ task :compile do
273
273
  raise "utf8proc shared library not found after build" unless u8_lib
274
274
  cp(u8_lib, "lib/#{File.basename(u8_lib)}")
275
275
  sign_darwin_binaries("lib/libleptris#{ext}", "lib/#{File.basename(u8_lib)}")
276
+ # ruby#582 dev follow-through: a source checkout carrying the
277
+ # release-assembly vendor copy (lib/leptris/vendor/<platform>/)
278
+ # would shadow the fresh lib/ dylib — ffi_lib prefers vendor_dirs.
279
+ # Sync the platform copy so `rake compile` keeps every vendored
280
+ # location at the built engine version (CI source-install lanes
281
+ # hit the same shadow).
282
+ # the vendor dir spelling comes from the FFI loader's own platform
283
+ # derivation (RUBY_PLATFORM carries the darwin OS version:
284
+ # "arm64-darwin23" -> vendor "arm64-darwin")
285
+ cpu = RUBY_PLATFORM.split('-').first
286
+ os = RUBY_PLATFORM.include?('darwin') ? 'darwin' : 'linux'
287
+ vendor_dir = "lib/leptris/vendor/#{cpu}-#{os}"
288
+ if Dir.exist?(vendor_dir)
289
+ cp(lib, File.join(vendor_dir, "libleptris#{ext}"))
290
+ sign_darwin_binaries(File.join(vendor_dir, "libleptris#{ext}"))
291
+ puts "Synced #{vendor_dir}/libleptris#{ext}"
292
+ end
276
293
  puts "Vendored #{File.basename(lib)} + #{File.basename(u8_lib)} into lib/"
277
294
 
278
295
  # Opt-in native read layer ext (#185): built and vendored beside
@@ -165,4 +165,10 @@ end
165
165
  # same basename — exported by native.c and pinned in the Windows
166
166
  # .def above.
167
167
  minor_us = RUBY_VERSION[/\A\d+\.\d+/].tr(".", "_")
168
+ # ruby#582: hide every internal symbol; only the Init_* entry
169
+ # points opt back in (visibility("default")). Linux's flat symbol
170
+ # scope otherwise lets another gem's exports hijack our calls.
171
+ unless RUBY_PLATFORM =~ /mswin|mingw/
172
+ append_cflags("-fvisibility=hidden")
173
+ end
168
174
  create_makefile("leptris/xml/native_#{minor_us}")
@@ -3701,6 +3701,11 @@ static VALUE leptris_native_resolve_rb(VALUE self, VALUE lib_path)
3701
3701
  */
3702
3702
  #if defined(_WIN32)
3703
3703
  # define LEPTRIS_INIT_EXPORT __declspec(dllexport)
3704
+ #elif defined(__GNUC__) || defined(__clang__)
3705
+ /* -fvisibility=hidden (extconf) keeps every internal symbol off
3706
+ * the dynamic table; the entry points opt back in (#582) so no
3707
+ * internal name can clash with another gem's exports. */
3708
+ # define LEPTRIS_INIT_EXPORT __attribute__((visibility("default")))
3704
3709
  #else
3705
3710
  # define LEPTRIS_INIT_EXPORT
3706
3711
  #endif
@@ -3993,7 +3998,15 @@ static VALUE nf_capabilities(VALUE module) {
3993
3998
  return hash;
3994
3999
  }
3995
4000
 
3996
- LEPTRIS_INIT_EXPORT void Init_native(void)
4001
+ /* leptris-ruby#582: the setup body is PRIVATE (static) so the
4002
+ * per-minor entry points call leptris's own code unconditionally.
4003
+ * MRI loads extensions into the global symbol scope on Linux —
4004
+ * when the per-minor entries called the exported `Init_native`,
4005
+ * a second gem's `Init_native` (loaded first) hijacked the call
4006
+ * and leptris's setup never ran (NativeNode undefined). The
4007
+ * exported plain `Init_native` stays only for the mkmf .def
4008
+ * contract; nothing in the gem loads it. */
4009
+ static void leptris_native_setup(void)
3997
4010
  {
3998
4011
  VALUE m_leptris, m_xml, m_native;
3999
4012
 
@@ -4236,9 +4249,17 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
4236
4249
  * unconditionally on every platform since ruby#476: the darwin/
4237
4250
  * Linux per-minor bundles (native_<minor>) resolve these too —
4238
4251
  * an artifact only ever loads under the Ruby minor it was built
4239
- * against. */
4240
- LEPTRIS_INIT_EXPORT void Init_native_3_1(void) { Init_native(); }
4241
- LEPTRIS_INIT_EXPORT void Init_native_3_2(void) { Init_native(); }
4242
- LEPTRIS_INIT_EXPORT void Init_native_3_3(void) { Init_native(); }
4243
- LEPTRIS_INIT_EXPORT void Init_native_3_4(void) { Init_native(); }
4244
- LEPTRIS_INIT_EXPORT void Init_native_4_0(void) { Init_native(); }
4252
+ * against. Each entry calls the PRIVATE setup directly (#582):
4253
+ * routing through the exported `Init_native` let whichever gem
4254
+ * defined that symbol first win the call on Linux's flat
4255
+ * namespace. */
4256
+ LEPTRIS_INIT_EXPORT void Init_native_3_1(void) { leptris_native_setup(); }
4257
+ LEPTRIS_INIT_EXPORT void Init_native_3_2(void) { leptris_native_setup(); }
4258
+ LEPTRIS_INIT_EXPORT void Init_native_3_3(void) { leptris_native_setup(); }
4259
+ LEPTRIS_INIT_EXPORT void Init_native_3_4(void) { leptris_native_setup(); }
4260
+ LEPTRIS_INIT_EXPORT void Init_native_4_0(void) { leptris_native_setup(); }
4261
+
4262
+ /* The plain entry stays exported for the mkmf .def contract (see
4263
+ * the LEPTRIS_INIT_EXPORT note); the gem's own loader only ever
4264
+ * requires the per-minor bundles. */
4265
+ LEPTRIS_INIT_EXPORT void Init_native(void) { leptris_native_setup(); }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.403.0"
4
+ VERSION = "1.9.404.0"
5
5
  end
@@ -209,7 +209,12 @@ class Leptris::XML::Descriptor
209
209
  # libleptris 1.9.312 (#1551): the root plan's serialization
210
210
  # prefix (ns_form EXACT rows emit "prefix:local" and the
211
211
  # xmlns declaration lands once on the output root).
212
- ep[:ns_prefix] = anchor_string(anchors, plan[:ns_prefix]) if plan[:ns_prefix]
212
+ # leptris#1941: the compiler's tree ns Hash carries the wire
213
+ # prefix ({exact:, prefix:}) — the emission prefix rides the
214
+ # same slot as an explicit plan[:ns_prefix].
215
+ prefix_src = plan[:ns_prefix] ||
216
+ (plan[:ns].is_a?(Hash) ? plan[:ns][:prefix] : nil)
217
+ ep[:ns_prefix] = anchor_string(anchors, prefix_src) if prefix_src
213
218
  attrs = plan[:attributes] || []
214
219
  attr_memory = attrs.empty? ? nil :
215
220
  ::FFI::MemoryPointer.new(Leptris::XML::FFI::AttrPlan, attrs.size)
@@ -233,7 +238,9 @@ class Leptris::XML::Descriptor
233
238
  anchor_string(anchors, row[:ns].fetch(:exact)) : nil
234
239
  # libleptris 1.9.312 (#1551): serialization prefix — with
235
240
  # ns_form EXACT the attribute emits as "prefix:local".
236
- ap[:ns_prefix] = anchor_string(anchors, row[:ns_prefix]) if row[:ns_prefix]
241
+ aprefix = row[:ns_prefix] ||
242
+ (row[:ns].is_a?(Hash) ? row[:ns][:prefix] : nil)
243
+ ap[:ns_prefix] = anchor_string(anchors, aprefix) if aprefix
237
244
  pack_predicates(ap, row, anchors)
238
245
  end
239
246
  ep[:attribute_count] = attrs.size
@@ -271,7 +278,9 @@ class Leptris::XML::Descriptor
271
278
  # libleptris 1.9.312 (#1551): serialization prefix — with
272
279
  # ns_form EXACT the element emits as "prefix:local" and
273
280
  # its declaration lands once on the output root.
274
- cp[:ns_prefix] = anchor_string(anchors, row[:ns_prefix]) if row[:ns_prefix]
281
+ cprefix = row[:ns_prefix] ||
282
+ (row[:ns].is_a?(Hash) ? row[:ns][:prefix] : nil)
283
+ cp[:ns_prefix] = anchor_string(anchors, cprefix) if cprefix
275
284
  pack_predicates(cp, row, anchors)
276
285
  end
277
286
  ep[:child_count] = children.size
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.404
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,17 +1,118 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.404] - 2026-11-03
4
+
5
+ ### Fixed
6
+
7
+ - **XSD validation: the leptris-rs#35 regression wave** — four
8
+ strictness defects introduced/exposed by the 1.9.403 fixes, all
9
+ expected-VALID W3C cases that passed on 1.9.402:
10
+ - fixed + empty CHILD elements: particles capture `fixed`/`default`
11
+ and an empty element is satisfied BY the value (XSD 1.0
12
+ §3.12.2/§4.3.1.2) — the fill substitutes for the empty lexical at
13
+ every simple-type check site (isDefault005/006/025/026/060_1);
14
+ - `mixed="true"` on a particle-less complexType admits character
15
+ content (ctA033/ctA035);
16
+ - redefine composition with inline mixed children (idF025/033/034,
17
+ idG018/019/027/028) — the same root cause: the mixed flag now
18
+ survives capture;
19
+ - default-supplied content on an empty list-typed element (stZ072).
20
+ All fifteen issue cases run verbatim from the msData fixtures; the
21
+ capture fields are ASAN-leak clean.
22
+
23
+ - **Descriptor: the ops builder carries the emission namespace
24
+ bindings (leptris#1941)** — `leptris_plan_result_build` dropped the
25
+ `(ns_prefix, ns_uri)` bindings the walk stamps: root, scalar, and
26
+ attribute ops serialized bare names with no xmlns declarations.
27
+ Root ops bind the plan's prefix, scalar ops their row binding,
28
+ nested element ops inherit the CHILD plan's binding (explicit row
29
+ bindings win), and prefix-only rows fall back to the target plan's
30
+ URI. The serializer spells `prefix:local` for attributes from the
31
+ stored LOCAL name. Matching is untouched — the bindings are
32
+ emission-only.
33
+
34
+
35
+
3
36
  ## [1.9.403] - 2026-11-03
4
37
 
5
38
  ### Fixed
6
39
 
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)
40
+ **XSD regex conformance: the #1936 family closes.** The
41
+ msMeta-classified W3C XSD suite divergences go from 104
42
+ engine-wrong rows to ZERO; the 22 remaining sweep divergences are
43
+ documented suite-stale dispositions (reJ x15 modern-Unicode,
44
+ reS/reT `queried` rows, Unicode-3.1 vintage, reDH7a whose suite
45
+ metadata contradicts its own annotation and the oracle).
46
+
47
+ - **Multiple `xs:pattern` facets are a disjunction** (p16: two
48
+ patterns accept a value matching ANY of them, "same as
49
+ `[abc]+|[123]+`") — the old last-pattern-wins capture
50
+ under-accepted every earlier pattern.
51
+ - **Pattern facets are validated at schema compile** (F.1
52
+ productions [14]/[17]-[22]): a standalone `-` is a class member
53
+ only at group start or end — mid-dash patterns
54
+ (`[a-c-1-4x-z-7-9]`, `[a-a-x-x]`, reG26-33/reH19) are grammar
55
+ errors and reject the schema. Empty patterns stay legal (reA1).
56
+ - **In-class negated builtins complement exactly** (reG21/23):
57
+ `[\D]+` matched `'1'` because the uppercase spellings built an
58
+ empty member set and the "complement" memset accepted every
59
+ byte. The positive class now rides the negm slot — exact across
60
+ bytes, uni ranges and categories.
61
+ - **charClassSub skipped only the `-`** before handing the stream
62
+ to the class parser, which expects entry PAST the `[` — the
63
+ subtrahend's `[` parsed as a literal member and a leading `^`
64
+ was dropped, so `[a-z-[^a]]` matched a-z minus `{a}` instead of
65
+ `{a}` (reF39). The subtraction also composes AFTER the
66
+ negCharGroup flip (`[^cde-[ag]]`, RegexTest_430).
67
+ - **`\w` excludes ALL of `\p{P}`** — Pc too: `'_'` is NOT a word
68
+ char (reZ002: `first_last` fails `[\w\-\.]+@.*`; Perl's `\w`
69
+ includes it, XSD's does not).
70
+ - **`{n,}` stays unbounded** (the `{n}`-exact fix collapsed every
71
+ comma form to `{n,n}` — reC57); **an empty branch is legal**
72
+ and matches only the empty string (reE10); **a REP over a
73
+ nullable body** pins each counted iteration to consume
74
+ (reD3-6: `((boy|(girl))...?)|(man|woman)...` under `woman1y`).
75
+ - **The in-class builtin merge carries uni ranges and the XML 1.0
76
+ explicit-list pins** (reZ003-006): U+1369-1371 (legacy Nd) in
77
+ `[\d]`, U+212E (BaseChar) in `\i`/`\c`, U+06DD/U+06DE
78
+ (Mn-in-3.1 demotions) and U+00B7/U+0387 (Extender's explicit Po
79
+ members) in `\c`.
80
+ - **Empty content faces simple-type facets** (reG17: `''` fails
81
+ the pattern and is not a valid `xs:integer`); the fixed-value
82
+ check fires with no text node.
83
+ - **An attributes-only complexType has EMPTY content** —
84
+ character content violates it (p2: `<elem>abc</elem>`
85
+ [invalid]; whitespace-only too, per the oracle).
86
+
87
+ **leptris-rs#25-29 validation-semantics wave** (found by the
88
+ binding audit):
89
+
90
+ - **rs#25 (regression in 1.9.402)**: an element with a fixed
91
+ value and EMPTY instance content is VALID — the fixed value
92
+ supplies the content (XSD §3.12.2; nine W3C rows flipped on the
93
+ 402 ride: isDefault001/002/076, ctZ013a, elemQ019, stE065/066/
94
+ 096, particlesZ040). Only differing non-empty content violates;
95
+ whitespace-only counts as empty.
96
+ - **rs#26**: a NILLED element has neither character nor element
97
+ content — the content model is not applied
98
+ (particlesIa002/QFE1700g2). Attributes are unaffected and still
99
+ validate.
100
+ - **rs#27**: temporal enumeration compares by VALUE, not
101
+ lexically — dateTime by instant (App. E: `+00:00` equals `Z` of
102
+ the same instant), time/date/gMonth normalize only the
103
+ zero-timezone spellings (the timezone is part of the value).
104
+ - **rs#28**: `-0` is a valid nonNegativeInteger lexical (§3.3.20:
105
+ zero may carry a negative sign); positiveInteger keeps
106
+ excluding it.
107
+ - **rs#29**: whiteSpace=collapse is FIXED on every builtin except
108
+ string (preserve) and normalizedString (replace) — the xsi:type
109
+ override path now collapses integer content like the declared
110
+ path (elemZ002).
111
+
112
+ All fixes are red-first in the test suite (158 XSD specs green in
113
+ both the utf8proc and no-utf8proc configs) and verified against
114
+ the vendored W3C corpus documents; rng/sch/dtd/xpath/libxslt
115
+ suites unchanged (204 + 1 standing skip).
15
116
 
16
117
 
17
118
 
@@ -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.404
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++;
@@ -191,6 +191,8 @@ static void xsd_cm_free(XsdCm* cm) {
191
191
  free(cm->not_qname);
192
192
  free(cm->any_unit_tns);
193
193
  free(cm->text_type);
194
+ free(cm->fixed_value);
195
+ free(cm->default_value);
194
196
  free(cm);
195
197
  cm = next;
196
198
  }
@@ -279,6 +281,13 @@ static XsdCm* xsd_cm_parse(struct leptris_xsd_schema* s,
279
281
  if (xsd_capture_inline(s, e, synth))
280
282
  cm->type = xsd_strdup(synth);
281
283
  }
284
+ /* leptris-rs#35 (isDefault005): particle value
285
+ * constraints — an empty child is satisfied BY its
286
+ * fixed/default value (§3.12.2). */
287
+ cm->fixed_value = xsd_strdup(
288
+ leptris_element_attribute(e, "fixed"));
289
+ cm->default_value = xsd_strdup(
290
+ leptris_element_attribute(e, "default"));
282
291
  }
283
292
  } else if (strcmp(local, "group") == 0) {
284
293
  /* <xs:group ref="g"/> — expanded at NFA build so
@@ -2471,6 +2480,9 @@ static void xsd_capture_root(struct leptris_xsd_schema* s,
2471
2480
  d->fixed = xsd_strdup(
2472
2481
  leptris_element_attribute((LeptrisElement)n,
2473
2482
  "fixed"));
2483
+ d->default_value = xsd_strdup(
2484
+ leptris_element_attribute((LeptrisElement)n,
2485
+ "default"));
2474
2486
  const char* sg = leptris_element_attribute(
2475
2487
  (LeptrisElement)n, "substitutionGroup");
2476
2488
  if (sg) {
@@ -2509,6 +2521,9 @@ static void xsd_capture_root(struct leptris_xsd_schema* s,
2509
2521
  d->fixed = xsd_strdup(
2510
2522
  leptris_element_attribute((LeptrisElement)n,
2511
2523
  "fixed"));
2524
+ d->default_value = xsd_strdup(
2525
+ leptris_element_attribute((LeptrisElement)n,
2526
+ "default"));
2512
2527
  const char* sg = leptris_element_attribute(
2513
2528
  (LeptrisElement)n, "substitutionGroup");
2514
2529
  if (sg) {
@@ -2706,6 +2721,7 @@ LEPTRIS_API void leptris_xsd_free(LeptrisXsdSchema schema) {
2706
2721
  free(d->name);
2707
2722
  free(d->type);
2708
2723
  free(d->fixed);
2724
+ free(d->default_value);
2709
2725
  free(d->sub_head);
2710
2726
  free(d);
2711
2727
  d = dn;
@@ -2922,6 +2938,10 @@ static XsdCm* xsd_capture_complex_model(struct leptris_xsd_schema* s,
2922
2938
  const char* name) {
2923
2939
  XsdCm* root = xsd_cm_new(XSD_CM_SEQ); /* wrapper keeps the name */
2924
2940
  if (!root) return NULL;
2941
+ /* leptris-rs#35 (ctA033, idF025's inline c): mixed="true" admits
2942
+ * character data even with no particle model — the flag must
2943
+ * survive capture or the validator treats the type as empty. */
2944
+ root->mixed = xsd_mixed_flag(ct);
2925
2945
  XsdAttrDecl* attrs = NULL;
2926
2946
  char* any_attr_ns = NULL;
2927
2947
  char* any_attr_not_qname = NULL;