leptris 1.9.201.0-arm-linux → 1.9.201.2-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 (1535) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/Rakefile +52 -12
  4. data/ext/leptris/native/extconf.rb +85 -0
  5. data/ext/leptris/native/native.c +1 -1
  6. data/lib/leptris/version.rb +1 -1
  7. data/lib/leptris/xml/ffi.rb +13 -0
  8. data/lib/leptris/xml/native.so +0 -0
  9. data/vendor-src/libleptris/CHANGELOG.md +8080 -0
  10. data/vendor-src/libleptris/CLAUDE.md +150 -0
  11. data/vendor-src/libleptris/CMakeLists.txt +379 -0
  12. data/vendor-src/libleptris/CMakePresets.json +61 -0
  13. data/vendor-src/libleptris/CODE_OF_CONDUCT.md +132 -0
  14. data/vendor-src/libleptris/CONTEXT.md +49 -0
  15. data/vendor-src/libleptris/LICENSE.md +33 -0
  16. data/vendor-src/libleptris/README.adoc +1197 -0
  17. data/vendor-src/libleptris/TODO.assemble/README.md +16 -0
  18. data/vendor-src/libleptris/TODO.bindings/01-mutation-construction.md +18 -0
  19. data/vendor-src/libleptris/TODO.bindings/02-incremental-iterparse.md +15 -0
  20. data/vendor-src/libleptris/TODO.bindings/03-compiled-xpath.md +15 -0
  21. data/vendor-src/libleptris/TODO.bindings/04-pull-stax-api.md +14 -0
  22. data/vendor-src/libleptris/TODO.bindings/05-per-parse-options.md +17 -0
  23. data/vendor-src/libleptris/TODO.bindings/06-serialize-encoding-guarantees.md +14 -0
  24. data/vendor-src/libleptris/TODO.bindings/README.md +36 -0
  25. data/vendor-src/libleptris/TODO.concurrency/01-thread-safe-errors.md +19 -0
  26. data/vendor-src/libleptris/TODO.concurrency/02-export-surface-gate.md +24 -0
  27. data/vendor-src/libleptris/TODO.concurrency/03-mixed-nodeset-batch.md +14 -0
  28. data/vendor-src/libleptris/TODO.concurrency/04-canonical-status-message.md +13 -0
  29. data/vendor-src/libleptris/TODO.concurrency/05-windows-dll-name.md +10 -0
  30. data/vendor-src/libleptris/TODO.concurrency/06-exslt-pack.md +26 -0
  31. data/vendor-src/libleptris/TODO.concurrency/07-ns-set-pairs.md +11 -0
  32. data/vendor-src/libleptris/TODO.concurrency/08-threading-contract.md +45 -0
  33. data/vendor-src/libleptris/TODO.engine/01-file-sources.md +11 -0
  34. data/vendor-src/libleptris/TODO.engine/02-compiled-contexts.md +10 -0
  35. data/vendor-src/libleptris/TODO.engine/03-rust-publish.md +9 -0
  36. data/vendor-src/libleptris/TODO.engine/04-ruby-release-input.md +8 -0
  37. data/vendor-src/libleptris/TODO.engine/05-todo-md-refresh.md +7 -0
  38. data/vendor-src/libleptris/TODO.engine/README.md +16 -0
  39. data/vendor-src/libleptris/TODO.hygiene/README.md +15 -0
  40. data/vendor-src/libleptris/TODO.max-perf/00-INDEX.md +22 -0
  41. data/vendor-src/libleptris/TODO.max-perf/1-simd-html-scanner.md +15 -0
  42. data/vendor-src/libleptris/TODO.max-perf/10-moxml-plan-followups.md +9 -0
  43. data/vendor-src/libleptris/TODO.max-perf/2-compiled-dispatch-tokenizer.md +8 -0
  44. data/vendor-src/libleptris/TODO.max-perf/3-iterparse-fixed-cost.md +5 -0
  45. data/vendor-src/libleptris/TODO.max-perf/4-compact-node-micro-opts.md +17 -0
  46. data/vendor-src/libleptris/TODO.max-perf/5-xslt-bench-profiling-rounds.md +13 -0
  47. data/vendor-src/libleptris/TODO.max-perf/6-language-tails.md +9 -0
  48. data/vendor-src/libleptris/TODO.max-perf/7-validate-bindings.md +6 -0
  49. data/vendor-src/libleptris/TODO.max-perf/8-native-xml-diff-consumer.md +5 -0
  50. data/vendor-src/libleptris/TODO.max-perf/9-prebuilt-gem-matrix.md +14 -0
  51. data/vendor-src/libleptris/TODO.md +33 -0
  52. data/vendor-src/libleptris/TODO.transform/README.md +39 -0
  53. data/vendor-src/libleptris/TODO.validate/README.md +32 -0
  54. data/vendor-src/libleptris/TODO.xpath2/README.md +91 -0
  55. data/vendor-src/libleptris/TODO.xslt-full/01-xpath-fn-sequences.md +27 -0
  56. data/vendor-src/libleptris/TODO.xslt-full/02-xpath-fn-regex.md +13 -0
  57. data/vendor-src/libleptris/TODO.xslt-full/03-xpath-fn-math.md +10 -0
  58. data/vendor-src/libleptris/TODO.xslt-full/04-xpath-fn-strings-qname-uri.md +97 -0
  59. data/vendor-src/libleptris/TODO.xslt-full/05-xpath-fn-dates.md +30 -0
  60. data/vendor-src/libleptris/TODO.xslt-full/06-xpath-grammar-3x.md +83 -0
  61. data/vendor-src/libleptris/TODO.xslt-full/07-xpath-function-items.md +124 -0
  62. data/vendor-src/libleptris/TODO.xslt-full/08-xpath-maps-arrays.md +79 -0
  63. data/vendor-src/libleptris/TODO.xslt-full/09-xslt-noop-fillins.md +35 -0
  64. data/vendor-src/libleptris/TODO.xslt-full/10-xslt-tunnel-params.md +9 -0
  65. data/vendor-src/libleptris/TODO.xslt-full/11-xquery-core.md +119 -0
  66. data/vendor-src/libleptris/TODO.xslt-full/12-xquery-31.md +65 -0
  67. data/vendor-src/libleptris/TODO.xslt-full/13-perf-inprocess.md +425 -0
  68. data/vendor-src/libleptris/TODO.xslt-full/14-html-mode.md +803 -0
  69. data/vendor-src/libleptris/TODO.xslt-full/15-binding-entries.md +19 -0
  70. data/vendor-src/libleptris/TODO.xslt-full/16-schematron.md +156 -0
  71. data/vendor-src/libleptris/TODO.xslt-full/17-xml-diff.md +52 -0
  72. data/vendor-src/libleptris/TODO.xslt-full/18-compact-nodes.md +278 -0
  73. data/vendor-src/libleptris/TODO.xslt-full/README.md +26 -0
  74. data/vendor-src/libleptris/TODO.xslt-full/REMAINING.md +163 -0
  75. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/00-triage.md +171 -0
  76. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/01-fragment-nodes.md +19 -0
  77. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/02-root-node-semantics.md +34 -0
  78. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/03-crashes.md +15 -0
  79. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/04-namespaces.md +14 -0
  80. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/05-number-attrset-sort.md +13 -0
  81. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/06-document-chains.md +10 -0
  82. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/07-charef-serializer.md +9 -0
  83. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/08-perf-gate.md +8 -0
  84. data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/09-release.md +14 -0
  85. data/vendor-src/libleptris/VALIDATION.md +151 -0
  86. data/vendor-src/libleptris/benchmarks/CMakeLists.txt +259 -0
  87. data/vendor-src/libleptris/benchmarks/README.adoc +228 -0
  88. data/vendor-src/libleptris/benchmarks/README.md +212 -0
  89. data/vendor-src/libleptris/benchmarks/common/benchmark.c +252 -0
  90. data/vendor-src/libleptris/benchmarks/common/benchmark.h +77 -0
  91. data/vendor-src/libleptris/benchmarks/common/test_data.c +415 -0
  92. data/vendor-src/libleptris/benchmarks/common/test_data.h +18 -0
  93. data/vendor-src/libleptris/benchmarks/comprehensive/CMakeLists.txt +184 -0
  94. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_decomp.cpp +110 -0
  95. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_first_access.cpp +261 -0
  96. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_many_attrs.cpp +150 -0
  97. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_memory.cpp +185 -0
  98. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_parse.cpp +270 -0
  99. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_parse_ops.cpp +392 -0
  100. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_sax.c +106 -0
  101. data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_write.cpp +351 -0
  102. data/vendor-src/libleptris/benchmarks/data/attrs.xml +303 -0
  103. data/vendor-src/libleptris/benchmarks/data/cdata_test.xml +13 -0
  104. data/vendor-src/libleptris/benchmarks/data/comment_test.xml +15 -0
  105. data/vendor-src/libleptris/benchmarks/data/deep.xml +205 -0
  106. data/vendor-src/libleptris/benchmarks/data/generate_attrs.rb +22 -0
  107. data/vendor-src/libleptris/benchmarks/data/generate_deep.rb +25 -0
  108. data/vendor-src/libleptris/benchmarks/data/generate_large.rb +33 -0
  109. data/vendor-src/libleptris/benchmarks/data/generate_wide.rb +18 -0
  110. data/vendor-src/libleptris/benchmarks/data/large.xml +21003 -0
  111. data/vendor-src/libleptris/benchmarks/data/large_workflow.xml +4003 -0
  112. data/vendor-src/libleptris/benchmarks/data/medium.xml +67 -0
  113. data/vendor-src/libleptris/benchmarks/data/medium_workflow.xml +353 -0
  114. data/vendor-src/libleptris/benchmarks/data/pi_test.xml +9 -0
  115. data/vendor-src/libleptris/benchmarks/data/small.xml +10 -0
  116. data/vendor-src/libleptris/benchmarks/data/small_workflow.xml +36 -0
  117. data/vendor-src/libleptris/benchmarks/data/wide.xml +5003 -0
  118. data/vendor-src/libleptris/benchmarks/dom/bench_document_lifecycle.c +69 -0
  119. data/vendor-src/libleptris/benchmarks/dom/bench_leptris.c +184 -0
  120. data/vendor-src/libleptris/benchmarks/dom/bench_libxml2.c +176 -0
  121. data/vendor-src/libleptris/benchmarks/dom/bench_text_borrowed.c +74 -0
  122. data/vendor-src/libleptris/benchmarks/dom/dom_benchmark_v2.cpp +314 -0
  123. data/vendor-src/libleptris/benchmarks/fixtures/large.xml +4003 -0
  124. data/vendor-src/libleptris/benchmarks/fixtures/large_catalog.xml +50003 -0
  125. data/vendor-src/libleptris/benchmarks/fixtures/libxml2/eve.xml +6 -0
  126. data/vendor-src/libleptris/benchmarks/fixtures/libxml2/slashdot.rdf +66 -0
  127. data/vendor-src/libleptris/benchmarks/fixtures/libxml2/wap.xml +27 -0
  128. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/4rects.xml +11 -0
  129. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/a-valid.xml +10 -0
  130. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/a-wf.xml +9 -0
  131. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/bike.xml +41 -0
  132. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/circle.xml +11 -0
  133. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/defs.xml +14 -0
  134. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/desc.xml +14 -0
  135. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/ellipse.xml +10 -0
  136. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/flower2.xml +44 -0
  137. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/gradient.xml +16 -0
  138. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group01.xml +15 -0
  139. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group02.xml +13 -0
  140. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group03.xml +13 -0
  141. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/image-valid.xml +11 -0
  142. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/image-wf.xml +11 -0
  143. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/lin-gradient.xml +16 -0
  144. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/marker.xml +28 -0
  145. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/mask.xml +13 -0
  146. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/mathswitch.xml +32 -0
  147. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/parentns.xml +12 -0
  148. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/path01.xml +5 -0
  149. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/path02.xml +10 -0
  150. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/patternfill.xml +12 -0
  151. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/polyline.xml +9 -0
  152. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/private.xml +19 -0
  153. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/rad-gradient.xml +17 -0
  154. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/rectangle.xml +10 -0
  155. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/richdesc.xml +12 -0
  156. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/script.xml +13 -0
  157. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/structure01.xml +10 -0
  158. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/style.xml +11 -0
  159. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/switch.xml +21 -0
  160. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/symbol-use.xml +28 -0
  161. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/template.xml +9 -0
  162. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text01.xml +12 -0
  163. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text02.xml +17 -0
  164. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text03.xml +8 -0
  165. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/toap01.xml +10 -0
  166. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/toap02.xml +33 -0
  167. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/transform.xml +26 -0
  168. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/trivial.xml +6 -0
  169. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/twin-gradients.xml +19 -0
  170. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/v-template.xml +9 -0
  171. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport-nest.xml +13 -0
  172. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport-transform.xml +46 -0
  173. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport.xml +11 -0
  174. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/wf-template.xml +7 -0
  175. data/vendor-src/libleptris/benchmarks/fixtures/libxml2_xsdtest.xml +5286 -0
  176. data/vendor-src/libleptris/benchmarks/fixtures/medium.xml +403 -0
  177. data/vendor-src/libleptris/benchmarks/fixtures/medium_catalog.xml +3003 -0
  178. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/empty.xml +0 -0
  179. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/large.xml +1 -0
  180. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/latintest_latin1.xml +1 -0
  181. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/latintest_utf8.xml +1 -0
  182. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/multiline.xml +3 -0
  183. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/small.xml +1 -0
  184. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/truncation.xml +19 -0
  185. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be.xml +0 -0
  186. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_bom.xml +0 -0
  187. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_clean.xml +0 -0
  188. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_nodecl.xml +0 -0
  189. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le.xml +0 -0
  190. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_bom.xml +0 -0
  191. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_clean.xml +0 -0
  192. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_nodecl.xml +0 -0
  193. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be.xml +0 -0
  194. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_bom.xml +0 -0
  195. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_clean.xml +0 -0
  196. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_nodecl.xml +0 -0
  197. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le.xml +0 -0
  198. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_bom.xml +0 -0
  199. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_clean.xml +0 -0
  200. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_nodecl.xml +0 -0
  201. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8.xml +87 -0
  202. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_bom.xml +87 -0
  203. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_clean.xml +84 -0
  204. data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_nodecl.xml +86 -0
  205. data/vendor-src/libleptris/benchmarks/fixtures/pugixml//321/202/320/265/321/201/321/202.xml +1 -0
  206. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/empty.xml +0 -0
  207. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/large.xml +1 -0
  208. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/latintest_latin1.xml +1 -0
  209. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/latintest_utf8.xml +1 -0
  210. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/multiline.xml +3 -0
  211. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/small.xml +1 -0
  212. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/truncation.xml +19 -0
  213. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be.xml +0 -0
  214. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_bom.xml +0 -0
  215. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_clean.xml +0 -0
  216. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_nodecl.xml +0 -0
  217. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le.xml +0 -0
  218. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_bom.xml +0 -0
  219. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_clean.xml +0 -0
  220. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_nodecl.xml +0 -0
  221. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be.xml +0 -0
  222. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_bom.xml +0 -0
  223. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_clean.xml +0 -0
  224. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_nodecl.xml +0 -0
  225. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le.xml +0 -0
  226. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_bom.xml +0 -0
  227. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_clean.xml +0 -0
  228. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_nodecl.xml +0 -0
  229. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8.xml +87 -0
  230. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_bom.xml +87 -0
  231. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_clean.xml +84 -0
  232. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_nodecl.xml +86 -0
  233. data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests//321/202/320/265/321/201/321/202.xml +1 -0
  234. data/vendor-src/libleptris/benchmarks/fixtures/small.xml +38 -0
  235. data/vendor-src/libleptris/benchmarks/html/bench_html_parse.c +111 -0
  236. data/vendor-src/libleptris/benchmarks/html/gen_nokogiri_reference.rb +112 -0
  237. data/vendor-src/libleptris/benchmarks/html/nokogiri_html_parse.rb +64 -0
  238. data/vendor-src/libleptris/benchmarks/matrix/README.md +71 -0
  239. data/vendor-src/libleptris/benchmarks/matrix/bench2html.rb +316 -0
  240. data/vendor-src/libleptris/benchmarks/matrix/bench_matrix.cpp +724 -0
  241. data/vendor-src/libleptris/benchmarks/modification/bench_leptris_modify.c +211 -0
  242. data/vendor-src/libleptris/benchmarks/modification/bench_node_creation.c +130 -0
  243. data/vendor-src/libleptris/benchmarks/results/BENCHMARK_REPORT.md +226 -0
  244. data/vendor-src/libleptris/benchmarks/results/baseline_report.md +219 -0
  245. data/vendor-src/libleptris/benchmarks/results/benchmark_20251223_134550.json +13 -0
  246. data/vendor-src/libleptris/benchmarks/results/benchmark_20260129_225844.json +13 -0
  247. data/vendor-src/libleptris/benchmarks/results/leptris_dom_output.txt +24 -0
  248. data/vendor-src/libleptris/benchmarks/results/leptris_modify.json +36 -0
  249. data/vendor-src/libleptris/benchmarks/results/leptris_modify_optimized.json +36 -0
  250. data/vendor-src/libleptris/benchmarks/results/leptris_modify_session1.json +36 -0
  251. data/vendor-src/libleptris/benchmarks/results/leptris_modify_session2.json +36 -0
  252. data/vendor-src/libleptris/benchmarks/results/leptris_serialize.json +34 -0
  253. data/vendor-src/libleptris/benchmarks/results/leptris_xpath_output.txt +24 -0
  254. data/vendor-src/libleptris/benchmarks/results/libxml2_dom_output.txt +24 -0
  255. data/vendor-src/libleptris/benchmarks/results/libxml2_xpath_output.txt +24 -0
  256. data/vendor-src/libleptris/benchmarks/results/phase16_session2.json +21 -0
  257. data/vendor-src/libleptris/benchmarks/results/phase17.5_session1.json +30 -0
  258. data/vendor-src/libleptris/benchmarks/results/phase17_session1.json +30 -0
  259. data/vendor-src/libleptris/benchmarks/results/pugixml_dom_output.txt +51 -0
  260. data/vendor-src/libleptris/benchmarks/results/xpath_axes_leptris.json +318 -0
  261. data/vendor-src/libleptris/benchmarks/results/xpath_axes_libxml2.json +318 -0
  262. data/vendor-src/libleptris/benchmarks/results/xpath_functions_leptris.json +222 -0
  263. data/vendor-src/libleptris/benchmarks/results/xpath_functions_libxml2.json +222 -0
  264. data/vendor-src/libleptris/benchmarks/sax/bench_iterparse.c +115 -0
  265. data/vendor-src/libleptris/benchmarks/sax/bench_leptris.c +124 -0
  266. data/vendor-src/libleptris/benchmarks/sax/bench_libxml2.c +115 -0
  267. data/vendor-src/libleptris/benchmarks/serialization/bench_leptris_serialize.c +198 -0
  268. data/vendor-src/libleptris/benchmarks/src/benchmark_base.h +175 -0
  269. data/vendor-src/libleptris/benchmarks/twins/mutation_leptris.c +37 -0
  270. data/vendor-src/libleptris/benchmarks/twins/mutation_pugixml.cpp +28 -0
  271. data/vendor-src/libleptris/benchmarks/twins/parse_leptris.c +35 -0
  272. data/vendor-src/libleptris/benchmarks/twins/parse_pugixml.cpp +35 -0
  273. data/vendor-src/libleptris/benchmarks/utils.c +171 -0
  274. data/vendor-src/libleptris/benchmarks/utils.h +70 -0
  275. data/vendor-src/libleptris/benchmarks/workflows/bench_dom_modify.c +325 -0
  276. data/vendor-src/libleptris/benchmarks/workflows/bench_end_to_end.c +529 -0
  277. data/vendor-src/libleptris/benchmarks/xpath/bench_axes.c +411 -0
  278. data/vendor-src/libleptris/benchmarks/xpath/bench_axes_libxml2.c +108 -0
  279. data/vendor-src/libleptris/benchmarks/xpath/bench_diagnostic.c +431 -0
  280. data/vendor-src/libleptris/benchmarks/xpath/bench_functions.c +271 -0
  281. data/vendor-src/libleptris/benchmarks/xpath/bench_functions_libxml2.c +123 -0
  282. data/vendor-src/libleptris/benchmarks/xpath/bench_leptris.c +78 -0
  283. data/vendor-src/libleptris/benchmarks/xpath/bench_libxml2.c +98 -0
  284. data/vendor-src/libleptris/benchmarks/xpath/bench_pugixml.cpp +117 -0
  285. data/vendor-src/libleptris/benchmarks/xpath/bench_scalar_eval.c +86 -0
  286. data/vendor-src/libleptris/benchmarks/xpath/bench_scalar_eval_libxml2.c +70 -0
  287. data/vendor-src/libleptris/benchmarks/xpath/bench_xslt_transform.c +48 -0
  288. data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch.c +52 -0
  289. data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch_heavy.c +82 -0
  290. data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch_pred.c +34 -0
  291. data/vendor-src/libleptris/benchmarks/xslt/bench_subtree_copy.c +55 -0
  292. data/vendor-src/libleptris/benchmarks/xslt/bench_valueof.c +46 -0
  293. data/vendor-src/libleptris/benchmarks/xslt/heavy_lxml.py +48 -0
  294. data/vendor-src/libleptris/benchmarks/xslt/scorecard_lxml.py +169 -0
  295. data/vendor-src/libleptris/bindings/ruby/leptris.gemspec +22 -0
  296. data/vendor-src/libleptris/bindings/ruby/lib/leptris/document.rb +60 -0
  297. data/vendor-src/libleptris/bindings/ruby/lib/leptris/element.rb +86 -0
  298. data/vendor-src/libleptris/bindings/ruby/lib/leptris/error.rb +6 -0
  299. data/vendor-src/libleptris/bindings/ruby/lib/leptris/node.rb +73 -0
  300. data/vendor-src/libleptris/bindings/ruby/lib/leptris/sax.rb +189 -0
  301. data/vendor-src/libleptris/bindings/ruby/lib/leptris/xpath.rb +44 -0
  302. data/vendor-src/libleptris/bindings/ruby/lib/leptris.rb +137 -0
  303. data/vendor-src/libleptris/bindings/ruby/spec/leptris_spec.rb +113 -0
  304. data/vendor-src/libleptris/bindings/ruby/spec/sax_spec.rb +141 -0
  305. data/vendor-src/libleptris/bindings/ruby/spec/spec_helper.rb +7 -0
  306. data/vendor-src/libleptris/bindings/ruby/test_full.rb +21 -0
  307. data/vendor-src/libleptris/bindings/rust/Cargo.lock +7 -0
  308. data/vendor-src/libleptris/bindings/rust/Cargo.toml +13 -0
  309. data/vendor-src/libleptris/bindings/rust/README.md +61 -0
  310. data/vendor-src/libleptris/bindings/rust/build.rs +74 -0
  311. data/vendor-src/libleptris/bindings/rust/src/ffi.rs +204 -0
  312. data/vendor-src/libleptris/bindings/rust/src/lib.rs +580 -0
  313. data/vendor-src/libleptris/bindings/rust/tests/integration.rs +156 -0
  314. data/vendor-src/libleptris/cli/ARCHITECTURE_REVIEW.md +514 -0
  315. data/vendor-src/libleptris/cli/CLI_ARCHITECTURE.md +851 -0
  316. data/vendor-src/libleptris/cli/CMakeLists.txt +46 -0
  317. data/vendor-src/libleptris/cli/cli.c +115 -0
  318. data/vendor-src/libleptris/cli/cli.h +232 -0
  319. data/vendor-src/libleptris/cli/commands/diff.c +208 -0
  320. data/vendor-src/libleptris/cli/commands/format.c +379 -0
  321. data/vendor-src/libleptris/cli/commands/parse.c +343 -0
  322. data/vendor-src/libleptris/cli/commands/validate.c +284 -0
  323. data/vendor-src/libleptris/cli/commands/version.c +49 -0
  324. data/vendor-src/libleptris/cli/commands/xpath.c +428 -0
  325. data/vendor-src/libleptris/cli/commands/xquery.c +188 -0
  326. data/vendor-src/libleptris/cli/completion/leptris.bash +86 -0
  327. data/vendor-src/libleptris/cli/completion/leptris.zsh +74 -0
  328. data/vendor-src/libleptris/cli/error.c +394 -0
  329. data/vendor-src/libleptris/cli/error.h +360 -0
  330. data/vendor-src/libleptris/cli/leptris +0 -0
  331. data/vendor-src/libleptris/cli/main.c +127 -0
  332. data/vendor-src/libleptris/cli/man/leptris-format.1.adoc +226 -0
  333. data/vendor-src/libleptris/cli/man/leptris-parse.1.adoc +213 -0
  334. data/vendor-src/libleptris/cli/man/leptris-xpath.1.adoc +479 -0
  335. data/vendor-src/libleptris/cli/man/leptris.1.adoc +192 -0
  336. data/vendor-src/libleptris/cli/options.c +451 -0
  337. data/vendor-src/libleptris/cli/options.h +378 -0
  338. data/vendor-src/libleptris/cli/output.c +841 -0
  339. data/vendor-src/libleptris/cli/output.h +361 -0
  340. data/vendor-src/libleptris/cmake/FindUtf8proc.cmake +56 -0
  341. data/vendor-src/libleptris/cmake/leptris-config.cmake.in +14 -0
  342. data/vendor-src/libleptris/cmake/leptris.pc.in +11 -0
  343. data/vendor-src/libleptris/cmake/modules/AdocMan.cmake +132 -0
  344. data/vendor-src/libleptris/docs/ARCHITECTURE_REVIEW.md +280 -0
  345. data/vendor-src/libleptris/docs/Doxyfile +47 -0
  346. data/vendor-src/libleptris/docs/FFI.md +165 -0
  347. data/vendor-src/libleptris/docs/README.md +47 -0
  348. data/vendor-src/libleptris/docs/ROADMAP-SAXON-PARITY.md +194 -0
  349. data/vendor-src/libleptris/docs/guide/building.md +199 -0
  350. data/vendor-src/libleptris/docs/guide/getting-started.md +134 -0
  351. data/vendor-src/libleptris/docs/guide/parsing.md +315 -0
  352. data/vendor-src/libleptris/docs/guide/xpath-queries.md +444 -0
  353. data/vendor-src/libleptris/examples/c/CMakeLists.txt +58 -0
  354. data/vendor-src/libleptris/examples/c/README.md +345 -0
  355. data/vendor-src/libleptris/examples/c/basic_example.c +80 -0
  356. data/vendor-src/libleptris/examples/c/dom_traversal_example.c +58 -0
  357. data/vendor-src/libleptris/examples/c/error_handling_example.c +121 -0
  358. data/vendor-src/libleptris/examples/c/namespace_example.c +49 -0
  359. data/vendor-src/libleptris/examples/c/xpath_example.c +74 -0
  360. data/vendor-src/libleptris/ports/leptris/portfile.cmake +41 -0
  361. data/vendor-src/libleptris/ports/leptris/usage +28 -0
  362. data/vendor-src/libleptris/scripts/check_dll_exports.py +54 -0
  363. data/vendor-src/libleptris/scripts/check_export_surface.py +84 -0
  364. data/vendor-src/libleptris/scripts/check_ffi_mirrors.py +163 -0
  365. data/vendor-src/libleptris/scripts/check_formatting.sh +30 -0
  366. data/vendor-src/libleptris/scripts/check_shared_exports.sh +120 -0
  367. data/vendor-src/libleptris/scripts/check_trailing_whitespace.sh +18 -0
  368. data/vendor-src/libleptris/scripts/gen-api-docs.sh +31 -0
  369. data/vendor-src/libleptris/scripts/run_static_analysis.sh +16 -0
  370. data/vendor-src/libleptris/scripts/validate.sh +199 -0
  371. data/vendor-src/libleptris/scripts/xslt_triage.sh +72 -0
  372. data/vendor-src/libleptris/src/CMakeLists.txt +597 -0
  373. data/vendor-src/libleptris/src/include/leptris/descriptor.h +178 -0
  374. data/vendor-src/libleptris/src/include/leptris/dom/document.h +213 -0
  375. data/vendor-src/libleptris/src/include/leptris/dom/element.h +435 -0
  376. data/vendor-src/libleptris/src/include/leptris/dom/serialize.h +133 -0
  377. data/vendor-src/libleptris/src/include/leptris/dtd.h +178 -0
  378. data/vendor-src/libleptris/src/include/leptris/error.h +97 -0
  379. data/vendor-src/libleptris/src/include/leptris/sax/sax.h +584 -0
  380. data/vendor-src/libleptris/src/include/leptris/types.h +386 -0
  381. data/vendor-src/libleptris/src/include/leptris/xpath/xpath.h +250 -0
  382. data/vendor-src/libleptris/src/include/leptris/xquery/xquery.h +80 -0
  383. data/vendor-src/libleptris/src/include/leptris.h +3701 -0
  384. data/vendor-src/libleptris/src/leptris/chartype.h +124 -0
  385. data/vendor-src/libleptris/src/leptris/common/chartype.c +90 -0
  386. data/vendor-src/libleptris/src/leptris/common/chartype.h +44 -0
  387. data/vendor-src/libleptris/src/leptris/common/cpu.c +40 -0
  388. data/vendor-src/libleptris/src/leptris/common/cpu.h +63 -0
  389. data/vendor-src/libleptris/src/leptris/common/entities.c +329 -0
  390. data/vendor-src/libleptris/src/leptris/common/entities.h +79 -0
  391. data/vendor-src/libleptris/src/leptris/common/format_number.c +273 -0
  392. data/vendor-src/libleptris/src/leptris/common/format_number.h +29 -0
  393. data/vendor-src/libleptris/src/leptris/common/port.h +171 -0
  394. data/vendor-src/libleptris/src/leptris/common/simd_text.c +237 -0
  395. data/vendor-src/libleptris/src/leptris/common/simd_text.h +104 -0
  396. data/vendor-src/libleptris/src/leptris/common/simd_text_avx2.c +105 -0
  397. data/vendor-src/libleptris/src/leptris/common/simd_text_neon.c +280 -0
  398. data/vendor-src/libleptris/src/leptris/common/string_view.c +204 -0
  399. data/vendor-src/libleptris/src/leptris/common/string_view.h +68 -0
  400. data/vendor-src/libleptris/src/leptris/common/types_internal.h +31 -0
  401. data/vendor-src/libleptris/src/leptris/core.c +201 -0
  402. data/vendor-src/libleptris/src/leptris/descriptor/plan.c +527 -0
  403. data/vendor-src/libleptris/src/leptris/diff/diff.c +491 -0
  404. data/vendor-src/libleptris/src/leptris/dom/cdata.c +47 -0
  405. data/vendor-src/libleptris/src/leptris/dom/cdata.h +73 -0
  406. data/vendor-src/libleptris/src/leptris/dom/comment.c +48 -0
  407. data/vendor-src/libleptris/src/leptris/dom/comment.h +74 -0
  408. data/vendor-src/libleptris/src/leptris/dom/compact.c +397 -0
  409. data/vendor-src/libleptris/src/leptris/dom/compact.h +307 -0
  410. data/vendor-src/libleptris/src/leptris/dom/diag.c +58 -0
  411. data/vendor-src/libleptris/src/leptris/dom/diag.h +75 -0
  412. data/vendor-src/libleptris/src/leptris/dom/digest.c +255 -0
  413. data/vendor-src/libleptris/src/leptris/dom/doctype.c +137 -0
  414. data/vendor-src/libleptris/src/leptris/dom/doctype.h +52 -0
  415. data/vendor-src/libleptris/src/leptris/dom/document_node.c +13 -0
  416. data/vendor-src/libleptris/src/leptris/dom/document_node.h +21 -0
  417. data/vendor-src/libleptris/src/leptris/dom/edges.h +60 -0
  418. data/vendor-src/libleptris/src/leptris/dom/element.c +1114 -0
  419. data/vendor-src/libleptris/src/leptris/dom/element.h +1109 -0
  420. data/vendor-src/libleptris/src/leptris/dom/element_index.c +444 -0
  421. data/vendor-src/libleptris/src/leptris/dom/element_index.h +135 -0
  422. data/vendor-src/libleptris/src/leptris/dom/element_modify.c +2185 -0
  423. data/vendor-src/libleptris/src/leptris/dom/element_query.c +1468 -0
  424. data/vendor-src/libleptris/src/leptris/dom/entity_ref.c +57 -0
  425. data/vendor-src/libleptris/src/leptris/dom/entity_ref.h +70 -0
  426. data/vendor-src/libleptris/src/leptris/dom/node.c +420 -0
  427. data/vendor-src/libleptris/src/leptris/dom/node.h +170 -0
  428. data/vendor-src/libleptris/src/leptris/dom/node_public.c +937 -0
  429. data/vendor-src/libleptris/src/leptris/dom/node_vtable.c +138 -0
  430. data/vendor-src/libleptris/src/leptris/dom/pi.c +70 -0
  431. data/vendor-src/libleptris/src/leptris/dom/pi.h +80 -0
  432. data/vendor-src/libleptris/src/leptris/dom/root_doc_map.c +310 -0
  433. data/vendor-src/libleptris/src/leptris/dom/root_doc_map.h +30 -0
  434. data/vendor-src/libleptris/src/leptris/dom/text.c +157 -0
  435. data/vendor-src/libleptris/src/leptris/dom/text.h +119 -0
  436. data/vendor-src/libleptris/src/leptris/dtd/content_check.c +300 -0
  437. data/vendor-src/libleptris/src/leptris/dtd/model.c +533 -0
  438. data/vendor-src/libleptris/src/leptris/dtd/model.h +354 -0
  439. data/vendor-src/libleptris/src/leptris/dtd/parser.c +827 -0
  440. data/vendor-src/libleptris/src/leptris/dtd/resolver.c +354 -0
  441. data/vendor-src/libleptris/src/leptris/dtd/validator.c +668 -0
  442. data/vendor-src/libleptris/src/leptris/encoding/encoders.c +346 -0
  443. data/vendor-src/libleptris/src/leptris/encoding/encoders.h +61 -0
  444. data/vendor-src/libleptris/src/leptris/encoding/encoding.c +451 -0
  445. data/vendor-src/libleptris/src/leptris/encoding/encoding.h +118 -0
  446. data/vendor-src/libleptris/src/leptris/encoding/unicode.c +317 -0
  447. data/vendor-src/libleptris/src/leptris/encoding/unicode.h +64 -0
  448. data/vendor-src/libleptris/src/leptris/encoding/utf16.c +204 -0
  449. data/vendor-src/libleptris/src/leptris/encoding/utf16.h +78 -0
  450. data/vendor-src/libleptris/src/leptris/encoding/wrapper.c +243 -0
  451. data/vendor-src/libleptris/src/leptris/error.c +134 -0
  452. data/vendor-src/libleptris/src/leptris/flat/direct_parse.c +1935 -0
  453. data/vendor-src/libleptris/src/leptris/flat/direct_parse.h +41 -0
  454. data/vendor-src/libleptris/src/leptris/html/html_parse.c +8040 -0
  455. data/vendor-src/libleptris/src/leptris/leptris.c +1264 -0
  456. data/vendor-src/libleptris/src/leptris/leptris_internal.h +910 -0
  457. data/vendor-src/libleptris/src/leptris/leptris_memory.c +179 -0
  458. data/vendor-src/libleptris/src/leptris/leptris_memory.h +180 -0
  459. data/vendor-src/libleptris/src/leptris/leptris_parse.h +195 -0
  460. data/vendor-src/libleptris/src/leptris/memory/arena.c +243 -0
  461. data/vendor-src/libleptris/src/leptris/memory/arena.h +93 -0
  462. data/vendor-src/libleptris/src/leptris/memory/pool.c +1055 -0
  463. data/vendor-src/libleptris/src/leptris/memory/pool.h +426 -0
  464. data/vendor-src/libleptris/src/leptris/rng/parse.c +814 -0
  465. data/vendor-src/libleptris/src/leptris/rng/rng_internal.h +112 -0
  466. data/vendor-src/libleptris/src/leptris/rng/rng_public.c +159 -0
  467. data/vendor-src/libleptris/src/leptris/rng/rng_regex.c +453 -0
  468. data/vendor-src/libleptris/src/leptris/rng/validate.c +1923 -0
  469. data/vendor-src/libleptris/src/leptris/sax/iterparse.c +435 -0
  470. data/vendor-src/libleptris/src/leptris/sax/parser.c +105 -0
  471. data/vendor-src/libleptris/src/leptris/sax/pull.c +489 -0
  472. data/vendor-src/libleptris/src/leptris/sax/recorder.c +252 -0
  473. data/vendor-src/libleptris/src/leptris/sax/sax_internal.h +163 -0
  474. data/vendor-src/libleptris/src/leptris/sax/streaming.c +1469 -0
  475. data/vendor-src/libleptris/src/leptris/sch/schematron.c +1588 -0
  476. data/vendor-src/libleptris/src/leptris/serialize/c14n.c +1143 -0
  477. data/vendor-src/libleptris/src/leptris/serialize/serialize.c +2333 -0
  478. data/vendor-src/libleptris/src/leptris/serialize/serialize.h +188 -0
  479. data/vendor-src/libleptris/src/leptris/simd_helpers.h +447 -0
  480. data/vendor-src/libleptris/src/leptris/unicode/unicode.c +237 -0
  481. data/vendor-src/libleptris/src/leptris/unicode/unicode.h +113 -0
  482. data/vendor-src/libleptris/src/leptris/xinclude/xinclude.c +794 -0
  483. data/vendor-src/libleptris/src/leptris/xpath/bytecode.h +229 -0
  484. data/vendor-src/libleptris/src/leptris/xpath/compiler.c +1478 -0
  485. data/vendor-src/libleptris/src/leptris/xpath/evaluator.c +1099 -0
  486. data/vendor-src/libleptris/src/leptris/xpath/evaluator.h +189 -0
  487. data/vendor-src/libleptris/src/leptris/xpath/evaluator_axes.c +787 -0
  488. data/vendor-src/libleptris/src/leptris/xpath/evaluator_internal.h +112 -0
  489. data/vendor-src/libleptris/src/leptris/xpath/evaluator_operators.c +2138 -0
  490. data/vendor-src/libleptris/src/leptris/xpath/evaluator_path.c +1312 -0
  491. data/vendor-src/libleptris/src/leptris/xpath/evaluator_types.c +294 -0
  492. data/vendor-src/libleptris/src/leptris/xpath/functions.c +2544 -0
  493. data/vendor-src/libleptris/src/leptris/xpath/functions.h +161 -0
  494. data/vendor-src/libleptris/src/leptris/xpath/functions_exslt.c +545 -0
  495. data/vendor-src/libleptris/src/leptris/xpath/functions_ext31.c +4316 -0
  496. data/vendor-src/libleptris/src/leptris/xpath/lexer.c +636 -0
  497. data/vendor-src/libleptris/src/leptris/xpath/lexer.h +25 -0
  498. data/vendor-src/libleptris/src/leptris/xpath/parser.c +2992 -0
  499. data/vendor-src/libleptris/src/leptris/xpath/parser.h +28 -0
  500. data/vendor-src/libleptris/src/leptris/xpath/vm.c +2903 -0
  501. data/vendor-src/libleptris/src/leptris/xpath/xpath_ast_cache.c +319 -0
  502. data/vendor-src/libleptris/src/leptris/xpath/xpath_compiled.c +263 -0
  503. data/vendor-src/libleptris/src/leptris/xpath/xpath_internal.h +134 -0
  504. data/vendor-src/libleptris/src/leptris/xpath/xpath_public.c +1139 -0
  505. data/vendor-src/libleptris/src/leptris/xpath/xpath_variables.c +410 -0
  506. data/vendor-src/libleptris/src/leptris/xpath/xpath_variables.h +230 -0
  507. data/vendor-src/libleptris/src/leptris/xquery/xquery.c +2641 -0
  508. data/vendor-src/libleptris/src/leptris/xslt/xslt_exec.c +4887 -0
  509. data/vendor-src/libleptris/src/leptris/xslt/xslt_functions.c +1612 -0
  510. data/vendor-src/libleptris/src/leptris/xslt/xslt_internal.h +862 -0
  511. data/vendor-src/libleptris/src/leptris/xslt/xslt_parse.c +2418 -0
  512. data/vendor-src/libleptris/src/leptris/xslt/xslt_pattern.c +441 -0
  513. data/vendor-src/libleptris/src/leptris/xslt/xslt_public.c +710 -0
  514. data/vendor-src/libleptris/src/leptris.symvers +16 -0
  515. data/vendor-src/libleptris/src/man/libleptris.5.adoc +961 -0
  516. data/vendor-src/libleptris/test/CMakeLists.txt +234 -0
  517. data/vendor-src/libleptris/test/README.md +59 -0
  518. data/vendor-src/libleptris/test/abi/test_descriptor.cpp +441 -0
  519. data/vendor-src/libleptris/test/abi/test_doctype_api.cpp +51 -0
  520. data/vendor-src/libleptris/test/abi/test_dom_deep_copy.cpp +110 -0
  521. data/vendor-src/libleptris/test/abi/test_dom_mutation_bugs.cpp +210 -0
  522. data/vendor-src/libleptris/test/abi/test_header_hygiene.cpp +269 -0
  523. data/vendor-src/libleptris/test/abi/test_namespace_mutation_and_create.cpp +198 -0
  524. data/vendor-src/libleptris/test/abi/test_node_get_xpath.cpp +128 -0
  525. data/vendor-src/libleptris/test/abi/test_nokogiri_api.cpp +392 -0
  526. data/vendor-src/libleptris/test/abi/test_parse_fragment.cpp +114 -0
  527. data/vendor-src/libleptris/test/abi/test_previous_sibling_and_c14n_ex.cpp +299 -0
  528. data/vendor-src/libleptris/test/abi/test_public_surface.cpp +463 -0
  529. data/vendor-src/libleptris/test/abi/test_serialize_abi.cpp +67 -0
  530. data/vendor-src/libleptris/test/abi/test_v0_5_14_bugs.cpp +299 -0
  531. data/vendor-src/libleptris/test/abi/test_xpath_custom_fns.cpp +106 -0
  532. data/vendor-src/libleptris/test/cli/test_cli.cpp +493 -0
  533. data/vendor-src/libleptris/test/common/test_simd_spans.cpp +88 -0
  534. data/vendor-src/libleptris/test/common/test_simd_text.cpp +142 -0
  535. data/vendor-src/libleptris/test/concurrency/test_concurrency.cpp +218 -0
  536. data/vendor-src/libleptris/test/diff/test_diff.cpp +244 -0
  537. data/vendor-src/libleptris/test/dom/test_compact.cpp +339 -0
  538. data/vendor-src/libleptris/test/dom/test_digest.cpp +111 -0
  539. data/vendor-src/libleptris/test/dom/test_document_children.cpp +270 -0
  540. data/vendor-src/libleptris/test/dom/test_dom.cpp +2310 -0
  541. data/vendor-src/libleptris/test/dom/test_map_lifecycle.cpp +111 -0
  542. data/vendor-src/libleptris/test/dom/test_node_surface_parity.cpp +268 -0
  543. data/vendor-src/libleptris/test/dom/test_text_borrowed.cpp +126 -0
  544. data/vendor-src/libleptris/test/dom/test_vtable.cpp +108 -0
  545. data/vendor-src/libleptris/test/dtd/test_dtd_validate.cpp +1227 -0
  546. data/vendor-src/libleptris/test/dtd/test_w3c_conformance.cpp +212 -0
  547. data/vendor-src/libleptris/test/fixtures/basic.xml +13 -0
  548. data/vendor-src/libleptris/test/fixtures/cdata.xml +5 -0
  549. data/vendor-src/libleptris/test/fixtures/malformed.xml +2 -0
  550. data/vendor-src/libleptris/test/fixtures/namespaces.xml +11 -0
  551. data/vendor-src/libleptris/test/fixtures/utf16_decl.xml +5 -0
  552. data/vendor-src/libleptris/test/fuzz/fuzz_parse.c +40 -0
  553. data/vendor-src/libleptris/test/html/html5lib-redlist.txt +1366 -0
  554. data/vendor-src/libleptris/test/html/html5lib-tests/LICENSE +21 -0
  555. data/vendor-src/libleptris/test/html/html5lib-tests/README.md +11 -0
  556. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/adoption01.dat +354 -0
  557. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/adoption02.dat +39 -0
  558. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/blocks.dat +695 -0
  559. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/comments01.dat +217 -0
  560. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/doctype01.dat +474 -0
  561. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/domjs-unsafe.dat +0 -0
  562. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/entities01.dat +943 -0
  563. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/entities02.dat +309 -0
  564. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/foreign-fragment.dat +645 -0
  565. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/html5test-com.dat +301 -0
  566. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/inbody01.dat +54 -0
  567. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/isindex.dat +49 -0
  568. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/main-element.dat +46 -0
  569. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/math.dat +104 -0
  570. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/menuitem-element.dat +240 -0
  571. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/namespace-sensitivity.dat +22 -0
  572. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/noscript01.dat +237 -0
  573. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/pending-spec-changes-plain-text-unsafe.dat +0 -0
  574. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/pending-spec-changes.dat +46 -0
  575. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/plain-text-unsafe.dat +0 -0
  576. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/ruby.dat +302 -0
  577. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/scriptdata01.dat +372 -0
  578. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/search-element.dat +46 -0
  579. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/svg.dat +104 -0
  580. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tables01.dat +308 -0
  581. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/template.dat +1673 -0
  582. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests1.dat +1956 -0
  583. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests10.dat +849 -0
  584. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests11.dat +523 -0
  585. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests12.dat +62 -0
  586. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests14.dat +75 -0
  587. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests15.dat +216 -0
  588. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests16.dat +2602 -0
  589. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests17.dat +179 -0
  590. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests18.dat +558 -0
  591. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests19.dat +1398 -0
  592. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests2.dat +821 -0
  593. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests20.dat +842 -0
  594. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests21.dat +306 -0
  595. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests22.dat +190 -0
  596. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests23.dat +168 -0
  597. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests24.dat +79 -0
  598. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests25.dat +288 -0
  599. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests26.dat +453 -0
  600. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests3.dat +305 -0
  601. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests4.dat +58 -0
  602. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests5.dat +210 -0
  603. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests6.dat +663 -0
  604. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests7.dat +417 -0
  605. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests8.dat +165 -0
  606. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests9.dat +472 -0
  607. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests_innerHTML_1.dat +843 -0
  608. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tricky01.dat +336 -0
  609. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/webkit01.dat +785 -0
  610. data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/webkit02.dat +554 -0
  611. data/vendor-src/libleptris/test/html/html5lib_cases.h.in +6 -0
  612. data/vendor-src/libleptris/test/html/nokogiri-parity-redlist.txt +1183 -0
  613. data/vendor-src/libleptris/test/html/nokogiri-tree-tests.dat +18107 -0
  614. data/vendor-src/libleptris/test/html/test_html.cpp +2191 -0
  615. data/vendor-src/libleptris/test/html/test_html5lib.cpp +831 -0
  616. data/vendor-src/libleptris/test/memory/test_arena.cpp +252 -0
  617. data/vendor-src/libleptris/test/memory/test_oom_injection.cpp +170 -0
  618. data/vendor-src/libleptris/test/memory/test_pool.cpp +331 -0
  619. data/vendor-src/libleptris/test/memory/test_pool_arena.cpp +180 -0
  620. data/vendor-src/libleptris/test/parser/test_encoding.cpp +282 -0
  621. data/vendor-src/libleptris/test/parser/test_large_documents.cpp +346 -0
  622. data/vendor-src/libleptris/test/parser/test_parser.cpp +565 -0
  623. data/vendor-src/libleptris/test/parser/test_simd_count.cpp +70 -0
  624. data/vendor-src/libleptris/test/perf/test_perf.cpp +362 -0
  625. data/vendor-src/libleptris/test/perf/test_stress_high_doc_count.cpp +67 -0
  626. data/vendor-src/libleptris/test/rng/include-cases/bad-construct.rng +7 -0
  627. data/vendor-src/libleptris/test/rng/include-cases/bad-override.rng +6 -0
  628. data/vendor-src/libleptris/test/rng/include-cases/bad-start-override.rng +5 -0
  629. data/vendor-src/libleptris/test/rng/include-cases/ext-lib.rng +3 -0
  630. data/vendor-src/libleptris/test/rng/include-cases/ext-main.rng +7 -0
  631. data/vendor-src/libleptris/test/rng/include-cases/lib.rng +5 -0
  632. data/vendor-src/libleptris/test/rng/include-cases/lib2.rng +6 -0
  633. data/vendor-src/libleptris/test/rng/include-cases/main.rng +4 -0
  634. data/vendor-src/libleptris/test/rng/include-cases/no-href.rng +4 -0
  635. data/vendor-src/libleptris/test/rng/include-cases/override.rng +8 -0
  636. data/vendor-src/libleptris/test/rng/include-cases/self-include.rng +4 -0
  637. data/vendor-src/libleptris/test/rng/include-cases/start-override.rng +5 -0
  638. data/vendor-src/libleptris/test/rng/jing-cases/000.bad.xml +1 -0
  639. data/vendor-src/libleptris/test/rng/jing-cases/000.ok.xml +1 -0
  640. data/vendor-src/libleptris/test/rng/jing-cases/000.rng +1 -0
  641. data/vendor-src/libleptris/test/rng/jing-cases/001.bad.xml +1 -0
  642. data/vendor-src/libleptris/test/rng/jing-cases/001.ok.xml +1 -0
  643. data/vendor-src/libleptris/test/rng/jing-cases/001.rng +1 -0
  644. data/vendor-src/libleptris/test/rng/jing-cases/002.bad.xml +1 -0
  645. data/vendor-src/libleptris/test/rng/jing-cases/002.ok.xml +1 -0
  646. data/vendor-src/libleptris/test/rng/jing-cases/002.rng +1 -0
  647. data/vendor-src/libleptris/test/rng/jing-cases/003.bad.xml +1 -0
  648. data/vendor-src/libleptris/test/rng/jing-cases/003.ok.xml +1 -0
  649. data/vendor-src/libleptris/test/rng/jing-cases/003.rng +1 -0
  650. data/vendor-src/libleptris/test/rng/jing-cases/004.bad.xml +1 -0
  651. data/vendor-src/libleptris/test/rng/jing-cases/004.ok.xml +1 -0
  652. data/vendor-src/libleptris/test/rng/jing-cases/004.rng +1 -0
  653. data/vendor-src/libleptris/test/rng/jing-cases/005.bad.xml +1 -0
  654. data/vendor-src/libleptris/test/rng/jing-cases/005.ok.xml +1 -0
  655. data/vendor-src/libleptris/test/rng/jing-cases/005.rng +1 -0
  656. data/vendor-src/libleptris/test/rng/jing-cases/006.bad.xml +1 -0
  657. data/vendor-src/libleptris/test/rng/jing-cases/006.ok.xml +1 -0
  658. data/vendor-src/libleptris/test/rng/jing-cases/006.rng +1 -0
  659. data/vendor-src/libleptris/test/rng/jing-cases/007.bad.xml +1 -0
  660. data/vendor-src/libleptris/test/rng/jing-cases/007.ok.xml +1 -0
  661. data/vendor-src/libleptris/test/rng/jing-cases/007.rng +1 -0
  662. data/vendor-src/libleptris/test/rng/jing-cases/008.bad.xml +1 -0
  663. data/vendor-src/libleptris/test/rng/jing-cases/008.ok.xml +1 -0
  664. data/vendor-src/libleptris/test/rng/jing-cases/008.rng +1 -0
  665. data/vendor-src/libleptris/test/rng/jing-cases/009.bad.xml +1 -0
  666. data/vendor-src/libleptris/test/rng/jing-cases/009.ok.xml +1 -0
  667. data/vendor-src/libleptris/test/rng/jing-cases/009.rng +1 -0
  668. data/vendor-src/libleptris/test/rng/jing-cases/010.bad.xml +1 -0
  669. data/vendor-src/libleptris/test/rng/jing-cases/010.ok.xml +1 -0
  670. data/vendor-src/libleptris/test/rng/jing-cases/010.rng +1 -0
  671. data/vendor-src/libleptris/test/rng/jing-cases/011.bad.xml +1 -0
  672. data/vendor-src/libleptris/test/rng/jing-cases/011.ok.xml +1 -0
  673. data/vendor-src/libleptris/test/rng/jing-cases/011.rng +1 -0
  674. data/vendor-src/libleptris/test/rng/jing-cases/012.bad.xml +1 -0
  675. data/vendor-src/libleptris/test/rng/jing-cases/012.ok.xml +1 -0
  676. data/vendor-src/libleptris/test/rng/jing-cases/012.rng +1 -0
  677. data/vendor-src/libleptris/test/rng/jing-cases/013.bad.xml +1 -0
  678. data/vendor-src/libleptris/test/rng/jing-cases/013.ok.xml +1 -0
  679. data/vendor-src/libleptris/test/rng/jing-cases/013.rng +1 -0
  680. data/vendor-src/libleptris/test/rng/jing-cases/014.bad.xml +1 -0
  681. data/vendor-src/libleptris/test/rng/jing-cases/014.ok.xml +1 -0
  682. data/vendor-src/libleptris/test/rng/jing-cases/014.rng +1 -0
  683. data/vendor-src/libleptris/test/rng/jing-cases/015.bad.xml +1 -0
  684. data/vendor-src/libleptris/test/rng/jing-cases/015.ok.xml +1 -0
  685. data/vendor-src/libleptris/test/rng/jing-cases/015.rng +1 -0
  686. data/vendor-src/libleptris/test/rng/jing-cases/016.bad.xml +1 -0
  687. data/vendor-src/libleptris/test/rng/jing-cases/016.ok.xml +1 -0
  688. data/vendor-src/libleptris/test/rng/jing-cases/016.rng +1 -0
  689. data/vendor-src/libleptris/test/rng/jing-cases/017.bad.xml +1 -0
  690. data/vendor-src/libleptris/test/rng/jing-cases/017.ok.xml +1 -0
  691. data/vendor-src/libleptris/test/rng/jing-cases/017.rng +1 -0
  692. data/vendor-src/libleptris/test/rng/jing-cases/018.bad.xml +1 -0
  693. data/vendor-src/libleptris/test/rng/jing-cases/018.ok.xml +1 -0
  694. data/vendor-src/libleptris/test/rng/jing-cases/018.rng +1 -0
  695. data/vendor-src/libleptris/test/rng/jing-cases/019.bad.xml +1 -0
  696. data/vendor-src/libleptris/test/rng/jing-cases/019.ok.xml +1 -0
  697. data/vendor-src/libleptris/test/rng/jing-cases/019.rng +7 -0
  698. data/vendor-src/libleptris/test/rng/jing-cases/020-book.rng +4 -0
  699. data/vendor-src/libleptris/test/rng/jing-cases/020.bad.xml +1 -0
  700. data/vendor-src/libleptris/test/rng/jing-cases/020.ok.xml +1 -0
  701. data/vendor-src/libleptris/test/rng/jing-cases/020.rng +3 -0
  702. data/vendor-src/libleptris/test/rng/jing-cases/README.md +32 -0
  703. data/vendor-src/libleptris/test/rng/jing-cases/jing-ref.json +212 -0
  704. data/vendor-src/libleptris/test/rng/jing-cases/meta.json +1 -0
  705. data/vendor-src/libleptris/test/rng/test_rng.cpp +1365 -0
  706. data/vendor-src/libleptris/test/rng/test_rng_corpus.cpp +133 -0
  707. data/vendor-src/libleptris/test/rng/test_rng_corpus_msg.cpp +233 -0
  708. data/vendor-src/libleptris/test/sax/test_iterparse.cpp +203 -0
  709. data/vendor-src/libleptris/test/sax/test_pull.cpp +214 -0
  710. data/vendor-src/libleptris/test/sax/test_pull_batch.cpp +201 -0
  711. data/vendor-src/libleptris/test/sax/test_recorder.cpp +265 -0
  712. data/vendor-src/libleptris/test/sax/test_sax.cpp +665 -0
  713. data/vendor-src/libleptris/test/sax/test_streaming.cpp +434 -0
  714. data/vendor-src/libleptris/test/sch/conformance-cases/README.md +15 -0
  715. data/vendor-src/libleptris/test/sch/conformance-cases/extends-baseuri-fixup-01.xml +28 -0
  716. data/vendor-src/libleptris/test/sch/conformance-cases/extends-recursive-01.xml +27 -0
  717. data/vendor-src/libleptris/test/sch/conformance-cases/include-baseuri-fixup-01.xml +24 -0
  718. data/vendor-src/libleptris/test/sch/conformance-cases/include-recursive-01.xml +24 -0
  719. data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-01.xml +20 -0
  720. data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-02.xml +20 -0
  721. data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-03.xml +20 -0
  722. data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-04.xml +23 -0
  723. data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-05.xml +20 -0
  724. data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-06.xml +25 -0
  725. data/vendor-src/libleptris/test/sch/conformance-cases/let-pattern-global-01.xml +24 -0
  726. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-01.xml +18 -0
  727. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-02.xml +18 -0
  728. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-03.xml +18 -0
  729. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-04.xml +19 -0
  730. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-05.xml +20 -0
  731. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-06.xml +20 -0
  732. data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-07.xml +18 -0
  733. data/vendor-src/libleptris/test/sch/conformance-cases/let-rule-global-01.xml +20 -0
  734. data/vendor-src/libleptris/test/sch/conformance-cases/let-rule-global-02.xml +23 -0
  735. data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-pattern-01.xml +25 -0
  736. data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-phase-01.xml +23 -0
  737. data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-rule-01.xml +23 -0
  738. data/vendor-src/libleptris/test/sch/conformance-cases/let-value-element-content-01.xml +33 -0
  739. data/vendor-src/libleptris/test/sch/conformance-cases/pattern-abstract-01.xml +22 -0
  740. data/vendor-src/libleptris/test/sch/conformance-cases/pattern-subordinate-document-01.xml +21 -0
  741. data/vendor-src/libleptris/test/sch/conformance-cases/pattern-subordinate-document-02.xml +21 -0
  742. data/vendor-src/libleptris/test/sch/conformance-cases/rule-abstract-01.xml +21 -0
  743. data/vendor-src/libleptris/test/sch/conformance-cases/rule-abstract-02.xml +23 -0
  744. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-attribute-01.xml +18 -0
  745. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-comment-01.xml +20 -0
  746. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-element-01.xml +18 -0
  747. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-pi-01.xml +20 -0
  748. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-root-01.xml +18 -0
  749. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-text-01.xml +18 -0
  750. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-01.xml +22 -0
  751. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-02.xml +25 -0
  752. data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-03.xml +22 -0
  753. data/vendor-src/libleptris/test/sch/conformance-cases/rule-order-01.xml +21 -0
  754. data/vendor-src/libleptris/test/sch/conformance-cases/schema-default-phase-01.xml +26 -0
  755. data/vendor-src/libleptris/test/sch/conformance-cases/schema-default-phase-02.xml +25 -0
  756. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-diagnostic-01.xml +28 -0
  757. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-diagnostic-02.xml +25 -0
  758. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-name-nopath-01.xml +23 -0
  759. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-name-path-01.xml +23 -0
  760. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-property-01.xml +28 -0
  761. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-property-copy-of.xml +26 -0
  762. data/vendor-src/libleptris/test/sch/conformance-cases/svrl-value-of-01.xml +23 -0
  763. data/vendor-src/libleptris/test/sch/conformance-cases/xslt-key-01.xml +19 -0
  764. data/vendor-src/libleptris/test/sch/conformance-cases/xslt-key-element-content-01.xml +21 -0
  765. data/vendor-src/libleptris/test/sch/test_schematron.cpp +337 -0
  766. data/vendor-src/libleptris/test/sch/test_schematron_corpus.cpp +421 -0
  767. data/vendor-src/libleptris/test/serializer/test_c14n.cpp +539 -0
  768. data/vendor-src/libleptris/test/serializer/test_serialize.cpp +890 -0
  769. data/vendor-src/libleptris/test/smoke/test_smoke.cpp +41 -0
  770. data/vendor-src/libleptris/test/xinclude/test_xinclude.cpp +903 -0
  771. data/vendor-src/libleptris/test/xpath/test_bytecode_vm.cpp +755 -0
  772. data/vendor-src/libleptris/test/xpath/test_compiled.cpp +171 -0
  773. data/vendor-src/libleptris/test/xpath/test_exslt.cpp +141 -0
  774. data/vendor-src/libleptris/test/xpath/test_xpath.cpp +2433 -0
  775. data/vendor-src/libleptris/test/xpath/test_xpath_conformance.cpp +570 -0
  776. data/vendor-src/libleptris/test/xpath/test_xslt.cpp +4245 -0
  777. data/vendor-src/libleptris/test/xquery/books.xml +1 -0
  778. data/vendor-src/libleptris/test/xquery/qt3/README.md +28 -0
  779. data/vendor-src/libleptris/test/xquery/qt3/fn/concat.xml +878 -0
  780. data/vendor-src/libleptris/test/xquery/qt3/fn/contains.xml +795 -0
  781. data/vendor-src/libleptris/test/xquery/qt3/fn/ends-with.xml +556 -0
  782. data/vendor-src/libleptris/test/xquery/qt3/fn/starts-with.xml +644 -0
  783. data/vendor-src/libleptris/test/xquery/qt3/fn/substring/concepts.xml +1 -0
  784. data/vendor-src/libleptris/test/xquery/qt3/fn/substring.xml +449 -0
  785. data/vendor-src/libleptris/test/xquery/test_qt3.cpp +324 -0
  786. data/vendor-src/libleptris/test/xquery/test_xquery.cpp +768 -0
  787. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/ATTRIBUTION.md +12 -0
  788. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.out +4 -0
  789. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.xml +7 -0
  790. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.xsl +26 -0
  791. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.out +6 -0
  792. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.xml +7 -0
  793. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.xsl +21 -0
  794. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.out +2 -0
  795. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.xml +3 -0
  796. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.xsl +10 -0
  797. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.out +2 -0
  798. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.xml +1 -0
  799. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.xsl +9 -0
  800. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.out +2 -0
  801. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.xml +1 -0
  802. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.xsl +8 -0
  803. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102-inc.xsl +21 -0
  804. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.out +3 -0
  805. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.xml +1 -0
  806. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.xsl +10 -0
  807. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.out +2 -0
  808. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.xml +1 -0
  809. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.xsl +13 -0
  810. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.out +2 -0
  811. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.xml +1 -0
  812. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.xsl +10 -0
  813. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.out +2 -0
  814. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.xml +1 -0
  815. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.xsl +8 -0
  816. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.out +2 -0
  817. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.xml +2 -0
  818. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.xsl +12 -0
  819. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.out +8 -0
  820. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.xml +7 -0
  821. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.xsl +11 -0
  822. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.out +25 -0
  823. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.xml +4 -0
  824. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.xsl +21 -0
  825. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.out +3 -0
  826. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.xml +4 -0
  827. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.xsl +7 -0
  828. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.out +1 -0
  829. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.xml +4 -0
  830. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.xsl +12 -0
  831. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.ent +1 -0
  832. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.out +1 -0
  833. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.xml +9 -0
  834. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.xsl +20 -0
  835. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.out +6 -0
  836. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.xml +17 -0
  837. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.xsl +45 -0
  838. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.out +2 -0
  839. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.xml +1 -0
  840. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.xsl +22 -0
  841. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.out +4 -0
  842. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.xml +7 -0
  843. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.xsl +15 -0
  844. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.out +3 -0
  845. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.xml +7 -0
  846. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.xsl +16 -0
  847. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.out +2 -0
  848. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.xml +1 -0
  849. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.xsl +19 -0
  850. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.out +2 -0
  851. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.xml +1 -0
  852. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.xsl +22 -0
  853. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.out +5 -0
  854. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.xml +10 -0
  855. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.xsl +59 -0
  856. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.out +3 -0
  857. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.xml +6 -0
  858. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.xsl +14 -0
  859. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.out +10 -0
  860. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.xml +12 -0
  861. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.xsl +12 -0
  862. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.out +2 -0
  863. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.xml +9 -0
  864. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.xsl +16 -0
  865. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.out +8 -0
  866. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.xml +15 -0
  867. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.xsl +27 -0
  868. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.out +1 -0
  869. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.xml +1 -0
  870. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.xsl +8 -0
  871. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.out +2 -0
  872. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.xml +11 -0
  873. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.xsl +17 -0
  874. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.out +2 -0
  875. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.xml +2 -0
  876. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.xsl +14 -0
  877. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.out +2 -0
  878. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.xml +6 -0
  879. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.xsl +14 -0
  880. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.out +351 -0
  881. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.xml +118 -0
  882. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.xsl +99 -0
  883. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.out +9 -0
  884. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.xml +1 -0
  885. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.xsl +17 -0
  886. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.out +1 -0
  887. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.xml +1 -0
  888. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.xsl +18 -0
  889. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.out +5 -0
  890. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.xml +26 -0
  891. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.xsl +26 -0
  892. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.out +6 -0
  893. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.xml +6 -0
  894. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.xsl +10 -0
  895. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.out +2 -0
  896. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.xml +1 -0
  897. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.xsl +10 -0
  898. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp1.imp +25 -0
  899. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp2.imp +14 -0
  900. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp3.imp +16 -0
  901. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp4.imp +22 -0
  902. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.doc +7 -0
  903. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.out +1 -0
  904. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.xml +4 -0
  905. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.xsl +22 -0
  906. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131-imp.imp +19 -0
  907. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.out +2 -0
  908. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.xml +3 -0
  909. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.xsl +13 -0
  910. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.out +6 -0
  911. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.xml +6 -0
  912. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.xsl +13 -0
  913. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.out +6 -0
  914. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.xml +7 -0
  915. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.xsl +32 -0
  916. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.out +2 -0
  917. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.xml +5 -0
  918. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.xsl +12 -0
  919. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.out +2 -0
  920. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.xml +5 -0
  921. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.xsl +10 -0
  922. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.out +4 -0
  923. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.xml +4 -0
  924. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.xsl +8 -0
  925. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.imp +12 -0
  926. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.out +2 -0
  927. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.xml +1 -0
  928. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.xsl +8 -0
  929. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.out +23 -0
  930. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.xml +15 -0
  931. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.xsl +28 -0
  932. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.out +4 -0
  933. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.xml +9 -0
  934. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.xsl +14 -0
  935. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.out +4 -0
  936. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.xml +7 -0
  937. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.xsl +23 -0
  938. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.out +4 -0
  939. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.xml +6 -0
  940. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.xsl +32 -0
  941. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.out +46 -0
  942. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.xml +9 -0
  943. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.xsl +25 -0
  944. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.out +35 -0
  945. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.xml +65 -0
  946. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.xsl +85 -0
  947. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.out +2 -0
  948. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.xml +1 -0
  949. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.xsl +10 -0
  950. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.out +2 -0
  951. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.xml +1 -0
  952. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.xsl +10 -0
  953. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.err +5 -0
  954. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.xml +10 -0
  955. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.xsl +10 -0
  956. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-1.imp +11 -0
  957. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-2.imp +11 -0
  958. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-3.imp +57 -0
  959. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-4.imp +15 -0
  960. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-5.imp +27 -0
  961. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-6.imp +31 -0
  962. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.out +17 -0
  963. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.xml +21 -0
  964. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.xsl +29 -0
  965. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.out +2 -0
  966. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.xml +1 -0
  967. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.xsl +13 -0
  968. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.out +2 -0
  969. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.xml +1 -0
  970. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.xsl +11 -0
  971. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.out +5 -0
  972. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.xml +5 -0
  973. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.xsl +15 -0
  974. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.out +2 -0
  975. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.xml +1 -0
  976. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.xsl +9 -0
  977. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-151.xml +1 -0
  978. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-151.xsl +15 -0
  979. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.out +12 -0
  980. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.xml +1 -0
  981. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.xsl +30 -0
  982. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.doc +4 -0
  983. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.out +2 -0
  984. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.xml +9 -0
  985. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.xsl +19 -0
  986. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-154.xml +1 -0
  987. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-154.xsl +4 -0
  988. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.out +3 -0
  989. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.xml +5 -0
  990. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.xsl +10 -0
  991. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.err +2 -0
  992. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.imp1.imp +16 -0
  993. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.imp2.imp +10 -0
  994. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.xml +1 -0
  995. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.xsl +12 -0
  996. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.err +3 -0
  997. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.out +9 -0
  998. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.xml +6 -0
  999. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.xsl +22 -0
  1000. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.doc +3 -0
  1001. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.out +4 -0
  1002. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.xml +2 -0
  1003. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.xsl +19 -0
  1004. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.out +8 -0
  1005. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.xml +1 -0
  1006. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.xsl +17 -0
  1007. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.out +14 -0
  1008. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.xml +17 -0
  1009. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.xsl +13 -0
  1010. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.out +7 -0
  1011. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.xml +8 -0
  1012. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.xsl +14 -0
  1013. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.out +6 -0
  1014. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.xml +5 -0
  1015. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.xsl +18 -0
  1016. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.out +2 -0
  1017. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.xml +5 -0
  1018. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.xsl +6 -0
  1019. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.out +4 -0
  1020. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.xml +4 -0
  1021. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.xsl +13 -0
  1022. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.err +6 -0
  1023. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.xml +10 -0
  1024. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.xsl +9 -0
  1025. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.out +15256 -0
  1026. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.xml +15255 -0
  1027. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.xsl +131 -0
  1028. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.out +1 -0
  1029. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.xml +1 -0
  1030. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.xsl +20 -0
  1031. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.out +2 -0
  1032. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.xml +9 -0
  1033. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.xsl +9 -0
  1034. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.imp +5 -0
  1035. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.out +2 -0
  1036. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.xml +1 -0
  1037. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.xsl +11 -0
  1038. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.out +2 -0
  1039. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.xml +1 -0
  1040. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.xsl +7 -0
  1041. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.out +4 -0
  1042. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.xml +3 -0
  1043. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.xsl +6 -0
  1044. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.out +2 -0
  1045. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.xml +4 -0
  1046. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.xsl +7 -0
  1047. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.out +6 -0
  1048. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.xml +6 -0
  1049. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.xsl +22 -0
  1050. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.out +1 -0
  1051. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.xml +1 -0
  1052. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.xsl +11 -0
  1053. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.err +1 -0
  1054. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.xml +1 -0
  1055. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.xsl +18 -0
  1056. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.err +2 -0
  1057. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.out +8 -0
  1058. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.xml +1 -0
  1059. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.xsl +33 -0
  1060. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.out +2 -0
  1061. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.xml +1 -0
  1062. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.xsl +11 -0
  1063. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.out +2 -0
  1064. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.xml +1 -0
  1065. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.xsl +7 -0
  1066. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.out +2 -0
  1067. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.xml +1 -0
  1068. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.xsl +18 -0
  1069. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.out +9 -0
  1070. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.xml +1 -0
  1071. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.xsl +24 -0
  1072. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.out +2 -0
  1073. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.xml +3 -0
  1074. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.xsl +17 -0
  1075. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.err +4 -0
  1076. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.xml +2 -0
  1077. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.xsl +8 -0
  1078. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.out +5 -0
  1079. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.xml +4 -0
  1080. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.xsl +13 -0
  1081. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.out +2 -0
  1082. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.xml +4 -0
  1083. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.xsl +21 -0
  1084. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.out +2 -0
  1085. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.xml +5 -0
  1086. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.xsl +9 -0
  1087. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.err +6 -0
  1088. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.xml +1 -0
  1089. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.xsl +8 -0
  1090. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.out +5 -0
  1091. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.xml +4 -0
  1092. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.xsl +7 -0
  1093. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.err +6 -0
  1094. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.out +14 -0
  1095. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.xml +1 -0
  1096. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.xsl +42 -0
  1097. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188-imp.xsl +8 -0
  1098. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.out +4 -0
  1099. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.xml +1 -0
  1100. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.xsl +20 -0
  1101. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.out +5 -0
  1102. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.xml +1 -0
  1103. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.xsl +25 -0
  1104. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.out +2 -0
  1105. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.xml +3 -0
  1106. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.xsl +17 -0
  1107. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190-imp.xsl +10 -0
  1108. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.out +4 -0
  1109. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.xml +1 -0
  1110. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.xsl +16 -0
  1111. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191-imp.xsl +8 -0
  1112. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.err +2 -0
  1113. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.xml +1 -0
  1114. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.xsl +9 -0
  1115. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.out +1 -0
  1116. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.xml +1 -0
  1117. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.xsl +33 -0
  1118. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.out +2 -0
  1119. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.xml +1 -0
  1120. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.xsl +11 -0
  1121. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.err +9 -0
  1122. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.xml +1 -0
  1123. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.xsl +8 -0
  1124. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.out +8 -0
  1125. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.xml +9 -0
  1126. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.xsl +19 -0
  1127. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.out +7 -0
  1128. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.xml +9 -0
  1129. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.xsl +19 -0
  1130. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.out +6 -0
  1131. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.xml +6 -0
  1132. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.xsl +16 -0
  1133. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.out +2 -0
  1134. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.xml +2 -0
  1135. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.xsl +17 -0
  1136. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.out +6 -0
  1137. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.xml +6 -0
  1138. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.xsl +18 -0
  1139. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.out +8 -0
  1140. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.xml +12 -0
  1141. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.xsl +16 -0
  1142. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.out +4 -0
  1143. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.xml +7 -0
  1144. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.xsl +22 -0
  1145. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.out +2 -0
  1146. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.xml +1 -0
  1147. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.xsl +5 -0
  1148. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.err +6 -0
  1149. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.xml +1 -0
  1150. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.xsl +16 -0
  1151. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.err +2 -0
  1152. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.xml +1 -0
  1153. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.xsl +5 -0
  1154. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.err +1 -0
  1155. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.xml +1 -0
  1156. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.xsl +5 -0
  1157. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.err +2 -0
  1158. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.xml +1 -0
  1159. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.xsl +6 -0
  1160. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.out +2 -0
  1161. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.xml +1 -0
  1162. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.xsl +10 -0
  1163. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.out +2 -0
  1164. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.xml +1 -0
  1165. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.xsl +9 -0
  1166. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.out +2 -0
  1167. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.xml +1 -0
  1168. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.xsl +61 -0
  1169. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.err +6 -0
  1170. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.xml +8 -0
  1171. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.xsl +8 -0
  1172. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.out +2 -0
  1173. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.xml +1 -0
  1174. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.xsl +21 -0
  1175. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.out +2 -0
  1176. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.xml +8 -0
  1177. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.xsl +7 -0
  1178. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.out +2 -0
  1179. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.xml +1 -0
  1180. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.xsl +20 -0
  1181. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.out +2 -0
  1182. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.xml +1 -0
  1183. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.xsl +26 -0
  1184. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.out +1 -0
  1185. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.xml +1 -0
  1186. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.xsl +25 -0
  1187. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.out +1 -0
  1188. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.xml +1 -0
  1189. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.xsl +26 -0
  1190. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.out +6 -0
  1191. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.xml +6 -0
  1192. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.xsl +25 -0
  1193. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.err +5 -0
  1194. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.xml +1 -0
  1195. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.xsl +6 -0
  1196. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.out +2 -0
  1197. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.xml +1 -0
  1198. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.xsl +11 -0
  1199. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.out +2 -0
  1200. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.xml +1 -0
  1201. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.xsl +24 -0
  1202. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.out +2 -0
  1203. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.xml +1 -0
  1204. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.xsl +8 -0
  1205. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.out +68 -0
  1206. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.xml +22 -0
  1207. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.xsl +17 -0
  1208. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.out +12 -0
  1209. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.xml +18 -0
  1210. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.xsl +19 -0
  1211. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.out +2 -0
  1212. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.xml +1 -0
  1213. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.xsl +15 -0
  1214. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.out +2 -0
  1215. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.xml +9 -0
  1216. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.xsl +15 -0
  1217. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.out +2 -0
  1218. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.xml +1 -0
  1219. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.xsl +6 -0
  1220. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223-imp.xsl +12 -0
  1221. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223-inc.xsl +12 -0
  1222. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.out +1 -0
  1223. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.xml +1 -0
  1224. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.xsl +17 -0
  1225. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.out +9 -0
  1226. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.xml +8 -0
  1227. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.xsl +28 -0
  1228. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.out +2 -0
  1229. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.xml +1 -0
  1230. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.xsl +32 -0
  1231. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.out +15 -0
  1232. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.xml +21 -0
  1233. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.xsl +20 -0
  1234. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.out +27 -0
  1235. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.xml +2419 -0
  1236. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.xsl +22 -0
  1237. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.out +3 -0
  1238. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.xml +1 -0
  1239. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.xsl +10 -0
  1240. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.out +2 -0
  1241. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.xml +1 -0
  1242. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.xsl +9 -0
  1243. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.out +2 -0
  1244. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.xml +1 -0
  1245. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.xsl +14 -0
  1246. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.out +1 -0
  1247. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.xml +1 -0
  1248. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.xsl +9 -0
  1249. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.ent +7 -0
  1250. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.out +10 -0
  1251. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.xml +5 -0
  1252. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.xsl +16 -0
  1253. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.out +2 -0
  1254. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.xml +1 -0
  1255. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.xsl +13 -0
  1256. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.out +2 -0
  1257. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.xml +1 -0
  1258. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.xsl +7 -0
  1259. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.out +3 -0
  1260. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.xml +4 -0
  1261. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.xsl +10 -0
  1262. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.out +2 -0
  1263. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.xml +1 -0
  1264. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.xsl +17 -0
  1265. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.out +16 -0
  1266. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.xml +14 -0
  1267. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.xsl +29 -0
  1268. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.out +2 -0
  1269. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.xml +1 -0
  1270. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.xsl +10 -0
  1271. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.out +4 -0
  1272. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.xml +5 -0
  1273. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.xsl +8 -0
  1274. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-inc.xsl +16 -0
  1275. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.out +4 -0
  1276. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.xml +5 -0
  1277. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.xsl +8 -0
  1278. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-inc.xsl +15 -0
  1279. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.out +2 -0
  1280. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.xml +17 -0
  1281. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.xsl +17 -0
  1282. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.out +3 -0
  1283. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.xml +3 -0
  1284. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.xsl +34 -0
  1285. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.out +6 -0
  1286. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.xml +38 -0
  1287. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.xsl +12 -0
  1288. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.out +2 -0
  1289. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.xml +1 -0
  1290. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.xsl +16 -0
  1291. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.out +2 -0
  1292. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.xml +1 -0
  1293. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.xsl +19 -0
  1294. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.out +2 -0
  1295. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.xml +1 -0
  1296. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.xsl +16 -0
  1297. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.out +2 -0
  1298. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.xml +1 -0
  1299. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.xsl +19 -0
  1300. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.out +2 -0
  1301. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.xml +1 -0
  1302. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.xsl +19 -0
  1303. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.out +2 -0
  1304. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.xml +1 -0
  1305. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.xsl +27 -0
  1306. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.out +2 -0
  1307. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.xml +1 -0
  1308. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.xsl +16 -0
  1309. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.out +2 -0
  1310. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.xml +1 -0
  1311. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.xsl +18 -0
  1312. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.out +2 -0
  1313. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.xml +1 -0
  1314. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.xsl +24 -0
  1315. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.out +2 -0
  1316. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.xml +1 -0
  1317. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.xsl +15 -0
  1318. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.out +954 -0
  1319. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.xml +475 -0
  1320. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.xsl +158 -0
  1321. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.out +7 -0
  1322. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.xml +3 -0
  1323. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.xsl +14 -0
  1324. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.out +3 -0
  1325. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.xml +12 -0
  1326. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.xsl +16 -0
  1327. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.out +1 -0
  1328. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.xml +6 -0
  1329. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.xsl +11 -0
  1330. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.out +2 -0
  1331. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.xml +2 -0
  1332. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.xsl +22 -0
  1333. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.out +2 -0
  1334. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.xml +3 -0
  1335. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.xsl +9 -0
  1336. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.out +3 -0
  1337. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.xml +1 -0
  1338. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.xsl +28 -0
  1339. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.out +2 -0
  1340. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.xml +8 -0
  1341. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.xsl +21 -0
  1342. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-58.xsl +274 -0
  1343. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.out +2 -0
  1344. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.xml +1 -0
  1345. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.xsl +9 -0
  1346. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.out +4 -0
  1347. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.xml +6 -0
  1348. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.xsl +32 -0
  1349. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.err +2 -0
  1350. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.out +2 -0
  1351. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.xml +1 -0
  1352. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.xsl +15 -0
  1353. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.out +10 -0
  1354. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.xml +1 -0
  1355. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.xsl +14 -0
  1356. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62-inc.xsl +4 -0
  1357. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.out +2 -0
  1358. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.xml +1 -0
  1359. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.xsl +8 -0
  1360. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.out +22 -0
  1361. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.xml +13 -0
  1362. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.xsl +13 -0
  1363. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.out +2 -0
  1364. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.xml +1 -0
  1365. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.xsl +8 -0
  1366. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.ent +7 -0
  1367. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.out +8 -0
  1368. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.xml +5 -0
  1369. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.xsl +26 -0
  1370. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.out +2 -0
  1371. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.xml +8 -0
  1372. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.xsl +12 -0
  1373. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.out +1 -0
  1374. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.xml +1 -0
  1375. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.xsl +8 -0
  1376. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.out +2 -0
  1377. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.xml +2 -0
  1378. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.xsl +12 -0
  1379. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.out +2 -0
  1380. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.xml +3 -0
  1381. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.xsl +11 -0
  1382. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.out +9 -0
  1383. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.xml +10 -0
  1384. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.xsl +13 -0
  1385. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.out +2 -0
  1386. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.xml +1 -0
  1387. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.xsl +17 -0
  1388. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.out +6 -0
  1389. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.xml +3 -0
  1390. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.xsl +31 -0
  1391. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.out +3 -0
  1392. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.xml +5 -0
  1393. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.xsl +17 -0
  1394. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.out +2 -0
  1395. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.xml +3 -0
  1396. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.xsl +12 -0
  1397. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.out +6 -0
  1398. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.xml +1 -0
  1399. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.xsl +9 -0
  1400. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.out +4 -0
  1401. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.xml +4 -0
  1402. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.xsl +16 -0
  1403. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.out +5 -0
  1404. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.xml +4 -0
  1405. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.xsl +18 -0
  1406. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.out +3 -0
  1407. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.xml +8 -0
  1408. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.xsl +17 -0
  1409. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.out +5 -0
  1410. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.xml +4 -0
  1411. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.xsl +4 -0
  1412. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.out +3 -0
  1413. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.xml +5 -0
  1414. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.xsl +13 -0
  1415. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.out +2 -0
  1416. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.xml +6 -0
  1417. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.xsl +29 -0
  1418. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.out +4 -0
  1419. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.xml +12 -0
  1420. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.xsl +18 -0
  1421. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.out +5 -0
  1422. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.xml +4 -0
  1423. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.xsl +12 -0
  1424. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.out +1 -0
  1425. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.xml +1 -0
  1426. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.xsl +14 -0
  1427. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.out +15 -0
  1428. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.xml +22 -0
  1429. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.xsl +14 -0
  1430. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.out +6 -0
  1431. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.xml +7 -0
  1432. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.xsl +7 -0
  1433. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.out +5 -0
  1434. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.xml +6 -0
  1435. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.xsl +16 -0
  1436. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.out +2 -0
  1437. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.xml +1 -0
  1438. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.xsl +6 -0
  1439. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.out +12 -0
  1440. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.xml +13 -0
  1441. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.xsl +105 -0
  1442. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.out +2 -0
  1443. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.xml +3 -0
  1444. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.xsl +10 -0
  1445. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.out +13 -0
  1446. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.xml +15 -0
  1447. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.xsl +35 -0
  1448. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.out +3 -0
  1449. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.xml +4 -0
  1450. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.xsl +8 -0
  1451. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.out +15 -0
  1452. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.xml +19 -0
  1453. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.xsl +19 -0
  1454. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93-inc.xsl +12 -0
  1455. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.out +3 -0
  1456. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.xml +1 -0
  1457. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.xsl +7 -0
  1458. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.out +2 -0
  1459. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.xml +9 -0
  1460. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.xsl +35 -0
  1461. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.out +4 -0
  1462. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.xml +5 -0
  1463. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.xsl +22 -0
  1464. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.out +5 -0
  1465. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.xml +5 -0
  1466. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.xsl +10 -0
  1467. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.out +9 -0
  1468. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.xml +16 -0
  1469. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.xsl +32 -0
  1470. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.out +6 -0
  1471. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.xml +10 -0
  1472. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.xsl +31 -0
  1473. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.out +2 -0
  1474. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.xml +1 -0
  1475. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.xsl +16 -0
  1476. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.out +2 -0
  1477. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.xml +23 -0
  1478. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.xsl +16 -0
  1479. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.out +9 -0
  1480. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.xml +1 -0
  1481. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.xsl +16 -0
  1482. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.dtd +7 -0
  1483. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.out +16 -0
  1484. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.xml +17 -0
  1485. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.xsl +62 -0
  1486. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/inner.xsl +12 -0
  1487. data/vendor-src/libleptris/test/xslt/libxslt_suite_general/items.xml +34 -0
  1488. data/vendor-src/libleptris/test/xslt/open_cases.txt +0 -0
  1489. data/vendor-src/libleptris/test/xslt/test_libxslt_suite.cpp +398 -0
  1490. data/vendor-src/libleptris/vcpkg.json +29 -0
  1491. data/vendor-src/utf8proc/CMakeLists.txt +133 -0
  1492. data/vendor-src/utf8proc/Doxyfile +2765 -0
  1493. data/vendor-src/utf8proc/LICENSE.md +93 -0
  1494. data/vendor-src/utf8proc/MANIFEST +9 -0
  1495. data/vendor-src/utf8proc/Makefile +203 -0
  1496. data/vendor-src/utf8proc/NEWS.md +479 -0
  1497. data/vendor-src/utf8proc/README.md +143 -0
  1498. data/vendor-src/utf8proc/appveyor.yml +46 -0
  1499. data/vendor-src/utf8proc/bench/Makefile +40 -0
  1500. data/vendor-src/utf8proc/bench/bench.c +56 -0
  1501. data/vendor-src/utf8proc/bench/icu.c +61 -0
  1502. data/vendor-src/utf8proc/bench/unistring.c +60 -0
  1503. data/vendor-src/utf8proc/bench/util.c +39 -0
  1504. data/vendor-src/utf8proc/bench/util.h +22 -0
  1505. data/vendor-src/utf8proc/cmake/utf8proc-config.cmake.in +5 -0
  1506. data/vendor-src/utf8proc/data/Makefile +62 -0
  1507. data/vendor-src/utf8proc/data/Manifest.toml +16 -0
  1508. data/vendor-src/utf8proc/data/Project.toml +2 -0
  1509. data/vendor-src/utf8proc/data/data_generator.jl +498 -0
  1510. data/vendor-src/utf8proc/libutf8proc.pc.cmakein +10 -0
  1511. data/vendor-src/utf8proc/libutf8proc.pc.in +10 -0
  1512. data/vendor-src/utf8proc/lump.md +27 -0
  1513. data/vendor-src/utf8proc/test/app/CMakeLists.txt +6 -0
  1514. data/vendor-src/utf8proc/test/app/app.c +9 -0
  1515. data/vendor-src/utf8proc/test/case.c +76 -0
  1516. data/vendor-src/utf8proc/test/charwidth.c +91 -0
  1517. data/vendor-src/utf8proc/test/custom.c +28 -0
  1518. data/vendor-src/utf8proc/test/fuzz_main.c +54 -0
  1519. data/vendor-src/utf8proc/test/fuzzer.c +97 -0
  1520. data/vendor-src/utf8proc/test/graphemetest.c +136 -0
  1521. data/vendor-src/utf8proc/test/iscase.c +63 -0
  1522. data/vendor-src/utf8proc/test/iterate.c +168 -0
  1523. data/vendor-src/utf8proc/test/maxdecomposition.c +22 -0
  1524. data/vendor-src/utf8proc/test/misc.c +51 -0
  1525. data/vendor-src/utf8proc/test/normtest.c +64 -0
  1526. data/vendor-src/utf8proc/test/ossfuzz.sh +13 -0
  1527. data/vendor-src/utf8proc/test/printproperty.c +68 -0
  1528. data/vendor-src/utf8proc/test/tests.c +60 -0
  1529. data/vendor-src/utf8proc/test/tests.h +27 -0
  1530. data/vendor-src/utf8proc/test/valid.c +41 -0
  1531. data/vendor-src/utf8proc/utf8proc.c +834 -0
  1532. data/vendor-src/utf8proc/utf8proc.h +794 -0
  1533. data/vendor-src/utf8proc/utf8proc_data.c +17141 -0
  1534. data/vendor-src/utf8proc/utils.cmake +20 -0
  1535. metadata +1528 -2
@@ -0,0 +1,3701 @@
1
+ /* libleptris - Pure C XML/XPath library
2
+ * Copyright (c) 2024, Ribose Inc.
3
+ * All rights reserved.
4
+ *
5
+ * Public API header - No Ruby dependencies
6
+ */
7
+
8
+ #ifndef LIBLEPTRIS_H
9
+ #define LIBLEPTRIS_H
10
+
11
+ #include <stddef.h>
12
+ #include <stdint.h>
13
+
14
+ #ifdef __cplusplus
15
+ extern "C" {
16
+ #endif
17
+
18
+ /* Export macro for Windows DLL support and binding generators.
19
+ *
20
+ * On Unix the build sets default symbol visibility to hidden
21
+ * (CMAKE_C_VISIBILITY_PRESET=hidden in CMakeLists.txt); LEPTRIS_API
22
+ * opts back into default visibility for the public surface.
23
+ * Internal helpers stay hidden and never appear in the .so export
24
+ * table. See TODO 80.
25
+ *
26
+ * When LEPTRIS_FOR_BINDGEN is defined (by bindgen/cffi/ctypes),
27
+ * the macro expands to nothing so the header parses cleanly.
28
+ * See TODO 84. */
29
+ #ifdef LEPTRIS_FOR_BINDGEN
30
+ #define LEPTRIS_API
31
+ #else
32
+ #ifndef LEPTRIS_API
33
+ # ifdef _WIN32
34
+ # ifdef LEPTRIS_BUILD_SHARED
35
+ # define LEPTRIS_API __declspec(dllexport)
36
+ # elif defined(LEPTRIS_BUILDING_DLL)
37
+ /* CMake defines LEPTRIS_BUILDING_DLL (not LEPTRIS_BUILD_SHARED)
38
+ * on the leptris_shared target — accept both so the DLL
39
+ * actually exports its symbols (issue #278). */
40
+ # define LEPTRIS_API __declspec(dllexport)
41
+ # elif defined(LEPTRIS_USE_SHARED)
42
+ # define LEPTRIS_API __declspec(dllimport)
43
+ # else
44
+ # define LEPTRIS_API
45
+ # endif
46
+ # else
47
+ # define LEPTRIS_API __attribute__((visibility("default"), used))
48
+ # endif
49
+ #endif
50
+ #endif /* LEPTRIS_FOR_BINDGEN */
51
+
52
+ /* ============================================================================
53
+ * Public types — single canonical source in leptris/types.h.
54
+ *
55
+ * leptris.h is the "full API" header; leptris/types.h is the lightweight
56
+ * types-only header. All shared typedefs, enums, and option structs
57
+ * live in types.h. See TODO 99.
58
+ * ============================================================================ */
59
+ #include "leptris/types.h"
60
+
61
+ /* ABI sanity asserts — catches accidental struct-field exposure
62
+ * that would change opaque-handle sizes. See TODO 84.
63
+ * Uses _Static_assert (works on GCC/Clang as extension in C99,
64
+ * standard in C11, and in C++ via static_assert). MSVC supports
65
+ * static_assert as a C keyword too — preferred over _Static_assert
66
+ * which only became a keyword in /std:c11 mode. */
67
+ #ifndef LEPTRIS_STATIC_ASSERT
68
+ # ifdef __cplusplus
69
+ # define LEPTRIS_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
70
+ # elif defined(_MSC_VER)
71
+ # define LEPTRIS_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
72
+ # else
73
+ # define LEPTRIS_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
74
+ # endif
75
+ #endif
76
+
77
+ LEPTRIS_STATIC_ASSERT(sizeof(LeptrisDocument) == sizeof(void*), "ABI");
78
+ LEPTRIS_STATIC_ASSERT(sizeof(LeptrisElement) == sizeof(void*), "ABI");
79
+ LEPTRIS_STATIC_ASSERT(sizeof(LeptrisAttribute) == sizeof(void*), "ABI");
80
+ LEPTRIS_STATIC_ASSERT(sizeof(LeptrisXPathResult) == sizeof(void*), "ABI");
81
+
82
+ /* ============================================================================
83
+ * Node Operations
84
+ * ============================================================================ */
85
+
86
+ /**
87
+ * Get node type
88
+ *
89
+ * @param node Node handle
90
+ * @return Node type code (0=Element, 1=Text, 2=Comment, 3=CDATA, 4=PI, 5=DOCTYPE, 6=Attribute)
91
+ */
92
+ LEPTRIS_API int leptris_node_get_type(LeptrisNodeRef node);
93
+
94
+ /**
95
+ * Get the 1-based source line of a node (issue #510)
96
+ *
97
+ * Derived on demand from the node's text anchor (element name,
98
+ * text/comment/CDATA content, PI target) inside the document's
99
+ * input buffer — nodes carry no line field (96-byte budget). Cost
100
+ * is proportional to the bytes before the node; fine for tooling,
101
+ * avoid in hot loops.
102
+ *
103
+ * @param node Any node handle (cast elements with
104
+ * leptris_element_as_node)
105
+ * @return 1-based line, or 0 when unknown: mutated/created nodes
106
+ * (pool-owned strings), detached nodes, or NULL
107
+ */
108
+ LEPTRIS_API int leptris_node_line(LeptrisNodeRef node);
109
+ /**
110
+ * Get the node's byte offset within the source document (0-based;
111
+ * the '<' of the node's markup). Returns 0 when unknown (mutation-
112
+ * created nodes, or documents >= 2 GiB whose offsets do not fit).
113
+ * Parse-created nodes store byteOffset+1 internally (the issue #223
114
+ * lazy line scheme) — this accessor surfaces the raw byte position
115
+ * for descriptor materialization (#1039).
116
+ */
117
+ LEPTRIS_API size_t leptris_node_byte_offset(LeptrisNodeRef node);
118
+
119
+
120
+ /**
121
+ * Get first child node (any type)
122
+ *
123
+ * @param node Parent node
124
+ * @return First child node (element, text, comment, CDATA, or PI), or NULL if no children
125
+ *
126
+ * Memory: Node is owned by document. Do not free.
127
+ */
128
+ LEPTRIS_API LeptrisNodeRef leptris_node_first_child(LeptrisNodeRef node);
129
+
130
+ /**
131
+ * Get last child node (any type)
132
+ *
133
+ * @param node Parent node
134
+ * @return Last child node, or NULL if no children
135
+ *
136
+ * Memory: Node is owned by document. Do not free.
137
+ */
138
+ LEPTRIS_API LeptrisNodeRef leptris_node_last_child(LeptrisNodeRef node);
139
+
140
+ /**
141
+ * Get next sibling node (any type)
142
+ *
143
+ * @param node Current node
144
+ * @return Next sibling node, or NULL if node is last child
145
+ *
146
+ * Memory: Node is owned by document. Do not free.
147
+ */
148
+ LEPTRIS_API LeptrisNodeRef leptris_node_next_sibling(LeptrisNodeRef node);
149
+
150
+ /**
151
+ * Get previous sibling node (any type)
152
+ *
153
+ * @param node Current node
154
+ * @return Previous sibling node, or NULL if node is first child
155
+ *
156
+ * Memory: Node is owned by document. Do not free.
157
+ */
158
+ LEPTRIS_API LeptrisNodeRef leptris_node_previous_sibling(LeptrisNodeRef node);
159
+
160
+ /**
161
+ * Get child ELEMENT count (issue #910: the count covers elements
162
+ * only; the mixed-kind child chain — text, comments, CDATA, PIs —
163
+ * is walked via leptris_node_first_child/next_sibling, or sized
164
+ * and copied in one call by leptris_node_children(parent, NULL, 0)
165
+ * followed by the copy call).
166
+ *
167
+ * @param node Parent node
168
+ * @return Number of child elements (0 for non-element nodes)
169
+ */
170
+ LEPTRIS_API size_t leptris_node_child_count(LeptrisNodeRef node);
171
+
172
+ /* On-demand Merkle digest of a subtree's CONTENT (issue #869):
173
+ * a stable, content-defined hash — element name/prefix/resolved
174
+ * namespace URI, attributes sorted by (namespace URI, local name)
175
+ * and deduplicated first-wins, children hashed recursively in
176
+ * document order; text/CDATA/comment/PI hash their content (target
177
+ * included for PIs). No pointers or addresses participate, so the
178
+ * value is stable across processes. Equality implies subtree
179
+ * equivalence under the flag semantics; inequality implies nothing
180
+ * (descend and decide). Zero cost when never called.
181
+ *
182
+ * @param node Subtree root (any node type; NULL hashes to 0)
183
+ * @param flags LEPTRIS_DIGEST_DROP_WS_TEXT skips whitespace-only
184
+ * text nodes
185
+ * @return 64-bit content digest
186
+ */
187
+ LEPTRIS_API uint64_t leptris_node_digest(LeptrisNodeRef node,
188
+ LeptrisDigestFlags flags);
189
+
190
+ /* ============================================================================
191
+ * Schematron (lane 16) — the third validation pillar
192
+ * ========================================================================== */
193
+
194
+ typedef struct leptris_schematron* LeptrisSchematron;
195
+
196
+ /**
197
+ * Parse a Schematron schema (ISO/2025 vocabulary: schema/pattern/
198
+ * rule/assert/report with @context/@test; queryBinding xslt).
199
+ *
200
+ * @param schema Schema text
201
+ * @param len Length
202
+ * @param status Optional status out-param
203
+ * @return Schema handle, or NULL on error (detail via
204
+ * leptris_schematron_error / leptris_last_error)
205
+ * Memory: Caller owns (leptris_schematron_free).
206
+ */
207
+ LEPTRIS_API LeptrisSchematron leptris_schematron_parse(
208
+ const char* schema, size_t len, LeptrisStatus* status);
209
+
210
+ /** Parse a Schematron schema from a file path. */
211
+ LEPTRIS_API LeptrisSchematron leptris_schematron_parse_file(
212
+ const char* path, LeptrisStatus* status);
213
+
214
+ /**
215
+ * Parse a Schematron schema selecting a PHASE (@p phase_id): only
216
+ * the patterns the phase activates are evaluated. NULL or "" for
217
+ * @p phase_id keeps every pattern (the default).
218
+ */
219
+ LEPTRIS_API LeptrisSchematron leptris_schematron_parse_phase(
220
+ const char* schema, size_t len, const char* phase_id,
221
+ LeptrisStatus* status);
222
+
223
+ /** Free a schema handle. */
224
+ LEPTRIS_API void leptris_schematron_free(LeptrisSchematron sch);
225
+
226
+ /**
227
+ * Validate an instance document. Validity = zero failed asserts
228
+ * (successful-report entries do not invalidate).
229
+ *
230
+ * @return 1 valid, 0 invalid (or bad args)
231
+ */
232
+ LEPTRIS_API int leptris_schematron_valid(LeptrisSchematron sch,
233
+ LeptrisDocument doc);
234
+
235
+ /**
236
+ * Validate and return the SVRL report document (svrl:
237
+ * schematron-output with failed-assert / successful-report
238
+ * entries carrying @test, @location and svrl:text).
239
+ *
240
+ * @return SVRL document (caller frees), or NULL on error
241
+ */
242
+ LEPTRIS_API LeptrisDocument leptris_schematron_validate(
243
+ LeptrisSchematron sch, LeptrisDocument doc);
244
+
245
+ /** Last schema-level error message, or NULL. */
246
+ LEPTRIS_API const char* leptris_schematron_error(
247
+ LeptrisSchematron sch);
248
+
249
+ /* ============================================================================
250
+ * XML Diff (lane 17) — digest-pruned ordered edit script
251
+ * ========================================================================== */
252
+
253
+ typedef struct leptris_diff* LeptrisDiff;
254
+
255
+ /**
256
+ * Compute a tree diff between two documents.
257
+ *
258
+ * Equal subtrees (by the #869 content-defined Merkle digest)
259
+ * prune in O(1); diverging regions align via an LCS on child
260
+ * digests, then same-named elements recurse. Attribute add and
261
+ * remove are UPDATE_ATTR ops with an empty side.
262
+ *
263
+ * @param a First document (the "before")
264
+ * @param b Second document (the "after")
265
+ * @param flags LEPTRIS_DIFF_DEFAULT or LEPTRIS_DIFF_IGNORE_WS_TEXT
266
+ * @param status Optional status out-param
267
+ * @return Opaque diff handle, or NULL on error
268
+ * Memory: Caller owns the handle (leptris_diff_free).
269
+ */
270
+ LEPTRIS_API LeptrisDiff leptris_diff(LeptrisDocument a,
271
+ LeptrisDocument b,
272
+ LeptrisDiffFlags flags,
273
+ LeptrisStatus* status);
274
+
275
+ /** Free a diff handle (all op strings are owned by it). */
276
+ LEPTRIS_API void leptris_diff_free(LeptrisDiff diff);
277
+
278
+ /** Number of ops in the edit script. */
279
+ LEPTRIS_API size_t leptris_diff_op_count(LeptrisDiff diff);
280
+
281
+ /** Op kind at @p index (0-based; out of range -> 0). */
282
+ LEPTRIS_API LeptrisDiffOpType leptris_diff_op_type(LeptrisDiff diff,
283
+ size_t index);
284
+
285
+ /**
286
+ * Op path at @p index: root-relative, e.g. "/r/i[2]". Children
287
+ * named uniquely carry no suffix; INSERT/DELETE paths always
288
+ * carry the 1-based same-name position. Document-owned.
289
+ */
290
+ LEPTRIS_API const char* leptris_diff_op_path(LeptrisDiff diff,
291
+ size_t index);
292
+
293
+ /**
294
+ * Op name at @p index: the attribute name for UPDATE_ATTR, the
295
+ * element name for INSERT/DELETE, "" for UPDATE_TEXT.
296
+ * Document-owned.
297
+ */
298
+ LEPTRIS_API const char* leptris_diff_op_name(LeptrisDiff diff,
299
+ size_t index);
300
+
301
+ /** Before payload (attribute value / text), "" when none.
302
+ * Document-owned. */
303
+ LEPTRIS_API const char* leptris_diff_op_before(LeptrisDiff diff,
304
+ size_t index);
305
+
306
+ /** After payload (attribute value / text), "" when none.
307
+ * Document-owned. */
308
+ LEPTRIS_API const char* leptris_diff_op_after(LeptrisDiff diff,
309
+ size_t index);
310
+
311
+ /**
312
+ * Serialize the edit script to a line-per-op text form:
313
+ * '- <path> @<attr> "<before>" -> "<after>"' (UPDATE_ATTR)
314
+ * '~ <path> "<before>" -> "<after>"' (UPDATE_TEXT)
315
+ * '+ <path> <<name>>' (INSERT)
316
+ * 'x <path> <<name>>' (DELETE)
317
+ *
318
+ * @return Malloc'd string (free with leptris_free_string)
319
+ */
320
+ LEPTRIS_API char* leptris_diff_serialize(LeptrisDiff diff);
321
+
322
+
323
+ /**
324
+ * Copy child node handles of ANY kind into a caller array (issue #535)
325
+ *
326
+ * One call instead of first_child + N next_sibling round-trips —
327
+ * elements, text, comments, CDATA and PIs alike. Same shape as
328
+ * leptris_xpath_result_get_nodes_ex.
329
+ *
330
+ * @param parent Parent node (any type that can hold children)
331
+ * @param out_nodes Output array of child node handles, or NULL for
332
+ * a count-only query
333
+ * @param max_count Capacity of out_nodes
334
+ * @return With out_nodes NULL: the TOTAL child count across every
335
+ * kind (leptris_node_child_count counts elements only, so
336
+ * it cannot size a mixed array). With out_nodes non-NULL:
337
+ * the number of handles copied, min(total, max_count).
338
+ *
339
+ * Memory: Nodes are owned by the document. Do not free separately.
340
+ */
341
+ LEPTRIS_API size_t leptris_node_children(LeptrisNodeRef parent,
342
+ LeptrisNodeRef* out_nodes,
343
+ size_t max_count);
344
+
345
+ /**
346
+ * Batch child handles WITH each child's kind (issue #617)
347
+ *
348
+ * leptris_node_children's shape plus out_kinds: the kind rides the
349
+ * batch, so a binding's child walk skips the per-node get_type
350
+ * dispatch entirely (the same shape as the XPath batch accessors).
351
+ *
352
+ * @param parent Parent node (any type that can hold children)
353
+ * @param out_nodes Output array of child node handles, or NULL for
354
+ * a count-only query
355
+ * @param out_kinds Output array receiving each child's LeptrisNodeKind
356
+ * in lockstep with out_nodes; NULL to skip
357
+ * @param max_count Capacity of out_nodes/out_kinds
358
+ * @return Identical contract to leptris_node_children: with
359
+ * out_nodes NULL the total child count; otherwise the number
360
+ * copied, min(total, max_count).
361
+ *
362
+ * Memory: Nodes are owned by the document. Do not free separately.
363
+ */
364
+ LEPTRIS_API size_t leptris_node_children_ex(LeptrisNodeRef parent,
365
+ LeptrisNodeRef* out_nodes,
366
+ LeptrisNodeKind* out_kinds,
367
+ size_t max_count);
368
+ /**
369
+ * Raw attribute view including xmlns declarations, source order
370
+ * (issue #635)
371
+ *
372
+ * The attribute chain and the namespace-declaration accessors store
373
+ * the two separately; this returns the MIXED qname-ordered list the
374
+ * streaming transports deliver - declarations interleaved among the
375
+ * attributes at their byte positions. Names and values are as
376
+ * written (qnames like "xmlns" / "xmlns:prefix" / "a:attr").
377
+ *
378
+ * @param elem Element (any; elements without attributes or
379
+ * declarations report 0)
380
+ * @param out_qnames Output array of qualified-name strings, or NULL
381
+ * for a count-only query
382
+ * @param out_values Output array of value strings (parallel), or
383
+ * NULL for a count-only query
384
+ * @param max_count Capacity of the output arrays
385
+ * @return With both outputs NULL: the total entry count. Otherwise
386
+ * the number copied, min(total, max_count).
387
+ *
388
+ * Memory: Strings are owned by the element. Do not free separately.
389
+ */
390
+ LEPTRIS_API size_t leptris_element_attributes_raw(
391
+ LeptrisElement elem, const char** out_qnames, const char** out_values,
392
+ size_t max_count);
393
+
394
+ /**
395
+ * Cast node to element (if node is an element)
396
+ *
397
+ * @param node Node handle
398
+ * @return Element handle, or NULL if node is not an element
399
+ *
400
+ * Memory: Element is owned by document. Do not free.
401
+ */
402
+ LEPTRIS_API LeptrisElement leptris_node_as_element(LeptrisNodeRef node);
403
+
404
+ /**
405
+ * Cast element to its base node handle (for traversal with the
406
+ * leptris_node_* family of operations).
407
+ *
408
+ * Every element IS-A node (the element struct begins with a LeptrisNode
409
+ * header), so this cast is always safe. The reverse direction is
410
+ * leptris_node_as_element(), which returns NULL for non-element nodes.
411
+ *
412
+ * @param elem Element handle
413
+ * @return Node handle, or NULL if elem is NULL
414
+ *
415
+ * Memory: Handle is owned by the document. Do not free.
416
+ */
417
+ LEPTRIS_API LeptrisNodeRef leptris_element_as_node(LeptrisElement elem);
418
+
419
+ /**
420
+ * Get text content from text node
421
+ *
422
+ * @param node Node handle (must be LEPTRIS_NODE_TYPE_TEXT or LEPTRIS_NODE_TYPE_CDATA)
423
+ * @return Text content, or NULL if node is not a text/CDATA node
424
+ *
425
+ * Memory: String is owned by node. Do not free or modify.
426
+ */
427
+ LEPTRIS_API const char* leptris_text_node_get_content(LeptrisNodeRef node);
428
+
429
+ /**
430
+ * Create a new Text node owned by the given document (issue #167).
431
+ *
432
+ * @param doc Document that will own the new node
433
+ * @param content Text content (NUL-terminated). May be empty ("").
434
+ * @return New node handle, or NULL on allocation failure
435
+ *
436
+ * Memory: Node is owned by doc; released by leptris_document_free.
437
+ * content is pool-copied.
438
+ */
439
+ LEPTRIS_API LeptrisNodeRef leptris_text_node_create(LeptrisDocument doc,
440
+ const char* content);
441
+
442
+ /**
443
+ * Create a new Comment node owned by the given document (issue #167).
444
+ *
445
+ * @param doc Owning document
446
+ * @param content Comment body (NUL-terminated)
447
+ * @return New node handle, or NULL on allocation failure
448
+ *
449
+ * Memory: Node is owned by doc; released by leptris_document_free.
450
+ */
451
+ LEPTRIS_API LeptrisNodeRef leptris_comment_node_create(LeptrisDocument doc,
452
+ const char* content);
453
+
454
+ /**
455
+ * Create a new CDATA node owned by the given document (issue #167).
456
+ *
457
+ * @param doc Owning document
458
+ * @param content CDATA section content (NUL-terminated)
459
+ * @return New node handle, or NULL on allocation failure
460
+ *
461
+ * Memory: Node is owned by doc; released by leptris_document_free.
462
+ */
463
+ LEPTRIS_API LeptrisNodeRef leptris_cdata_node_create(LeptrisDocument doc,
464
+ const char* content);
465
+
466
+ /**
467
+ * Create a new Processing Instruction node (issue #167).
468
+ *
469
+ * @param doc Owning document
470
+ * @param target PI target (e.g. "xml-stylesheet")
471
+ * @param data PI data (may be NULL or empty)
472
+ * @return New node handle, or NULL on allocation failure
473
+ *
474
+ * Memory: Node is owned by doc; released by leptris_document_free.
475
+ */
476
+ LEPTRIS_API LeptrisNodeRef leptris_pi_node_create(LeptrisDocument doc,
477
+ const char* target,
478
+ const char* data);
479
+
480
+ /**
481
+ * Create a new Entity Reference node (&name;) owned by the given
482
+ * document (#1094).
483
+ *
484
+ * The node serializes back as "&name;" and text-content reads
485
+ * resolve it against the predefined entities and the document's
486
+ * DTD entity table.
487
+ *
488
+ * @param doc Owning document
489
+ * @param name Entity name (e.g. "foo" for &foo;). Must be a
490
+ * non-empty NUL-terminated string.
491
+ * @return New node handle, or NULL on error
492
+ *
493
+ * Memory: Node is owned by doc; released by leptris_document_free.
494
+ * name is pool-copied.
495
+ */
496
+ LEPTRIS_API LeptrisNodeRef leptris_entity_ref_node_create(LeptrisDocument doc,
497
+ const char* name);
498
+
499
+ /**
500
+ * Read an entity-reference node's name (#1094).
501
+ *
502
+ * @return The entity name (e.g. "foo" for &foo;), or NULL when
503
+ * node is NULL or not an entity-reference node.
504
+ */
505
+ LEPTRIS_API const char* leptris_entity_ref_node_name(LeptrisNodeRef node);
506
+
507
+ /**
508
+ * Replace a Text node's content (issue #167).
509
+ *
510
+ * @param node Node handle (must be TEXT or CDATA)
511
+ * @param content New content (NUL-terminated, pool-copied)
512
+ * @return LEPTRIS_OK on success, LEPTRIS_ERROR_NULL_ARG or
513
+ * LEPTRIS_ERROR_INVALID_ARG on bad input
514
+ */
515
+ LEPTRIS_API LeptrisStatus leptris_text_node_set_content(LeptrisNodeRef node,
516
+ const char* content);
517
+
518
+ /**
519
+ * Replace a Comment node's content (issue #167).
520
+ */
521
+ LEPTRIS_API LeptrisStatus leptris_comment_node_set_content(LeptrisNodeRef node,
522
+ const char* content);
523
+
524
+ /**
525
+ * Replace a CDATA node's content (issue #167).
526
+ */
527
+ LEPTRIS_API LeptrisStatus leptris_cdata_node_set_content(LeptrisNodeRef node,
528
+ const char* content);
529
+
530
+ /**
531
+ * Replace a PI node's target (issue #167).
532
+ */
533
+ LEPTRIS_API LeptrisStatus leptris_pi_node_set_target(LeptrisNodeRef node,
534
+ const char* target);
535
+
536
+ /**
537
+ * Replace a PI node's data (issue #167).
538
+ */
539
+ LEPTRIS_API LeptrisStatus leptris_pi_node_set_data(LeptrisNodeRef node,
540
+ const char* data);
541
+
542
+ /**
543
+ * Get the parent of any node type (issue #168). Works on Text, Comment,
544
+ * CDATA, PI, and Element nodes. Returns NULL if node is detached or is
545
+ * the document root.
546
+ *
547
+ * @param node Node handle
548
+ * @return Parent element, or NULL if no parent
549
+ *
550
+ * Memory: Handle is owned by the document. Do not free.
551
+ */
552
+ LEPTRIS_API LeptrisElement leptris_node_parent(LeptrisNodeRef node);
553
+
554
+ /**
555
+ * Detach a node from its parent (issue #168). The node remains owned
556
+ * by its document and can be re-attached via leptris_element_append_child.
557
+ *
558
+ * @param node Node to unlink
559
+ * @return LEPTRIS_OK on success,
560
+ * LEPTRIS_ERROR_NULL_ARG if node is NULL,
561
+ * LEPTRIS_ERROR_NOT_FOUND if node has no parent
562
+ */
563
+ LEPTRIS_API LeptrisStatus leptris_node_unlink(LeptrisNodeRef node);
564
+
565
+ /**
566
+ * Get the source line number where the node's opening token appeared
567
+ * (issue #172). Returns 0 if the node was created programmatically
568
+ * (no source info) or the parser did not record line numbers.
569
+ */
570
+ LEPTRIS_API int leptris_node_line(LeptrisNodeRef node);
571
+
572
+ /** Parser-recorded source position for an element node (#1124). */
573
+ typedef struct {
574
+ int line; /* 1-based line, 0 when unknown */
575
+ int col_start; /* 1-based column after the start tag's '>' */
576
+ int col_end; /* 1-based column after the element's final '>' */
577
+ } LeptrisSourcePosition;
578
+
579
+ /**
580
+ * Get full parser-recorded source position for an element node.
581
+ *
582
+ * The parser records exact byte offsets while it scans tags. The
583
+ * columns follow Jing's diagnostic convention: col_start points to
584
+ * the byte after the start-tag '>'; col_end points to the byte after
585
+ * the element's final '>'. Programmatically-created nodes return
586
+ * zeros. Non-element parsed nodes currently return line with zero
587
+ * columns.
588
+ */
589
+ LEPTRIS_API void leptris_node_source_position(LeptrisNodeRef node,
590
+ LeptrisSourcePosition* out);
591
+
592
+ /**
593
+ * One RELAX NG validation error, in the structured report shape.
594
+ * Returned as a whole-list report via leptris_rng_error_report() -
595
+ * no per-index accessor stitching. All strings are handle-owned
596
+ * and live until the next validate call or leptris_rng_free.
597
+ */
598
+ typedef struct {
599
+ const char* kind; /* failure class, stable name:
600
+ * "not-allowed-anywhere", "not-allowed-here",
601
+ * "not-allowed-yet", "incomplete",
602
+ * "missing-required-attr", "attr-not-allowed",
603
+ * "attr-value-invalid", "char-content-invalid" */
604
+ const char* message; /* Jing-parity rendered message */
605
+ const char* offender; /* offending element/attribute name, or NULL */
606
+ unsigned line; /* 1-based source line, 0 when unknown */
607
+ unsigned column; /* 1-based Jing-convention column */
608
+ } LeptrisRngErrorRecord;
609
+
610
+ /**
611
+ * Get the full RELAX NG validation error report in one call.
612
+ *
613
+ * @param rng compiled schema handle after a leptris_rng_validate call
614
+ * @param out receives the handle-owned record array (may be NULL when
615
+ * the count is 0; left untouched on a NULL rng)
616
+ * @return record count; 0 for a valid document
617
+ */
618
+ LEPTRIS_API size_t leptris_rng_error_report(
619
+ LeptrisRelaxNG rng, const LeptrisRngErrorRecord** out);
620
+
621
+ /**
622
+ * Get the binding wrapper pointer cached on this node (#262).
623
+ *
624
+ * Language bindings (Ruby FFI, Python ctypes, etc.) set this on
625
+ * first node wrap so subsequent traversals find the cached wrapper
626
+ * without per-node FFI call overhead. Returns NULL when no binding
627
+ * is attached.
628
+ *
629
+ * Memory: The pointer is owned by the binding. libleptris never
630
+ * dereferences or frees it. Cleared to NULL on node creation.
631
+ */
632
+ LEPTRIS_API void* leptris_node_get_binding_wrapper(LeptrisNodeRef node);
633
+
634
+ /**
635
+ * Set the binding wrapper pointer on this node (#262).
636
+ *
637
+ * The binding must ensure the wrapper object outlives the document
638
+ * (or clear the pointer before the document is freed). libleptris
639
+ * treats this as opaque — it never reads or frees the value.
640
+ */
641
+ LEPTRIS_API void leptris_node_set_binding_wrapper(LeptrisNodeRef node, void* wrapper);
642
+
643
+ /**
644
+ * Document-order comparison (issue #172).
645
+ *
646
+ * @return -1 if a precedes b, 0 if equal, 1 if a follows b.
647
+ * Returns 0 if either is NULL or they are in different documents.
648
+ */
649
+ LEPTRIS_API int leptris_node_compare(LeptrisNodeRef a, LeptrisNodeRef b);
650
+
651
+ /**
652
+ * Build a canonical unique XPath string identifying `node` within
653
+ * its document (TODO 148 Phase 3).
654
+ *
655
+ * Format matches Nokogiri's `Node#path`:
656
+ * - Element: `/{qname}[N]` where N is 1-based position among
657
+ * same-named element siblings. If the qname is unique among
658
+ * siblings, `[N]` is omitted.
659
+ * - Text / CDATA: `/text()`
660
+ * - Comment: `/comment()`
661
+ * - Processing Instruction: `/processing-instruction()`
662
+ * - Root: `/` (a single slash)
663
+ *
664
+ * @param node Node to identify (must not be NULL)
665
+ * @return Newly allocated NUL-terminated string. Caller frees via
666
+ * `leptris_free_string`. Returns NULL on NULL node or
667
+ * allocation failure.
668
+ *
669
+ * Memory: Caller-owned; release with `leptris_free_string`.
670
+ */
671
+ LEPTRIS_API char* leptris_node_get_xpath(LeptrisNodeRef node);
672
+
673
+ /* Traversal order for leptris_node_traverse. */
674
+ typedef enum {
675
+ LEPTRIS_TRAVERSE_PRE_ORDER = 0, /* Parent before children */
676
+ LEPTRIS_TRAVERSE_POST_ORDER = 1 /* Children before parent */
677
+ } LeptrisTraverseOrder;
678
+
679
+ /**
680
+ * Traverse all descendant nodes of `root` in the specified order,
681
+ * invoking `callback` once per node.
682
+ *
683
+ * Crossing the FFI boundary once per traversal (not once per node)
684
+ * eliminates per-node call overhead — the main bottleneck for
685
+ * language bindings implementing Node#traverse, Node#each, etc.
686
+ *
687
+ * @param root Starting node (included in traversal)
688
+ * @param order LEPTRIS_TRAVERSE_PRE_ORDER or POST_ORDER
689
+ * @param callback Called once per node. Return 0 to continue,
690
+ * non-zero to stop early.
691
+ * @param user_data Opaque pointer passed to callback (may be NULL)
692
+ *
693
+ * @return Number of nodes visited, or -1 on error.
694
+ *
695
+ * Memory: Node handles passed to callback are document-owned.
696
+ */
697
+ LEPTRIS_API int leptris_node_traverse(LeptrisNodeRef root,
698
+ LeptrisTraverseOrder order,
699
+ int (*callback)(LeptrisNodeRef node,
700
+ void* user_data),
701
+ void* user_data);
702
+
703
+ /**
704
+ * Get comment content
705
+ *
706
+ * @param node Node handle (must be LEPTRIS_NODE_TYPE_COMMENT)
707
+ * @return Comment content, or NULL if node is not a comment
708
+ *
709
+ * Memory: String is owned by node. Do not free or modify.
710
+ */
711
+ LEPTRIS_API const char* leptris_comment_node_get_content(LeptrisNodeRef node);
712
+
713
+ /**
714
+ * Get CDATA content
715
+ *
716
+ * @param node Node handle (must be LEPTRIS_NODE_TYPE_CDATA)
717
+ * @return CDATA content, or NULL if node is not a CDATA node
718
+ *
719
+ * Memory: String is owned by node. Do not free or modify.
720
+ */
721
+ LEPTRIS_API const char* leptris_cdata_node_get_content(LeptrisNodeRef node);
722
+
723
+ /**
724
+ * Get processing instruction target
725
+ *
726
+ * @param node Node handle (must be LEPTRIS_NODE_TYPE_PI)
727
+ * @return PI target, or NULL if node is not a PI
728
+ *
729
+ * Memory: String is owned by node. Do not free or modify.
730
+ */
731
+ LEPTRIS_API const char* leptris_pi_node_get_target(LeptrisNodeRef node);
732
+
733
+ /**
734
+ * Get processing instruction data
735
+ *
736
+ * @param node Node handle (must be LEPTRIS_NODE_TYPE_PI)
737
+ * @return PI data, or NULL if node is not a PI or has no data
738
+ *
739
+ * Memory: String is owned by node. Do not free or modify.
740
+ */
741
+ LEPTRIS_API const char* leptris_pi_node_get_data(LeptrisNodeRef node);
742
+
743
+ /* ============================================================================
744
+ * Document Operations
745
+ * ============================================================================ */
746
+
747
+ /**
748
+ * Create an empty document with its own memory pool
749
+ *
750
+ * Complements the parse entry points: until now documents could only
751
+ * be obtained by parsing. Programmatic construction (bindings that
752
+ * build trees bottom-up) needs a document handle first so elements
753
+ * can be created against its pool via leptris_element_create().
754
+ *
755
+ * The document has no root element; attach one with
756
+ * leptris_document_set_root(). Serializing a rootless document
757
+ * returns NULL (there is nothing to write).
758
+ *
759
+ * @return Document handle or NULL on allocation failure
760
+ *
761
+ * Memory: Caller must call leptris_document_free() when done
762
+ * Thread safety: Not thread-safe. One document per thread.
763
+ */
764
+ LEPTRIS_API LeptrisDocument leptris_document_create(void);
765
+
766
+ /**
767
+ * Attach an element as the document's root element
768
+ *
769
+ * The element must have been created against @p doc (via
770
+ * leptris_element_create) and must not be attached to a parent.
771
+ * Replaces any existing root; the previous root is not freed — it
772
+ * remains a pool-owned, detached element.
773
+ *
774
+ * @param doc Document handle
775
+ * @param root Element to attach as root
776
+ * @return LEPTRIS_OK on success, LEPTRIS_ERROR_NULL_ARG on NULL
777
+ * inputs, or LEPTRIS_ERROR_INVALID_ARG when the element
778
+ * belongs to another document or already has a parent
779
+ */
780
+ LEPTRIS_API LeptrisStatus leptris_document_set_root(LeptrisDocument doc,
781
+ LeptrisElement root);
782
+
783
+ /**
784
+ * Parse XML string into document
785
+ *
786
+ * @param xml XML string (must be valid UTF-8)
787
+ * @param length Length of XML string in bytes
788
+ * @param status Output status code (can be NULL)
789
+ * @return Document handle or NULL on error
790
+ *
791
+ * Memory: Caller must call leptris_document_free() when done
792
+ * Thread safety: Not thread-safe. One document per thread.
793
+ */
794
+ LEPTRIS_API LeptrisDocument leptris_parse_string(const char* xml, size_t length, LeptrisStatus* status);
795
+
796
+ /**
797
+ * Parse an HTML string into a document (issue #659)
798
+ *
799
+ * Tolerant HTML4/5 parse into the standard DOM: implied end tags
800
+ * (p/li/td/tr/th/dt/dd/option/...), void elements, raw-text
801
+ * <script>/<style>, minimized + unquoted attribute values,
802
+ * case-insensitive tag/attribute names, and the HTML named-entity
803
+ * table. Behaviors follow libxml2's HTMLparser as exposed by
804
+ * Nokogiri (fragment shape: no synthesized <html>/<head>/<body>,
805
+ * no implied <tbody>). Malformed input never fails the parse — it
806
+ * degrades to text; a document with no nodes at all is an error.
807
+ * The result serializes and queries (XPath/XSLT) like any
808
+ * libleptris document.
809
+ *
810
+ * @param html HTML input (must be valid UTF-8)
811
+ * @param length Length of input in bytes
812
+ * @param status Output status code (can be NULL)
813
+ * @return Document handle or NULL on error
814
+ *
815
+ * Memory: Caller must call leptris_document_free() when done
816
+ * Thread safety: Not thread-safe. One document per thread.
817
+ */
818
+ LEPTRIS_API LeptrisDocument leptris_parse_html_string(const char* html,
819
+ size_t length,
820
+ LeptrisStatus* status);
821
+
822
+ /* HTML4/libxml2-compatibility mode (#659): identical tolerant
823
+ * tokenizer and Nokogiri document shape, except leading
824
+ * script/style content stays in <body> (libxml2's shape —
825
+ * title/meta/link/base still lift into the implied head). Bindings
826
+ * that must match Nokogiri byte-for-byte pin this entry;
827
+ * leptris_parse_html_string is the WHATWG-conformant engine.
828
+ * Memory contract identical to leptris_parse_html_string. */
829
+ LEPTRIS_API LeptrisDocument leptris_parse_html4_string(const char* html,
830
+ size_t length,
831
+ LeptrisStatus* status);
832
+
833
+ /* ---- RELAX NG (#878) ------------------------------------------------
834
+ * Phase 1: parse a RELAX NG XML-syntax schema into the compiled
835
+ * pattern representation. Validation arrives in phase 2.
836
+ *
837
+ * @param schema RELAX NG XML-syntax schema text
838
+ * @param len schema byte length
839
+ * @param status LEPTRIS_OK, or LEPTRIS_ERROR_PARSE on a schema
840
+ * error (wrong root namespace, unknown pattern
841
+ * element, missing @name, unsupported construct)
842
+ * @return compiled schema, or NULL (status says why)
843
+ *
844
+ * Memory: free with leptris_rng_free.
845
+ */
846
+ LEPTRIS_API LeptrisRelaxNG leptris_rng_parse(const char* schema,
847
+ size_t len,
848
+ LeptrisStatus* status);
849
+
850
+ /* Parse a RELAX NG schema from a file. <include href="..."> resolves
851
+ * relative to the file's directory; a <start>/<define> nested inside
852
+ * an <include> replaces the included grammar's matching declaration
853
+ * (which must exist). Include cycles are detected and rejected.
854
+ *
855
+ * @param path schema file path
856
+ * @param status LEPTRIS_OK, or LEPTRIS_ERROR_PARSE (missing file,
857
+ * not well-formed, schema error, bad include)
858
+ * @return compiled schema, or NULL (status says why)
859
+ *
860
+ * Memory: free with leptris_rng_free.
861
+ */
862
+ LEPTRIS_API LeptrisRelaxNG leptris_rng_parse_file(const char* path,
863
+ LeptrisStatus* status);
864
+ LEPTRIS_API void leptris_rng_free(LeptrisRelaxNG rng);
865
+ /* Validate an instance document against the parsed schema
866
+ * (phase-2 core subset: element/attribute/text/data/value/
867
+ * choice/group/interleave/repeats/ref). Returns 1 valid; on 0,
868
+ * every failure is appended to a per-validate list (Jing parity
869
+ * — the engine used to stop at the first). leptris_rng_error
870
+ * keeps returning the FIRST message (back-compat); the per-error
871
+ * accessors below enumerate every entry. */
872
+ LEPTRIS_API int leptris_rng_validate(LeptrisRelaxNG rng,
873
+ LeptrisDocument doc);
874
+ /* Last parse error detail (NULL when the handle is valid).
875
+ * For validation: returns the FIRST validation error in
876
+ * "line:column: error: message" shape, with parser-recorded
877
+ * Jing-compatible positions. */
878
+ LEPTRIS_API const char* leptris_rng_error(LeptrisRelaxNG rng);
879
+ /* Number of accumulated validation errors from the last
880
+ * leptris_rng_validate call. Reset to 0 at the start of every
881
+ * validate call. */
882
+ LEPTRIS_API size_t leptris_rng_error_count(LeptrisRelaxNG rng);
883
+ /* Nth accumulated error's message (NULL when i is out of
884
+ * range). The string is schema/instance-owned and lives until
885
+ * the next validate call or leptris_rng_free. */
886
+ LEPTRIS_API const char* leptris_rng_error_message(LeptrisRelaxNG rng,
887
+ size_t i);
888
+ /* Nth accumulated error's parse line (1-based, 0 unknown). */
889
+ LEPTRIS_API int leptris_rng_error_line(LeptrisRelaxNG rng, size_t i);
890
+ /* Nth accumulated error's parser-recorded column (1-based). */
891
+ LEPTRIS_API int leptris_rng_error_column(LeptrisRelaxNG rng, size_t i);
892
+
893
+
894
+ LEPTRIS_API LeptrisDocument leptris_parse_string_flags(const char* xml,
895
+ size_t length,
896
+ LeptrisParseFlags flags,
897
+ LeptrisStatus* status);
898
+
899
+ /**
900
+ * Parse with per-call options (TODO.bindings/05)
901
+ *
902
+ * Scoped alternative to the thread-global leptris_set_strict_mode /
903
+ * leptris_set_max_depth: the options apply to THIS parse only; the
904
+ * thread defaults are restored on return. Invalid input fails with
905
+ * LEPTRIS_ERROR_PARSE (message + position via leptris_last_error /
906
+ * leptris_last_error_position).
907
+ *
908
+ * Not reentrant: do not parse from inside allocators invoked by
909
+ * this call (options are applied via thread-local state).
910
+ *
911
+ * @param xml Input
912
+ * @param length Input length in bytes
913
+ * @param options Options (NULL = defaults, same as parse_string)
914
+ * @param status Optional status out-param
915
+ * @return Document, or NULL on failure
916
+ */
917
+ LEPTRIS_API LeptrisDocument leptris_parse_string_ex(const char* xml,
918
+ size_t length,
919
+ const LeptrisParseOptions* options,
920
+ LeptrisStatus* status);
921
+
922
+ /**
923
+ * Parse XML string into document with zero-copy optimization
924
+ *
925
+ * This function modifies the input buffer in-place by NULL-terminating strings.
926
+ * The document retains a reference to the input buffer, which must remain valid
927
+ * for the lifetime of the document.
928
+ *
929
+ * @param xml Writable XML string (must be valid UTF-8, will be modified)
930
+ * @param length Length of XML string in bytes
931
+ * @param status Output status code (can be NULL)
932
+ * @return Document handle or NULL on error
933
+ *
934
+ * Memory:
935
+ * - Caller must call leptris_document_free() when done
936
+ * - Caller must keep xml buffer alive until document is freed
937
+ * - xml buffer will be modified (NULL terminators inserted)
938
+ *
939
+ * Performance: 3-5x faster than leptris_parse_string() due to zero allocations
940
+ * Thread safety: Not thread-safe. One document per thread.
941
+ */
942
+ LEPTRIS_API LeptrisDocument leptris_parse_string_inplace(char* xml, size_t length, LeptrisStatus* status);
943
+
944
+ /**
945
+ * Parse an XML fragment (multiple top-level children allowed) into
946
+ * a synthetic container element owned by `dest_doc` (TODO 148
947
+ * Phase 4).
948
+ *
949
+ * @param xml Fragment source (NUL-terminated not required; length used)
950
+ * @param length Byte length of `xml`
951
+ * @param dest_doc Document that will own the synthetic container
952
+ * and its children. May NOT be NULL.
953
+ * @param status Output status (may be NULL)
954
+ * @return Newly created synthetic element named `#document-fragment`,
955
+ * or NULL on error. The synthetic has no parent reference;
956
+ * caller may attach or discard it.
957
+ *
958
+ * The synthetic container's children are the parsed top-level
959
+ * nodes. Fragment parsing differs from full-document parsing in
960
+ * that multiple top-level elements are allowed (e.g. `"<a/><b/>"`).
961
+ *
962
+ * Backs `Document#fragment` and `Node#fragment` in the Ruby
963
+ * binding. Caller moves children via `leptris_element_append_child`
964
+ * (which unlinks from the synthetic, see #217).
965
+ *
966
+ * Memory: Synthetic + children are owned by `dest_doc`; released
967
+ * by `leptris_document_free`.
968
+ */
969
+ LEPTRIS_API LeptrisElement leptris_parse_fragment(const char* xml,
970
+ size_t length,
971
+ LeptrisDocument dest_doc,
972
+ LeptrisStatus* status);
973
+
974
+ /**
975
+ * Parse XML string with automatic encoding detection and conversion
976
+ *
977
+ * This function automatically detects the encoding from:
978
+ * 1. XML declaration encoding="..." attribute
979
+ * 2. Byte Order Mark (BOM) if present
980
+ * 3. Heuristic detection (UTF-8, UTF-16, ISO-8859-1, etc.)
981
+ *
982
+ * If the encoding is not UTF-8, the input is converted to UTF-8 before parsing.
983
+ * Requires iconv support (enabled by default via vcpkg).
984
+ *
985
+ * @param xml XML string (any encoding)
986
+ * @param length Length of XML string in bytes
987
+ * @param status Output status code (can be NULL)
988
+ * @return Document handle or NULL on error
989
+ *
990
+ * Supported encodings:
991
+ * - UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE
992
+ * - ISO-8859-1, ISO-8859-2, ISO-8859-15
993
+ * - Windows-1252
994
+ * - Shift_JIS, EUC-JP, GB18030
995
+ *
996
+ * Memory: Caller must call leptris_document_free() when done
997
+ * Thread safety: Not thread-safe. One document per thread.
998
+ */
999
+ LEPTRIS_API LeptrisDocument leptris_parse_string_with_encoding(const char* xml, size_t length, LeptrisStatus* status);
1000
+
1001
+ /**
1002
+ * Load file into memory buffer
1003
+ *
1004
+ * Reads entire file into a newly allocated buffer. Caller must free the buffer.
1005
+ *
1006
+ * @param filepath Path to file to load
1007
+ * @param out_size Output parameter for file size (can be NULL)
1008
+ * @return Newly allocated buffer containing file contents, or NULL on error
1009
+ *
1010
+ * Memory: Caller must free the returned buffer with LEPTRIS_FREE()
1011
+ * Thread safety: Thread-safe (multiple threads can load different files)
1012
+ */
1013
+ LEPTRIS_API char* leptris_load_file(const char* filepath, size_t* out_size);
1014
+
1015
+ /**
1016
+ * Parse XML file directly
1017
+ *
1018
+ * Convenience function that loads a file and parses it as XML.
1019
+ *
1020
+ * @param filepath Path to XML file to parse
1021
+ * @param status Output status code (can be NULL)
1022
+ * @return Document handle or NULL on error
1023
+ *
1024
+ * Memory: Caller must call leptris_document_free() when done
1025
+ * Thread safety: Not thread-safe. One document per thread.
1026
+ */
1027
+ LEPTRIS_API LeptrisDocument leptris_parse_file(const char* filepath, LeptrisStatus* status);
1028
+
1029
+ /**
1030
+ * Free document and all its elements
1031
+ *
1032
+ * @param doc Document to free (can be NULL)
1033
+ */
1034
+ LEPTRIS_API void leptris_document_free(LeptrisDocument doc);
1035
+
1036
+ /**
1037
+ * Adopt a child document into the parent's lifecycle.
1038
+ *
1039
+ * TODO 117: used by xi:include parse="xml" to transfer ownership
1040
+ * of a freshly-parsed included document so its pool (which now
1041
+ * owns nodes spliced into the parent tree) survives until the
1042
+ * parent is freed. Sets `child->child_docs` to NULL so the child
1043
+ * doesn't recursively carry its own adopted docs.
1044
+ *
1045
+ * @param parent Owning document (must outlive child)
1046
+ * @param child Adopted document (its pool is kept alive by `parent`)
1047
+ */
1048
+ LEPTRIS_API void leptris_document_adopt_child(LeptrisDocument parent,
1049
+ LeptrisDocument child);
1050
+
1051
+ /**
1052
+ * Get root element of document
1053
+ *
1054
+ * @param doc Document
1055
+ * @return Root element or NULL if document is NULL or empty
1056
+ *
1057
+ * Memory: Element is owned by document. Do not free separately.
1058
+ */
1059
+ LEPTRIS_API LeptrisElement leptris_document_root(LeptrisDocument doc);
1060
+
1061
+ /* #580 document-children chain: [prolog nodes..., root, epilog
1062
+ * nodes...]. Chain-less documents fall back to the root element.
1063
+ * Walk with leptris_node_next_sibling.
1064
+ * Memory: node is owned by the document. */
1065
+ LEPTRIS_API LeptrisNodeRef leptris_document_first_child(
1066
+ LeptrisDocument doc);
1067
+
1068
+ /**
1069
+ * Get document encoding string
1070
+ *
1071
+ * @param doc Document
1072
+ * @return Encoding string (e.g. "UTF-8") or NULL if not set
1073
+ *
1074
+ * Memory: String is owned by document. Do not free.
1075
+ */
1076
+ LEPTRIS_API const char* leptris_document_encoding(LeptrisDocument doc);
1077
+
1078
+ /**
1079
+ * XML declaration surface (#1094). Getters read the parsed or
1080
+ * previously-set values; the setters pool-copy and mark the
1081
+ * document as declaration-bearing so serialization emits
1082
+ * <?xml ...?> in document position.
1083
+ *
1084
+ * standalone: -1 = not set, 0 = "no", 1 = "yes".
1085
+ */
1086
+ LEPTRIS_API const char* leptris_document_version(LeptrisDocument doc);
1087
+ LEPTRIS_API int leptris_document_standalone(LeptrisDocument doc);
1088
+ LEPTRIS_API LeptrisStatus leptris_document_set_version(
1089
+ LeptrisDocument doc, const char* version);
1090
+ LEPTRIS_API LeptrisStatus leptris_document_set_encoding(
1091
+ LeptrisDocument doc, const char* encoding);
1092
+ LEPTRIS_API LeptrisStatus leptris_document_set_standalone(
1093
+ LeptrisDocument doc, int standalone);
1094
+
1095
+ /**
1096
+ * Programmatic DOCTYPE (#1094): create and set the document's
1097
+ * DOCTYPE (root name + optional PUBLIC/SYSTEM external
1098
+ * identifiers). Serializes in document position once set; read
1099
+ * back with the leptris_doctype_* getters on the returned node.
1100
+ *
1101
+ * Memory: The node is owned by the document; the input strings are
1102
+ * pool-copied.
1103
+ */
1104
+ LEPTRIS_API LeptrisDoctype leptris_document_set_doctype(
1105
+ LeptrisDocument doc, const char* name,
1106
+ const char* public_id, const char* system_id);
1107
+
1108
+ /**
1109
+ * Get the document's internal DTD subset — the DOCTYPE declaration
1110
+ * (TODO 148 Phase 2).
1111
+ *
1112
+ * @param doc Document handle
1113
+ * @return Opaque `LeptrisDoctype` handle, or NULL if the document
1114
+ * has no DOCTYPE.
1115
+ *
1116
+ * Use the `leptris_doctype_*` accessors below to read the name,
1117
+ * public identifier, system identifier, and internal subset.
1118
+ *
1119
+ * Memory: Handle is owned by the document; released by
1120
+ * `leptris_document_free`.
1121
+ */
1122
+ LEPTRIS_API LeptrisDoctype leptris_document_internal_subset(LeptrisDocument doc);
1123
+
1124
+ /* ============================================================================
1125
+ * Document-level processing instructions (issue #526)
1126
+ * ============================================================================ */
1127
+
1128
+ /**
1129
+ * The document node — XPath/XSLT root (issue #580)
1130
+ *
1131
+ * Navigation head for the document's children: prolog comments/PIs,
1132
+ * the root element, then epilog comments/PIs, in document order.
1133
+ * Standard node APIs (leptris_node_first_child, next_sibling,
1134
+ * get_type, leptris_node_children) walk that chain; document-level
1135
+ * nodes are visible to leptris_xpath_eval (/processing-instruction(),
1136
+ * /comment(), //comment()).
1137
+ *
1138
+ * The handle is a stable, document-owned singleton.
1139
+ *
1140
+ * @param doc Document
1141
+ * @return The document node, or NULL for NULL
1142
+ */
1143
+ LEPTRIS_API LeptrisNodeRef leptris_document_node(LeptrisDocument doc);
1144
+
1145
+ /**
1146
+ * Visit callback for leptris_node_visit (issue #645a): node pointer
1147
+ * with enter/leave (elements) and depth from the walk's root.
1148
+ */
1149
+ typedef void (*LeptrisNodeVisitor)(void* user_data, LeptrisNodeRef node,
1150
+ int entering, int depth);
1151
+
1152
+ /**
1153
+ * Wrap-free subtree visitation (issue #645a)
1154
+ *
1155
+ * Walks a subtree in document order with ONE C call, handing the
1156
+ * host every node pointer through a callback — bindings wrap nodes
1157
+ * lazily instead of materializing per-level NodeSet/Array
1158
+ * allocations (the per-node allocation floor of the walk).
1159
+ *
1160
+ * Elements are visited TWICE: entering=1 before their children,
1161
+ * entering=0 after the subtree completes. Every other node kind
1162
+ * (text, CDATA, comment, PI) is visited once with entering=1.
1163
+ * `depth` is 0 at the walk's root and increments per element level.
1164
+ *
1165
+ * Passing the DOCUMENT node walks the document child chain (the
1166
+ * root element and any document-level nodes); the document node
1167
+ * itself is the container, not a visited node.
1168
+ *
1169
+ * The walk is read-only; mutating the tree from the callback
1170
+ * (unlinking, moving) is not supported.
1171
+ *
1172
+ * @param root Subtree root (any node kind, or a document node)
1173
+ * @param visitor Callback per node (may be NULL — no-op)
1174
+ * @param user_data Opaque context for the callback
1175
+ */
1176
+ LEPTRIS_API void leptris_node_visit(LeptrisNodeRef root,
1177
+ LeptrisNodeVisitor visitor,
1178
+ void* user_data);
1179
+
1180
+ /**
1181
+ * Count the document's top-level processing instructions
1182
+ *
1183
+ * Parsed `<?target data?>` items outside the root element (and ones
1184
+ * added via leptris_document_add_pi). The XML declaration is not a PI.
1185
+ *
1186
+ * @param doc Document
1187
+ * @return PI count, or 0 for NULL
1188
+ */
1189
+ LEPTRIS_API size_t leptris_document_pi_count(LeptrisDocument doc);
1190
+
1191
+ /**
1192
+ * Get a document-level PI's target by index
1193
+ *
1194
+ * @param doc Document
1195
+ * @param index 0-based, < leptris_document_pi_count
1196
+ * @return Target string (document-owned, lives until
1197
+ * leptris_document_free), or NULL when out of range
1198
+ */
1199
+ LEPTRIS_API const char* leptris_document_pi_target(LeptrisDocument doc,
1200
+ size_t index);
1201
+
1202
+ /**
1203
+ * Get a document-level PI's data by index
1204
+ *
1205
+ * @param doc Document
1206
+ * @param index 0-based, < leptris_document_pi_count
1207
+ * @return Data string, "" when the PI has none (document-owned), or
1208
+ * NULL when out of range
1209
+ */
1210
+ LEPTRIS_API const char* leptris_document_pi_data(LeptrisDocument doc,
1211
+ size_t index);
1212
+
1213
+ /* ============================================================================
1214
+ * Document-level comments (issue #578)
1215
+ * ============================================================================ */
1216
+
1217
+ /**
1218
+ * Count the document's top-level comments
1219
+ *
1220
+ * Parsed `<!-- ... -->` items outside the root element, in document
1221
+ * order (prolog comments first, then epilog comments).
1222
+ *
1223
+ * @param doc Document
1224
+ * @return Comment count, or 0 for NULL
1225
+ */
1226
+ LEPTRIS_API size_t leptris_document_comment_count(LeptrisDocument doc);
1227
+
1228
+ /**
1229
+ * Get a document-level comment's content by index
1230
+ *
1231
+ * @param doc Document
1232
+ * @param index 0-based, < leptris_document_comment_count
1233
+ * @return Content between the markers (document-owned, lives until
1234
+ * leptris_document_free), or NULL when out of range
1235
+ */
1236
+ LEPTRIS_API const char* leptris_document_comment_content(LeptrisDocument doc,
1237
+ size_t index);
1238
+
1239
+ /**
1240
+ * Append a document-level processing instruction
1241
+ *
1242
+ * The PI is appended after any existing document PIs (serialized
1243
+ * after the XML declaration, before the root element).
1244
+ *
1245
+ * @param doc Document (must exist)
1246
+ * @param target PI target (copied)
1247
+ * @param data PI data (copied; may be NULL or empty)
1248
+ * @return Opaque non-NULL witness on success (enumerate via the
1249
+ * accessors above; do NOT pass it to node APIs — document
1250
+ * PIs are not tree nodes), or NULL on invalid input / OOM
1251
+ */
1252
+ /**
1253
+ * Remove a document-level processing instruction (issue #612)
1254
+ *
1255
+ * Identifies the PI by target (first match in document order), or
1256
+ * by index among the document's PIs when target is NULL. The node
1257
+ * is unlinked from the document's child chain and returned — it is
1258
+ * pool-owned and remains valid until leptris_document_free (this
1259
+ * API does not free it).
1260
+ *
1261
+ * @param doc Document
1262
+ * @param target PI target to match, or NULL to use index
1263
+ * @param index 0-based index among the document's PIs (target=NULL)
1264
+ * @return the removed node, or NULL when not found
1265
+ */
1266
+ LEPTRIS_API LeptrisNodeRef leptris_document_remove_pi(LeptrisDocument doc,
1267
+ const char* target,
1268
+ size_t index);
1269
+
1270
+ LEPTRIS_API LeptrisNodeRef leptris_document_add_pi(LeptrisDocument doc,
1271
+ const char* target,
1272
+ const char* data);
1273
+
1274
+ /**
1275
+ * Append a document-level PI at the END of the document-children
1276
+ * chain (epilog — after the root element), #1094. Node identity,
1277
+ * prolog/epilog anchoring and removal are the document-children
1278
+ * chain: walk with leptris_document_first_child +
1279
+ * leptris_node_get_next_sibling; remove with
1280
+ * leptris_document_remove_child.
1281
+ */
1282
+ LEPTRIS_API LeptrisNodeRef leptris_document_append_pi(LeptrisDocument doc,
1283
+ const char* target,
1284
+ const char* data);
1285
+
1286
+ /**
1287
+ * Remove a document-level PI or comment node from the document
1288
+ * children chain (#1094). The node itself stays document-owned.
1289
+ *
1290
+ * @return LEPTRIS_OK, or LEPTRIS_ERROR_NOT_FOUND when the node is
1291
+ * not in the chain.
1292
+ */
1293
+ LEPTRIS_API LeptrisStatus leptris_document_remove_child(
1294
+ LeptrisDocument doc, LeptrisNodeRef node);
1295
+
1296
+ /**
1297
+ * Append a document-level comment (epilog position: after the root
1298
+ * element). The writer twin of leptris_document_comment_count /
1299
+ * leptris_document_comment_content (#578 readers) and the
1300
+ * leptris_document_add_pi shape (#1032).
1301
+ *
1302
+ * @param doc Document
1303
+ * @param content Comment content (no `<!--` `-->`; NULL = empty)
1304
+ * @return the new comment node, or NULL on invalid args / allocation
1305
+ * failure
1306
+ */
1307
+ LEPTRIS_API LeptrisNodeRef leptris_document_add_comment(
1308
+ LeptrisDocument doc, const char* content);
1309
+
1310
+ /**
1311
+ * Get the DOCTYPE's root element name (the name following
1312
+ * `<!DOCTYPE`).
1313
+ *
1314
+ * For `<!DOCTYPE html ...>`, returns `"html"`.
1315
+ *
1316
+ * @param dt DOCTYPE handle (must not be NULL)
1317
+ * @return Root element name, or NULL if `dt` is NULL
1318
+ *
1319
+ * Memory: String is owned by the document; do not free.
1320
+ */
1321
+ LEPTRIS_API const char* leptris_doctype_get_name(LeptrisDoctype dt);
1322
+
1323
+ /**
1324
+ * Get the DOCTYPE's root element name (alias matching the libxml2
1325
+ * / Nokogiri `DocType#name` convention).
1326
+ *
1327
+ * @param dt DOCTYPE handle
1328
+ * @return Same value as `leptris_doctype_get_name`
1329
+ *
1330
+ * Memory: String is owned by the document. Do not free.
1331
+ */
1332
+ LEPTRIS_API const char* leptris_doctype_get_root_name(LeptrisDoctype dt);
1333
+
1334
+ /**
1335
+ * Get the DOCTYPE's PUBLIC identifier.
1336
+ *
1337
+ * For `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "...">`
1338
+ * returns `"-//W3C//DTD XHTML 1.0//EN"`. Returns NULL for SYSTEM
1339
+ * declarations and bare `<!DOCTYPE html>` declarations.
1340
+ *
1341
+ * @param dt DOCTYPE handle
1342
+ * @return Public identifier, or NULL if not declared
1343
+ *
1344
+ * Memory: String is owned by the document. Do not free.
1345
+ */
1346
+ LEPTRIS_API const char* leptris_doctype_get_public_id(LeptrisDoctype dt);
1347
+
1348
+ /**
1349
+ * Get the DOCTYPE's SYSTEM identifier.
1350
+ *
1351
+ * For `<!DOCTYPE html SYSTEM "html.dtd">` returns `"html.dtd"`.
1352
+ * Returns NULL if not declared.
1353
+ *
1354
+ * @param dt DOCTYPE handle
1355
+ * @return System identifier, or NULL if not declared
1356
+ *
1357
+ * Memory: String is owned by the document. Do not free.
1358
+ */
1359
+ LEPTRIS_API const char* leptris_doctype_get_system_id(LeptrisDoctype dt);
1360
+
1361
+ /**
1362
+ * Get the DOCTYPE's internal DTD subset — the contents of the
1363
+ * `[...]` block following the name and external identifiers.
1364
+ *
1365
+ * For `<!DOCTYPE root [<!ENTITY foo "bar">]>` returns
1366
+ * `<!ENTITY foo "bar">`. Returns NULL if no internal subset.
1367
+ *
1368
+ * @param dt DOCTYPE handle
1369
+ * @return Internal subset source, or NULL if empty
1370
+ *
1371
+ * Memory: String is owned by the document. Do not free.
1372
+ */
1373
+ LEPTRIS_API const char* leptris_doctype_get_internal_subset(LeptrisDoctype dt);
1374
+
1375
+ /**
1376
+ * Eagerly convert all StringViews to NULL-terminated strings
1377
+ *
1378
+ * PERFORMANCE OPTIMIZATION: Call this after parsing to optimize for
1379
+ * query-heavy workloads. Eliminates lazy conversion overhead during
1380
+ * attribute/element access.
1381
+ *
1382
+ * For parse-once-serialize workflows, this can be skipped to avoid
1383
+ * unnecessary string conversions.
1384
+ *
1385
+ * @param doc Document to finalize strings for
1386
+ * @return 0 on success, -1 on failure
1387
+ *
1388
+ * Thread safety: Not thread-safe if document is shared between threads.
1389
+ * Memory: Strings are allocated from document's memory pool.
1390
+ */
1391
+ LEPTRIS_API int leptris_document_finalize_strings(LeptrisDocument doc);
1392
+
1393
+ /**
1394
+ * Set strict parsing mode
1395
+ *
1396
+ * Controls whether the parser should be strict or lenient when parsing XML.
1397
+ * In strict mode, the parser will reject malformed XML and return errors.
1398
+ * In lenient mode, the parser may attempt to recover from certain errors.
1399
+ *
1400
+ * @param strict 1 for strict mode, 0 for lenient mode
1401
+ *
1402
+ * Thread safety: __thread (TODO 27 phase 1) — each thread has its
1403
+ * own default. Documents created after this call inherit the value
1404
+ * at creation time. Per-document override: leptris_document_set_strict.
1405
+ */
1406
+ LEPTRIS_API void leptris_set_strict_mode(int strict);
1407
+
1408
+ /**
1409
+ * Set strict mode on a specific document (TODO 38).
1410
+ *
1411
+ * Overrides the thread-default for this document only. Useful when
1412
+ * an application wants to mix strict and lenient parsing in the same
1413
+ * thread.
1414
+ *
1415
+ * @param doc Document to modify.
1416
+ * @param strict 1 for strict mode, 0 for lenient mode.
1417
+ * @return LEPTRIS_OK on success, LEPTRIS_ERROR_NULL_ARG if doc is NULL.
1418
+ *
1419
+ * Memory: No allocation.
1420
+ */
1421
+ LEPTRIS_API LeptrisStatus leptris_document_set_strict(LeptrisDocument doc, int strict);
1422
+
1423
+ /**
1424
+ * Get strict mode for a specific document.
1425
+ *
1426
+ * Returns the per-document setting (set via leptris_document_set_strict)
1427
+ * or the thread-default if never explicitly set.
1428
+ *
1429
+ * @param doc Document to query.
1430
+ * @return 1 if strict, 0 if lenient, 0 if doc is NULL.
1431
+ */
1432
+ LEPTRIS_API int leptris_document_get_strict(LeptrisDocument doc);
1433
+
1434
+ /**
1435
+ * Get the thread-default strict mode.
1436
+ *
1437
+ * Documents inherit this value at creation time unless
1438
+ * leptris_document_set_strict overrides it.
1439
+ *
1440
+ * @return 1 if strict default, 0 if lenient.
1441
+ */
1442
+ LEPTRIS_API int leptris_get_strict_mode(void);
1443
+
1444
+ /* ============================================================================
1445
+ * Document Freeze API (TODO 88)
1446
+ *
1447
+ * A frozen document is marked immutable. Mutation functions SHOULD
1448
+ * check the frozen flag and refuse to modify a frozen document.
1449
+ * (Currently the flag is advisory — mutation functions do not yet
1450
+ * enforce it. COW deep-copy on mutation is a future enhancement.)
1451
+ * ============================================================================ */
1452
+
1453
+ /**
1454
+ * Freeze a document, marking all its nodes as immutable.
1455
+ *
1456
+ * The freeze flag is **advisory only** — it does not cause mutation
1457
+ * functions (set_attribute, append_child, etc.) to return an error.
1458
+ * Callers who want to honor the freeze should check
1459
+ * `leptris_document_is_frozen` before mutating.
1460
+ *
1461
+ * Rationale: the alternative ("freeze = read-only, mutations reject")
1462
+ * breaks the common pattern of parse-then-modify, since every
1463
+ * freshly-parsed document is auto-frozen by the parser. Users who
1464
+ * want true immutability should keep the document pointer private
1465
+ * and check `is_frozen` at their own API boundaries.
1466
+ *
1467
+ * @param doc Document to freeze. Must not be NULL.
1468
+ * @return LEPTRIS_OK on success, LEPTRIS_ERROR_NULL_ARG if doc is NULL.
1469
+ */
1470
+ LEPTRIS_API LeptrisStatus leptris_document_freeze(LeptrisDocument doc);
1471
+
1472
+ /**
1473
+ * Check if a document has been frozen (advisory — see
1474
+ * leptris_document_freeze for the full contract).
1475
+ *
1476
+ * @param doc Document to query. NULL returns 0.
1477
+ * @return 1 if frozen, 0 if mutable.
1478
+ */
1479
+ LEPTRIS_API int leptris_document_is_frozen(LeptrisDocument doc);
1480
+
1481
+ /**
1482
+ * Set the thread-default maximum element-nesting depth.
1483
+ *
1484
+ * Documents deeper than this are rejected with LEPTRIS_ERROR_PARSE to
1485
+ * prevent stack-overflow crashes. Default: 256 (matches libxml2).
1486
+ *
1487
+ * Set to 0 to restore the default.
1488
+ *
1489
+ * @param max_depth Maximum depth, or 0 for default.
1490
+ *
1491
+ * Thread safety: __thread — each thread has its own default.
1492
+ */
1493
+ LEPTRIS_API void leptris_set_max_depth(int max_depth);
1494
+
1495
+ /**
1496
+ * Get the thread-default maximum element-nesting depth.
1497
+ *
1498
+ * @return The effective depth (always > 0; returns the default if unset).
1499
+ */
1500
+ LEPTRIS_API int leptris_get_max_depth(void);
1501
+
1502
+ /* ============================================================================
1503
+ * Element Operations
1504
+ * ============================================================================ */
1505
+
1506
+ /**
1507
+ * Get element name
1508
+ *
1509
+ * @param elem Element
1510
+ * @return Element name or NULL if elem is NULL
1511
+ *
1512
+ * Memory: String is owned by element. Do not free or modify.
1513
+ */
1514
+ LEPTRIS_API const char* leptris_element_name(LeptrisElement elem);
1515
+
1516
+ /**
1517
+ * Read an element's expanded name in one call — the local name,
1518
+ * its prefix, and the resolved namespace URI. Equivalent to
1519
+ * leptris_element_name() + leptris_element_prefix() +
1520
+ * leptris_element_namespace()/leptris_namespace_uri(), but one
1521
+ * call for FFI adapters that fan out per-element reads.
1522
+ *
1523
+ * Each out-param may be NULL (that value is skipped). Contracts
1524
+ * match the individual accessors exactly: local_name is never
1525
+ * NULL ("" for nameless); prefix and namespace_uri are NULL when
1526
+ * absent.
1527
+ *
1528
+ * Memory: all returned strings are document-owned and live until
1529
+ * leptris_document_free().
1530
+ */
1531
+ LEPTRIS_API void leptris_element_expanded_name(LeptrisElement elem,
1532
+ const char** local_name,
1533
+ const char** prefix,
1534
+ const char** namespace_uri);
1535
+
1536
+ /**
1537
+ * Get element text content (concatenation of all text nodes)
1538
+ *
1539
+ * @param elem Element
1540
+ * @return Text content, or "" if elem is NULL or has no text
1541
+ *
1542
+ * Memory: String is owned by the document. Do not free or modify. It stays
1543
+ * valid until leptris_document_free(). When the element's only child is a text
1544
+ * or CDATA node the node's own storage is returned; mixed content is
1545
+ * concatenated into the document pool.
1546
+ */
1547
+ LEPTRIS_API const char* leptris_element_text(LeptrisElement elem);
1548
+
1549
+ /**
1550
+ * Get element text content as integer
1551
+ *
1552
+ * @param elem Element
1553
+ * @param default_value Value to return if element is NULL, has no text, or text is not a valid integer
1554
+ * @return Text content as integer, or default_value
1555
+ *
1556
+ * Converts element text content to int using strtol(). Supports decimal and hexadecimal (0x) formats.
1557
+ * Returns default_value if element is NULL, has no text, or text cannot be parsed.
1558
+ */
1559
+ LEPTRIS_API int leptris_element_text_int(LeptrisElement elem, int default_value);
1560
+
1561
+ /**
1562
+ * Get element text content as unsigned integer
1563
+ *
1564
+ * @param elem Element
1565
+ * @param default_value Value to return if element is NULL, has no text, or text is not a valid integer
1566
+ * @return Text content as unsigned integer, or default_value
1567
+ *
1568
+ * Converts element text content to unsigned int using strtoul(). Supports decimal and hexadecimal (0x) formats.
1569
+ * Returns default_value if element is NULL, has no text, or text cannot be parsed.
1570
+ */
1571
+ LEPTRIS_API unsigned int leptris_element_text_uint(LeptrisElement elem, unsigned int default_value);
1572
+
1573
+ /**
1574
+ * Get element text content as double
1575
+ *
1576
+ * @param elem Element
1577
+ * @param default_value Value to return if element is NULL, has no text, or text is not a valid number
1578
+ * @return Text content as double, or default_value
1579
+ *
1580
+ * Converts element text content to double using strtod().
1581
+ * Returns default_value if element is NULL, has no text, or text cannot be parsed.
1582
+ */
1583
+ LEPTRIS_API double leptris_element_text_double(LeptrisElement elem, double default_value);
1584
+
1585
+ /**
1586
+ * Get element text content as float
1587
+ *
1588
+ * @param elem Element
1589
+ * @param default_value Value to return if element is NULL, has no text, or text is not a valid number
1590
+ * @return Text content as float, or default_value
1591
+ *
1592
+ * Converts element text content to float using strtof().
1593
+ * Returns default_value if element is NULL, has no text, or text cannot be parsed.
1594
+ */
1595
+ LEPTRIS_API float leptris_element_text_float(LeptrisElement elem, float default_value);
1596
+
1597
+ /**
1598
+ * Get element text content as boolean
1599
+ *
1600
+ * @param elem Element
1601
+ * @param default_value Value to return if element is NULL, has no text, or text is not a valid boolean
1602
+ * @return Text content as boolean (1 for true, 0 for false), or default_value
1603
+ *
1604
+ * Parses text content as boolean. Accepts: "true", "1" (case-insensitive) for true;
1605
+ * "false", "0" (case-insensitive) for false.
1606
+ * Returns default_value if element is NULL, has no text, or text cannot be parsed.
1607
+ */
1608
+ LEPTRIS_API int leptris_element_text_bool(LeptrisElement elem, int default_value);
1609
+
1610
+ /**
1611
+ * Get attribute value by name
1612
+ *
1613
+ * @param elem Element
1614
+ * @param name Attribute name
1615
+ * @return Attribute value or NULL if not found
1616
+ *
1617
+ * Memory: String is owned by element. Do not free or modify.
1618
+ */
1619
+ LEPTRIS_API const char* leptris_element_attribute(LeptrisElement elem, const char* name);
1620
+
1621
+ /**
1622
+ * Test whether an attribute is present on this element.
1623
+ *
1624
+ * @param elem Element
1625
+ * @param name Attribute name
1626
+ * @return 1 if the attribute exists, 0 otherwise
1627
+ *
1628
+ * Memory: None. Convenient alternative to
1629
+ * `leptris_element_attribute(elem, name) != NULL` for callers that
1630
+ * only need the boolean answer (issue #166-class visibility gap
1631
+ * reported in the v0.5.13 audit).
1632
+ */
1633
+ LEPTRIS_API int leptris_element_has_attribute(LeptrisElement elem, const char* name);
1634
+
1635
+ /**
1636
+ * Get attribute value by EXPANDED name (issue #542)
1637
+ *
1638
+ * XML Namespaces 1.0 semantics: uri NULL or "" matches only the
1639
+ * no-namespace attribute; otherwise the value is returned when the
1640
+ * attribute's prefix resolves to `uri` through the owning element's
1641
+ * in-scope declarations (the written prefix itself never matters).
1642
+ * xmlns declarations are not attributes and never match.
1643
+ *
1644
+ * @param elem Element
1645
+ * @param uri Namespace URI (NULL/"" for no namespace)
1646
+ * @param local Local name
1647
+ * @return Attribute value (document-owned), or NULL
1648
+ */
1649
+ LEPTRIS_API const char* leptris_element_attribute_ns(LeptrisElement elem,
1650
+ const char* uri,
1651
+ const char* local);
1652
+
1653
+ /**
1654
+ * Test attribute presence by EXPANDED name (issue #542)
1655
+ *
1656
+ * Same semantics as leptris_element_attribute_ns.
1657
+ */
1658
+ LEPTRIS_API int leptris_element_has_attribute_ns(LeptrisElement elem,
1659
+ const char* uri,
1660
+ const char* local);
1661
+
1662
+ /**
1663
+ * Get an attribute's namespace prefix (issue #542)
1664
+ *
1665
+ * The prefix as written in the qualified name (the bytes before the
1666
+ * colon), or NULL for a no-namespace attribute. Name-derived and
1667
+ * immutable; does not consult declarations.
1668
+ *
1669
+ * Memory: String is document-owned. Do not free.
1670
+ */
1671
+ LEPTRIS_API const char* leptris_attribute_prefix(LeptrisAttribute attr);
1672
+
1673
+ /**
1674
+ * Get an attribute's namespace URI (issue #542)
1675
+ *
1676
+ * Resolved through the OWNING element's in-scope declarations at
1677
+ * read time (the xml prefix is prebound to
1678
+ * http://www.w3.org/XML/1998/namespace). NULL for a no-namespace
1679
+ * attribute or an undeclared prefix.
1680
+ *
1681
+ * Memory: String is document-owned. Do not free.
1682
+ */
1683
+ LEPTRIS_API const char* leptris_attribute_namespace_uri(LeptrisAttribute attr);
1684
+
1685
+ /**
1686
+ * Get attribute value as integer
1687
+ *
1688
+ * @param elem Element
1689
+ * @param name Attribute name
1690
+ * @param default_value Value to return if attribute not found
1691
+ * @return Attribute value as integer, or default_value if not found
1692
+ *
1693
+ * Converts attribute value to int using atoi(). Returns default_value
1694
+ * if attribute doesn't exist or value is empty.
1695
+ */
1696
+ LEPTRIS_API int leptris_element_attribute_int(LeptrisElement elem, const char* name, int default_value);
1697
+
1698
+ /**
1699
+ * Get attribute value as double
1700
+ *
1701
+ * @param elem Element
1702
+ * @param name Attribute name
1703
+ * @param default_value Value to return if attribute not found
1704
+ * @return Attribute value as double, or default_value if not found
1705
+ *
1706
+ * Converts attribute value to double using atof(). Returns default_value
1707
+ * if attribute doesn't exist or value is empty.
1708
+ */
1709
+ LEPTRIS_API double leptris_element_attribute_double(LeptrisElement elem, const char* name, double default_value);
1710
+
1711
+ /**
1712
+ * Get attribute value as boolean
1713
+ *
1714
+ * @param elem Element
1715
+ * @param name Attribute name
1716
+ * @param default_value Value to return if attribute not found
1717
+ * @return Attribute value as boolean, or default_value if not found
1718
+ *
1719
+ * Returns true if attribute exists and value is "true" or "1" (case-insensitive).
1720
+ * Returns false if attribute exists and value is "false" or "0" (case-insensitive).
1721
+ * Returns default_value if attribute doesn't exist.
1722
+ */
1723
+ LEPTRIS_API int leptris_element_attribute_bool(LeptrisElement elem, const char* name, int default_value);
1724
+
1725
+ /**
1726
+ * Get attribute value as unsigned integer
1727
+ *
1728
+ * @param elem Element
1729
+ * @param name Attribute name
1730
+ * @param default_value Value to return if attribute not found
1731
+ * @return Attribute value as unsigned int, or default_value if not found
1732
+ *
1733
+ * Converts attribute value to unsigned int using strtoul(). Returns default_value
1734
+ * if attribute doesn't exist or value is empty/invalid.
1735
+ */
1736
+ LEPTRIS_API unsigned int leptris_element_attribute_uint(LeptrisElement elem, const char* name, unsigned int default_value);
1737
+
1738
+ /**
1739
+ * Get attribute value as float
1740
+ *
1741
+ * @param elem Element
1742
+ * @param name Attribute name
1743
+ * @param default_value Value to return if attribute not found
1744
+ * @return Attribute value as float, or default_value if not found
1745
+ *
1746
+ * Converts attribute value to float using strtof(). Returns default_value
1747
+ * if attribute doesn't exist or value is empty/invalid.
1748
+ */
1749
+ LEPTRIS_API float leptris_element_attribute_float(LeptrisElement elem, const char* name, float default_value);
1750
+
1751
+ /**
1752
+ * Get attribute value as string with default
1753
+ *
1754
+ * @param elem Element
1755
+ * @param name Attribute name
1756
+ * @param default_value Value to return if attribute not found
1757
+ * @return Attribute value, or default_value if not found
1758
+ *
1759
+ * Memory: String is owned by element. Do not free or modify.
1760
+ * The default_value string must remain valid for the duration of use.
1761
+ */
1762
+ LEPTRIS_API const char* leptris_element_attribute_string(LeptrisElement elem, const char* name, const char* default_value);
1763
+
1764
+ /**
1765
+ * Get number of attributes on an element
1766
+ *
1767
+ * @param elem Element
1768
+ * @return Attribute count or 0 if elem is NULL
1769
+ */
1770
+ LEPTRIS_API size_t leptris_element_attribute_count(LeptrisElement elem);
1771
+
1772
+ /**
1773
+ * Get name of attribute by index
1774
+ *
1775
+ * @param elem Element
1776
+ * @param index Attribute index (0-based)
1777
+ * @return Attribute name or NULL if index out of range
1778
+ *
1779
+ * Memory: String is owned by element. Do not free.
1780
+ */
1781
+ LEPTRIS_API const char* leptris_element_attribute_name_at(LeptrisElement elem, size_t index);
1782
+
1783
+ /**
1784
+ * Get value of attribute by index
1785
+ *
1786
+ * @param elem Element
1787
+ * @param index Attribute index (0-based)
1788
+ * @return Attribute value or NULL if index out of range
1789
+ *
1790
+ * Memory: String is owned by element. Do not free.
1791
+ */
1792
+ LEPTRIS_API const char* leptris_element_attribute_value_at(LeptrisElement elem, size_t index);
1793
+
1794
+ /**
1795
+ * Attribute iteration — first attribute of an element
1796
+ *
1797
+ * Handle-based iteration for bindings and C callers that want to
1798
+ * walk attributes as objects rather than by index (each _at call
1799
+ * re-walks the list from the head, making index iteration O(n^2);
1800
+ * handle iteration is O(n) total).
1801
+ *
1802
+ * for (LeptrisAttribute a = leptris_element_first_attribute(e); a;
1803
+ * a = leptris_attribute_next(a)) { ... }
1804
+ *
1805
+ * @param elem Element
1806
+ * @return First attribute handle, or NULL if the element has none
1807
+ *
1808
+ * Memory: Handles are owned by the document; do not free. Valid
1809
+ * until the attribute is removed or the document is freed.
1810
+ */
1811
+ LEPTRIS_API LeptrisAttribute leptris_element_first_attribute(LeptrisElement elem);
1812
+
1813
+ /**
1814
+ * Attribute iteration — next attribute
1815
+ *
1816
+ * @param attr Current attribute handle
1817
+ * @return Next attribute handle, or NULL at the end of the list
1818
+ *
1819
+ * Memory: Same ownership as the incoming handle.
1820
+ */
1821
+ LEPTRIS_API LeptrisAttribute leptris_attribute_next(LeptrisAttribute attr);
1822
+
1823
+ /**
1824
+ * Get an attribute's name from its handle
1825
+ *
1826
+ * @param attr Attribute handle
1827
+ * @return Attribute name (empty string for a NULL handle)
1828
+ *
1829
+ * Memory: String is owned by the document. Do not free.
1830
+ */
1831
+ LEPTRIS_API const char* leptris_attribute_get_name(LeptrisAttribute attr);
1832
+
1833
+ /**
1834
+ * Get an attribute's value from its handle
1835
+ *
1836
+ * Expands entity references on first access (same contract as
1837
+ * leptris_element_attribute). The element argument supplies the
1838
+ * document pool for expansion — attr must belong to elem.
1839
+ *
1840
+ * @param elem Owning element
1841
+ * @param attr Attribute handle (must belong to elem)
1842
+ * @return Attribute value with entities expanded (empty string for
1843
+ * a NULL handle)
1844
+ *
1845
+ * Memory: String is owned by the document. Do not free.
1846
+ */
1847
+ LEPTRIS_API const char* leptris_attribute_get_value(LeptrisElement elem, LeptrisAttribute attr);
1848
+
1849
+ /**
1850
+ * Get number of child elements
1851
+ *
1852
+ * @param elem Element
1853
+ * @return Number of children or 0 if elem is NULL
1854
+ */
1855
+ LEPTRIS_API size_t leptris_element_child_count(LeptrisElement elem);
1856
+
1857
+ /**
1858
+ * Get child element by index
1859
+ *
1860
+ * @param elem Element
1861
+ * @param index Child index (0-based)
1862
+ * @return Child element or NULL if index out of bounds
1863
+ *
1864
+ * Memory: Element is owned by document. Do not free separately.
1865
+ *
1866
+ * Performance: **O(index)**. Walks the linked-list of children from
1867
+ * `first_child` to reach the requested index. The legacy index-cache
1868
+ * (`children_array`) was removed in TODO 90 Phase 1 to shrink the
1869
+ * element struct; sequential iteration via
1870
+ * `leptris_element_first_child_any` + `next_sibling_any` is O(1) per
1871
+ * step and is the recommended pattern when iterating all children.
1872
+ */
1873
+ LEPTRIS_API LeptrisElement leptris_element_child(LeptrisElement elem, size_t index);
1874
+
1875
+ /**
1876
+ * Get parent element
1877
+ *
1878
+ * @param elem Element
1879
+ * @return Parent element or NULL if elem is root or NULL
1880
+ *
1881
+ * Memory: Element is owned by document. Do not free separately.
1882
+ */
1883
+ LEPTRIS_API LeptrisElement leptris_element_parent(LeptrisElement elem);
1884
+
1885
+ /**
1886
+ * Get root element from any element in the document
1887
+ *
1888
+ * @param elem Any element in the document
1889
+ * @return Root element of the document, or NULL if elem is NULL or not in a document
1890
+ *
1891
+ * Memory: Element is owned by document. Do not free separately.
1892
+ */
1893
+ LEPTRIS_API LeptrisElement leptris_element_root(LeptrisElement elem);
1894
+
1895
+ /**
1896
+ * Get hash value of element for comparison
1897
+ *
1898
+ * @param elem Element
1899
+ * @return Hash value based on element name and attributes
1900
+ *
1901
+ * Computes a hash value for the element based on its name and attributes.
1902
+ * This can be used for quick comparison between elements.
1903
+ * Returns 0 if elem is NULL.
1904
+ */
1905
+ LEPTRIS_API size_t leptris_element_hash_value(LeptrisElement elem);
1906
+
1907
+ /* ============================================================================
1908
+ * Element Modification Operations
1909
+ * ============================================================================ */
1910
+
1911
+ /**
1912
+ * Create new element in document
1913
+ *
1914
+ * @param doc Document that will own the element
1915
+ * @param name Element name (without namespace prefix)
1916
+ * @return New element or NULL on error
1917
+ *
1918
+ * Memory: Element owned by document, freed when document freed
1919
+ */
1920
+ LEPTRIS_API LeptrisElement leptris_element_create(LeptrisDocument doc, const char* name);
1921
+
1922
+ /**
1923
+ * Set element name (rename element tag)
1924
+ *
1925
+ * @param elem Element to rename
1926
+ * @param new_name New element name (will be copied)
1927
+ * @return LEPTRIS_OK on success, error code otherwise
1928
+ *
1929
+ * Example:
1930
+ * // Change &lt;old&gt; to &lt;new&gt;
1931
+ * leptris_element_set_name(elem, "new");
1932
+ *
1933
+ * Memory: Name is copied (pooled for pool documents)
1934
+ */
1935
+ LEPTRIS_API LeptrisStatus leptris_element_set_name(LeptrisElement elem, const char* new_name);
1936
+
1937
+ /**
1938
+ * Append child element
1939
+ *
1940
+ * @param parent Parent element
1941
+ * @param child Child element to append
1942
+ * @return LEPTRIS_OK on success, error code otherwise
1943
+ */
1944
+ LEPTRIS_API LeptrisStatus leptris_element_append_child(LeptrisElement parent, LeptrisElement child);
1945
+
1946
+ /**
1947
+ * Create a new element and append it to parent in one call.
1948
+ *
1949
+ * The fused twin of create + append_child: one document resolution,
1950
+ * one public entry — the builder-shape answer to single-call DOM
1951
+ * construction APIs. Identical tree semantics to the two-call pair
1952
+ * (same name handling incl. QName splits, same append rules).
1953
+ *
1954
+ * Memory: the element is owned by parent's document; freed via
1955
+ * leptris_document_free. Returns NULL on invalid args or allocation
1956
+ * failure (nothing is attached in that case).
1957
+ */
1958
+ LEPTRIS_API LeptrisElement leptris_element_create_child(LeptrisElement parent, const char* name);
1959
+
1960
+ /**
1961
+ * Prepend child element at the beginning
1962
+ *
1963
+ * @param parent Parent element
1964
+ * @param child Child element to prepend
1965
+ * @return LEPTRIS_OK on success, error code otherwise
1966
+ */
1967
+ LEPTRIS_API LeptrisStatus leptris_element_prepend_child(LeptrisElement parent, LeptrisElement child);
1968
+
1969
+ /**
1970
+ * Insert new node before a sibling
1971
+ *
1972
+ * @param sibling Sibling element to insert before
1973
+ * @param new_node New element to insert
1974
+ * @return LEPTRIS_OK on success, error code otherwise
1975
+ */
1976
+ LEPTRIS_API LeptrisStatus leptris_element_insert_before(LeptrisElement sibling, LeptrisElement new_node);
1977
+
1978
+ /**
1979
+ * Insert new node after a sibling
1980
+ *
1981
+ * @param sibling Sibling element to insert after
1982
+ * @param new_node New element to insert
1983
+ * @return LEPTRIS_OK on success, error code otherwise
1984
+ */
1985
+ LEPTRIS_API LeptrisStatus leptris_element_insert_after(LeptrisElement sibling, LeptrisElement new_node);
1986
+
1987
+ /**
1988
+ * Remove child element
1989
+ *
1990
+ * @param parent Parent element
1991
+ * @param child Child element to remove
1992
+ * @return LEPTRIS_OK on success, error code otherwise
1993
+ */
1994
+ LEPTRIS_API LeptrisStatus leptris_element_remove_child(LeptrisElement parent, LeptrisElement child);
1995
+
1996
+ /**
1997
+ * Remove all children from element
1998
+ *
1999
+ * @param elem Element to remove children from
2000
+ * @return LEPTRIS_OK on success, error code otherwise
2001
+ *
2002
+ * Removes all child nodes from the element, making it empty.
2003
+ * The removed nodes are freed and should not be accessed afterwards.
2004
+ */
2005
+ LEPTRIS_API LeptrisStatus leptris_element_remove_children(LeptrisElement elem);
2006
+
2007
+ /**
2008
+ * Set element text content
2009
+ *
2010
+ * @param elem Element
2011
+ * @param text New text content (will be copied)
2012
+ * @return LEPTRIS_OK on success, error code otherwise
2013
+ */
2014
+ LEPTRIS_API LeptrisStatus leptris_element_set_text(LeptrisElement elem, const char* text);
2015
+
2016
+ /**
2017
+ * Set attribute value (creates if doesn't exist, updates if exists)
2018
+ *
2019
+ * @param elem Element
2020
+ * @param name Attribute name
2021
+ * @param value Attribute value (will be copied)
2022
+ * @return LEPTRIS_OK on success, error code otherwise
2023
+ */
2024
+ LEPTRIS_API LeptrisStatus leptris_element_set_attribute(LeptrisElement elem,
2025
+ const char* name,
2026
+ const char* value);
2027
+
2028
+ /**
2029
+ * Set attribute value as double (converts to string)
2030
+ *
2031
+ * @param elem Element
2032
+ * @param name Attribute name
2033
+ * @param value Numeric value to set
2034
+ * @return LEPTRIS_OK on success, error code otherwise
2035
+ *
2036
+ * Converts the double value to a string and sets it as an attribute.
2037
+ */
2038
+ LEPTRIS_API LeptrisStatus leptris_element_set_attribute_double(LeptrisElement elem,
2039
+ const char* name,
2040
+ double value);
2041
+
2042
+ /**
2043
+ * Set attribute value as float (converts to string)
2044
+ *
2045
+ * @param elem Element
2046
+ * @param name Attribute name
2047
+ * @param value Numeric value to set
2048
+ * @return LEPTRIS_OK on success, error code otherwise
2049
+ *
2050
+ * Converts the float value to a string and sets it as an attribute.
2051
+ */
2052
+ LEPTRIS_API LeptrisStatus leptris_element_set_attribute_float(LeptrisElement elem,
2053
+ const char* name,
2054
+ float value);
2055
+
2056
+ /**
2057
+ * Set attribute value as boolean (converts to string)
2058
+ *
2059
+ * @param elem Element
2060
+ * @param name Attribute name
2061
+ * @param value Boolean value to set
2062
+ * @return LEPTRIS_OK on success, error code otherwise
2063
+ *
2064
+ * Converts the boolean value to "true" or "false" and sets it as an attribute.
2065
+ */
2066
+ LEPTRIS_API LeptrisStatus leptris_element_set_attribute_bool(LeptrisElement elem,
2067
+ const char* name,
2068
+ int value);
2069
+
2070
+ /**
2071
+ * Set attribute value as integer (converts to string)
2072
+ *
2073
+ * @param elem Element
2074
+ * @param name Attribute name
2075
+ * @param value Integer value to set
2076
+ * @return LEPTRIS_OK on success, error code otherwise
2077
+ *
2078
+ * Converts the integer value to a string and sets it as an attribute.
2079
+ */
2080
+ LEPTRIS_API LeptrisStatus leptris_element_set_attribute_int(LeptrisElement elem,
2081
+ const char* name,
2082
+ int value);
2083
+
2084
+ /**
2085
+ * Set attribute value as unsigned integer (converts to string)
2086
+ *
2087
+ * @param elem Element
2088
+ * @param name Attribute name
2089
+ * @param value Unsigned integer value to set
2090
+ * @return LEPTRIS_OK on success, error code otherwise
2091
+ *
2092
+ * Converts the unsigned integer value to a string and sets it as an attribute.
2093
+ */
2094
+ LEPTRIS_API LeptrisStatus leptris_element_set_attribute_uint(LeptrisElement elem,
2095
+ const char* name,
2096
+ unsigned int value);
2097
+
2098
+ /**
2099
+ * Remove attribute
2100
+ *
2101
+ * @param elem Element
2102
+ * @param name Attribute name
2103
+ * @return LEPTRIS_OK on success, LEPTRIS_ERROR_NOT_FOUND if attribute doesn't exist
2104
+ */
2105
+ LEPTRIS_API LeptrisStatus leptris_element_remove_attribute(LeptrisElement elem, const char* name);
2106
+
2107
+ /**
2108
+ * Remove all attributes from element
2109
+ *
2110
+ * @param elem Element
2111
+ * @return LEPTRIS_OK on success
2112
+ */
2113
+ LEPTRIS_API LeptrisStatus leptris_element_remove_all_attributes(LeptrisElement elem);
2114
+
2115
+ /**
2116
+ * Find first child element with given tag name
2117
+ *
2118
+ * @param elem Element to search in
2119
+ * @param name Tag name to find
2120
+ * @return First matching child element or NULL if not found
2121
+ *
2122
+ * Memory: Element is owned by document. Do not free separately.
2123
+ */
2124
+ LEPTRIS_API LeptrisElement leptris_element_find_child(LeptrisElement elem, const char* name);
2125
+
2126
+ /**
2127
+ * Find first child with given name and attribute value
2128
+ *
2129
+ * @param elem Element to search in
2130
+ * @param child_name Child tag name (NULL to match any tag)
2131
+ * @param attr_name Attribute name to check
2132
+ * @param attr_value Attribute value to match
2133
+ * @return First matching child element or NULL if not found
2134
+ *
2135
+ * Memory: Element is owned by document. Do not free separately.
2136
+ */
2137
+ LEPTRIS_API LeptrisElement leptris_element_find_child_by_attr(LeptrisElement elem,
2138
+ const char* child_name,
2139
+ const char* attr_name,
2140
+ const char* attr_value);
2141
+
2142
+ /**
2143
+ * Get next sibling element with specified name
2144
+ *
2145
+ * @param elem Element to start from
2146
+ * @param name Element name to find (NULL to get next sibling regardless of name)
2147
+ * @return Next sibling with matching name, or NULL if not found
2148
+ *
2149
+ * Memory: Element is owned by document. Do not free separately.
2150
+ */
2151
+ LEPTRIS_API LeptrisElement leptris_element_next_sibling(LeptrisElement elem, const char* name);
2152
+
2153
+ /**
2154
+ * Get previous sibling element with specified name
2155
+ *
2156
+ * @param elem Element to start from
2157
+ * @param name Element name to find (NULL to get previous sibling regardless of name)
2158
+ * @return Previous sibling with matching name, or NULL if not found
2159
+ *
2160
+ * Memory: Element is owned by document. Do not free separately.
2161
+ */
2162
+ LEPTRIS_API LeptrisElement leptris_element_previous_sibling(LeptrisElement elem, const char* name);
2163
+
2164
+ /**
2165
+ * Get first child element with specified name
2166
+ *
2167
+ * @param elem Element to search in
2168
+ * @param name Element name to find (NULL to get first child regardless of name)
2169
+ * @return First child with matching name, or NULL if not found
2170
+ *
2171
+ * Memory: Element is owned by document. Do not free separately.
2172
+ */
2173
+ LEPTRIS_API LeptrisElement leptris_element_first_child(LeptrisElement elem, const char* name);
2174
+
2175
+ /**
2176
+ * Get last child element with specified name
2177
+ *
2178
+ * @param elem Element to search in
2179
+ * @param name Element name to find (NULL to get last child regardless of name)
2180
+ * @return Last child with matching name, or NULL if not found
2181
+ *
2182
+ * Memory: Element is owned by document. Do not free separately.
2183
+ */
2184
+ LEPTRIS_API LeptrisElement leptris_element_last_child(LeptrisElement elem, const char* name);
2185
+
2186
+ /**
2187
+ * Get first child element regardless of name
2188
+ *
2189
+ * @param elem Element to search in
2190
+ * @return First child element or NULL if elem has no children
2191
+ *
2192
+ * Convenience function that returns the first child element
2193
+ * regardless of its name. Same as leptris_element_first_child(elem, NULL).
2194
+ *
2195
+ * Memory: Element is owned by document. Do not free separately.
2196
+ */
2197
+ LEPTRIS_API LeptrisElement leptris_element_first_child_any(LeptrisElement elem);
2198
+
2199
+ /**
2200
+ * Get last child element regardless of name
2201
+ *
2202
+ * @param elem Parent element
2203
+ * @return Last child element or NULL if elem has no children
2204
+ *
2205
+ * Convenience function that returns the last child element
2206
+ * regardless of its name.
2207
+ *
2208
+ * Memory: Element is owned by document. Do not free separately.
2209
+ */
2210
+ LEPTRIS_API LeptrisElement leptris_element_last_child_any(LeptrisElement elem);
2211
+
2212
+ /**
2213
+ * Get next sibling element regardless of name
2214
+ *
2215
+ * @param elem Element to start from
2216
+ * @return Next sibling element or NULL if elem is last child
2217
+ *
2218
+ * Convenience function that returns the next sibling element
2219
+ * regardless of its name. Same as leptris_element_next_sibling(elem, NULL).
2220
+ *
2221
+ * Memory: Element is owned by document. Do not free separately.
2222
+ */
2223
+ LEPTRIS_API LeptrisElement leptris_element_next_sibling_any(LeptrisElement elem);
2224
+
2225
+ /**
2226
+ * Get child elements in bulk
2227
+ *
2228
+ * Fills out_children with up to max_count element children in
2229
+ * document order, skipping interleaved text/comment/CDATA nodes.
2230
+ * Size the array from leptris_element_child_count.
2231
+ */
2232
+ LEPTRIS_API size_t leptris_element_children(
2233
+ LeptrisElement elem, LeptrisElement* out_children, size_t max_count);
2234
+
2235
+ /**
2236
+ * Get previous sibling element regardless of name
2237
+ *
2238
+ * @param elem Current element
2239
+ * @return Previous sibling element, or NULL if not found
2240
+ *
2241
+ * Convenience function that returns the previous sibling element
2242
+ * regardless of its name. Same as leptris_element_previous_sibling(elem, NULL).
2243
+ *
2244
+ * Memory: Element is owned by document. Do not free separately.
2245
+ */
2246
+ LEPTRIS_API LeptrisElement leptris_element_previous_sibling_any(LeptrisElement elem);
2247
+
2248
+ /**
2249
+ * Get child element text content
2250
+ *
2251
+ * @param elem Parent element
2252
+ * @return Text content of first child text node, or NULL if not found
2253
+ *
2254
+ * Returns the text content of the first text node child.
2255
+ * This is a convenience function for accessing element text.
2256
+ *
2257
+ * Memory: String is owned by element. Do not free or modify.
2258
+ */
2259
+ LEPTRIS_API const char* leptris_element_child_value(LeptrisElement elem);
2260
+
2261
+ /**
2262
+ * Deep copy element into a destination document (detached).
2263
+ *
2264
+ * @param src Element to copy (subtree copied recursively)
2265
+ * @param dest_doc Document that will own the copy. May be the same
2266
+ * document or a different one (cross-document copy).
2267
+ * @return Newly created copy detached from any parent, or NULL on
2268
+ * error (bad args or pool allocation failure).
2269
+ *
2270
+ * Issue #148 Phase 1: backs `Node#dup` / `#clone` in the Ruby
2271
+ * binding. The copy carries no parent reference and the caller
2272
+ * owns attaching it via `leptris_element_append_child`.
2273
+ *
2274
+ * Memory: Copy is owned by `dest_doc`; released by
2275
+ * `leptris_document_free`.
2276
+ */
2277
+ LEPTRIS_API LeptrisElement leptris_element_copy(LeptrisElement src,
2278
+ LeptrisDocument dest_doc);
2279
+
2280
+ /**
2281
+ * Deep copy an entire document.
2282
+ *
2283
+ * @param src Source document
2284
+ * @return Newly created document, or NULL on error
2285
+ *
2286
+ * Copies the tree (root element + all descendants), the XML
2287
+ * declaration (version/encoding/standalone), document-level
2288
+ * processing instructions, and (if present) the DOCTYPE.
2289
+ *
2290
+ * Memory: Caller owns the result; release with
2291
+ * `leptris_document_free`.
2292
+ */
2293
+ LEPTRIS_API LeptrisDocument leptris_document_copy(LeptrisDocument src);
2294
+
2295
+ /**
2296
+ * Deep copy element and append to parent
2297
+ *
2298
+ * @param parent Parent element to append to
2299
+ * @param source Element to copy (can be from different document)
2300
+ * @return Newly created copy, or NULL on error
2301
+ *
2302
+ * Creates a deep copy including all children and attributes.
2303
+ * The copy belongs to parent's document.
2304
+ *
2305
+ * Memory: Copy is owned by parent's document
2306
+ */
2307
+ LEPTRIS_API LeptrisElement leptris_element_append_copy(LeptrisElement parent, LeptrisElement source);
2308
+
2309
+ /**
2310
+ * Deep copy element and prepend to parent
2311
+ *
2312
+ * @param parent Parent element to prepend to
2313
+ * @param source Element to copy (can be from different document)
2314
+ * @return Newly created copy, or NULL on error
2315
+ *
2316
+ * Creates a deep copy and inserts at the beginning of parent's children.
2317
+ * The copy belongs to parent's document.
2318
+ *
2319
+ * Memory: Copy is owned by parent's document
2320
+ */
2321
+ LEPTRIS_API LeptrisElement leptris_element_prepend_copy(LeptrisElement parent, LeptrisElement source);
2322
+
2323
+ /**
2324
+ * Deep copy element and insert before sibling
2325
+ *
2326
+ * @param sibling Sibling element to insert before
2327
+ * @param source Element to copy (can be from different document)
2328
+ * @return Newly created copy, or NULL on error
2329
+ *
2330
+ * Creates a deep copy and inserts it before the sibling.
2331
+ * The copy belongs to sibling's document.
2332
+ *
2333
+ * Memory: Copy is owned by sibling's document
2334
+ */
2335
+ LEPTRIS_API LeptrisElement leptris_element_insert_copy_before(LeptrisElement sibling, LeptrisElement source);
2336
+
2337
+ /**
2338
+ * Deep copy element and insert after sibling
2339
+ *
2340
+ * @param sibling Sibling element to insert after
2341
+ * @param source Element to copy (can be from different document)
2342
+ * @return Newly created copy, or NULL on error
2343
+ *
2344
+ * Creates a deep copy and inserts it after the sibling.
2345
+ * The copy belongs to sibling's document.
2346
+ *
2347
+ * Memory: Copy is owned by sibling's document
2348
+ */
2349
+ LEPTRIS_API LeptrisElement leptris_element_insert_copy_after(LeptrisElement sibling, LeptrisElement source);
2350
+
2351
+ /* ============================================================================
2352
+ * Serialization Operations
2353
+ * ============================================================================ */
2354
+
2355
+ /**
2356
+ * Options for XML serialization
2357
+ *
2358
+ * Definition lives in leptris/types.h.
2359
+ */
2360
+
2361
+ /**
2362
+ * Serialize document to XML string
2363
+ *
2364
+ * @param doc Document to serialize
2365
+ * @param options Serialization options (NULL for defaults: compact, no declaration)
2366
+ * @return XML string or NULL on error (caller must free with leptris_free_string)
2367
+ *
2368
+ * Example (compact):
2369
+ * char* xml = leptris_document_serialize(doc, NULL);
2370
+ * printf("%s\n", xml);
2371
+ * leptris_free_string(xml);
2372
+ *
2373
+ * Example (pretty-print with declaration):
2374
+ * LeptrisSerializeOptions opts = { .indent = 2, .xml_declaration = 1, .encoding = "UTF-8" };
2375
+ * char* xml = leptris_document_serialize(doc, &opts);
2376
+ * printf("%s\n", xml);
2377
+ * leptris_free_string(xml);
2378
+ *
2379
+ * Memory: Caller must free returned string with leptris_free_string()
2380
+ */
2381
+ LEPTRIS_API char* leptris_document_serialize(LeptrisDocument doc,
2382
+ const LeptrisSerializeOptions* options);
2383
+
2384
+ /**
2385
+ * Serialize a document into a caller-provided buffer (issue #535)
2386
+ *
2387
+ * One call, zero library-side allocations for the result: the
2388
+ * common FFI pattern (serialize + read_string + free_string)
2389
+ * collapses, and bindings can write into MemoryPointer-backed
2390
+ * storage directly.
2391
+ *
2392
+ * @param doc Document
2393
+ * @param buf Output buffer, or NULL to just query the size
2394
+ * @param capacity Capacity of buf in bytes
2395
+ * @param out_len Out: written length WITHOUT the NUL (may be NULL)
2396
+ * @return Bytes needed INCLUDING the NUL terminator. Copy happens
2397
+ * only when buf is non-NULL and capacity >= return value.
2398
+ * 0 on failure.
2399
+ */
2400
+ LEPTRIS_API char* leptris_document_serialize_ext(LeptrisDocument doc,
2401
+ const LeptrisSerializeOptions* options,
2402
+ const LeptrisSerializeExtOptions* ext);
2403
+
2404
+ /**
2405
+ * Size-aware leptris_document_serialize_ext (issue #644): the ext
2406
+ * struct may GROW, and FFI/binding callers allocate only the fields
2407
+ * they know. Pass your compile-time sizeof(LeptrisSerializeExtOptions)
2408
+ * — every field beyond your buffer stays at its zero default instead
2409
+ * of being read out of bounds. leptris_document_serialize_ext is
2410
+ * this entry with the full size.
2411
+ *
2412
+ * @param doc Document
2413
+ * @param options Serialization options, or NULL for defaults
2414
+ * @param ext Extended options, or NULL
2415
+ * @param ext_size sizeof of the caller's ext-struct allocation
2416
+ * @return Serialized XML string (caller frees with
2417
+ * leptris_free_string), or NULL
2418
+ */
2419
+ LEPTRIS_API char* leptris_document_serialize_ext_sized(LeptrisDocument doc,
2420
+ const LeptrisSerializeOptions* options,
2421
+ const LeptrisSerializeExtOptions* ext,
2422
+ size_t ext_size);
2423
+
2424
+ /**
2425
+ * Extended element serialization (issue #882): the same option
2426
+ * surface as leptris_document_serialize_ext — indent_text,
2427
+ * indent_unit, expand_empty — at element level.
2428
+ *
2429
+ * @param elem Element subtree to serialize
2430
+ * @param options Serialization options, or NULL for defaults
2431
+ * @param ext Extended options, or NULL
2432
+ * @return Serialized XML string (caller frees with
2433
+ * leptris_free_string), or NULL
2434
+ */
2435
+ LEPTRIS_API char* leptris_element_serialize_ext(LeptrisElement elem,
2436
+ const LeptrisSerializeOptions* options,
2437
+ const LeptrisSerializeExtOptions* ext);
2438
+
2439
+ /* Size-aware twin (issue #644 pattern). */
2440
+ LEPTRIS_API char* leptris_element_serialize_ext_sized(LeptrisElement elem,
2441
+ const LeptrisSerializeOptions* options,
2442
+ const LeptrisSerializeExtOptions* ext,
2443
+ size_t ext_size);
2444
+
2445
+ LEPTRIS_API size_t leptris_document_serialize_into(LeptrisDocument doc,
2446
+ char* buf,
2447
+ size_t capacity,
2448
+ size_t* out_len,
2449
+ const LeptrisSerializeOptions* options);
2450
+
2451
+ /**
2452
+ * Serialize document with automatic options (legacy alias)
2453
+ *
2454
+ * Equivalent to leptris_document_serialize with options chosen from
2455
+ * the document's own properties (XML declaration included when the
2456
+ * source had one). Kept because it was exported before options
2457
+ * existed; prefer leptris_document_serialize for new code.
2458
+ *
2459
+ * Declared here retroactively (2026-08-22): the symbol was
2460
+ * implemented, exported, and used by bindings, but never declared
2461
+ * in any public header — invisible to header-derived cdef/bindgen
2462
+ * mirrors and to export audits.
2463
+ *
2464
+ * DEPRECATED: prefer leptris_document_serialize in new code; this
2465
+ * alias will not gain options or fixes beyond ABI stability.
2466
+ *
2467
+ * @param doc Document
2468
+ * @return XML string or NULL on error
2469
+ *
2470
+ * Memory: Caller must free returned string with leptris_free_string()
2471
+ */
2472
+ LEPTRIS_API char* leptris_serialize_document(LeptrisDocument doc);
2473
+
2474
+ /**
2475
+ * Serialize element subtree to XML string
2476
+ *
2477
+ * @param elem Element to serialize
2478
+ * @param options Serialization options (NULL for defaults)
2479
+ * @return XML string or NULL on error (caller must free with leptris_free_string)
2480
+ *
2481
+ * Memory: Caller must free returned string with leptris_free_string()
2482
+ */
2483
+ LEPTRIS_API char* leptris_element_serialize(LeptrisElement elem,
2484
+ const LeptrisSerializeOptions* options);
2485
+
2486
+ /**
2487
+ * Serialize an element subtree into a caller-provided buffer
2488
+ * (issue #535) — same contract as leptris_document_serialize_into.
2489
+ */
2490
+ LEPTRIS_API size_t leptris_element_serialize_into(LeptrisElement elem,
2491
+ char* buf,
2492
+ size_t capacity,
2493
+ size_t* out_len,
2494
+ const LeptrisSerializeOptions* options);
2495
+
2496
+ /**
2497
+ * Save document to file
2498
+ *
2499
+ * @param doc Document to save
2500
+ * @param filepath Path to output file
2501
+ * @param options Serialization options (NULL for defaults: compact, no declaration)
2502
+ * @return LEPTRIS_OK on success, error code on failure
2503
+ *
2504
+ * Thread safety: Thread-safe (multiple threads can save different files)
2505
+ *
2506
+ * Example:
2507
+ * LeptrisStatus status = leptris_document_save_file(doc, "output.xml", NULL);
2508
+ * if (status != LEPTRIS_OK) {
2509
+ * printf("Failed to save: %d\n", status);
2510
+ * }
2511
+ */
2512
+ LEPTRIS_API LeptrisStatus leptris_document_save_file(LeptrisDocument doc,
2513
+ const char* filepath,
2514
+ const LeptrisSerializeOptions* options);
2515
+
2516
+ /* ============================================================================
2517
+ * Canonical XML (C14N) Operations
2518
+ * ============================================================================ */
2519
+
2520
+ /**
2521
+ * Canonicalize document to C14N format
2522
+ *
2523
+ * C14N generates a canonical form of an XML document for:
2524
+ * - Digital signatures
2525
+ * - Cryptographic hashing
2526
+ * - Semantic XML comparison
2527
+ *
2528
+ * Key C14N rules applied:
2529
+ * 1. UTF-8 encoding
2530
+ * 2. Normalized line endings (\n)
2531
+ * 3. Lexicographic attribute ordering
2532
+ * 4. Namespace declaration ordering
2533
+ * 5. Empty element normalization (&lt;tag&gt;&lt;/tag&gt; not &lt;tag/&gt;)
2534
+ * 6. Entity/character reference expansion
2535
+ * 7. Attribute value quoting with double quotes
2536
+ *
2537
+ * @param doc Document to canonicalize
2538
+ * @param version C14N version (LEPTRIS_C14N_1_0 or LEPTRIS_C14N_1_1)
2539
+ * @param flags Reserved for future use (pass 0)
2540
+ * @return Canonicalized XML string (caller must free with leptris_free_string())
2541
+ *
2542
+ * Memory: Caller must free returned string with leptris_free_string()
2543
+ */
2544
+ LEPTRIS_API char* leptris_c14n_canonicalize(struct leptris_document* doc,
2545
+ int version,
2546
+ int flags);
2547
+
2548
+ /**
2549
+ * Canonicalize a subtree rooted at the given element (issue #169).
2550
+ * Same algorithm as leptris_c14n_canonicalize but limited to elem
2551
+ * and its descendants. Pairs of PIs and the document's XML
2552
+ * declaration are NOT included (subtree C14N is element-scoped).
2553
+ *
2554
+ * @param elem Subtree root
2555
+ * @param version C14N version (LEPTRIS_C14N_1_0 or LEPTRIS_C14N_1_1)
2556
+ * @param flags Reserved for future use (pass 0)
2557
+ * @return Canonicalized XML string (caller must free with
2558
+ * leptris_free_string), or NULL on error
2559
+ *
2560
+ * Memory: Caller must free the returned string (free() or leptris_free_string).
2561
+ */
2562
+ LEPTRIS_API char* leptris_c14n_canonicalize_subtree(LeptrisElement elem,
2563
+ int version,
2564
+ int flags);
2565
+
2566
+ /**
2567
+ * Extended canonicalization with mode, inclusive namespaces, and
2568
+ * comments toggle (issue #183).
2569
+ *
2570
+ * @param doc Document
2571
+ * @param version LEPTRIS_C14N_1_0 or LEPTRIS_C14N_1_1
2572
+ * @param mode LEPTRIS_C14N_MODE_CANONICAL or LEPTRIS_C14N_MODE_EXCLUSIVE
2573
+ * @param inclusive_ns_prefixes NULL or NULL-terminated array of
2574
+ * namespace prefixes to include even under EXCLUSIVE mode.
2575
+ * Pass NULL when not needed.
2576
+ * @param with_comments 0 to strip comments, 1 to preserve
2577
+ * @return Canonicalized XML string (caller frees with
2578
+ * leptris_free_string), or NULL on error
2579
+ *
2580
+ * Memory: Caller must free the returned string (free() or leptris_free_string).
2581
+ */
2582
+ LEPTRIS_API char* leptris_c14n_canonicalize_ex(
2583
+ struct leptris_document* doc,
2584
+ int version,
2585
+ LeptrisC14NMode mode,
2586
+ const char** inclusive_ns_prefixes,
2587
+ int with_comments);
2588
+
2589
+ /**
2590
+ * Extended subtree canonicalization (issue #183). Same parameters
2591
+ * as leptris_c14n_canonicalize_ex but limited to elem + descendants.
2592
+ *
2593
+ * Memory: Caller must free the returned string (free() or leptris_free_string).
2594
+ */
2595
+ LEPTRIS_API char* leptris_c14n_canonicalize_subtree_ex(
2596
+ LeptrisElement elem,
2597
+ int version,
2598
+ LeptrisC14NMode mode,
2599
+ const char** inclusive_ns_prefixes,
2600
+ int with_comments);
2601
+
2602
+ /* ============================================================================
2603
+ * Namespace Operations
2604
+ * ============================================================================ */
2605
+
2606
+ /**
2607
+ * Get element's active namespace
2608
+ *
2609
+ * @param elem Element
2610
+ * @return Namespace or NULL if elem has no namespace
2611
+ *
2612
+ * Memory: Namespace is owned by element. Do not free separately.
2613
+ */
2614
+ LEPTRIS_API LeptrisNamespace leptris_element_namespace(LeptrisElement elem);
2615
+
2616
+ /**
2617
+ * Set (or detach) an element's namespace (issue #817)
2618
+ *
2619
+ * The setter counterpart of leptris_element_namespace, matching
2620
+ * Nokogiri's node.namespace= semantics:
2621
+ * - NULL (or "") DETACHES: the resolved namespace link and the
2622
+ * name's prefix clear, and an xmlns="" undeclaration is added so
2623
+ * an in-scope default namespace cannot capture the now
2624
+ * unqualified name.
2625
+ * - A non-empty URI REBINDS to an IN-SCOPE declaration carrying
2626
+ * that URI (its prefix is adopted). A URI with no in-scope
2627
+ * declaration returns LEPTRIS_ERROR_NOT_FOUND — this API does
2628
+ * not invent declarations; call
2629
+ * leptris_element_add_namespace_definition first.
2630
+ *
2631
+ * @param elem Element
2632
+ * @param uri Namespace URI, or NULL to detach
2633
+ * @return LEPTRIS_OK, or an error status
2634
+ */
2635
+ LEPTRIS_API LeptrisStatus leptris_element_set_namespace(
2636
+ LeptrisElement elem, const char* uri);
2637
+
2638
+ /**
2639
+ * Get an element's own namespace prefix
2640
+ *
2641
+ * The prefix of the element's qualified name (e.g. "foo" in
2642
+ * &lt;foo:child/&gt;), or NULL when the element has none.
2643
+ *
2644
+ * @param elem Element
2645
+ * @return Prefix string or NULL
2646
+ *
2647
+ * Memory: String is owned by element. Do not free or modify.
2648
+ */
2649
+ LEPTRIS_API const char* leptris_element_prefix(LeptrisElement elem);
2650
+
2651
+ /**
2652
+ * Get namespace URI
2653
+ *
2654
+ * @param ns Namespace
2655
+ * @return URI string or NULL if ns is NULL
2656
+ *
2657
+ * Memory: String is owned by namespace. Do not free or modify.
2658
+ */
2659
+ LEPTRIS_API const char* leptris_namespace_uri(LeptrisNamespace ns);
2660
+
2661
+ /**
2662
+ * Get namespace prefix
2663
+ *
2664
+ * @param ns Namespace
2665
+ * @return Prefix string or NULL if default namespace or ns is NULL
2666
+ *
2667
+ * Memory: String is owned by namespace. Do not free or modify.
2668
+ */
2669
+ LEPTRIS_API const char* leptris_namespace_prefix(LeptrisNamespace ns);
2670
+
2671
+ /**
2672
+ * Resolve namespace prefix (with inheritance)
2673
+ *
2674
+ * @param elem Element to start search from
2675
+ * @param prefix Prefix to resolve (NULL for default namespace)
2676
+ * @return Namespace URI or NULL if not found
2677
+ *
2678
+ * Memory: String is owned by element. Do not free or modify.
2679
+ */
2680
+ LEPTRIS_API const char* leptris_element_namespace_for_prefix(LeptrisElement elem, const char* prefix);
2681
+
2682
+ /**
2683
+ * Get number of namespaces declared on an element
2684
+ *
2685
+ * Counts xmlns and xmlns:* attributes. O(n) over the attribute list.
2686
+ *
2687
+ * @param elem Element
2688
+ * @return Namespace count or 0 if elem is NULL
2689
+ */
2690
+ LEPTRIS_API size_t leptris_element_namespace_count(LeptrisElement elem);
2691
+
2692
+ /**
2693
+ * Get the prefix of the namespace declaration at the given index
2694
+ * (issue #171). Use with leptris_element_namespace_count to enumerate
2695
+ * all declarations on an element.
2696
+ *
2697
+ * @param elem Element
2698
+ * @param index 0-based index, must be < namespace_count
2699
+ * @return Prefix string (NULL for the default namespace),
2700
+ * or NULL if index is out of range
2701
+ *
2702
+ * Memory: String is owned by the element. Do not free or modify.
2703
+ */
2704
+ LEPTRIS_API const char* leptris_element_namespace_decl_prefix(LeptrisElement elem,
2705
+ size_t index);
2706
+
2707
+ /**
2708
+ * Get the URI of the namespace declaration at the given index
2709
+ * (issue #171). Pairs with leptris_element_namespace_decl_prefix.
2710
+ *
2711
+ * @param elem Element
2712
+ * @param index 0-based index
2713
+ * @return URI string, or NULL if index is out of range
2714
+ */
2715
+ LEPTRIS_API const char* leptris_element_namespace_decl_uri(LeptrisElement elem,
2716
+ size_t index);
2717
+
2718
+ /**
2719
+ * Add a namespace declaration to an element (issue #186).
2720
+ *
2721
+ * @param elem Element to receive the declaration
2722
+ * @param prefix Namespace prefix. NULL or "" means default namespace.
2723
+ * @param href Namespace URI (required)
2724
+ * @return LEPTRIS_OK on success,
2725
+ * LEPTRIS_ERROR_NULL_ARG if elem or href is NULL,
2726
+ * LEPTRIS_ERROR_MEMORY on allocation failure
2727
+ *
2728
+ * Memory: prefix and href are pool-copied; caller may free or
2729
+ * modify the inputs immediately.
2730
+ */
2731
+ LEPTRIS_API LeptrisStatus leptris_element_add_namespace_definition(
2732
+ LeptrisElement elem, const char* prefix, const char* href);
2733
+
2734
+ /**
2735
+ * Set the default namespace on an element (issue #186).
2736
+ * Equivalent to add_namespace_definition(elem, NULL, href).
2737
+ */
2738
+ LEPTRIS_API LeptrisStatus leptris_element_set_default_namespace(
2739
+ LeptrisElement elem, const char* href);
2740
+
2741
+ /**
2742
+ * Remove the namespace declaration matching prefix (issue #186).
2743
+ *
2744
+ * @param elem Element
2745
+ * @param prefix Prefix to match. NULL means default namespace.
2746
+ * @return LEPTRIS_OK on success,
2747
+ * LEPTRIS_ERROR_NULL_ARG if elem is NULL,
2748
+ * LEPTRIS_ERROR_NOT_FOUND if no matching declaration exists
2749
+ */
2750
+ LEPTRIS_API LeptrisStatus leptris_element_remove_namespace_definition(
2751
+ LeptrisElement elem, const char* prefix);
2752
+
2753
+ /**
2754
+ * Convert status code to human-readable string
2755
+ *
2756
+ * The CANONICAL status->message function (leptris_error_message in
2757
+ * error.h is a deprecated alias with identical output —
2758
+ * TODO.concurrency/04).
2759
+ *
2760
+ * @param status Status code from leptris_parse_string or other API
2761
+ * @return Static string (never NULL, never freed)
2762
+ *
2763
+ * Memory: Static string. Do not free.
2764
+ */
2765
+ LEPTRIS_API const char* leptris_status_string(LeptrisStatus status);
2766
+
2767
+ /* ============================================================================
2768
+ * XPath Operations
2769
+ * ============================================================================ */
2770
+
2771
+ /**
2772
+ * Evaluate XPath expression
2773
+ *
2774
+ * @param doc Document (required)
2775
+ * @param context Context element (NULL = document root)
2776
+ * @param expression XPath expression string
2777
+ * @return XPath result or NULL on error
2778
+ *
2779
+ * Memory: Caller must call leptris_xpath_result_free() when done
2780
+ * Thread safety: Not thread-safe. One evaluation per thread.
2781
+ *
2782
+ * XPath 1.0 compliance: Full XPath 1.0 specification
2783
+ * - All 13 axes: child, descendant, parent, ancestor, sibling, etc.
2784
+ * - All 27 functions: string(), count(), position(), etc.
2785
+ * - All operators: =, !=, <, <=, >, >=, +, -, *, div, mod, |, and, or
2786
+ * - Predicates: [1], [\@attr], [position() > 2], etc.
2787
+ */
2788
+ /* ============================================================================
2789
+ * Batch-context evaluation (issue #560)
2790
+ * ============================================================================ */
2791
+
2792
+ /**
2793
+ * Evaluate one expression against N context nodes in a single call
2794
+ *
2795
+ * Union semantics (NodeSet#xpath): each context element evaluates
2796
+ * the expression independently; the results merge into ONE
2797
+ * de-duplicated nodeset in document order — the same-node match from
2798
+ * several contexts is kept once, and the C side does the work that
2799
+ * bindings previously paid N dispatches for.
2800
+ *
2801
+ * @param doc Document
2802
+ * @param contexts Caller array of context elements (all non-NULL)
2803
+ * @param count Number of contexts
2804
+ * @param expression XPath 1.0 expression
2805
+ * @return De-duplicated, document-ordered nodeset, or NULL on
2806
+ * NULL/empty inputs or evaluation failure
2807
+ *
2808
+ * Memory: free with leptris_xpath_result_free.
2809
+ */
2810
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_eval_nodeset(
2811
+ LeptrisDocument doc, LeptrisElement* contexts, size_t count,
2812
+ const char* expression);
2813
+
2814
+ /** Compiled-expression variant of leptris_xpath_eval_nodeset. */
2815
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_compiled_eval_nodeset(
2816
+ LeptrisDocument doc, LeptrisElement* contexts, size_t count,
2817
+ LeptrisXPathCompiled compiled);
2818
+
2819
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_eval(
2820
+ LeptrisDocument doc,
2821
+ LeptrisElement context,
2822
+ const char* expression
2823
+ );
2824
+
2825
+ /**
2826
+ * Evaluate an XPath expression under a pinned language version
2827
+ * (lane 15). LEPTRIS_XPATH_10 keeps the strict XPath 1.0 surface
2828
+ * (3.x-only syntax — arrow, bang, lookup, let, inline functions,
2829
+ * string templates — is rejected with LEPTRIS_ERROR_INVALID_ARG);
2830
+ * LEPTRIS_XPATH_31 evaluates the full grammar (identical to
2831
+ * leptris_xpath_eval).
2832
+ *
2833
+ * @param doc Document to evaluate against
2834
+ * @param context Context element (NULL = document root)
2835
+ * @param expression Expression text
2836
+ * @param version LEPTRIS_XPATH_10 or LEPTRIS_XPATH_31
2837
+ * @param status Optional status out-param
2838
+ * @return Result handle, or NULL on error
2839
+ * Memory: Caller owns the result (leptris_xpath_result_free).
2840
+ */
2841
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_eval_versioned(
2842
+ LeptrisDocument doc,
2843
+ LeptrisElement context,
2844
+ const char* expression,
2845
+ LeptrisXPathVersion version,
2846
+ LeptrisStatus* status
2847
+ );
2848
+
2849
+ /**
2850
+ * Compile an XPath expression once, evaluate many times
2851
+ *
2852
+ * Skips the per-call expression hash + cache probe that
2853
+ * leptris_xpath_eval pays — the hot-loop win for bindings
2854
+ * (TODO.bindings/03, issue #510 Tier 2).
2855
+ *
2856
+ * Thread contract: the compiled handle is immutable — any number of
2857
+ * threads may evaluate it concurrently (against their own
2858
+ * documents). Free only after the last evaluation returns.
2859
+ *
2860
+ * @param expression XPath 1.0 expression
2861
+ * @return Compiled handle, or NULL on syntax error (message via
2862
+ * leptris_last_error)
2863
+ *
2864
+ * Memory: free with leptris_xpath_compiled_free.
2865
+ */
2866
+ LEPTRIS_API LeptrisXPathCompiled leptris_xpath_compile(const char* expression);
2867
+
2868
+ /**
2869
+ * Evaluate a compiled expression against a document
2870
+ *
2871
+ * Same evaluation semantics as leptris_xpath_eval (VM path with the
2872
+ * direct-AST fallback); failures snapshot into the document's error
2873
+ * slot (leptris_document_last_error).
2874
+ *
2875
+ * @param compiled Handle from leptris_xpath_compile
2876
+ * @param doc Document to evaluate against
2877
+ * @param context Context element, or NULL for the document root
2878
+ * @return Result (free with leptris_xpath_result_free), or NULL
2879
+ */
2880
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_compiled_eval(
2881
+ LeptrisXPathCompiled compiled, LeptrisDocument doc,
2882
+ LeptrisElement context);
2883
+
2884
+ /**
2885
+ * Free a compiled expression handle
2886
+ *
2887
+ * Must not race with in-flight evaluations of the same handle.
2888
+ */
2889
+ /* Source text of a compiled expression (owned by the handle).
2890
+ * Memory: valid until leptris_xpath_compiled_free. */
2891
+ LEPTRIS_API const char* leptris_xpath_compiled_text(
2892
+ LeptrisXPathCompiled compiled);
2893
+
2894
+ LEPTRIS_API void leptris_xpath_compiled_free(LeptrisXPathCompiled compiled);
2895
+
2896
+ /**
2897
+ * Evaluate a compiled expression with external namespace bindings
2898
+ *
2899
+ * Compiled-handle counterpart of leptris_xpath_eval_ns
2900
+ * (TODO.engine/02): prefixed name tests resolve through the binding
2901
+ * set, same semantics, minus the per-call parse.
2902
+ */
2903
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_compiled_eval_ns(
2904
+ LeptrisXPathCompiled compiled, LeptrisDocument doc,
2905
+ LeptrisElement context, LeptrisXPathNsSet ns);
2906
+
2907
+ /**
2908
+ * Evaluate a compiled expression with external variables
2909
+ *
2910
+ * Compiled-handle counterpart of leptris_xpath_eval_with_vars_context
2911
+ * (TODO.engine/02): $var references resolve through the variable
2912
+ * set, same semantics, minus the per-call parse.
2913
+ */
2914
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_compiled_eval_vars(
2915
+ LeptrisXPathCompiled compiled, LeptrisDocument doc,
2916
+ LeptrisElement context, LeptrisXPathVariableSet variables);
2917
+
2918
+ /**
2919
+ * Evaluate a compiled expression with namespaces AND variables
2920
+ *
2921
+ * The combined form (issue #608): prefixed name tests resolve
2922
+ * through the binding set and $var references through the variable
2923
+ * set in one compiled call — bindings no longer fall back to
2924
+ * uncompiled evaluation for expressions like count(//x:b[@id=$id]).
2925
+ * Either argument may be NULL for the single-set behavior.
2926
+ */
2927
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_compiled_eval_ns_vars(
2928
+ LeptrisXPathCompiled compiled, LeptrisDocument doc,
2929
+ LeptrisElement context, LeptrisXPathNsSet ns,
2930
+ LeptrisXPathVariableSet variables);
2931
+
2932
+ /**
2933
+ * Compile an XSLT 1.0 stylesheet (TODO.transform)
2934
+ *
2935
+ * The stylesheet is compiled ONCE into an immutable instruction
2936
+ * forest: patterns compile to XPath ASTs, select/test expressions go
2937
+ * through leptris_xpath_compile, and literal result elements are
2938
+ * stored verbatim. The handle can then be applied to any number of
2939
+ * documents with no re-parsing.
2940
+ *
2941
+ * @param stylesheet_xml The stylesheet document (UTF-8)
2942
+ * @param len Byte length of stylesheet_xml
2943
+ * @return Compiled stylesheet, or NULL on syntax error (message via
2944
+ * leptris_last_error)
2945
+ *
2946
+ * Memory: free with leptris_xslt_free.
2947
+ */
2948
+ LEPTRIS_API LeptrisXslt leptris_xslt_parse(const char* stylesheet_xml,
2949
+ size_t len);
2950
+
2951
+ /**
2952
+ * Compile a stylesheet from a file
2953
+ *
2954
+ * Reads `path` (UTF-8) and compiles via leptris_xslt_parse. Also
2955
+ * resolves §2.7 embedded stylesheets (xml-stylesheet PI with an
2956
+ * href="#id" fragment) when the document root is not a stylesheet.
2957
+ */
2958
+ LEPTRIS_API LeptrisXslt leptris_xslt_parse_file(const char* path);
2959
+
2960
+ /**
2961
+ * Free a compiled stylesheet handle
2962
+ *
2963
+ * Must not race with in-flight leptris_xslt_apply calls on the same
2964
+ * handle.
2965
+ */
2966
+ LEPTRIS_API void leptris_xslt_free(LeptrisXslt xslt);
2967
+
2968
+ /**
2969
+ * Apply a compiled stylesheet to a document
2970
+ *
2971
+ * @param xslt Compiled stylesheet (from leptris_xslt_parse)
2972
+ * @param doc Source document (not modified)
2973
+ * @return Result tree (free with leptris_document_free), or NULL on
2974
+ * error (message via leptris_document_last_error)
2975
+ */
2976
+ LEPTRIS_API LeptrisDocument leptris_xslt_apply(LeptrisXslt xslt,
2977
+ LeptrisDocument doc);
2978
+
2979
+ /**
2980
+ * Apply a compiled stylesheet and serialize the result
2981
+ *
2982
+ * Convenience wrapper: leptris_xslt_apply + serialize, including
2983
+ * top-level text nodes and result fragments that the tree API would
2984
+ * flatten.
2985
+ *
2986
+ * @param xslt Compiled stylesheet
2987
+ * @param doc Source document
2988
+ * @return Serialized result (free with leptris_free_string), or NULL
2989
+ */
2990
+ LEPTRIS_API char* leptris_xslt_apply_string(LeptrisXslt xslt,
2991
+ LeptrisDocument doc);
2992
+
2993
+ /**
2994
+ * Custom XPath function handler (string-valued).
2995
+ *
2996
+ * The handler receives the string representations of each XPath
2997
+ * argument (XPath node-sets are flattened to concatenated text
2998
+ * content; numbers and booleans are stringified). It returns a
2999
+ * newly-allocated NUL-terminated string, or NULL on error.
3000
+ *
3001
+ * The caller (libleptris) frees the returned string. The `args`
3002
+ * array is owned by libleptris; do not free or modify.
3003
+ *
3004
+ * Use this with `leptris_xpath_register_function` to expose Ruby
3005
+ * callbacks via `Searchable#xpath(expr, ..., handler)` in the
3006
+ * Nokogiri-compatible API.
3007
+ */
3008
+ typedef char* (*LeptrisXPathFn)(const char* const* args,
3009
+ int argc,
3010
+ void* user_data);
3011
+
3012
+ /**
3013
+ * Register a custom XPath function on a document.
3014
+ *
3015
+ * @param doc Document that will own the registration
3016
+ * @param name Function name as it appears in XPath expressions.
3017
+ * Must not conflict with the standard XPath 1.0
3018
+ * function names (count, position, last, etc.) — the
3019
+ * standard library wins ties.
3020
+ * @param fn Handler. Must not be NULL.
3021
+ * @param user_data Opaque pointer passed back to `fn` on each
3022
+ * call. May be NULL.
3023
+ * @return LEPTRIS_OK on success, LEPTRIS_ERROR_NULL_ARG on NULL
3024
+ * doc/name/fn.
3025
+ *
3026
+ * Registered functions are scoped to `doc`; they live for the
3027
+ * document's lifetime and are released by
3028
+ * `leptris_document_free`. Within an XPath expression they are
3029
+ * callable by name — no namespace prefix needed. The handler
3030
+ * runs only when the function is invoked during
3031
+ * `leptris_xpath_eval` against this document.
3032
+ *
3033
+ * Memory: the document owns the registration; user_data is owned
3034
+ * by the caller.
3035
+ */
3036
+ LEPTRIS_API LeptrisStatus leptris_xpath_register_function(
3037
+ LeptrisDocument doc,
3038
+ const char* name,
3039
+ LeptrisXPathFn fn,
3040
+ void* user_data
3041
+ );
3042
+ /**
3043
+ * Check whether an XPath function name is supported
3044
+ *
3045
+ * Covers the standard XPath 1.0 library. Custom functions
3046
+ * registered on a document report 0 here (they are per-document).
3047
+ *
3048
+ * @param function_name Function name (e.g. "count")
3049
+ * @return 1 supported, 0 unknown/NULL
3050
+ */
3051
+ LEPTRIS_API int leptris_xpath_function_supported(const char* function_name);
3052
+
3053
+ /**
3054
+ * List the supported XPath function names
3055
+ *
3056
+ * @return NULL-terminated static array of names (do not free);
3057
+ * valid for the library's lifetime
3058
+ */
3059
+ LEPTRIS_API const char** leptris_xpath_supported_functions(void);
3060
+ /**
3061
+ * Enable the first-party EXSLT-style extension pack for a document
3062
+ *
3063
+ * Registers str:/set:/math: prefixed functions (replace, tokenize,
3064
+ * split, concat, padding; distinct, intersection, difference,
3065
+ * leading, trailing; max, min, abs, sqrt, power) as native handlers
3066
+ * on this document — one C implementation shared by every binding
3067
+ * instead of per-language reimplementations (TODO.concurrency/06).
3068
+ * Prefixed names never collide with the XPath 1.0 core.
3069
+ *
3070
+ * @param doc Document that will own the registration
3071
+ * @return LEPTRIS_OK, or NULL_ARG
3072
+ */
3073
+ LEPTRIS_API LeptrisStatus leptris_exslt_enable(LeptrisDocument doc);
3074
+
3075
+
3076
+
3077
+ /**
3078
+ * Get XPath result type
3079
+ *
3080
+ * @param result XPath result
3081
+ * @return Result type or -1 if result is NULL
3082
+ */
3083
+ LEPTRIS_API LeptrisXPathResultType leptris_xpath_result_type(LeptrisXPathResult result);
3084
+
3085
+ /**
3086
+ * Get nodeset size (for NODESET results)
3087
+ *
3088
+ * @param result XPath result
3089
+ * @return Number of nodes or 0 if not a nodeset or result is NULL
3090
+ */
3091
+ LEPTRIS_API size_t leptris_xpath_result_count(LeptrisXPathResult result);
3092
+
3093
+ /**
3094
+ * Get node from nodeset by index
3095
+ *
3096
+ * @param result XPath result
3097
+ * @param index Node index (0-based)
3098
+ * @return Element or NULL if index out of bounds or not a nodeset
3099
+ *
3100
+ * Memory: Element is owned by document. Do not free separately.
3101
+ */
3102
+ LEPTRIS_API LeptrisElement leptris_xpath_result_get(LeptrisXPathResult result, size_t index);
3103
+
3104
+ /**
3105
+ * Batch-copy all nodes from a nodeset result into a caller-provided array.
3106
+ *
3107
+ * Eliminates per-node FFI call overhead for bindings that iterate
3108
+ * large nodesets (e.g., //book returning 100+ nodes). One call
3109
+ * instead of N calls (#262).
3110
+ *
3111
+ * @param result XPath result (must be NODESET type)
3112
+ * ELEMENTS ONLY: mixed nodesets (from //node(), text(), unions)
3113
+ * copy just their element entries here — use
3114
+ * leptris_xpath_result_get_nodes_ex for every kind
3115
+ * (TODO.concurrency/03).
3116
+ *
3117
+ * @param out_nodes Caller-allocated array of LeptrisElement
3118
+ * @param max_count Capacity of out_nodes
3119
+ * @return Number of ELEMENT entries copied (not the result count
3120
+ * when the nodeset is mixed)
3121
+ *
3122
+ * Memory: Elements are owned by document. Do not free separately.
3123
+ */
3124
+ LEPTRIS_API size_t leptris_xpath_result_get_nodes(
3125
+ LeptrisXPathResult result, LeptrisElement* out_nodes, size_t max_count);
3126
+ /**
3127
+ * Copy every node of a mixed nodeset result with its kind
3128
+ *
3129
+ * Unlike leptris_xpath_result_get_nodes (which copies ELEMENT
3130
+ * entries only), this copies every entry — elements, text, comment,
3131
+ * CDATA, attribute, namespace — writing the node handle to
3132
+ * out_nodes[i] and its kind to out_kinds[i]. Inspect handles via
3133
+ * leptris_node_get_type / leptris_node_first_child; attribute-kind
3134
+ * entries are synthetic nodes understood by the mixed-nodeset
3135
+ * accessors (TODO.concurrency/03).
3136
+ *
3137
+ * @param result XPath result (NODESET type)
3138
+ * @param out_nodes Output array (may be NULL when only counting)
3139
+ * @param out_kinds Output kind array (may be NULL)
3140
+ * @param max_count Capacity of both arrays
3141
+ * @return Number of entries copied (min(result count, max_count))
3142
+ */
3143
+ LEPTRIS_API size_t leptris_xpath_result_get_nodes_ex(
3144
+ LeptrisXPathResult result,
3145
+ LeptrisNodeRef* out_nodes,
3146
+ LeptrisXPathNodeKind* out_kinds,
3147
+ size_t max_count);
3148
+
3149
+
3150
+ /**
3151
+ * Get the kind of a node in a mixed nodeset result
3152
+ *
3153
+ * Nodesets contain element nodes AND synthetic attribute nodes (from
3154
+ * \@attr / attribute:: axes). This reports which. String results of
3155
+ * any kind are read via leptris_xpath_result_string.
3156
+ *
3157
+ * @param result XPath result (NODESET type)
3158
+ * @param index Node index (0-based, < leptris_xpath_result_count)
3159
+ * @return Node kind, or LEPTRIS_XPATH_NODE_OTHER on error/out of range
3160
+ */
3161
+ LEPTRIS_API LeptrisXPathNodeKind leptris_xpath_result_node_kind(
3162
+ LeptrisXPathResult result, size_t index);
3163
+
3164
+ /**
3165
+ * Get any node from a mixed nodeset result
3166
+ *
3167
+ * Unlike leptris_xpath_result_get (elements only), this returns the
3168
+ * node whatever its kind. For LEPTRIS_XPATH_NODE_ELEMENT results the
3169
+ * handle casts to LeptrisElement (leptris_node_as_element); attribute
3170
+ * and text nodes are opaque handles read via node_name/node_value.
3171
+ *
3172
+ * @param result XPath result (NODESET type)
3173
+ * @param index Node index (0-based)
3174
+ * @return Node handle, or NULL on error/out of range
3175
+ *
3176
+ * Memory: Node is owned by the result/document. Do not free.
3177
+ */
3178
+ LEPTRIS_API LeptrisNodeRef leptris_xpath_result_get_node(
3179
+ LeptrisXPathResult result, size_t index);
3180
+
3181
+ /**
3182
+ * Get the name of a node in a nodeset result
3183
+ *
3184
+ * @param result XPath result (NODESET type)
3185
+ * @param index Node index (0-based)
3186
+ * @return Element name for element nodes; attribute name for
3187
+ * attribute nodes; NULL for text/comment/other nodes
3188
+ *
3189
+ * Memory: String is owned by the result or the document. Do not free.
3190
+ */
3191
+ LEPTRIS_API const char* leptris_xpath_result_node_name(
3192
+ LeptrisXPathResult result, size_t index);
3193
+
3194
+ /**
3195
+ * Get the string value of a non-element node in a nodeset result
3196
+ *
3197
+ * Attribute nodes: the attribute value. Text nodes: the content.
3198
+ *
3199
+ * @param result XPath result (NODESET type)
3200
+ * @param index Node index (0-based)
3201
+ * @return Value string, or NULL for element/other nodes
3202
+ *
3203
+ * Memory: String is owned by the result. Do not free.
3204
+ */
3205
+ LEPTRIS_API const char* leptris_xpath_result_node_value(
3206
+ LeptrisXPathResult result, size_t index);
3207
+
3208
+ /**
3209
+ * Get boolean value (for BOOLEAN results or type conversion)
3210
+ *
3211
+ * @param result XPath result
3212
+ * @return Boolean value (1 = true, 0 = false)
3213
+ *
3214
+ * Type conversion rules:
3215
+ * - BOOLEAN: Direct value
3216
+ * - NUMBER: true if non-zero and not NaN
3217
+ * - STRING: true if non-empty
3218
+ * - NODESET: true if non-empty
3219
+ */
3220
+ LEPTRIS_API int leptris_xpath_result_boolean(LeptrisXPathResult result);
3221
+
3222
+ /**
3223
+ * Get number value (for NUMBER results or type conversion)
3224
+ *
3225
+ * @param result XPath result
3226
+ * @return Number value (NaN if conversion fails)
3227
+ *
3228
+ * Type conversion rules:
3229
+ * - NUMBER: Direct value
3230
+ * - BOOLEAN: 1.0 or 0.0
3231
+ * - STRING: Parsed as number (NaN if invalid)
3232
+ * - NODESET: First node's string value converted to number
3233
+ */
3234
+ LEPTRIS_API double leptris_xpath_result_number(LeptrisXPathResult result);
3235
+
3236
+ /**
3237
+ * Get string value (for STRING results or type conversion)
3238
+ *
3239
+ * @param result XPath result
3240
+ * @return String value or NULL if result is NULL
3241
+ *
3242
+ * Memory: Caller must call leptris_free_string() when done
3243
+ *
3244
+ * Type conversion rules:
3245
+ * - STRING: Direct value
3246
+ * - BOOLEAN: "true" or "false"
3247
+ * - NUMBER: String representation of number
3248
+ * - NODESET: String value of first node (recursive text concatenation)
3249
+ */
3250
+ LEPTRIS_API char* leptris_xpath_result_string(LeptrisXPathResult result);
3251
+
3252
+ /**
3253
+ * Free XPath result
3254
+ *
3255
+ * @param result Result to free (can be NULL)
3256
+ */
3257
+ LEPTRIS_API void leptris_xpath_result_free(LeptrisXPathResult result);
3258
+
3259
+ /* ============================================================================
3260
+ * XPath Variables (XPath 1.0)
3261
+ * ============================================================================ */
3262
+
3263
+ /**
3264
+ * XPath variable value types
3265
+ *
3266
+ * Definition lives in leptris/types.h.
3267
+ */
3268
+
3269
+ /**
3270
+ * Opaque variable set type — defined in leptris/types.h.
3271
+ */
3272
+
3273
+ /**
3274
+ * Create a new variable set
3275
+ *
3276
+ * @return New variable set, or NULL on error
3277
+ *
3278
+ * Memory: Caller must call leptris_xpath_variable_set_free() when done
3279
+ */
3280
+ LEPTRIS_API LeptrisXPathVariableSet leptris_xpath_variable_set_new(void);
3281
+
3282
+ /**
3283
+ * Free a variable set
3284
+ *
3285
+ * @param set Variable set to free (can be NULL)
3286
+ */
3287
+ LEPTRIS_API void leptris_xpath_variable_set_free(LeptrisXPathVariableSet set);
3288
+
3289
+ /**
3290
+ * Add a boolean variable to the set
3291
+ *
3292
+ * @param set Variable set
3293
+ * @param name Variable name (must be valid XPath identifier)
3294
+ * @param value Boolean value
3295
+ * @return LEPTRIS_OK on success, error code on failure
3296
+ */
3297
+ LEPTRIS_API LeptrisStatus leptris_xpath_variable_set_boolean(LeptrisXPathVariableSet set, const char* name, int value);
3298
+
3299
+ /**
3300
+ * Add a number variable to the set
3301
+ *
3302
+ * @param set Variable set
3303
+ * @param name Variable name (must be valid XPath identifier)
3304
+ * @param value Number value
3305
+ * @return LEPTRIS_OK on success, error code on failure
3306
+ */
3307
+ LEPTRIS_API LeptrisStatus leptris_xpath_variable_set_number(LeptrisXPathVariableSet set, const char* name, double value);
3308
+
3309
+ /**
3310
+ * Add a string variable to the set
3311
+ *
3312
+ * @param set Variable set
3313
+ * @param name Variable name (must be valid XPath identifier)
3314
+ * @param value String value
3315
+ * @return LEPTRIS_OK on success, error code on failure
3316
+ */
3317
+ LEPTRIS_API LeptrisStatus leptris_xpath_variable_set_string(LeptrisXPathVariableSet set, const char* name, const char* value);
3318
+
3319
+ /**
3320
+ * Evaluate XPath expression with variables
3321
+ *
3322
+ * @param doc Document to evaluate against
3323
+ * @param expression XPath expression string
3324
+ * @param variables Variable set (can be NULL)
3325
+ * @return XPath result or NULL on error
3326
+ *
3327
+ * Memory: Caller must call leptris_xpath_result_free() when done
3328
+ *
3329
+ * XPath 1.0 compliance: Full XPath 1.0 specification
3330
+ *
3331
+ * Variables are referenced in expressions using $name syntax:
3332
+ * leptris_xpath_variable_set_number(vars, "x", 42);
3333
+ * leptris_xpath_eval(doc, "//item[@id = $x]", vars);
3334
+ */
3335
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_eval_with_vars(
3336
+ LeptrisDocument doc,
3337
+ const char* expression,
3338
+ LeptrisXPathVariableSet variables
3339
+ );
3340
+
3341
+ /**
3342
+ * Evaluate an XPath expression with both a context node and a variable
3343
+ * set (issue #170). Use this when the receiver is not the document
3344
+ * root (e.g. relative paths like ".//item[@id = $x]").
3345
+ *
3346
+ * @param doc Document
3347
+ * @param context Context element (NULL = document root)
3348
+ * @param expression XPath expression
3349
+ * @param variables Variable set (may be NULL)
3350
+ * @return XPath result (caller frees with leptris_xpath_result_free)
3351
+ *
3352
+ * Memory: Result is owned by the caller; free with leptris_xpath_result_free.
3353
+ */
3354
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_eval_with_vars_context(
3355
+ LeptrisDocument doc,
3356
+ LeptrisElement context,
3357
+ const char* expression,
3358
+ LeptrisXPathVariableSet variables
3359
+ );
3360
+
3361
+ /* ============================================================================
3362
+ * External Namespace Bindings
3363
+ * ============================================================================ */
3364
+
3365
+ /**
3366
+ * Create an empty namespace-binding set for XPath evaluation
3367
+ *
3368
+ * Bindings map expression prefixes to namespace URIs, so a prefixed
3369
+ * name test (p:title) matches elements in that namespace regardless
3370
+ * of the literal prefix the document uses (XPointer xmlns() is the
3371
+ * canonical use). Without bindings, prefixed name tests compare
3372
+ * prefixes literally (historic behavior, unchanged).
3373
+ *
3374
+ * @return New empty set (caller frees with leptris_xpath_ns_set_free)
3375
+ *
3376
+ * Memory: Set and its copies of prefix/URI strings are owned by the
3377
+ * caller; free with leptris_xpath_ns_set_free.
3378
+ */
3379
+ LEPTRIS_API LeptrisXPathNsSet leptris_xpath_ns_set_new(void);
3380
+
3381
+ /**
3382
+ * Free a namespace-binding set (NULL-safe)
3383
+ */
3384
+ LEPTRIS_API void leptris_xpath_ns_set_free(LeptrisXPathNsSet set);
3385
+
3386
+ /**
3387
+ * Bind an expression prefix to a namespace URI
3388
+ *
3389
+ * Re-binding an existing prefix replaces the URI. A NULL/empty
3390
+ * prefix is invalid (use unprefixed tests for no-namespace).
3391
+ *
3392
+ * @param set Binding set
3393
+ * @param prefix Prefix used in the expression (copied)
3394
+ * @param uri Namespace URI (copied)
3395
+ * @return LEPTRIS_OK, or NULL_ARG / MEMORY
3396
+ */
3397
+ LEPTRIS_API LeptrisStatus leptris_xpath_ns_set_add(
3398
+ LeptrisXPathNsSet set, const char* prefix, const char* uri);
3399
+ /**
3400
+ * Build a namespace-binding set from a flat array of pairs
3401
+ *
3402
+ * One FFI call instead of new + N x add (TODO.concurrency/07).
3403
+ * The array layout matches the c14n inclusive-namespaces argument
3404
+ * (flat [p1, u1, p2, u2, ...]) so bindings share one adapter.
3405
+ * Invalid entries (NULL/empty prefix or URI) fail the whole call.
3406
+ *
3407
+ * @param flat Array of 2*pair_count strings (prefix, URI alternating)
3408
+ * @param pair_count Number of pairs
3409
+ * @return New set (caller frees with leptris_xpath_ns_set_free),
3410
+ * or NULL on NULL/invalid input
3411
+ *
3412
+ * Memory: Set and its copies of the strings are owned by the
3413
+ * caller; free with leptris_xpath_ns_set_free.
3414
+ */
3415
+ LEPTRIS_API LeptrisXPathNsSet leptris_xpath_ns_set_new_from_pairs(
3416
+ const char* const* flat,
3417
+ size_t pair_count);
3418
+
3419
+
3420
+ /**
3421
+ * Evaluate an XPath expression with external namespace bindings
3422
+ *
3423
+ * Same as leptris_xpath_eval_with_vars_context, plus prefix->URI
3424
+ * resolution for prefixed name tests (p:title matches any element
3425
+ * named title in the bound namespace, whatever prefix the document
3426
+ * declared it with).
3427
+ *
3428
+ * @param doc Document
3429
+ * @param context Context element (NULL = document root)
3430
+ * @param expression XPath expression
3431
+ * @param ns Namespace bindings (may be NULL; then behavior equals
3432
+ * leptris_xpath_eval_with_vars_context)
3433
+ * @return XPath result (caller frees with leptris_xpath_result_free)
3434
+ *
3435
+ * Memory: Result is owned by the caller; free with leptris_xpath_result_free.
3436
+ */
3437
+ LEPTRIS_API LeptrisXPathResult leptris_xpath_eval_ns(
3438
+ LeptrisDocument doc,
3439
+ LeptrisElement context,
3440
+ const char* expression,
3441
+ LeptrisXPathNsSet ns
3442
+ );
3443
+
3444
+ /* ============================================================================
3445
+ * Memory Management Helpers
3446
+ * ============================================================================ */
3447
+
3448
+ /**
3449
+ * Free string returned by libleptris
3450
+ *
3451
+ * @param str String to free (can be NULL)
3452
+ *
3453
+ * Use this to free strings returned by:
3454
+ * - leptris_xpath_result_string()
3455
+ */
3456
+ LEPTRIS_API void leptris_free_string(char* str);
3457
+
3458
+ /**
3459
+ * Pre-scan predicate: does the buffer contain a named entity
3460
+ * reference that is NOT one of the five predefined XML entities
3461
+ * (amp, lt, gt, quot, apos) or a numeric character reference?
3462
+ *
3463
+ * Downstream adapters (e.g. moxml) preprocess XML so non-standard
3464
+ * named entities round-trip; for the overwhelmingly common case —
3465
+ * all entities predefined or numeric — no rewrite is needed. This
3466
+ * one-pass C check replaces a whole-buffer regex scan on the
3467
+ * caller's side (issue #745: +61% parse overhead down to ~+2%).
3468
+ *
3469
+ * A bare '&' with no terminating ';' is not an entity reference
3470
+ * and is left to the parser's error reporting.
3471
+ *
3472
+ * @param s Buffer to scan (can be NULL)
3473
+ * @param len Buffer length in bytes
3474
+ * @return 1 if a non-standard named entity reference is present,
3475
+ * 0 otherwise
3476
+ */
3477
+ LEPTRIS_API int leptris_str_has_nonstandard_entity(const char* s,
3478
+ size_t len);
3479
+
3480
+ /**
3481
+ * Cleanup function to free internal memory structures (for testing)
3482
+ *
3483
+ * This function cleans up the compact pointer overflow table and other
3484
+ * thread-local structures that may accumulate stale entries across
3485
+ * multiple document operations.
3486
+ *
3487
+ * IMPORTANT: This should ONLY be called between test runs or when
3488
+ * you're certain no documents are active. Calling this while documents
3489
+ * are active will cause crashes.
3490
+ *
3491
+ * This function is primarily intended for test suites to prevent
3492
+ * state accumulation between tests.
3493
+ */
3494
+ LEPTRIS_API void leptris_explicit_cleanup(void);
3495
+
3496
+ /* ============================================================================
3497
+ * Memory Allocation Hooks (for testing and custom allocators)
3498
+ *
3499
+ * The leptris_allocation_function / leptris_deallocation_function typedefs
3500
+ * come from leptris/types.h (included above). Only the API entry points
3501
+ * live here.
3502
+ * ============================================================================ */
3503
+
3504
+ /**
3505
+ * Set custom memory management functions for all allocations
3506
+ *
3507
+ * By default, Leptris uses malloc/free. This function allows you to
3508
+ * specify custom allocation functions for testing (memory leak detection)
3509
+ * or custom memory management.
3510
+ *
3511
+ * WARNING: This function affects ALL Leptris operations globally.
3512
+ * Set custom functions BEFORE any parsing operations and restore
3513
+ * to defaults before program exit.
3514
+ *
3515
+ * @param alloc_function Function to use for memory allocation (NULL = use malloc)
3516
+ * @param dealloc_function Function to use for memory deallocation (NULL = use free)
3517
+ *
3518
+ * Example:
3519
+ * void* my_alloc(size_t size) { return calloc(1, size); }
3520
+ * void my_free(void* ptr) { free(ptr); }
3521
+ * leptris_set_memory_management_functions(my_alloc, my_free);
3522
+ */
3523
+ LEPTRIS_API void leptris_set_memory_management_functions(leptris_allocation_function alloc_function,
3524
+ leptris_deallocation_function dealloc_function);
3525
+
3526
+ /**
3527
+ * Get current memory allocation function
3528
+ *
3529
+ * @return Current allocation function (NULL if using default malloc)
3530
+ */
3531
+ LEPTRIS_API leptris_allocation_function leptris_get_memory_allocation_function(void);
3532
+
3533
+ /**
3534
+ * Get current memory deallocation function
3535
+ *
3536
+ * @return Current deallocation function (NULL if using default free)
3537
+ */
3538
+ LEPTRIS_API leptris_deallocation_function leptris_get_memory_deallocation_function(void);
3539
+
3540
+ /* ============================================================================
3541
+ * Per-Document Allocator Hooks (TODO 74)
3542
+ *
3543
+ * Set allocator hooks on a specific document before parsing it. Useful
3544
+ * when an app needs different allocators for different documents in
3545
+ * the same thread.
3546
+ *
3547
+ * Must be called BEFORE leptris_parse_string. Changes after parse
3548
+ * have no effect on already-allocated memory.
3549
+ *
3550
+ * To set thread-default hooks (applies to all documents in the
3551
+ * current thread), use leptris_set_memory_management_functions().
3552
+ * ============================================================================ */
3553
+
3554
+ LEPTRIS_API LeptrisStatus leptris_document_set_allocators(
3555
+ LeptrisDocument doc,
3556
+ leptris_allocation_function alloc,
3557
+ leptris_deallocation_function dealloc);
3558
+
3559
+ /* ============================================================================
3560
+ * XInclude 1.0 Support
3561
+ * ============================================================================ */
3562
+
3563
+ /**
3564
+ * Process XInclude elements in document
3565
+ *
3566
+ * Replaces all <xi:include> elements with their included content.
3567
+ * Follows W3C XInclude 1.0 specification (https://www.w3.org/TR/xinclude/).
3568
+ *
3569
+ * @param doc Document to process
3570
+ * @param base_url Base URL for resolving relative hrefs (can be NULL)
3571
+ * @return LEPTRIS_OK on success, error code on failure
3572
+ *
3573
+ * XInclude namespace: http://www.w3.org/2001/XInclude
3574
+ *
3575
+ * Example:
3576
+ * &lt;root xmlns:xi="http://www.w3.org/2001/XInclude"&gt;
3577
+ * <xi:include href="chapter1.xml"/>
3578
+ * &lt;/root&gt;
3579
+ */
3580
+ LEPTRIS_API LeptrisStatus leptris_xinclude_process(LeptrisDocument doc, const char* base_url);
3581
+
3582
+ /**
3583
+ * Check if element is an XInclude include element
3584
+ *
3585
+ * @param elem Element to check
3586
+ * @return 1 if element is <xi:include>, 0 otherwise
3587
+ */
3588
+ LEPTRIS_API int leptris_xinclude_is_include_element(LeptrisElement elem);
3589
+
3590
+ /**
3591
+ * Check if element is an XInclude fallback element
3592
+ *
3593
+ * @param elem Element to check
3594
+ * @return 1 if element is <xi:fallback>, 0 otherwise
3595
+ */
3596
+ LEPTRIS_API int leptris_xinclude_is_fallback_element(LeptrisElement elem);
3597
+
3598
+ /**
3599
+ * Get href attribute value from include element
3600
+ *
3601
+ * @param include_elem Include element
3602
+ * @return href value or NULL if not found
3603
+ *
3604
+ * Memory: String is owned by the element. Do not free.
3605
+ */
3606
+ LEPTRIS_API const char* leptris_xinclude_get_href(LeptrisElement include_elem);
3607
+
3608
+ /**
3609
+ * Get parse attribute value from include element
3610
+ *
3611
+ * @param include_elem Include element
3612
+ * @return "xml" or "text" (defaults to "xml" if not specified)
3613
+ *
3614
+ * Memory: String is owned by the element. Do not free.
3615
+ */
3616
+ LEPTRIS_API const char* leptris_xinclude_get_parse(LeptrisElement include_elem);
3617
+
3618
+ /**
3619
+ * Get xpointer attribute value from include element
3620
+ *
3621
+ * @param include_elem Include element
3622
+ * @return xpointer value or NULL if not specified
3623
+ *
3624
+ * Memory: String is owned by the element. Do not free.
3625
+ */
3626
+ LEPTRIS_API const char* leptris_xinclude_get_xpointer(LeptrisElement include_elem);
3627
+
3628
+ /**
3629
+ * Get encoding attribute value from include element (for parse="text")
3630
+ *
3631
+ * @param include_elem Include element
3632
+ * @return encoding value or NULL if not specified
3633
+ *
3634
+ * Memory: String is owned by the element. Do not free.
3635
+ */
3636
+ LEPTRIS_API const char* leptris_xinclude_get_encoding(LeptrisElement include_elem);
3637
+
3638
+ /* ============================================================================
3639
+ * SAX (Simple API for XML) - Event-based Parsing
3640
+ * ============================================================================ */
3641
+
3642
+ /**
3643
+ * Include SAX parser support
3644
+ *
3645
+ * SAX provides event-driven XML parsing without building a DOM tree.
3646
+ * Useful for streaming large XML files or when only specific data is needed.
3647
+ *
3648
+ * Include <leptris/sax.h> for SAX parser API.
3649
+ */
3650
+
3651
+ /* ============================================================================
3652
+ * Version Information
3653
+ * ============================================================================ */
3654
+
3655
+ /* Keep in sync with project(VERSION) in the root CMakeLists.txt —
3656
+ * CI's export-surface gate diffs the header against the binary. */
3657
+ #define LIBLEPTRIS_VERSION_MAJOR 1
3658
+ #define LIBLEPTRIS_VERSION_MINOR 9
3659
+ #define LIBLEPTRIS_VERSION_PATCH 145
3660
+ #define LIBLEPTRIS_VERSION_STRING "1.9.145"
3661
+
3662
+ /**
3663
+ * Get libleptris version string
3664
+ *
3665
+ * @return Version string (e.g., "0.2.0")
3666
+ *
3667
+ * Memory: Static string. Do not free.
3668
+ */
3669
+ LEPTRIS_API const char* leptris_version(void);
3670
+
3671
+ /**
3672
+ * Get the library version as numeric components
3673
+ *
3674
+ * @param major Out: major version (may be NULL)
3675
+ * @param minor Out: minor version (may be NULL)
3676
+ * @param patch Out: patch version (may be NULL)
3677
+ *
3678
+ * Memory: Writes through the out-pointers only.
3679
+ */
3680
+ LEPTRIS_API void leptris_version_components(int* major, int* minor, int* patch);
3681
+
3682
+ /**
3683
+ * Release this thread's libleptris caches
3684
+ *
3685
+ * libleptris keeps small per-thread caches (XPath result/nodeset
3686
+ * free lists, the root-element map free list) for performance.
3687
+ * C99 has no portable thread-exit hook, so a thread that used
3688
+ * libleptris and then exits keeps those entries allocated. Call
3689
+ * this from each worker thread just before it exits — after the
3690
+ * last leptris_document_free — to release them (TODO.concurrency/08).
3691
+ *
3692
+ * Optional: long-lived threads and pooled bindings never need it.
3693
+ * Do not call while another operation is in flight on this thread.
3694
+ */
3695
+ LEPTRIS_API void leptris_thread_cleanup(void);
3696
+
3697
+ #ifdef __cplusplus
3698
+ }
3699
+ #endif
3700
+
3701
+ #endif /* LIBLEPTRIS_H */