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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/Rakefile +52 -12
- data/ext/leptris/native/extconf.rb +85 -0
- data/ext/leptris/native/native.c +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/ffi.rb +13 -0
- data/lib/leptris/xml/native.so +0 -0
- data/vendor-src/libleptris/CHANGELOG.md +8080 -0
- data/vendor-src/libleptris/CLAUDE.md +150 -0
- data/vendor-src/libleptris/CMakeLists.txt +379 -0
- data/vendor-src/libleptris/CMakePresets.json +61 -0
- data/vendor-src/libleptris/CODE_OF_CONDUCT.md +132 -0
- data/vendor-src/libleptris/CONTEXT.md +49 -0
- data/vendor-src/libleptris/LICENSE.md +33 -0
- data/vendor-src/libleptris/README.adoc +1197 -0
- data/vendor-src/libleptris/TODO.assemble/README.md +16 -0
- data/vendor-src/libleptris/TODO.bindings/01-mutation-construction.md +18 -0
- data/vendor-src/libleptris/TODO.bindings/02-incremental-iterparse.md +15 -0
- data/vendor-src/libleptris/TODO.bindings/03-compiled-xpath.md +15 -0
- data/vendor-src/libleptris/TODO.bindings/04-pull-stax-api.md +14 -0
- data/vendor-src/libleptris/TODO.bindings/05-per-parse-options.md +17 -0
- data/vendor-src/libleptris/TODO.bindings/06-serialize-encoding-guarantees.md +14 -0
- data/vendor-src/libleptris/TODO.bindings/README.md +36 -0
- data/vendor-src/libleptris/TODO.concurrency/01-thread-safe-errors.md +19 -0
- data/vendor-src/libleptris/TODO.concurrency/02-export-surface-gate.md +24 -0
- data/vendor-src/libleptris/TODO.concurrency/03-mixed-nodeset-batch.md +14 -0
- data/vendor-src/libleptris/TODO.concurrency/04-canonical-status-message.md +13 -0
- data/vendor-src/libleptris/TODO.concurrency/05-windows-dll-name.md +10 -0
- data/vendor-src/libleptris/TODO.concurrency/06-exslt-pack.md +26 -0
- data/vendor-src/libleptris/TODO.concurrency/07-ns-set-pairs.md +11 -0
- data/vendor-src/libleptris/TODO.concurrency/08-threading-contract.md +45 -0
- data/vendor-src/libleptris/TODO.engine/01-file-sources.md +11 -0
- data/vendor-src/libleptris/TODO.engine/02-compiled-contexts.md +10 -0
- data/vendor-src/libleptris/TODO.engine/03-rust-publish.md +9 -0
- data/vendor-src/libleptris/TODO.engine/04-ruby-release-input.md +8 -0
- data/vendor-src/libleptris/TODO.engine/05-todo-md-refresh.md +7 -0
- data/vendor-src/libleptris/TODO.engine/README.md +16 -0
- data/vendor-src/libleptris/TODO.hygiene/README.md +15 -0
- data/vendor-src/libleptris/TODO.max-perf/00-INDEX.md +22 -0
- data/vendor-src/libleptris/TODO.max-perf/1-simd-html-scanner.md +15 -0
- data/vendor-src/libleptris/TODO.max-perf/10-moxml-plan-followups.md +9 -0
- data/vendor-src/libleptris/TODO.max-perf/2-compiled-dispatch-tokenizer.md +8 -0
- data/vendor-src/libleptris/TODO.max-perf/3-iterparse-fixed-cost.md +5 -0
- data/vendor-src/libleptris/TODO.max-perf/4-compact-node-micro-opts.md +17 -0
- data/vendor-src/libleptris/TODO.max-perf/5-xslt-bench-profiling-rounds.md +13 -0
- data/vendor-src/libleptris/TODO.max-perf/6-language-tails.md +9 -0
- data/vendor-src/libleptris/TODO.max-perf/7-validate-bindings.md +6 -0
- data/vendor-src/libleptris/TODO.max-perf/8-native-xml-diff-consumer.md +5 -0
- data/vendor-src/libleptris/TODO.max-perf/9-prebuilt-gem-matrix.md +14 -0
- data/vendor-src/libleptris/TODO.md +33 -0
- data/vendor-src/libleptris/TODO.transform/README.md +39 -0
- data/vendor-src/libleptris/TODO.validate/README.md +32 -0
- data/vendor-src/libleptris/TODO.xpath2/README.md +91 -0
- data/vendor-src/libleptris/TODO.xslt-full/01-xpath-fn-sequences.md +27 -0
- data/vendor-src/libleptris/TODO.xslt-full/02-xpath-fn-regex.md +13 -0
- data/vendor-src/libleptris/TODO.xslt-full/03-xpath-fn-math.md +10 -0
- data/vendor-src/libleptris/TODO.xslt-full/04-xpath-fn-strings-qname-uri.md +97 -0
- data/vendor-src/libleptris/TODO.xslt-full/05-xpath-fn-dates.md +30 -0
- data/vendor-src/libleptris/TODO.xslt-full/06-xpath-grammar-3x.md +83 -0
- data/vendor-src/libleptris/TODO.xslt-full/07-xpath-function-items.md +124 -0
- data/vendor-src/libleptris/TODO.xslt-full/08-xpath-maps-arrays.md +79 -0
- data/vendor-src/libleptris/TODO.xslt-full/09-xslt-noop-fillins.md +35 -0
- data/vendor-src/libleptris/TODO.xslt-full/10-xslt-tunnel-params.md +9 -0
- data/vendor-src/libleptris/TODO.xslt-full/11-xquery-core.md +119 -0
- data/vendor-src/libleptris/TODO.xslt-full/12-xquery-31.md +65 -0
- data/vendor-src/libleptris/TODO.xslt-full/13-perf-inprocess.md +425 -0
- data/vendor-src/libleptris/TODO.xslt-full/14-html-mode.md +803 -0
- data/vendor-src/libleptris/TODO.xslt-full/15-binding-entries.md +19 -0
- data/vendor-src/libleptris/TODO.xslt-full/16-schematron.md +156 -0
- data/vendor-src/libleptris/TODO.xslt-full/17-xml-diff.md +52 -0
- data/vendor-src/libleptris/TODO.xslt-full/18-compact-nodes.md +278 -0
- data/vendor-src/libleptris/TODO.xslt-full/README.md +26 -0
- data/vendor-src/libleptris/TODO.xslt-full/REMAINING.md +163 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/00-triage.md +171 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/01-fragment-nodes.md +19 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/02-root-node-semantics.md +34 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/03-crashes.md +15 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/04-namespaces.md +14 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/05-number-attrset-sort.md +13 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/06-document-chains.md +10 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/07-charef-serializer.md +9 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/08-perf-gate.md +8 -0
- data/vendor-src/libleptris/TODO.xslt-full/legacy-v19/09-release.md +14 -0
- data/vendor-src/libleptris/VALIDATION.md +151 -0
- data/vendor-src/libleptris/benchmarks/CMakeLists.txt +259 -0
- data/vendor-src/libleptris/benchmarks/README.adoc +228 -0
- data/vendor-src/libleptris/benchmarks/README.md +212 -0
- data/vendor-src/libleptris/benchmarks/common/benchmark.c +252 -0
- data/vendor-src/libleptris/benchmarks/common/benchmark.h +77 -0
- data/vendor-src/libleptris/benchmarks/common/test_data.c +415 -0
- data/vendor-src/libleptris/benchmarks/common/test_data.h +18 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/CMakeLists.txt +184 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_decomp.cpp +110 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_first_access.cpp +261 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_many_attrs.cpp +150 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_memory.cpp +185 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_parse.cpp +270 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_parse_ops.cpp +392 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_sax.c +106 -0
- data/vendor-src/libleptris/benchmarks/comprehensive/benchmark_write.cpp +351 -0
- data/vendor-src/libleptris/benchmarks/data/attrs.xml +303 -0
- data/vendor-src/libleptris/benchmarks/data/cdata_test.xml +13 -0
- data/vendor-src/libleptris/benchmarks/data/comment_test.xml +15 -0
- data/vendor-src/libleptris/benchmarks/data/deep.xml +205 -0
- data/vendor-src/libleptris/benchmarks/data/generate_attrs.rb +22 -0
- data/vendor-src/libleptris/benchmarks/data/generate_deep.rb +25 -0
- data/vendor-src/libleptris/benchmarks/data/generate_large.rb +33 -0
- data/vendor-src/libleptris/benchmarks/data/generate_wide.rb +18 -0
- data/vendor-src/libleptris/benchmarks/data/large.xml +21003 -0
- data/vendor-src/libleptris/benchmarks/data/large_workflow.xml +4003 -0
- data/vendor-src/libleptris/benchmarks/data/medium.xml +67 -0
- data/vendor-src/libleptris/benchmarks/data/medium_workflow.xml +353 -0
- data/vendor-src/libleptris/benchmarks/data/pi_test.xml +9 -0
- data/vendor-src/libleptris/benchmarks/data/small.xml +10 -0
- data/vendor-src/libleptris/benchmarks/data/small_workflow.xml +36 -0
- data/vendor-src/libleptris/benchmarks/data/wide.xml +5003 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_document_lifecycle.c +69 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_leptris.c +184 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_libxml2.c +176 -0
- data/vendor-src/libleptris/benchmarks/dom/bench_text_borrowed.c +74 -0
- data/vendor-src/libleptris/benchmarks/dom/dom_benchmark_v2.cpp +314 -0
- data/vendor-src/libleptris/benchmarks/fixtures/large.xml +4003 -0
- data/vendor-src/libleptris/benchmarks/fixtures/large_catalog.xml +50003 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2/eve.xml +6 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2/slashdot.rdf +66 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2/wap.xml +27 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/4rects.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/a-valid.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/a-wf.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/bike.xml +41 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/circle.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/defs.xml +14 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/desc.xml +14 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/ellipse.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/flower2.xml +44 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/gradient.xml +16 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group01.xml +15 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group02.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/group03.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/image-valid.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/image-wf.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/lin-gradient.xml +16 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/marker.xml +28 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/mask.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/mathswitch.xml +32 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/parentns.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/path01.xml +5 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/path02.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/patternfill.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/polyline.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/private.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/rad-gradient.xml +17 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/rectangle.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/richdesc.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/script.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/structure01.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/style.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/switch.xml +21 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/symbol-use.xml +28 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/template.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text01.xml +12 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text02.xml +17 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/text03.xml +8 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/toap01.xml +10 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/toap02.xml +33 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/transform.xml +26 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/trivial.xml +6 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/twin-gradients.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/v-template.xml +9 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport-nest.xml +13 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport-transform.xml +46 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/viewport.xml +11 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_svg/wf-template.xml +7 -0
- data/vendor-src/libleptris/benchmarks/fixtures/libxml2_xsdtest.xml +5286 -0
- data/vendor-src/libleptris/benchmarks/fixtures/medium.xml +403 -0
- data/vendor-src/libleptris/benchmarks/fixtures/medium_catalog.xml +3003 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/empty.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/large.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/latintest_latin1.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/latintest_utf8.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/multiline.xml +3 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/small.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/truncation.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf16_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf32_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_bom.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_clean.xml +84 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml/utftest_utf8_nodecl.xml +86 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml//321/202/320/265/321/201/321/202.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/empty.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/large.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/latintest_latin1.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/latintest_utf8.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/multiline.xml +3 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/small.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/truncation.xml +19 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf16_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_be_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_bom.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_clean.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf32_le_nodecl.xml +0 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_bom.xml +87 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_clean.xml +84 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests/utftest_utf8_nodecl.xml +86 -0
- data/vendor-src/libleptris/benchmarks/fixtures/pugixml_tests//321/202/320/265/321/201/321/202.xml +1 -0
- data/vendor-src/libleptris/benchmarks/fixtures/small.xml +38 -0
- data/vendor-src/libleptris/benchmarks/html/bench_html_parse.c +111 -0
- data/vendor-src/libleptris/benchmarks/html/gen_nokogiri_reference.rb +112 -0
- data/vendor-src/libleptris/benchmarks/html/nokogiri_html_parse.rb +64 -0
- data/vendor-src/libleptris/benchmarks/matrix/README.md +71 -0
- data/vendor-src/libleptris/benchmarks/matrix/bench2html.rb +316 -0
- data/vendor-src/libleptris/benchmarks/matrix/bench_matrix.cpp +724 -0
- data/vendor-src/libleptris/benchmarks/modification/bench_leptris_modify.c +211 -0
- data/vendor-src/libleptris/benchmarks/modification/bench_node_creation.c +130 -0
- data/vendor-src/libleptris/benchmarks/results/BENCHMARK_REPORT.md +226 -0
- data/vendor-src/libleptris/benchmarks/results/baseline_report.md +219 -0
- data/vendor-src/libleptris/benchmarks/results/benchmark_20251223_134550.json +13 -0
- data/vendor-src/libleptris/benchmarks/results/benchmark_20260129_225844.json +13 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_dom_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify_optimized.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify_session1.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_modify_session2.json +36 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_serialize.json +34 -0
- data/vendor-src/libleptris/benchmarks/results/leptris_xpath_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/libxml2_dom_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/libxml2_xpath_output.txt +24 -0
- data/vendor-src/libleptris/benchmarks/results/phase16_session2.json +21 -0
- data/vendor-src/libleptris/benchmarks/results/phase17.5_session1.json +30 -0
- data/vendor-src/libleptris/benchmarks/results/phase17_session1.json +30 -0
- data/vendor-src/libleptris/benchmarks/results/pugixml_dom_output.txt +51 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_axes_leptris.json +318 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_axes_libxml2.json +318 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_functions_leptris.json +222 -0
- data/vendor-src/libleptris/benchmarks/results/xpath_functions_libxml2.json +222 -0
- data/vendor-src/libleptris/benchmarks/sax/bench_iterparse.c +115 -0
- data/vendor-src/libleptris/benchmarks/sax/bench_leptris.c +124 -0
- data/vendor-src/libleptris/benchmarks/sax/bench_libxml2.c +115 -0
- data/vendor-src/libleptris/benchmarks/serialization/bench_leptris_serialize.c +198 -0
- data/vendor-src/libleptris/benchmarks/src/benchmark_base.h +175 -0
- data/vendor-src/libleptris/benchmarks/twins/mutation_leptris.c +37 -0
- data/vendor-src/libleptris/benchmarks/twins/mutation_pugixml.cpp +28 -0
- data/vendor-src/libleptris/benchmarks/twins/parse_leptris.c +35 -0
- data/vendor-src/libleptris/benchmarks/twins/parse_pugixml.cpp +35 -0
- data/vendor-src/libleptris/benchmarks/utils.c +171 -0
- data/vendor-src/libleptris/benchmarks/utils.h +70 -0
- data/vendor-src/libleptris/benchmarks/workflows/bench_dom_modify.c +325 -0
- data/vendor-src/libleptris/benchmarks/workflows/bench_end_to_end.c +529 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_axes.c +411 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_axes_libxml2.c +108 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_diagnostic.c +431 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_functions.c +271 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_functions_libxml2.c +123 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_leptris.c +78 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_libxml2.c +98 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_pugixml.cpp +117 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_scalar_eval.c +86 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_scalar_eval_libxml2.c +70 -0
- data/vendor-src/libleptris/benchmarks/xpath/bench_xslt_transform.c +48 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch.c +52 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch_heavy.c +82 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_dispatch_pred.c +34 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_subtree_copy.c +55 -0
- data/vendor-src/libleptris/benchmarks/xslt/bench_valueof.c +46 -0
- data/vendor-src/libleptris/benchmarks/xslt/heavy_lxml.py +48 -0
- data/vendor-src/libleptris/benchmarks/xslt/scorecard_lxml.py +169 -0
- data/vendor-src/libleptris/bindings/ruby/leptris.gemspec +22 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/document.rb +60 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/element.rb +86 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/error.rb +6 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/node.rb +73 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/sax.rb +189 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris/xpath.rb +44 -0
- data/vendor-src/libleptris/bindings/ruby/lib/leptris.rb +137 -0
- data/vendor-src/libleptris/bindings/ruby/spec/leptris_spec.rb +113 -0
- data/vendor-src/libleptris/bindings/ruby/spec/sax_spec.rb +141 -0
- data/vendor-src/libleptris/bindings/ruby/spec/spec_helper.rb +7 -0
- data/vendor-src/libleptris/bindings/ruby/test_full.rb +21 -0
- data/vendor-src/libleptris/bindings/rust/Cargo.lock +7 -0
- data/vendor-src/libleptris/bindings/rust/Cargo.toml +13 -0
- data/vendor-src/libleptris/bindings/rust/README.md +61 -0
- data/vendor-src/libleptris/bindings/rust/build.rs +74 -0
- data/vendor-src/libleptris/bindings/rust/src/ffi.rs +204 -0
- data/vendor-src/libleptris/bindings/rust/src/lib.rs +580 -0
- data/vendor-src/libleptris/bindings/rust/tests/integration.rs +156 -0
- data/vendor-src/libleptris/cli/ARCHITECTURE_REVIEW.md +514 -0
- data/vendor-src/libleptris/cli/CLI_ARCHITECTURE.md +851 -0
- data/vendor-src/libleptris/cli/CMakeLists.txt +46 -0
- data/vendor-src/libleptris/cli/cli.c +115 -0
- data/vendor-src/libleptris/cli/cli.h +232 -0
- data/vendor-src/libleptris/cli/commands/diff.c +208 -0
- data/vendor-src/libleptris/cli/commands/format.c +379 -0
- data/vendor-src/libleptris/cli/commands/parse.c +343 -0
- data/vendor-src/libleptris/cli/commands/validate.c +284 -0
- data/vendor-src/libleptris/cli/commands/version.c +49 -0
- data/vendor-src/libleptris/cli/commands/xpath.c +428 -0
- data/vendor-src/libleptris/cli/commands/xquery.c +188 -0
- data/vendor-src/libleptris/cli/completion/leptris.bash +86 -0
- data/vendor-src/libleptris/cli/completion/leptris.zsh +74 -0
- data/vendor-src/libleptris/cli/error.c +394 -0
- data/vendor-src/libleptris/cli/error.h +360 -0
- data/vendor-src/libleptris/cli/leptris +0 -0
- data/vendor-src/libleptris/cli/main.c +127 -0
- data/vendor-src/libleptris/cli/man/leptris-format.1.adoc +226 -0
- data/vendor-src/libleptris/cli/man/leptris-parse.1.adoc +213 -0
- data/vendor-src/libleptris/cli/man/leptris-xpath.1.adoc +479 -0
- data/vendor-src/libleptris/cli/man/leptris.1.adoc +192 -0
- data/vendor-src/libleptris/cli/options.c +451 -0
- data/vendor-src/libleptris/cli/options.h +378 -0
- data/vendor-src/libleptris/cli/output.c +841 -0
- data/vendor-src/libleptris/cli/output.h +361 -0
- data/vendor-src/libleptris/cmake/FindUtf8proc.cmake +56 -0
- data/vendor-src/libleptris/cmake/leptris-config.cmake.in +14 -0
- data/vendor-src/libleptris/cmake/leptris.pc.in +11 -0
- data/vendor-src/libleptris/cmake/modules/AdocMan.cmake +132 -0
- data/vendor-src/libleptris/docs/ARCHITECTURE_REVIEW.md +280 -0
- data/vendor-src/libleptris/docs/Doxyfile +47 -0
- data/vendor-src/libleptris/docs/FFI.md +165 -0
- data/vendor-src/libleptris/docs/README.md +47 -0
- data/vendor-src/libleptris/docs/ROADMAP-SAXON-PARITY.md +194 -0
- data/vendor-src/libleptris/docs/guide/building.md +199 -0
- data/vendor-src/libleptris/docs/guide/getting-started.md +134 -0
- data/vendor-src/libleptris/docs/guide/parsing.md +315 -0
- data/vendor-src/libleptris/docs/guide/xpath-queries.md +444 -0
- data/vendor-src/libleptris/examples/c/CMakeLists.txt +58 -0
- data/vendor-src/libleptris/examples/c/README.md +345 -0
- data/vendor-src/libleptris/examples/c/basic_example.c +80 -0
- data/vendor-src/libleptris/examples/c/dom_traversal_example.c +58 -0
- data/vendor-src/libleptris/examples/c/error_handling_example.c +121 -0
- data/vendor-src/libleptris/examples/c/namespace_example.c +49 -0
- data/vendor-src/libleptris/examples/c/xpath_example.c +74 -0
- data/vendor-src/libleptris/ports/leptris/portfile.cmake +41 -0
- data/vendor-src/libleptris/ports/leptris/usage +28 -0
- data/vendor-src/libleptris/scripts/check_dll_exports.py +54 -0
- data/vendor-src/libleptris/scripts/check_export_surface.py +84 -0
- data/vendor-src/libleptris/scripts/check_ffi_mirrors.py +163 -0
- data/vendor-src/libleptris/scripts/check_formatting.sh +30 -0
- data/vendor-src/libleptris/scripts/check_shared_exports.sh +120 -0
- data/vendor-src/libleptris/scripts/check_trailing_whitespace.sh +18 -0
- data/vendor-src/libleptris/scripts/gen-api-docs.sh +31 -0
- data/vendor-src/libleptris/scripts/run_static_analysis.sh +16 -0
- data/vendor-src/libleptris/scripts/validate.sh +199 -0
- data/vendor-src/libleptris/scripts/xslt_triage.sh +72 -0
- data/vendor-src/libleptris/src/CMakeLists.txt +597 -0
- data/vendor-src/libleptris/src/include/leptris/descriptor.h +178 -0
- data/vendor-src/libleptris/src/include/leptris/dom/document.h +213 -0
- data/vendor-src/libleptris/src/include/leptris/dom/element.h +435 -0
- data/vendor-src/libleptris/src/include/leptris/dom/serialize.h +133 -0
- data/vendor-src/libleptris/src/include/leptris/dtd.h +178 -0
- data/vendor-src/libleptris/src/include/leptris/error.h +97 -0
- data/vendor-src/libleptris/src/include/leptris/sax/sax.h +584 -0
- data/vendor-src/libleptris/src/include/leptris/types.h +386 -0
- data/vendor-src/libleptris/src/include/leptris/xpath/xpath.h +250 -0
- data/vendor-src/libleptris/src/include/leptris/xquery/xquery.h +80 -0
- data/vendor-src/libleptris/src/include/leptris.h +3701 -0
- data/vendor-src/libleptris/src/leptris/chartype.h +124 -0
- data/vendor-src/libleptris/src/leptris/common/chartype.c +90 -0
- data/vendor-src/libleptris/src/leptris/common/chartype.h +44 -0
- data/vendor-src/libleptris/src/leptris/common/cpu.c +40 -0
- data/vendor-src/libleptris/src/leptris/common/cpu.h +63 -0
- data/vendor-src/libleptris/src/leptris/common/entities.c +329 -0
- data/vendor-src/libleptris/src/leptris/common/entities.h +79 -0
- data/vendor-src/libleptris/src/leptris/common/format_number.c +273 -0
- data/vendor-src/libleptris/src/leptris/common/format_number.h +29 -0
- data/vendor-src/libleptris/src/leptris/common/port.h +171 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text.c +237 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text.h +104 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text_avx2.c +105 -0
- data/vendor-src/libleptris/src/leptris/common/simd_text_neon.c +280 -0
- data/vendor-src/libleptris/src/leptris/common/string_view.c +204 -0
- data/vendor-src/libleptris/src/leptris/common/string_view.h +68 -0
- data/vendor-src/libleptris/src/leptris/common/types_internal.h +31 -0
- data/vendor-src/libleptris/src/leptris/core.c +201 -0
- data/vendor-src/libleptris/src/leptris/descriptor/plan.c +527 -0
- data/vendor-src/libleptris/src/leptris/diff/diff.c +491 -0
- data/vendor-src/libleptris/src/leptris/dom/cdata.c +47 -0
- data/vendor-src/libleptris/src/leptris/dom/cdata.h +73 -0
- data/vendor-src/libleptris/src/leptris/dom/comment.c +48 -0
- data/vendor-src/libleptris/src/leptris/dom/comment.h +74 -0
- data/vendor-src/libleptris/src/leptris/dom/compact.c +397 -0
- data/vendor-src/libleptris/src/leptris/dom/compact.h +307 -0
- data/vendor-src/libleptris/src/leptris/dom/diag.c +58 -0
- data/vendor-src/libleptris/src/leptris/dom/diag.h +75 -0
- data/vendor-src/libleptris/src/leptris/dom/digest.c +255 -0
- data/vendor-src/libleptris/src/leptris/dom/doctype.c +137 -0
- data/vendor-src/libleptris/src/leptris/dom/doctype.h +52 -0
- data/vendor-src/libleptris/src/leptris/dom/document_node.c +13 -0
- data/vendor-src/libleptris/src/leptris/dom/document_node.h +21 -0
- data/vendor-src/libleptris/src/leptris/dom/edges.h +60 -0
- data/vendor-src/libleptris/src/leptris/dom/element.c +1114 -0
- data/vendor-src/libleptris/src/leptris/dom/element.h +1109 -0
- data/vendor-src/libleptris/src/leptris/dom/element_index.c +444 -0
- data/vendor-src/libleptris/src/leptris/dom/element_index.h +135 -0
- data/vendor-src/libleptris/src/leptris/dom/element_modify.c +2185 -0
- data/vendor-src/libleptris/src/leptris/dom/element_query.c +1468 -0
- data/vendor-src/libleptris/src/leptris/dom/entity_ref.c +57 -0
- data/vendor-src/libleptris/src/leptris/dom/entity_ref.h +70 -0
- data/vendor-src/libleptris/src/leptris/dom/node.c +420 -0
- data/vendor-src/libleptris/src/leptris/dom/node.h +170 -0
- data/vendor-src/libleptris/src/leptris/dom/node_public.c +937 -0
- data/vendor-src/libleptris/src/leptris/dom/node_vtable.c +138 -0
- data/vendor-src/libleptris/src/leptris/dom/pi.c +70 -0
- data/vendor-src/libleptris/src/leptris/dom/pi.h +80 -0
- data/vendor-src/libleptris/src/leptris/dom/root_doc_map.c +310 -0
- data/vendor-src/libleptris/src/leptris/dom/root_doc_map.h +30 -0
- data/vendor-src/libleptris/src/leptris/dom/text.c +157 -0
- data/vendor-src/libleptris/src/leptris/dom/text.h +119 -0
- data/vendor-src/libleptris/src/leptris/dtd/content_check.c +300 -0
- data/vendor-src/libleptris/src/leptris/dtd/model.c +533 -0
- data/vendor-src/libleptris/src/leptris/dtd/model.h +354 -0
- data/vendor-src/libleptris/src/leptris/dtd/parser.c +827 -0
- data/vendor-src/libleptris/src/leptris/dtd/resolver.c +354 -0
- data/vendor-src/libleptris/src/leptris/dtd/validator.c +668 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoders.c +346 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoders.h +61 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoding.c +451 -0
- data/vendor-src/libleptris/src/leptris/encoding/encoding.h +118 -0
- data/vendor-src/libleptris/src/leptris/encoding/unicode.c +317 -0
- data/vendor-src/libleptris/src/leptris/encoding/unicode.h +64 -0
- data/vendor-src/libleptris/src/leptris/encoding/utf16.c +204 -0
- data/vendor-src/libleptris/src/leptris/encoding/utf16.h +78 -0
- data/vendor-src/libleptris/src/leptris/encoding/wrapper.c +243 -0
- data/vendor-src/libleptris/src/leptris/error.c +134 -0
- data/vendor-src/libleptris/src/leptris/flat/direct_parse.c +1935 -0
- data/vendor-src/libleptris/src/leptris/flat/direct_parse.h +41 -0
- data/vendor-src/libleptris/src/leptris/html/html_parse.c +8040 -0
- data/vendor-src/libleptris/src/leptris/leptris.c +1264 -0
- data/vendor-src/libleptris/src/leptris/leptris_internal.h +910 -0
- data/vendor-src/libleptris/src/leptris/leptris_memory.c +179 -0
- data/vendor-src/libleptris/src/leptris/leptris_memory.h +180 -0
- data/vendor-src/libleptris/src/leptris/leptris_parse.h +195 -0
- data/vendor-src/libleptris/src/leptris/memory/arena.c +243 -0
- data/vendor-src/libleptris/src/leptris/memory/arena.h +93 -0
- data/vendor-src/libleptris/src/leptris/memory/pool.c +1055 -0
- data/vendor-src/libleptris/src/leptris/memory/pool.h +426 -0
- data/vendor-src/libleptris/src/leptris/rng/parse.c +814 -0
- data/vendor-src/libleptris/src/leptris/rng/rng_internal.h +112 -0
- data/vendor-src/libleptris/src/leptris/rng/rng_public.c +159 -0
- data/vendor-src/libleptris/src/leptris/rng/rng_regex.c +453 -0
- data/vendor-src/libleptris/src/leptris/rng/validate.c +1923 -0
- data/vendor-src/libleptris/src/leptris/sax/iterparse.c +435 -0
- data/vendor-src/libleptris/src/leptris/sax/parser.c +105 -0
- data/vendor-src/libleptris/src/leptris/sax/pull.c +489 -0
- data/vendor-src/libleptris/src/leptris/sax/recorder.c +252 -0
- data/vendor-src/libleptris/src/leptris/sax/sax_internal.h +163 -0
- data/vendor-src/libleptris/src/leptris/sax/streaming.c +1469 -0
- data/vendor-src/libleptris/src/leptris/sch/schematron.c +1588 -0
- data/vendor-src/libleptris/src/leptris/serialize/c14n.c +1143 -0
- data/vendor-src/libleptris/src/leptris/serialize/serialize.c +2333 -0
- data/vendor-src/libleptris/src/leptris/serialize/serialize.h +188 -0
- data/vendor-src/libleptris/src/leptris/simd_helpers.h +447 -0
- data/vendor-src/libleptris/src/leptris/unicode/unicode.c +237 -0
- data/vendor-src/libleptris/src/leptris/unicode/unicode.h +113 -0
- data/vendor-src/libleptris/src/leptris/xinclude/xinclude.c +794 -0
- data/vendor-src/libleptris/src/leptris/xpath/bytecode.h +229 -0
- data/vendor-src/libleptris/src/leptris/xpath/compiler.c +1478 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator.c +1099 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator.h +189 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_axes.c +787 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_internal.h +112 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_operators.c +2138 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_path.c +1312 -0
- data/vendor-src/libleptris/src/leptris/xpath/evaluator_types.c +294 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions.c +2544 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions.h +161 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions_exslt.c +545 -0
- data/vendor-src/libleptris/src/leptris/xpath/functions_ext31.c +4316 -0
- data/vendor-src/libleptris/src/leptris/xpath/lexer.c +636 -0
- data/vendor-src/libleptris/src/leptris/xpath/lexer.h +25 -0
- data/vendor-src/libleptris/src/leptris/xpath/parser.c +2992 -0
- data/vendor-src/libleptris/src/leptris/xpath/parser.h +28 -0
- data/vendor-src/libleptris/src/leptris/xpath/vm.c +2903 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_ast_cache.c +319 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_compiled.c +263 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_internal.h +134 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_public.c +1139 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_variables.c +410 -0
- data/vendor-src/libleptris/src/leptris/xpath/xpath_variables.h +230 -0
- data/vendor-src/libleptris/src/leptris/xquery/xquery.c +2641 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_exec.c +4887 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_functions.c +1612 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_internal.h +862 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_parse.c +2418 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_pattern.c +441 -0
- data/vendor-src/libleptris/src/leptris/xslt/xslt_public.c +710 -0
- data/vendor-src/libleptris/src/leptris.symvers +16 -0
- data/vendor-src/libleptris/src/man/libleptris.5.adoc +961 -0
- data/vendor-src/libleptris/test/CMakeLists.txt +234 -0
- data/vendor-src/libleptris/test/README.md +59 -0
- data/vendor-src/libleptris/test/abi/test_descriptor.cpp +441 -0
- data/vendor-src/libleptris/test/abi/test_doctype_api.cpp +51 -0
- data/vendor-src/libleptris/test/abi/test_dom_deep_copy.cpp +110 -0
- data/vendor-src/libleptris/test/abi/test_dom_mutation_bugs.cpp +210 -0
- data/vendor-src/libleptris/test/abi/test_header_hygiene.cpp +269 -0
- data/vendor-src/libleptris/test/abi/test_namespace_mutation_and_create.cpp +198 -0
- data/vendor-src/libleptris/test/abi/test_node_get_xpath.cpp +128 -0
- data/vendor-src/libleptris/test/abi/test_nokogiri_api.cpp +392 -0
- data/vendor-src/libleptris/test/abi/test_parse_fragment.cpp +114 -0
- data/vendor-src/libleptris/test/abi/test_previous_sibling_and_c14n_ex.cpp +299 -0
- data/vendor-src/libleptris/test/abi/test_public_surface.cpp +463 -0
- data/vendor-src/libleptris/test/abi/test_serialize_abi.cpp +67 -0
- data/vendor-src/libleptris/test/abi/test_v0_5_14_bugs.cpp +299 -0
- data/vendor-src/libleptris/test/abi/test_xpath_custom_fns.cpp +106 -0
- data/vendor-src/libleptris/test/cli/test_cli.cpp +493 -0
- data/vendor-src/libleptris/test/common/test_simd_spans.cpp +88 -0
- data/vendor-src/libleptris/test/common/test_simd_text.cpp +142 -0
- data/vendor-src/libleptris/test/concurrency/test_concurrency.cpp +218 -0
- data/vendor-src/libleptris/test/diff/test_diff.cpp +244 -0
- data/vendor-src/libleptris/test/dom/test_compact.cpp +339 -0
- data/vendor-src/libleptris/test/dom/test_digest.cpp +111 -0
- data/vendor-src/libleptris/test/dom/test_document_children.cpp +270 -0
- data/vendor-src/libleptris/test/dom/test_dom.cpp +2310 -0
- data/vendor-src/libleptris/test/dom/test_map_lifecycle.cpp +111 -0
- data/vendor-src/libleptris/test/dom/test_node_surface_parity.cpp +268 -0
- data/vendor-src/libleptris/test/dom/test_text_borrowed.cpp +126 -0
- data/vendor-src/libleptris/test/dom/test_vtable.cpp +108 -0
- data/vendor-src/libleptris/test/dtd/test_dtd_validate.cpp +1227 -0
- data/vendor-src/libleptris/test/dtd/test_w3c_conformance.cpp +212 -0
- data/vendor-src/libleptris/test/fixtures/basic.xml +13 -0
- data/vendor-src/libleptris/test/fixtures/cdata.xml +5 -0
- data/vendor-src/libleptris/test/fixtures/malformed.xml +2 -0
- data/vendor-src/libleptris/test/fixtures/namespaces.xml +11 -0
- data/vendor-src/libleptris/test/fixtures/utf16_decl.xml +5 -0
- data/vendor-src/libleptris/test/fuzz/fuzz_parse.c +40 -0
- data/vendor-src/libleptris/test/html/html5lib-redlist.txt +1366 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/LICENSE +21 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/README.md +11 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/adoption01.dat +354 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/adoption02.dat +39 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/blocks.dat +695 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/comments01.dat +217 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/doctype01.dat +474 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/domjs-unsafe.dat +0 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/entities01.dat +943 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/entities02.dat +309 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/foreign-fragment.dat +645 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/html5test-com.dat +301 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/inbody01.dat +54 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/isindex.dat +49 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/main-element.dat +46 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/math.dat +104 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/menuitem-element.dat +240 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/namespace-sensitivity.dat +22 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/noscript01.dat +237 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/pending-spec-changes-plain-text-unsafe.dat +0 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/pending-spec-changes.dat +46 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/plain-text-unsafe.dat +0 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/ruby.dat +302 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/scriptdata01.dat +372 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/search-element.dat +46 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/svg.dat +104 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tables01.dat +308 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/template.dat +1673 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests1.dat +1956 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests10.dat +849 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests11.dat +523 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests12.dat +62 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests14.dat +75 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests15.dat +216 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests16.dat +2602 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests17.dat +179 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests18.dat +558 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests19.dat +1398 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests2.dat +821 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests20.dat +842 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests21.dat +306 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests22.dat +190 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests23.dat +168 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests24.dat +79 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests25.dat +288 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests26.dat +453 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests3.dat +305 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests4.dat +58 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests5.dat +210 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests6.dat +663 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests7.dat +417 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests8.dat +165 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests9.dat +472 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tests_innerHTML_1.dat +843 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/tricky01.dat +336 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/webkit01.dat +785 -0
- data/vendor-src/libleptris/test/html/html5lib-tests/tree-construction/webkit02.dat +554 -0
- data/vendor-src/libleptris/test/html/html5lib_cases.h.in +6 -0
- data/vendor-src/libleptris/test/html/nokogiri-parity-redlist.txt +1183 -0
- data/vendor-src/libleptris/test/html/nokogiri-tree-tests.dat +18107 -0
- data/vendor-src/libleptris/test/html/test_html.cpp +2191 -0
- data/vendor-src/libleptris/test/html/test_html5lib.cpp +831 -0
- data/vendor-src/libleptris/test/memory/test_arena.cpp +252 -0
- data/vendor-src/libleptris/test/memory/test_oom_injection.cpp +170 -0
- data/vendor-src/libleptris/test/memory/test_pool.cpp +331 -0
- data/vendor-src/libleptris/test/memory/test_pool_arena.cpp +180 -0
- data/vendor-src/libleptris/test/parser/test_encoding.cpp +282 -0
- data/vendor-src/libleptris/test/parser/test_large_documents.cpp +346 -0
- data/vendor-src/libleptris/test/parser/test_parser.cpp +565 -0
- data/vendor-src/libleptris/test/parser/test_simd_count.cpp +70 -0
- data/vendor-src/libleptris/test/perf/test_perf.cpp +362 -0
- data/vendor-src/libleptris/test/perf/test_stress_high_doc_count.cpp +67 -0
- data/vendor-src/libleptris/test/rng/include-cases/bad-construct.rng +7 -0
- data/vendor-src/libleptris/test/rng/include-cases/bad-override.rng +6 -0
- data/vendor-src/libleptris/test/rng/include-cases/bad-start-override.rng +5 -0
- data/vendor-src/libleptris/test/rng/include-cases/ext-lib.rng +3 -0
- data/vendor-src/libleptris/test/rng/include-cases/ext-main.rng +7 -0
- data/vendor-src/libleptris/test/rng/include-cases/lib.rng +5 -0
- data/vendor-src/libleptris/test/rng/include-cases/lib2.rng +6 -0
- data/vendor-src/libleptris/test/rng/include-cases/main.rng +4 -0
- data/vendor-src/libleptris/test/rng/include-cases/no-href.rng +4 -0
- data/vendor-src/libleptris/test/rng/include-cases/override.rng +8 -0
- data/vendor-src/libleptris/test/rng/include-cases/self-include.rng +4 -0
- data/vendor-src/libleptris/test/rng/include-cases/start-override.rng +5 -0
- data/vendor-src/libleptris/test/rng/jing-cases/000.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/000.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/000.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/001.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/001.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/001.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/002.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/002.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/002.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/003.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/003.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/003.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/004.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/004.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/004.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/005.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/005.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/005.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/006.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/006.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/006.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/007.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/007.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/007.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/008.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/008.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/008.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/009.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/009.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/009.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/010.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/010.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/010.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/011.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/011.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/011.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/012.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/012.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/012.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/013.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/013.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/013.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/014.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/014.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/014.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/015.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/015.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/015.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/016.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/016.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/016.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/017.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/017.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/017.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/018.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/018.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/018.rng +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/019.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/019.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/019.rng +7 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020-book.rng +4 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020.bad.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020.ok.xml +1 -0
- data/vendor-src/libleptris/test/rng/jing-cases/020.rng +3 -0
- data/vendor-src/libleptris/test/rng/jing-cases/README.md +32 -0
- data/vendor-src/libleptris/test/rng/jing-cases/jing-ref.json +212 -0
- data/vendor-src/libleptris/test/rng/jing-cases/meta.json +1 -0
- data/vendor-src/libleptris/test/rng/test_rng.cpp +1365 -0
- data/vendor-src/libleptris/test/rng/test_rng_corpus.cpp +133 -0
- data/vendor-src/libleptris/test/rng/test_rng_corpus_msg.cpp +233 -0
- data/vendor-src/libleptris/test/sax/test_iterparse.cpp +203 -0
- data/vendor-src/libleptris/test/sax/test_pull.cpp +214 -0
- data/vendor-src/libleptris/test/sax/test_pull_batch.cpp +201 -0
- data/vendor-src/libleptris/test/sax/test_recorder.cpp +265 -0
- data/vendor-src/libleptris/test/sax/test_sax.cpp +665 -0
- data/vendor-src/libleptris/test/sax/test_streaming.cpp +434 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/README.md +15 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/extends-baseuri-fixup-01.xml +28 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/extends-recursive-01.xml +27 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/include-baseuri-fixup-01.xml +24 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/include-recursive-01.xml +24 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-02.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-03.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-04.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-05.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-name-collision-error-06.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-pattern-global-01.xml +24 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-02.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-03.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-04.xml +19 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-05.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-06.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-reference-undefined-07.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-rule-global-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-rule-global-02.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-pattern-01.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-phase-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-scope-rule-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/let-value-element-content-01.xml +33 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/pattern-abstract-01.xml +22 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/pattern-subordinate-document-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/pattern-subordinate-document-02.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-abstract-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-abstract-02.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-attribute-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-comment-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-element-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-pi-01.xml +20 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-root-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-text-01.xml +18 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-01.xml +22 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-02.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-context-variable-03.xml +22 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/rule-order-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/schema-default-phase-01.xml +26 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/schema-default-phase-02.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-diagnostic-01.xml +28 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-diagnostic-02.xml +25 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-name-nopath-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-name-path-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-property-01.xml +28 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-property-copy-of.xml +26 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/svrl-value-of-01.xml +23 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/xslt-key-01.xml +19 -0
- data/vendor-src/libleptris/test/sch/conformance-cases/xslt-key-element-content-01.xml +21 -0
- data/vendor-src/libleptris/test/sch/test_schematron.cpp +337 -0
- data/vendor-src/libleptris/test/sch/test_schematron_corpus.cpp +421 -0
- data/vendor-src/libleptris/test/serializer/test_c14n.cpp +539 -0
- data/vendor-src/libleptris/test/serializer/test_serialize.cpp +890 -0
- data/vendor-src/libleptris/test/smoke/test_smoke.cpp +41 -0
- data/vendor-src/libleptris/test/xinclude/test_xinclude.cpp +903 -0
- data/vendor-src/libleptris/test/xpath/test_bytecode_vm.cpp +755 -0
- data/vendor-src/libleptris/test/xpath/test_compiled.cpp +171 -0
- data/vendor-src/libleptris/test/xpath/test_exslt.cpp +141 -0
- data/vendor-src/libleptris/test/xpath/test_xpath.cpp +2433 -0
- data/vendor-src/libleptris/test/xpath/test_xpath_conformance.cpp +570 -0
- data/vendor-src/libleptris/test/xpath/test_xslt.cpp +4245 -0
- data/vendor-src/libleptris/test/xquery/books.xml +1 -0
- data/vendor-src/libleptris/test/xquery/qt3/README.md +28 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/concat.xml +878 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/contains.xml +795 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/ends-with.xml +556 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/starts-with.xml +644 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/substring/concepts.xml +1 -0
- data/vendor-src/libleptris/test/xquery/qt3/fn/substring.xml +449 -0
- data/vendor-src/libleptris/test/xquery/test_qt3.cpp +324 -0
- data/vendor-src/libleptris/test/xquery/test_xquery.cpp +768 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/ATTRIBUTION.md +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/array.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-1-.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-10-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-100.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-101.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102-inc.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-102.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-103.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-104.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-105.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-106.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-107.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.out +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-108.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-109.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-11-.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.ent +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-110.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-111.xsl +45 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-112.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-113.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-114.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-115.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-116.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-117.xsl +59 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-118.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.out +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-119.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-12-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.xml +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-120.xsl +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-121.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.xml +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-122.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-123.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-124.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.out +351 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.xml +118 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-125.xsl +99 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-126.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-127.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.xml +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-128.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-129.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-13-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp1.imp +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp2.imp +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp3.imp +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130-imp4.imp +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.doc +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-130.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131-imp.imp +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-131.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-132.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-133.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-134.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-135.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-136.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.imp +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-137.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.out +23 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.xml +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-138.xsl +28 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-139.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-14-.xsl +23 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-140.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.out +46 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-141.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.out +35 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.xml +65 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-142.xsl +85 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-143.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-144.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.err +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-145.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-1.imp +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-2.imp +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-3.imp +57 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-4.imp +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-5.imp +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147-6.imp +31 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.out +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.xml +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-147.xsl +29 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-148.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-149.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-15-.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-150.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-151.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-151.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.out +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-152.xsl +30 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.doc +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-153.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-154.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-154.xsl +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-155.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.imp1.imp +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.imp2.imp +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-156.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.err +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-157.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.doc +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-158.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-159.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.out +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-16-.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.out +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-160.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-161.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-163.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-164.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-165.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.out +15256 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.xml +15255 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-166.xsl +131 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-167.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-168.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.imp +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-169.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-17-.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-170.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-171.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-172.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-173.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.err +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-174.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-175.xsl +33 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-176.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-177.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-178.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-179.xsl +24 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-18-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.err +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-180.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-181.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-182.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-183.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-184.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-186.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.out +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-187.xsl +42 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188-imp.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-188.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-189.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-19-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190-imp.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-190.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191-imp.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-191.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-192.xsl +33 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-193.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.err +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-194.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-195.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.out +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-196.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-197.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-198.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-199.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-2-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-20-.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-200.xsl +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-201.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-202.xsl +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.err +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-203.xsl +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-204.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-205.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-206.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-207.xsl +61 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.err +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-208.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-209.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-21-.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-210.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-211.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-212.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-213.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-214.xsl +25 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.err +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-215.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-216.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-217.xsl +24 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-218.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.out +68 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.xml +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-219.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.out +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.xml +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-22-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-220.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-221.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-222.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223-imp.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223-inc.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-223.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-224.xsl +28 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-225.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.out +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.xml +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-23-.xsl +20 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.out +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.xml +2419 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-24-.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-25-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-26-.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-27-.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-28-.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.ent +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.out +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-29-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-3-.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-30-.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-31-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-32-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.out +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.xml +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-33-.xsl +29 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-35-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-36-inc.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-37-inc.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-38-.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-39-.xsl +34 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.xml +38 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-4-.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-40-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-41-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-42-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-43-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-44-.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-45-.xsl +27 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-46-.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-47-.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-48-.xsl +24 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-49-.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.out +954 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.xml +475 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-5-.xsl +158 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.out +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-50-.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-52.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-53.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-54.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-55.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-56.xsl +28 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-57.xsl +21 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-58.xsl +274 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-59.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-6-.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.err +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-60.xsl +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.out +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-61.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62-inc.xsl +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-62.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.out +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.xml +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-63.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-64.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.ent +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.out +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-65.xsl +26 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-66.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-68.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.xml +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-69.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-7-.xsl +11 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-70.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-71.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-72.xsl +31 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-73.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-74.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-75.xsl +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-76.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-77.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.xml +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-78.xsl +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-79.xsl +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-8-.xsl +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-80.xsl +29 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.xml +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-81.xsl +18 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-82.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.out +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-83.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.out +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.xml +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-84.xsl +14 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.xml +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-86.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.xml +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-87.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-88.xsl +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.out +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.xml +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-89.xsl +105 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.xml +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-9-.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.out +13 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.xml +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-90.xsl +35 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.xml +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-91.xsl +8 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.out +15 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.xml +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-92.xsl +19 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93-inc.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.out +3 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-93.xsl +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.xml +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-94.xsl +35 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.out +4 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-95.xsl +22 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.out +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.xml +5 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-96.xsl +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.xml +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-97.xsl +32 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.out +6 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.xml +10 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-98.xsl +31 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/bug-99.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.out +2 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.xml +23 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/character.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.out +9 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.xml +1 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/date_add.xsl +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.dtd +7 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.out +16 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.xml +17 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/doc.xsl +62 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/inner.xsl +12 -0
- data/vendor-src/libleptris/test/xslt/libxslt_suite_general/items.xml +34 -0
- data/vendor-src/libleptris/test/xslt/open_cases.txt +0 -0
- data/vendor-src/libleptris/test/xslt/test_libxslt_suite.cpp +398 -0
- data/vendor-src/libleptris/vcpkg.json +29 -0
- data/vendor-src/utf8proc/CMakeLists.txt +133 -0
- data/vendor-src/utf8proc/Doxyfile +2765 -0
- data/vendor-src/utf8proc/LICENSE.md +93 -0
- data/vendor-src/utf8proc/MANIFEST +9 -0
- data/vendor-src/utf8proc/Makefile +203 -0
- data/vendor-src/utf8proc/NEWS.md +479 -0
- data/vendor-src/utf8proc/README.md +143 -0
- data/vendor-src/utf8proc/appveyor.yml +46 -0
- data/vendor-src/utf8proc/bench/Makefile +40 -0
- data/vendor-src/utf8proc/bench/bench.c +56 -0
- data/vendor-src/utf8proc/bench/icu.c +61 -0
- data/vendor-src/utf8proc/bench/unistring.c +60 -0
- data/vendor-src/utf8proc/bench/util.c +39 -0
- data/vendor-src/utf8proc/bench/util.h +22 -0
- data/vendor-src/utf8proc/cmake/utf8proc-config.cmake.in +5 -0
- data/vendor-src/utf8proc/data/Makefile +62 -0
- data/vendor-src/utf8proc/data/Manifest.toml +16 -0
- data/vendor-src/utf8proc/data/Project.toml +2 -0
- data/vendor-src/utf8proc/data/data_generator.jl +498 -0
- data/vendor-src/utf8proc/libutf8proc.pc.cmakein +10 -0
- data/vendor-src/utf8proc/libutf8proc.pc.in +10 -0
- data/vendor-src/utf8proc/lump.md +27 -0
- data/vendor-src/utf8proc/test/app/CMakeLists.txt +6 -0
- data/vendor-src/utf8proc/test/app/app.c +9 -0
- data/vendor-src/utf8proc/test/case.c +76 -0
- data/vendor-src/utf8proc/test/charwidth.c +91 -0
- data/vendor-src/utf8proc/test/custom.c +28 -0
- data/vendor-src/utf8proc/test/fuzz_main.c +54 -0
- data/vendor-src/utf8proc/test/fuzzer.c +97 -0
- data/vendor-src/utf8proc/test/graphemetest.c +136 -0
- data/vendor-src/utf8proc/test/iscase.c +63 -0
- data/vendor-src/utf8proc/test/iterate.c +168 -0
- data/vendor-src/utf8proc/test/maxdecomposition.c +22 -0
- data/vendor-src/utf8proc/test/misc.c +51 -0
- data/vendor-src/utf8proc/test/normtest.c +64 -0
- data/vendor-src/utf8proc/test/ossfuzz.sh +13 -0
- data/vendor-src/utf8proc/test/printproperty.c +68 -0
- data/vendor-src/utf8proc/test/tests.c +60 -0
- data/vendor-src/utf8proc/test/tests.h +27 -0
- data/vendor-src/utf8proc/test/valid.c +41 -0
- data/vendor-src/utf8proc/utf8proc.c +834 -0
- data/vendor-src/utf8proc/utf8proc.h +794 -0
- data/vendor-src/utf8proc/utf8proc_data.c +17141 -0
- data/vendor-src/utf8proc/utils.cmake +20 -0
- metadata +1528 -2
|
@@ -0,0 +1,2185 @@
|
|
|
1
|
+
/* lib/src/dom/element_modify.c - DOM Modification API (Compact Mode)
|
|
2
|
+
* Copyright (c) 2024, Ribose Inc.
|
|
3
|
+
*
|
|
4
|
+
* Public API for modifying DOM trees in-place.
|
|
5
|
+
* COMPACT MODE: Uses compact pointer encoding and accessor functions.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "../../include/leptris.h"
|
|
9
|
+
#include "../leptris_internal.h"
|
|
10
|
+
#include "../common/string_view.h"
|
|
11
|
+
#include "../memory/pool.h"
|
|
12
|
+
#include "element.h"
|
|
13
|
+
#include "element_index.h"
|
|
14
|
+
#include "compact.h"
|
|
15
|
+
#include "root_doc_map.h"
|
|
16
|
+
#include "node.h"
|
|
17
|
+
#include "text.h"
|
|
18
|
+
#include "comment.h"
|
|
19
|
+
#include "cdata.h"
|
|
20
|
+
#include "pi.h"
|
|
21
|
+
#include "entity_ref.h"
|
|
22
|
+
#include <stdio.h>
|
|
23
|
+
#include <string.h>
|
|
24
|
+
#include <stdlib.h>
|
|
25
|
+
|
|
26
|
+
/* ===========================================================================
|
|
27
|
+
* Public API Implementation - DOM Modification (Compact Mode)
|
|
28
|
+
* =========================================================================== */
|
|
29
|
+
|
|
30
|
+
/* Round 21: carve mutation element names from a per-document
|
|
31
|
+
* contiguous block — replaces leptris_pool_strdup on the create path
|
|
32
|
+
* (call chain + arena slack checks cost ~9ns for a 2-byte name;
|
|
33
|
+
* this is bump + copy). Oversized names (> block size) fall back
|
|
34
|
+
* to the pool. */
|
|
35
|
+
#define MUT_NAME_BLOCK_BYTES 4096
|
|
36
|
+
|
|
37
|
+
static char* mut_name_carve(struct leptris_document* doc,
|
|
38
|
+
const char* name, size_t name_len) {
|
|
39
|
+
/* Slot layout: [8B doc backpointer][name bytes][NUL]. The
|
|
40
|
+
* backpointer + header bit 6 let get_document resolve this
|
|
41
|
+
* element while unattached with zero registration (see
|
|
42
|
+
* leptris_elem_namebp_doc). */
|
|
43
|
+
size_t need = sizeof(struct leptris_document*) + name_len + 1;
|
|
44
|
+
if (name_len > 254 || need > MUT_NAME_BLOCK_BYTES / 4) {
|
|
45
|
+
/* Long names: pool path (rare; element names are short).
|
|
46
|
+
* No backpointer — caller must register in the root map. */
|
|
47
|
+
return NULL;
|
|
48
|
+
}
|
|
49
|
+
/* Small-name fast path (S8): a runtime-length memcpy is a libc
|
|
50
|
+
* call; element names are 1-8 bytes, so one 8-byte store wins.
|
|
51
|
+
* The store writes the full word — reserve it so the block-bound
|
|
52
|
+
* check accounts for the write, never just the logical size. */
|
|
53
|
+
if (name_len <= 8) need = sizeof(struct leptris_document*) + 9;
|
|
54
|
+
if (doc->mut_name_cursor + need > doc->mut_name_end) {
|
|
55
|
+
struct leptris_mut_name_block* blk =
|
|
56
|
+
(struct leptris_mut_name_block*)malloc(
|
|
57
|
+
sizeof(struct leptris_mut_name_block) + MUT_NAME_BLOCK_BYTES);
|
|
58
|
+
if (!blk) return NULL;
|
|
59
|
+
blk->next = doc->mut_name_blocks;
|
|
60
|
+
doc->mut_name_blocks = blk;
|
|
61
|
+
doc->mut_name_cursor = blk->bytes;
|
|
62
|
+
doc->mut_name_end = blk->bytes + MUT_NAME_BLOCK_BYTES;
|
|
63
|
+
}
|
|
64
|
+
char* slot = doc->mut_name_cursor;
|
|
65
|
+
doc->mut_name_cursor += need;
|
|
66
|
+
*(struct leptris_document**)slot = doc;
|
|
67
|
+
char* dst = slot + sizeof(struct leptris_document*);
|
|
68
|
+
if (name_len <= 8) {
|
|
69
|
+
uint64_t w = 0;
|
|
70
|
+
for (size_t i = 0; i < name_len; i++)
|
|
71
|
+
((unsigned char*)&w)[i] = (unsigned char)name[i];
|
|
72
|
+
memcpy(dst, &w, 8);
|
|
73
|
+
dst[name_len] = '\0';
|
|
74
|
+
} else {
|
|
75
|
+
memcpy(dst, name, name_len);
|
|
76
|
+
dst[name_len] = '\0';
|
|
77
|
+
}
|
|
78
|
+
return slot + sizeof(struct leptris_document*);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Round 22: carve mutation attrs from a per-document contiguous
|
|
82
|
+
* 40-byte-stride block (adjacent attrs keep their cp16 next-edges
|
|
83
|
+
* in-range — no compact-overflow traffic for programmatic builds).
|
|
84
|
+
* Falls back to the pool when a block can't be allocated. */
|
|
85
|
+
#define MUT_ATTR_BLOCK_COUNT 128
|
|
86
|
+
|
|
87
|
+
static struct leptris_attribute* mut_attr_carve(struct leptris_document* doc) {
|
|
88
|
+
if (doc->mut_attr_cursor && doc->mut_attr_cursor < doc->mut_attr_end) {
|
|
89
|
+
return doc->mut_attr_cursor++;
|
|
90
|
+
}
|
|
91
|
+
struct leptris_mut_attr_block* blk =
|
|
92
|
+
(struct leptris_mut_attr_block*)malloc(
|
|
93
|
+
sizeof(struct leptris_mut_attr_block) +
|
|
94
|
+
(size_t)MUT_ATTR_BLOCK_COUNT * sizeof(struct leptris_attribute));
|
|
95
|
+
if (!blk) return NULL;
|
|
96
|
+
blk->next = doc->mut_attr_blocks;
|
|
97
|
+
doc->mut_attr_blocks = blk;
|
|
98
|
+
doc->mut_attr_cursor = (struct leptris_attribute*)blk->bytes;
|
|
99
|
+
doc->mut_attr_end = doc->mut_attr_cursor + MUT_ATTR_BLOCK_COUNT;
|
|
100
|
+
return doc->mut_attr_cursor++;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Round 22: short string carve for attr names/values — reuses the
|
|
104
|
+
* name block (its 8-byte doc header is unused here; harmless).
|
|
105
|
+
* Returns NULL for long strings — caller falls back to the pool. */
|
|
106
|
+
static char* mut_str_carve(struct leptris_document* doc, const char* s,
|
|
107
|
+
size_t len) {
|
|
108
|
+
if (len + 1 > MUT_NAME_BLOCK_BYTES / 4) return NULL;
|
|
109
|
+
size_t need = 8 + len + 1;
|
|
110
|
+
if (doc->mut_name_cursor + need > doc->mut_name_end) {
|
|
111
|
+
struct leptris_mut_name_block* blk =
|
|
112
|
+
(struct leptris_mut_name_block*)malloc(
|
|
113
|
+
sizeof(struct leptris_mut_name_block) + MUT_NAME_BLOCK_BYTES);
|
|
114
|
+
if (!blk) return NULL;
|
|
115
|
+
blk->next = doc->mut_name_blocks;
|
|
116
|
+
doc->mut_name_blocks = blk;
|
|
117
|
+
doc->mut_name_cursor = blk->bytes;
|
|
118
|
+
doc->mut_name_end = blk->bytes + MUT_NAME_BLOCK_BYTES;
|
|
119
|
+
}
|
|
120
|
+
char* p = doc->mut_name_cursor + 8;
|
|
121
|
+
doc->mut_name_cursor += need;
|
|
122
|
+
memcpy(p, s, len);
|
|
123
|
+
p[len] = '\0';
|
|
124
|
+
return p;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Round 18: carve mutation elements from a per-document contiguous
|
|
128
|
+
* bump block. The pool extension path malloc'd each element
|
|
129
|
+
* separately, scattering them across heap regions — sibling edges
|
|
130
|
+
* (self-relative offsets) still worked but landed far apart, and
|
|
131
|
+
* every fresh malloc paid allocator + page costs. Contiguous
|
|
132
|
+
* carving keeps sequential-append elements cache-adjacent. Blocks
|
|
133
|
+
* chain via ->next and are freed with the document. */
|
|
134
|
+
#define MUT_ELEM_BLOCK_COUNT 1024
|
|
135
|
+
|
|
136
|
+
static LeptrisElement mut_elem_carve(struct leptris_document* doc) {
|
|
137
|
+
if (doc->mut_elem_cursor && doc->mut_elem_cursor < doc->mut_elem_end) {
|
|
138
|
+
return doc->mut_elem_cursor++;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
struct leptris_mut_elem_block* blk =
|
|
142
|
+
(struct leptris_mut_elem_block*)malloc(
|
|
143
|
+
sizeof(struct leptris_mut_elem_block) +
|
|
144
|
+
(size_t)MUT_ELEM_BLOCK_COUNT * sizeof(struct leptris_element));
|
|
145
|
+
if (!blk) return NULL;
|
|
146
|
+
|
|
147
|
+
blk->next = doc->mut_elem_blocks;
|
|
148
|
+
doc->mut_elem_blocks = blk;
|
|
149
|
+
doc->mut_elem_cursor = (LeptrisElement)blk->bytes;
|
|
150
|
+
doc->mut_elem_end = doc->mut_elem_cursor + MUT_ELEM_BLOCK_COUNT;
|
|
151
|
+
return doc->mut_elem_cursor++;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Create new element in document (Public API)
|
|
156
|
+
*/
|
|
157
|
+
LeptrisElement leptris_element_create(LeptrisDocument doc, const char* name) {
|
|
158
|
+
if (!doc || !name) return NULL;
|
|
159
|
+
|
|
160
|
+
/* Issue #187: trigger lazy promote if the doc was produced by
|
|
161
|
+
* the flat-parse fast path. The compact-pointer tree must exist
|
|
162
|
+
* before we can allocate a new element into it. */
|
|
163
|
+
leptris_document_ensure_promoted(doc);
|
|
164
|
+
|
|
165
|
+
LeptrisElement elem = NULL;
|
|
166
|
+
if (doc->pool) {
|
|
167
|
+
/* Round 18: struct from the bump block, name from the pool.
|
|
168
|
+
* Same init contract as leptris_element_create_with_view
|
|
169
|
+
* (memset-zero + type/name/name_hash/name_len). Falls back
|
|
170
|
+
* to the plain pool path when a block can't be allocated. */
|
|
171
|
+
size_t name_len = strlen(name);
|
|
172
|
+
elem = mut_elem_carve(doc);
|
|
173
|
+
if (elem) {
|
|
174
|
+
char* name_copy = mut_name_carve(doc, name, name_len);
|
|
175
|
+
if (name_copy) {
|
|
176
|
+
memset(elem, 0, sizeof(struct leptris_element));
|
|
177
|
+
elem->base.type = LEPTRIS_NODE_TYPE_ELEMENT;
|
|
178
|
+
elem->header.flags |= LEPTRIS_NAMEBP_FLAG;
|
|
179
|
+
elem->name = name_copy;
|
|
180
|
+
elem->name_hash = leptris_name_hash_compute(name_copy);
|
|
181
|
+
elem->name_len = (name_len > 254) ? 0xFF : (uint8_t)name_len;
|
|
182
|
+
/* Round 20 contract: create registers every new element
|
|
183
|
+
* so pre-attach ops (set_root validation, get_document
|
|
184
|
+
* on detached elements) can resolve the doc. The bump-
|
|
185
|
+
* block fast path omitted it, leaving detached elements
|
|
186
|
+
* unresolvable until attached. Register is O(1) with
|
|
187
|
+
* the ROOTMAP_FLAG fast-out, so no measurable cost. */
|
|
188
|
+
/* Lane 18 P1: NO map registration — mut_name_carve
|
|
189
|
+
* stamped the doc backpointer and header bit 6, and
|
|
190
|
+
* get_document resolves namebp BEFORE the map, so
|
|
191
|
+
* the entry is pure redundancy here (the #905 class
|
|
192
|
+
* only broke paths where namebp was NOT guaranteed;
|
|
193
|
+
* this branch guarantees it). The pool fallbacks
|
|
194
|
+
* below keep registering — their names carry no
|
|
195
|
+
* backpointer. */
|
|
196
|
+
/* Mut-block copy is writable: a QName splits in
|
|
197
|
+
* place (#846). */
|
|
198
|
+
leptris_elem_split_qname(elem, doc->pool);
|
|
199
|
+
} else {
|
|
200
|
+
/* Long name or block alloc failure: fall through to
|
|
201
|
+
* the pool path (registration follows below — pool
|
|
202
|
+
* names carry no backpointer). */
|
|
203
|
+
memset(elem, 0, sizeof(struct leptris_element));
|
|
204
|
+
char* pooled = leptris_pool_strdup(doc->pool, name);
|
|
205
|
+
if (!pooled) return NULL;
|
|
206
|
+
elem->base.type = LEPTRIS_NODE_TYPE_ELEMENT;
|
|
207
|
+
elem->name = pooled;
|
|
208
|
+
elem->name_hash = leptris_name_hash_compute(pooled);
|
|
209
|
+
elem->name_len = (name_len > 254) ? 0xFF : (uint8_t)name_len;
|
|
210
|
+
leptris_root_doc_register(elem, doc);
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
elem = leptris_element_create_pooled(name, doc->pool);
|
|
214
|
+
if (elem) leptris_root_doc_register(elem, doc);
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
elem = leptris_element_create_pooled(name, doc->pool);
|
|
218
|
+
if (elem) leptris_root_doc_register(elem, doc);
|
|
219
|
+
}
|
|
220
|
+
return elem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Append child element (Public API)
|
|
225
|
+
*/
|
|
226
|
+
/* Lane 18: the fused create+append. Shares the exact create and
|
|
227
|
+
* append internals with the two-call pair — one doc resolution and
|
|
228
|
+
* one public frame instead of two of each. */
|
|
229
|
+
LeptrisElement leptris_element_create_child(LeptrisElement parent, const char* name) {
|
|
230
|
+
if (!parent || !name) return NULL;
|
|
231
|
+
struct leptris_document* doc = leptris_element_get_document(parent);
|
|
232
|
+
if (!doc || !doc->pool) return NULL;
|
|
233
|
+
LeptrisElement elem = leptris_element_create(doc, name);
|
|
234
|
+
if (!elem) return NULL;
|
|
235
|
+
leptris_element_append_child_internal_doc(parent, (LeptrisNode*)elem, doc);
|
|
236
|
+
leptris_element_invalidate_child_cache(parent);
|
|
237
|
+
leptris_element_index_invalidate(doc);
|
|
238
|
+
return elem;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
LeptrisStatus leptris_element_append_child(LeptrisElement parent, LeptrisElement child) {
|
|
242
|
+
if (!parent || !child) return LEPTRIS_ERROR_NULL_ARG;
|
|
243
|
+
|
|
244
|
+
/* Single document resolution per mutation (TODO 195c): the
|
|
245
|
+
* root walk + map lookup was paid three times per append
|
|
246
|
+
* (twice here, once inside the internal for the tail cache). */
|
|
247
|
+
struct leptris_document* doc = leptris_element_get_document(parent);
|
|
248
|
+
|
|
249
|
+
/* Call internal void function, assume success */
|
|
250
|
+
leptris_element_append_child_internal_doc(parent, (LeptrisNode*)child, doc);
|
|
251
|
+
leptris_element_invalidate_child_cache(parent);
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
/* Invalidate element index (TODO 132): the new child changes
|
|
256
|
+
* the document's element set. The index will be rebuilt lazily
|
|
257
|
+
* on the next descendant-axis query. */
|
|
258
|
+
if (doc) {
|
|
259
|
+
leptris_element_index_invalidate(doc);
|
|
260
|
+
}
|
|
261
|
+
return LEPTRIS_OK;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Prepend child element at the beginning (Public API)
|
|
266
|
+
*/
|
|
267
|
+
LeptrisStatus leptris_element_prepend_child(LeptrisElement parent, LeptrisElement child) {
|
|
268
|
+
if (!parent || !child) return LEPTRIS_ERROR_NULL_ARG;
|
|
269
|
+
|
|
270
|
+
/* Call internal void function, assume success */
|
|
271
|
+
leptris_element_prepend_child_internal(parent, (LeptrisNode*)child);
|
|
272
|
+
leptris_element_invalidate_child_cache(parent);
|
|
273
|
+
return LEPTRIS_OK;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Insert new node before a sibling (Public API)
|
|
278
|
+
* Issue #216: supports all child node types (element, text, comment,
|
|
279
|
+
* cdata, pi), not just elements. The LeptrisElement signature is kept
|
|
280
|
+
* for ABI stability; callers cast non-element node pointers.
|
|
281
|
+
*/
|
|
282
|
+
LeptrisStatus leptris_element_insert_before(LeptrisElement sibling, LeptrisElement new_node) {
|
|
283
|
+
if (!sibling || !new_node) return LEPTRIS_ERROR_NULL_ARG;
|
|
284
|
+
|
|
285
|
+
LeptrisNode* new_node_ptr = (LeptrisNode*)new_node;
|
|
286
|
+
LeptrisNode* sibling_ptr = (LeptrisNode*)sibling;
|
|
287
|
+
|
|
288
|
+
/* Validate new_node type. */
|
|
289
|
+
if (new_node_ptr->type != LEPTRIS_NODE_TYPE_ELEMENT &&
|
|
290
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_TEXT &&
|
|
291
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_CDATA &&
|
|
292
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_COMMENT &&
|
|
293
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_PI &&
|
|
294
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_ENTITY_REF) {
|
|
295
|
+
return LEPTRIS_ERROR_INVALID_ARG;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Get parent using the type-dispatching accessor — sibling may
|
|
299
|
+
* be any child node type. Issue #540: a DETACHED sibling is
|
|
300
|
+
* legal — link-only mode below chains the two nodes so a later
|
|
301
|
+
* append of the chain head under a parent carries the whole
|
|
302
|
+
* sequence (libxml2 xmlAddPrevSibling semantics for unlinked
|
|
303
|
+
* nodes; the flat next-sibling layout needs no extra state). */
|
|
304
|
+
LeptrisElement parent = leptris_node_parent(sibling_ptr);
|
|
305
|
+
if (!parent) {
|
|
306
|
+
if (leptris_node_parent(new_node_ptr)) {
|
|
307
|
+
leptris_node_unlink(new_node_ptr);
|
|
308
|
+
}
|
|
309
|
+
/* new_node becomes the HEAD of the detached chain. */
|
|
310
|
+
leptris_node_set_next_sibling(new_node_ptr, sibling_ptr);
|
|
311
|
+
return LEPTRIS_OK;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Issue #217 + #518: unlink new_node from ANY current parent —
|
|
315
|
+
* including THIS one. A same-parent move without the unlink left
|
|
316
|
+
* the old next-sibling link in place and the splice below built
|
|
317
|
+
* a cycle in the child chain (later inserts/serializes hung
|
|
318
|
+
* forever). leptris_node_unlink also decrements the old parent's
|
|
319
|
+
* child_count, so the ++ below stays balanced for moves. */
|
|
320
|
+
if (leptris_node_parent(new_node_ptr)) {
|
|
321
|
+
leptris_node_unlink(new_node_ptr);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Walk the parent's true child chain (including non-element
|
|
325
|
+
* children) to find the node before sibling. MUST run after the
|
|
326
|
+
* unlink — new_node may have been in this chain. */
|
|
327
|
+
LeptrisNode* prev_child = NULL;
|
|
328
|
+
LeptrisNode* current = leptris_node_first_child_internal((LeptrisNode*)parent);
|
|
329
|
+
while (current && current != sibling_ptr) {
|
|
330
|
+
prev_child = current;
|
|
331
|
+
current = leptris_node_get_next_sibling(current);
|
|
332
|
+
}
|
|
333
|
+
if (!current) return LEPTRIS_ERROR_INVALID_ARG;
|
|
334
|
+
|
|
335
|
+
/* Splice new_node in between prev_child and sibling. */
|
|
336
|
+
if (prev_child) {
|
|
337
|
+
leptris_node_set_next_sibling(prev_child, new_node_ptr);
|
|
338
|
+
} else {
|
|
339
|
+
leptris_elem_set_first_child(parent, new_node_ptr);
|
|
340
|
+
}
|
|
341
|
+
leptris_node_set_next_sibling(new_node_ptr, sibling_ptr);
|
|
342
|
+
|
|
343
|
+
/* Set parent (type-dispatching). TODO 155 Phase A: document field
|
|
344
|
+
* removed; non-root elements reach doc via walk to root. */
|
|
345
|
+
if (new_node_ptr->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
346
|
+
leptris_element_set_parent((LeptrisElement)new_node_ptr, parent);
|
|
347
|
+
} else {
|
|
348
|
+
switch (new_node_ptr->type) {
|
|
349
|
+
case LEPTRIS_NODE_TYPE_TEXT:
|
|
350
|
+
leptris_textnode_set_parent((LeptrisTextNode*)new_node_ptr, parent);
|
|
351
|
+
break;
|
|
352
|
+
case LEPTRIS_NODE_TYPE_COMMENT:
|
|
353
|
+
leptris_comment_set_parent((LeptrisCommentNode*)new_node_ptr, parent);
|
|
354
|
+
break;
|
|
355
|
+
case LEPTRIS_NODE_TYPE_CDATA:
|
|
356
|
+
leptris_cdata_set_parent((LeptrisCDATANode*)new_node_ptr, parent);
|
|
357
|
+
break;
|
|
358
|
+
case LEPTRIS_NODE_TYPE_PI:
|
|
359
|
+
leptris_pi_set_parent((LeptrisPINode*)new_node_ptr, parent);
|
|
360
|
+
break;
|
|
361
|
+
case LEPTRIS_NODE_TYPE_ENTITY_REF:
|
|
362
|
+
leptris_entity_ref_set_parent(
|
|
363
|
+
(LeptrisEntityRefNode*)new_node_ptr, parent);
|
|
364
|
+
break;
|
|
365
|
+
default: break;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/* Issue #213: maintain child_count for element children only,
|
|
370
|
+
* matching leptris_element_append_child_internal. */
|
|
371
|
+
if (new_node_ptr->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
372
|
+
parent->child_count++;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(parent));
|
|
376
|
+
leptris_element_invalidate_child_cache(parent);
|
|
377
|
+
return LEPTRIS_OK;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Insert new node after a sibling (Public API)
|
|
382
|
+
* Issue #216: supports all child node types.
|
|
383
|
+
*/
|
|
384
|
+
LeptrisStatus leptris_element_insert_after(LeptrisElement sibling, LeptrisElement new_node) {
|
|
385
|
+
if (!sibling || !new_node) return LEPTRIS_ERROR_NULL_ARG;
|
|
386
|
+
|
|
387
|
+
LeptrisNode* new_node_ptr = (LeptrisNode*)new_node;
|
|
388
|
+
LeptrisNode* sibling_ptr = (LeptrisNode*)sibling;
|
|
389
|
+
|
|
390
|
+
if (new_node_ptr->type != LEPTRIS_NODE_TYPE_ELEMENT &&
|
|
391
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_TEXT &&
|
|
392
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_CDATA &&
|
|
393
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_COMMENT &&
|
|
394
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_PI &&
|
|
395
|
+
new_node_ptr->type != LEPTRIS_NODE_TYPE_ENTITY_REF) {
|
|
396
|
+
return LEPTRIS_ERROR_INVALID_ARG;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
LeptrisElement parent = leptris_node_parent(sibling_ptr);
|
|
400
|
+
if (!parent) {
|
|
401
|
+
/* Issue #540: detached sibling — link-only append after it. */
|
|
402
|
+
if (leptris_node_parent(new_node_ptr)) {
|
|
403
|
+
leptris_node_unlink(new_node_ptr);
|
|
404
|
+
}
|
|
405
|
+
LeptrisNode* after = leptris_node_get_next_sibling(sibling_ptr);
|
|
406
|
+
leptris_node_set_next_sibling(sibling_ptr, new_node_ptr);
|
|
407
|
+
leptris_node_set_next_sibling(new_node_ptr, after);
|
|
408
|
+
return LEPTRIS_OK;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* Issue #217 + #518: unlink from ANY current parent — including
|
|
412
|
+
* this one (a same-parent move must first come out of the chain,
|
|
413
|
+
* else the splice below cycles it; see insert_before). */
|
|
414
|
+
if (leptris_node_parent(new_node_ptr)) {
|
|
415
|
+
leptris_node_unlink(new_node_ptr);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* Read AFTER the unlink: if new_node was sibling's next sibling,
|
|
419
|
+
* reading before would capture new_node itself and the splice
|
|
420
|
+
* would link it to itself. */
|
|
421
|
+
LeptrisNode* next_sibling = leptris_node_get_next_sibling(sibling_ptr);
|
|
422
|
+
|
|
423
|
+
/* Splice new_node between sibling and next_sibling. Use the
|
|
424
|
+
* type-dispatching setter on new_node — leptris_elem_set_next_sibling
|
|
425
|
+
* only writes the element-form of the field. */
|
|
426
|
+
leptris_node_set_next_sibling(sibling_ptr, new_node_ptr);
|
|
427
|
+
leptris_node_set_next_sibling(new_node_ptr, next_sibling);
|
|
428
|
+
|
|
429
|
+
/* Set parent (type-dispatching). TODO 155 Phase A: document field
|
|
430
|
+
* removed; non-root elements reach doc via walk to root. */
|
|
431
|
+
if (new_node_ptr->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
432
|
+
leptris_element_set_parent((LeptrisElement)new_node_ptr, parent);
|
|
433
|
+
} else {
|
|
434
|
+
switch (new_node_ptr->type) {
|
|
435
|
+
case LEPTRIS_NODE_TYPE_TEXT:
|
|
436
|
+
leptris_textnode_set_parent((LeptrisTextNode*)new_node_ptr, parent);
|
|
437
|
+
break;
|
|
438
|
+
case LEPTRIS_NODE_TYPE_COMMENT:
|
|
439
|
+
leptris_comment_set_parent((LeptrisCommentNode*)new_node_ptr, parent);
|
|
440
|
+
break;
|
|
441
|
+
case LEPTRIS_NODE_TYPE_CDATA:
|
|
442
|
+
leptris_cdata_set_parent((LeptrisCDATANode*)new_node_ptr, parent);
|
|
443
|
+
break;
|
|
444
|
+
case LEPTRIS_NODE_TYPE_PI:
|
|
445
|
+
leptris_pi_set_parent((LeptrisPINode*)new_node_ptr, parent);
|
|
446
|
+
break;
|
|
447
|
+
case LEPTRIS_NODE_TYPE_ENTITY_REF:
|
|
448
|
+
leptris_entity_ref_set_parent(
|
|
449
|
+
(LeptrisEntityRefNode*)new_node_ptr, parent);
|
|
450
|
+
break;
|
|
451
|
+
default: break;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/* Update last_child if sibling was the last child. */
|
|
456
|
+
LeptrisNode* last = leptris_node_last_child_internal((LeptrisNode*)parent);
|
|
457
|
+
if (last == sibling_ptr) {
|
|
458
|
+
leptris_elem_set_last_child(parent, new_node_ptr);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (new_node_ptr->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
462
|
+
parent->child_count++;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(parent));
|
|
466
|
+
leptris_element_invalidate_child_cache(parent);
|
|
467
|
+
return LEPTRIS_OK;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Remove child element (Public API)
|
|
472
|
+
* COMPACT MODE: Simplified implementation
|
|
473
|
+
*/
|
|
474
|
+
LeptrisStatus leptris_element_remove_child(LeptrisElement parent, LeptrisElement child) {
|
|
475
|
+
if (!parent || !child) return LEPTRIS_ERROR_NULL_ARG;
|
|
476
|
+
|
|
477
|
+
/* Verify child is actually a child of parent */
|
|
478
|
+
LeptrisElement found = NULL;
|
|
479
|
+
LeptrisElement current = leptris_element_get_first_child(parent);
|
|
480
|
+
while (current) {
|
|
481
|
+
if (current == child) {
|
|
482
|
+
found = current;
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
current = leptris_element_get_next_sibling(current);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (!found) {
|
|
489
|
+
return LEPTRIS_ERROR_INVALID_ARG;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/* Find the node before child in the list */
|
|
493
|
+
LeptrisElement prev_child = NULL;
|
|
494
|
+
current = leptris_element_get_first_child(parent);
|
|
495
|
+
while (current && current != child) {
|
|
496
|
+
prev_child = current;
|
|
497
|
+
current = leptris_element_get_next_sibling(current);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
LeptrisElement next_child = leptris_element_get_next_sibling(child);
|
|
501
|
+
|
|
502
|
+
/* Unlink child from the list */
|
|
503
|
+
if (prev_child) {
|
|
504
|
+
leptris_elem_set_next_sibling(prev_child, (LeptrisNode*)next_child);
|
|
505
|
+
} else {
|
|
506
|
+
/* Child was first child */
|
|
507
|
+
leptris_elem_set_first_child(parent, (LeptrisNode*)next_child);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/* Update last_child pointer - directly check instead of using get_last_child */
|
|
511
|
+
if (leptris_elem_last_child(parent) == (LeptrisNode*)child) {
|
|
512
|
+
/* Child was last child */
|
|
513
|
+
leptris_elem_set_last_child(parent, (LeptrisNode*)prev_child);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* Clear parent and decrement count */
|
|
517
|
+
leptris_elem_set_parent(child, NULL);
|
|
518
|
+
parent->child_count--;
|
|
519
|
+
|
|
520
|
+
/* COW: Increment version */
|
|
521
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(parent));
|
|
522
|
+
|
|
523
|
+
leptris_element_invalidate_child_cache(parent);
|
|
524
|
+
|
|
525
|
+
/* Structural mutation: a cached element index would describe the
|
|
526
|
+
* pre-removal tree (append_child invalidates; removal must too). */
|
|
527
|
+
if (leptris_element_get_document(parent)) {
|
|
528
|
+
leptris_element_index_invalidate(leptris_element_get_document(parent));
|
|
529
|
+
}
|
|
530
|
+
return LEPTRIS_OK;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Remove all children (Public API)
|
|
535
|
+
*/
|
|
536
|
+
LeptrisStatus leptris_element_remove_all_children(LeptrisElement elem) {
|
|
537
|
+
if (!elem) return LEPTRIS_ERROR_NULL_ARG;
|
|
538
|
+
|
|
539
|
+
/* Walk through all children and clear parent references */
|
|
540
|
+
LeptrisElement child = leptris_element_get_first_child(elem);
|
|
541
|
+
while (child) {
|
|
542
|
+
LeptrisElement next = leptris_element_get_next_sibling(child);
|
|
543
|
+
leptris_elem_set_parent(child, NULL);
|
|
544
|
+
child = next;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/* Clear child pointers */
|
|
548
|
+
leptris_elem_set_first_child(elem, NULL);
|
|
549
|
+
leptris_elem_set_last_child(elem, NULL);
|
|
550
|
+
elem->child_count = 0;
|
|
551
|
+
|
|
552
|
+
/* COW: Increment version */
|
|
553
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(elem));
|
|
554
|
+
|
|
555
|
+
leptris_element_invalidate_child_cache(elem);
|
|
556
|
+
|
|
557
|
+
/* Structural mutation: invalidate any cached element index. */
|
|
558
|
+
if (leptris_element_get_document(elem)) {
|
|
559
|
+
leptris_element_index_invalidate(leptris_element_get_document(elem));
|
|
560
|
+
}
|
|
561
|
+
return LEPTRIS_OK;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Set element name (Public API)
|
|
566
|
+
*/
|
|
567
|
+
LeptrisStatus leptris_element_set_name(LeptrisElement elem, const char* name) {
|
|
568
|
+
if (!elem) return LEPTRIS_ERROR_NULL_ARG;
|
|
569
|
+
if (!name) return LEPTRIS_ERROR_INVALID_ARG;
|
|
570
|
+
|
|
571
|
+
/* CRITICAL FIX: Don't free old name - it might be pool-allocated!
|
|
572
|
+
* Pool-allocated strings will be freed when the pool is destroyed.
|
|
573
|
+
* If we free() a pool-allocated string, we get undefined behavior. */
|
|
574
|
+
|
|
575
|
+
/* Set new name - prefer pool allocation if document is available.
|
|
576
|
+
* Round 21: resolve the doc BEFORE clearing the mutation name-
|
|
577
|
+
* backpointer bit — the element was reachable only through that
|
|
578
|
+
* backpointer, and clearing it first sends the element down the
|
|
579
|
+
* standalone/malloc path (breaking every later mutation op).
|
|
580
|
+
* A replacement name is pool storage with no backpointer: clear
|
|
581
|
+
* the bit and register in the root map instead. */
|
|
582
|
+
struct leptris_document* sn_doc = leptris_element_get_document(elem);
|
|
583
|
+
elem->header.flags &= (uint8_t)(~LEPTRIS_NAMEBP_FLAG & 0xFFu);
|
|
584
|
+
if (sn_doc && sn_doc->pool) {
|
|
585
|
+
/* Use pool allocation for consistency with parsing */
|
|
586
|
+
elem->name = leptris_pool_strdup(sn_doc->pool, name);
|
|
587
|
+
if (elem->name) leptris_root_doc_register(elem, sn_doc);
|
|
588
|
+
} else {
|
|
589
|
+
/* Fallback to malloc for standalone elements */
|
|
590
|
+
elem->name = leptris_strdup(name);
|
|
591
|
+
}
|
|
592
|
+
if (!elem->name) return LEPTRIS_ERROR_MEMORY;
|
|
593
|
+
/* #817: keep the prefix cache coherent with the new name — an
|
|
594
|
+
* UNQUALIFIED rename must not let the serializer resurrect the
|
|
595
|
+
* old prefix (p:child renamed to child emitted p:child). A
|
|
596
|
+
* qualified rename adopts the lexical prefix; its URI stays
|
|
597
|
+
* whatever is in scope (set_namespace rebinds explicitly). */
|
|
598
|
+
{
|
|
599
|
+
const char* colon = strchr(elem->name, ':');
|
|
600
|
+
LeptrisMemoryPool* npool = leptris_element_get_pool(elem);
|
|
601
|
+
if (colon && colon > elem->name) {
|
|
602
|
+
size_t pl = (size_t)(colon - elem->name);
|
|
603
|
+
char* pfx = (char*)leptris_pool_alloc(
|
|
604
|
+
npool, pl + 1);
|
|
605
|
+
if (pfx) {
|
|
606
|
+
memcpy(pfx, elem->name, pl);
|
|
607
|
+
pfx[pl] = 0;
|
|
608
|
+
leptris_elem_set_prefix(elem, pfx, npool);
|
|
609
|
+
/* Name storage is the LOCAL part; slide past the
|
|
610
|
+
* prefix. */
|
|
611
|
+
elem->name = (char*)colon + 1;
|
|
612
|
+
}
|
|
613
|
+
} else {
|
|
614
|
+
leptris_elem_set_prefix(elem, NULL, npool);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
elem->name_hash = leptris_name_hash_compute(elem->name);
|
|
618
|
+
elem->name_len = (uint8_t)(strlen(elem->name) > 254
|
|
619
|
+
? 0xFF : strlen(elem->name));
|
|
620
|
+
|
|
621
|
+
/* COW: Increment version */
|
|
622
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(elem));
|
|
623
|
+
|
|
624
|
+
return LEPTRIS_OK;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Set element text content (Public API)
|
|
629
|
+
* COMPACT MODE: Removes all existing children and adds a single text node
|
|
630
|
+
*/
|
|
631
|
+
LeptrisStatus leptris_element_set_text(LeptrisElement elem, const char* text) {
|
|
632
|
+
if (!elem) return LEPTRIS_ERROR_NULL_ARG;
|
|
633
|
+
|
|
634
|
+
/* Remove all existing children */
|
|
635
|
+
leptris_element_remove_all_children(elem);
|
|
636
|
+
|
|
637
|
+
if (text) {
|
|
638
|
+
/* Create new text node (even if empty to match pugixml behavior) */
|
|
639
|
+
LeptrisMemoryPool* pool = leptris_element_get_pool(elem);
|
|
640
|
+
LeptrisTextNode* text_node = leptris_text_create(text, strlen(text), pool);
|
|
641
|
+
if (!text_node) {
|
|
642
|
+
return LEPTRIS_ERROR_MEMORY;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/* Add as child */
|
|
646
|
+
leptris_element_append_child_internal(elem, (LeptrisNode*)text_node);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
return LEPTRIS_OK;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Set attribute (Public API)
|
|
654
|
+
* COMPACT MODE: Uses linked list attribute storage
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
/* ---- Doc-level attribute-name index (mutation path) --------------------
|
|
658
|
+
*
|
|
659
|
+
* leptris_element_set_attribute walks the attr list per call to
|
|
660
|
+
* reject duplicates — O(N) per set, O(N^2) for programmatic builds
|
|
661
|
+
* (11 ms at 2000 attrs on one element). This open-addressed index
|
|
662
|
+
* keys (element pointer, 32-bit name hash) -> attribute so the
|
|
663
|
+
* duplicate check is O(1). Safety: nodes are arena-backed and
|
|
664
|
+
* element removal only unlinks (never frees), so raw attr pointers
|
|
665
|
+
* cannot dangle before leptris_document_free — which frees the
|
|
666
|
+
* index. Entries: attr != NULL live; attr == NULL with elem != NULL
|
|
667
|
+
* is a tombstone (probe continues); all-NULL slot ends the probe.
|
|
668
|
+
* The (elem, hash == 0) sentinel marks an element as registered:
|
|
669
|
+
* parse-created attrs are bulk-inserted on the element's first
|
|
670
|
+
* mutation so the index is authoritative without ever touching the
|
|
671
|
+
* parse path. ------------------------------------------------------------------ */
|
|
672
|
+
|
|
673
|
+
/* struct leptris_attr_index_entry / _index: leptris_internal.h
|
|
674
|
+
* (document_free releases the table). */
|
|
675
|
+
|
|
676
|
+
#define ATTR_INDEX_INIT_CAP 16u
|
|
677
|
+
|
|
678
|
+
/* Walk-first threshold: elements at or below this attr count use the
|
|
679
|
+
* hash-prefiltered list walk for the duplicate check instead of the
|
|
680
|
+
* doc-level index. XSLT result elements typically carry 1–3 attrs —
|
|
681
|
+
* register + probe + put costs more than walking a handful of nodes,
|
|
682
|
+
* and the index never re-pays for a short-lived result tree. Elements
|
|
683
|
+
* that grow past the threshold lazily bulk-register on their next
|
|
684
|
+
* mutation (attr_index_register inserts every existing attr). */
|
|
685
|
+
#define ATTR_INDEX_WALK_MAX 8
|
|
686
|
+
|
|
687
|
+
/* Index keys use the FULL 32-bit FNV of the name — independent of
|
|
688
|
+
* the attr field's 15-bit lazy hash (round 20). The u15 field feeds
|
|
689
|
+
* per-element walk pre-filters; the doc-level open-addressed index
|
|
690
|
+
* needs full-width keys so distinct names never share a probe key
|
|
691
|
+
* (a u15 key space turns each hash collision into an O(N) fallback
|
|
692
|
+
* walk, re-quadraticizing programmatic builds). */
|
|
693
|
+
static uint32_t attr_index_hash(const char* s, size_t len) {
|
|
694
|
+
uint32_t h = 2166136261u;
|
|
695
|
+
for (size_t i = 0; i < len; i++) {
|
|
696
|
+
h ^= (unsigned char)s[i];
|
|
697
|
+
h *= 16777619u;
|
|
698
|
+
}
|
|
699
|
+
return h;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
static uint32_t attr_index_slot(LeptrisElement elem, uint32_t name_hash,
|
|
703
|
+
size_t cap) {
|
|
704
|
+
uint64_t h = (uint64_t)(uintptr_t)elem;
|
|
705
|
+
h ^= h >> 33;
|
|
706
|
+
h *= 0xff51afd7ed558ccdULL;
|
|
707
|
+
/* Round 20: fold AFTER the multiply. The old `h2 ^= h2 >> 15`
|
|
708
|
+
* was a no-op for the 15-bit attr hashes — with stride-256 hash
|
|
709
|
+
* progressions (pre-finalizer bug) that piled whole arithmetic
|
|
710
|
+
* sequences onto single probe chains. */
|
|
711
|
+
uint64_t h2 = (uint64_t)name_hash * 0x9E3779B97F4A7C15ULL;
|
|
712
|
+
h2 ^= h2 >> 32;
|
|
713
|
+
return (uint32_t)((h ^ h2) & (cap - 1));
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
static struct leptris_attr_index* attr_index_get(struct leptris_document* doc) {
|
|
717
|
+
if (!doc->attr_index) {
|
|
718
|
+
doc->attr_index = (struct leptris_attr_index*)malloc(
|
|
719
|
+
sizeof(struct leptris_attr_index));
|
|
720
|
+
if (!doc->attr_index) return NULL;
|
|
721
|
+
doc->attr_index->slots = (struct leptris_attr_index_entry*)calloc(
|
|
722
|
+
ATTR_INDEX_INIT_CAP, sizeof(struct leptris_attr_index_entry));
|
|
723
|
+
if (!doc->attr_index->slots) {
|
|
724
|
+
free(doc->attr_index);
|
|
725
|
+
doc->attr_index = NULL;
|
|
726
|
+
return NULL;
|
|
727
|
+
}
|
|
728
|
+
doc->attr_index->cap = ATTR_INDEX_INIT_CAP;
|
|
729
|
+
doc->attr_index->used = 0;
|
|
730
|
+
}
|
|
731
|
+
return doc->attr_index;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/* Probe for (elem, name_hash). On hit returns the slot index with
|
|
735
|
+
* *attr_out set (NULL when the slot is the registration sentinel).
|
|
736
|
+
* On miss returns the empty-slot index for insertion. */
|
|
737
|
+
static size_t attr_index_probe(struct leptris_attr_index* ix,
|
|
738
|
+
LeptrisElement elem, uint32_t name_hash,
|
|
739
|
+
struct leptris_attribute** attr_out,
|
|
740
|
+
int* found) {
|
|
741
|
+
size_t cap = ix->cap;
|
|
742
|
+
size_t i = attr_index_slot(elem, name_hash, cap);
|
|
743
|
+
*found = 0;
|
|
744
|
+
for (size_t n_ = 0; n_ < cap; n_++) {
|
|
745
|
+
struct leptris_attr_index_entry* e = &ix->slots[i];
|
|
746
|
+
if (!e->elem && !e->attr) return i; /* never used: miss */
|
|
747
|
+
if (e->elem == elem && e->name_hash == name_hash) {
|
|
748
|
+
if (e->attr) { *attr_out = e->attr; *found = 1; return i; }
|
|
749
|
+
if (name_hash == 0) { *attr_out = NULL; *found = 1; return i; }
|
|
750
|
+
}
|
|
751
|
+
i = (i + 1) & (cap - 1);
|
|
752
|
+
}
|
|
753
|
+
return (size_t)-1; /* full (cannot happen: rehash keeps load < 0.7) */
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
static void attr_index_rehash(struct leptris_attr_index* ix) {
|
|
757
|
+
size_t ncap = ix->cap * 2;
|
|
758
|
+
struct leptris_attr_index_entry* ns = (struct leptris_attr_index_entry*)
|
|
759
|
+
calloc(ncap, sizeof(struct leptris_attr_index_entry));
|
|
760
|
+
if (!ns) return; /* stay at old size; probe loop tolerates it */
|
|
761
|
+
for (size_t i = 0; i < ix->cap; i++) {
|
|
762
|
+
struct leptris_attr_index_entry e = ix->slots[i];
|
|
763
|
+
if (!e.elem && !e.attr) continue;
|
|
764
|
+
if (!e.attr && e.name_hash != 0) continue; /* drop tombstones */
|
|
765
|
+
size_t j = attr_index_slot(e.elem, e.name_hash, ncap);
|
|
766
|
+
while (ns[j].elem || ns[j].attr) j = (j + 1) & (ncap - 1);
|
|
767
|
+
ns[j] = e;
|
|
768
|
+
}
|
|
769
|
+
free(ix->slots);
|
|
770
|
+
ix->slots = ns;
|
|
771
|
+
ix->cap = ncap;
|
|
772
|
+
ix->used = 0;
|
|
773
|
+
for (size_t i = 0; i < ncap; i++) {
|
|
774
|
+
if (ns[i].elem || ns[i].attr) ix->used++;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
static void attr_index_put(struct leptris_attr_index* ix, LeptrisElement elem,
|
|
779
|
+
uint32_t name_hash,
|
|
780
|
+
struct leptris_attribute* attr, size_t slot) {
|
|
781
|
+
if (slot >= ix->cap) {
|
|
782
|
+
attr_index_rehash(ix);
|
|
783
|
+
struct leptris_attribute* dummy;
|
|
784
|
+
int f;
|
|
785
|
+
slot = attr_index_probe(ix, elem, name_hash, &dummy, &f);
|
|
786
|
+
if (slot == (size_t)-1) return;
|
|
787
|
+
}
|
|
788
|
+
struct leptris_attr_index_entry* e = &ix->slots[slot];
|
|
789
|
+
if (!e->elem && !e->attr) ix->used++;
|
|
790
|
+
e->elem = elem;
|
|
791
|
+
e->name_hash = name_hash;
|
|
792
|
+
e->attr = attr;
|
|
793
|
+
if (ix->used * 10 >= ix->cap * 7) attr_index_rehash(ix);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/* Bulk-register every attr of `elem` plus the (elem, 0) sentinel so
|
|
797
|
+
* later probes are authoritative. Falls back silently (index stays
|
|
798
|
+
* partial) only on allocation failure — callers must then use the
|
|
799
|
+
* list walk. */
|
|
800
|
+
static void attr_index_register(struct leptris_document* doc,
|
|
801
|
+
struct leptris_attr_index* ix,
|
|
802
|
+
LeptrisElement elem) {
|
|
803
|
+
struct leptris_attribute* dummy;
|
|
804
|
+
int found;
|
|
805
|
+
size_t slot = attr_index_probe(ix, elem, 0, &dummy, &found);
|
|
806
|
+
if (found || slot == (size_t)-1) return;
|
|
807
|
+
attr_index_put(ix, elem, 0, NULL, slot);
|
|
808
|
+
struct leptris_attribute* a = leptris_element_get_first_attribute(elem);
|
|
809
|
+
while (a) {
|
|
810
|
+
uint32_t h = attr_index_hash(attr_cname(a), a->name_view.length);
|
|
811
|
+
slot = attr_index_probe(ix, elem, h, &dummy, &found);
|
|
812
|
+
if (!found && slot != (size_t)-1) {
|
|
813
|
+
attr_index_put(ix, elem, h, a, slot);
|
|
814
|
+
}
|
|
815
|
+
a = leptris_attr_next(a);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/* O(1) duplicate check with lazy registration. Returns the existing
|
|
820
|
+
* attr or NULL; *ix_out/registered bookkeeping lets the caller
|
|
821
|
+
* insert the new attr without re-probing. */
|
|
822
|
+
static struct leptris_attribute* attr_index_lookup(
|
|
823
|
+
struct leptris_document* doc, LeptrisElement elem, const char* name,
|
|
824
|
+
size_t name_len, uint32_t name_hash,
|
|
825
|
+
struct leptris_attr_index** ix_out, size_t* insert_slot) {
|
|
826
|
+
*ix_out = NULL;
|
|
827
|
+
*insert_slot = (size_t)-1;
|
|
828
|
+
struct leptris_attr_index* ix = attr_index_get(doc);
|
|
829
|
+
if (!ix) return NULL;
|
|
830
|
+
attr_index_register(doc, ix, elem);
|
|
831
|
+
struct leptris_attribute* hit = NULL;
|
|
832
|
+
int found;
|
|
833
|
+
size_t slot = attr_index_probe(ix, elem, name_hash, &hit, &found);
|
|
834
|
+
if (slot == (size_t)-1) return NULL;
|
|
835
|
+
if (!found) {
|
|
836
|
+
*ix_out = ix;
|
|
837
|
+
*insert_slot = slot;
|
|
838
|
+
return NULL;
|
|
839
|
+
}
|
|
840
|
+
if (!hit) return NULL; /* sentinel-only element */
|
|
841
|
+
/* Confirm with the string (hash collisions). */
|
|
842
|
+
if (hit->name_view.length == name_len &&
|
|
843
|
+
memcmp(attr_cname(hit), name, name_len) == 0) {
|
|
844
|
+
return hit;
|
|
845
|
+
}
|
|
846
|
+
/* Collision with a different name: fall back to the walk. */
|
|
847
|
+
return leptris_element_get_attribute_by_name(elem, name);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
LeptrisStatus leptris_element_set_attribute(LeptrisElement elem, const char* name, const char* value) {
|
|
851
|
+
if (!elem || !name) return LEPTRIS_ERROR_NULL_ARG;
|
|
852
|
+
|
|
853
|
+
/* Mutation-path perf: skip the pool's string interning hash table
|
|
854
|
+
* (TODO 106 Phase 1). Interning deduplicates attribute NAMES that
|
|
855
|
+
* recur across many elements during parsing; on the public mutation
|
|
856
|
+
* path the user knows the attr is unique, and the hash lookup/insert
|
|
857
|
+
* is pure overhead — ~200ns × N attrs. Inline pool_alloc + memcpy
|
|
858
|
+
* is faster than leptris_sv_to_cstr_pooled for this case. */
|
|
859
|
+
|
|
860
|
+
/* Check if attribute already exists — O(1) via the doc-level
|
|
861
|
+
* attr-name index (lazy registration covers parse-created attrs);
|
|
862
|
+
* NULL index (alloc failure) falls back to the list walk. */
|
|
863
|
+
size_t set_name_len = leptris_cstr_len16(name);
|
|
864
|
+
uint32_t set_name_hash = 0;
|
|
865
|
+
struct leptris_document* set_doc = leptris_element_get_document(elem);
|
|
866
|
+
struct leptris_attr_index* set_ix = NULL;
|
|
867
|
+
size_t set_slot = (size_t)-1;
|
|
868
|
+
struct leptris_attribute* existing;
|
|
869
|
+
if (set_doc &&
|
|
870
|
+
((elem->header.flags & LEPTRIS_ATTR_INDEXED_FLAG) != 0 ||
|
|
871
|
+
elem->attr_count > ATTR_INDEX_WALK_MAX)) {
|
|
872
|
+
/* Lane 18: the flag latches — attr_count wraps at 255 and
|
|
873
|
+
* must never flip a high-attr element back to the walk. */
|
|
874
|
+
elem->header.flags |= LEPTRIS_ATTR_INDEXED_FLAG;
|
|
875
|
+
set_name_hash = attr_index_hash(name, set_name_len);
|
|
876
|
+
existing = attr_index_lookup(set_doc, elem, name, set_name_len,
|
|
877
|
+
set_name_hash, &set_ix, &set_slot);
|
|
878
|
+
} else {
|
|
879
|
+
/* Walk-first (small elements): set_ix stays NULL so the
|
|
880
|
+
* insert below skips the index put too. */
|
|
881
|
+
existing = leptris_dom_attr_find(elem, name, set_name_len);
|
|
882
|
+
}
|
|
883
|
+
if (existing) {
|
|
884
|
+
/* Update existing attribute's value. One resolution (the
|
|
885
|
+
* set_doc from the top of the function) — the old path
|
|
886
|
+
* re-climbed get_document/get_pool twice per overwrite. */
|
|
887
|
+
LeptrisMemoryPool* pool = set_doc ? set_doc->pool : NULL;
|
|
888
|
+
|
|
889
|
+
if (value) {
|
|
890
|
+
size_t vlen = leptris_cstr_len16(value);
|
|
891
|
+
if (LEPTRIS_ATTR_VALUE_CAN_INLINE && vlen <= LEPTRIS_ATTR_VALUE_MAX_INLINE) {
|
|
892
|
+
/* lane18 S1: small values store INLINE in the slot —
|
|
893
|
+
* zero allocation per overwrite. */
|
|
894
|
+
leptris_attr_value_set_inline(existing, value, vlen);
|
|
895
|
+
attr_set_entities(existing, 0);
|
|
896
|
+
return LEPTRIS_OK;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (pool) {
|
|
900
|
+
/* Pool-allocated document: pool_strdup the new value (no
|
|
901
|
+
* interning — see header comment). Old value is pool-
|
|
902
|
+
* allocated and reclaims when the pool frees. */
|
|
903
|
+
if (value) {
|
|
904
|
+
size_t vlen = leptris_cstr_len16(value);
|
|
905
|
+
char* storage = (char*)leptris_pool_alloc(pool, vlen + 1);
|
|
906
|
+
if (!storage) return LEPTRIS_ERROR_MEMORY;
|
|
907
|
+
memcpy(storage, value, vlen);
|
|
908
|
+
storage[vlen] = '\0';
|
|
909
|
+
leptris_attr_value_set_heap(existing, leptris_sv_from_ptr(storage, vlen));
|
|
910
|
+
} else {
|
|
911
|
+
leptris_attr_value_set_heap(existing, leptris_sv_empty());
|
|
912
|
+
}
|
|
913
|
+
attr_set_entities(existing, 0);
|
|
914
|
+
} else {
|
|
915
|
+
/* No pool available: views into the caller's string
|
|
916
|
+
* (fallback for edge cases — mutation API contract says
|
|
917
|
+
* the value string must outlive the attribute here). */
|
|
918
|
+
leptris_attr_value_set_heap(existing, value ? leptris_sv_from_cstr(value) : leptris_sv_empty());
|
|
919
|
+
attr_set_entities(existing, 0);
|
|
920
|
+
}
|
|
921
|
+
} else {
|
|
922
|
+
/* Get the memory pool from the document */
|
|
923
|
+
LeptrisMemoryPool* pool = NULL;
|
|
924
|
+
if (leptris_element_get_document(elem) && leptris_element_get_pool(elem)) {
|
|
925
|
+
pool = leptris_element_get_pool(elem);
|
|
926
|
+
} else {
|
|
927
|
+
/* CRITICAL: No pool available - cannot allocate attributes without memory pool */
|
|
928
|
+
return LEPTRIS_ERROR_MEMORY;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/* Round 22: struct from the per-doc attr bump block (adjacent
|
|
932
|
+
* attrs keep cp16 next-edges in-range); strings from the name
|
|
933
|
+
* block. Pool fallbacks preserve the never-fail contract. */
|
|
934
|
+
struct leptris_attribute* attr = mut_attr_carve(set_doc);
|
|
935
|
+
if (!attr) attr = (struct leptris_attribute*)leptris_pool_alloc(
|
|
936
|
+
pool, sizeof(struct leptris_attribute));
|
|
937
|
+
if (!attr) {
|
|
938
|
+
return LEPTRIS_ERROR_MEMORY;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
size_t nlen = strlen(name);
|
|
942
|
+
char* name_storage = mut_str_carve(set_doc, name, nlen);
|
|
943
|
+
if (!name_storage) {
|
|
944
|
+
name_storage = (char*)leptris_pool_alloc(pool, nlen + 1);
|
|
945
|
+
if (!name_storage) return LEPTRIS_ERROR_MEMORY;
|
|
946
|
+
memcpy(name_storage, name, nlen);
|
|
947
|
+
name_storage[nlen] = '\0';
|
|
948
|
+
}
|
|
949
|
+
attr->name_view = leptris_sv_from_ptr(name_storage, nlen);
|
|
950
|
+
|
|
951
|
+
/* Pre-compute name hash for O(1) lookup filtering (TODO 113).
|
|
952
|
+
* Round 19: 15-bit + entity flag share the field. */
|
|
953
|
+
attr->name_hash = attr_hash15(name_storage, nlen);
|
|
954
|
+
|
|
955
|
+
if (value) {
|
|
956
|
+
size_t vlen = leptris_cstr_len16(value);
|
|
957
|
+
if (LEPTRIS_ATTR_VALUE_CAN_INLINE && vlen <= LEPTRIS_ATTR_VALUE_MAX_INLINE) {
|
|
958
|
+
/* lane18 S1: small new values inline in the slot —
|
|
959
|
+
* no carve, no pool round-trip. */
|
|
960
|
+
leptris_attr_value_set_inline(attr, value, vlen);
|
|
961
|
+
} else {
|
|
962
|
+
char* value_storage = mut_str_carve(set_doc, value, vlen);
|
|
963
|
+
if (!value_storage) {
|
|
964
|
+
value_storage = (char*)leptris_pool_alloc(pool, vlen + 1);
|
|
965
|
+
if (!value_storage) return LEPTRIS_ERROR_MEMORY;
|
|
966
|
+
memcpy(value_storage, value, vlen);
|
|
967
|
+
value_storage[vlen] = '\0';
|
|
968
|
+
}
|
|
969
|
+
leptris_attr_value_set_heap(
|
|
970
|
+
attr, leptris_sv_from_ptr(value_storage, vlen));
|
|
971
|
+
}
|
|
972
|
+
} else {
|
|
973
|
+
leptris_attr_value_set_heap(attr, leptris_sv_empty());
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
attr->ns_cache_off = 0; /* TODO 173 */
|
|
977
|
+
leptris_attr_set_next(attr, NULL);
|
|
978
|
+
|
|
979
|
+
/* Append via the doc-level attr-tail cache — O(1) for the
|
|
980
|
+
* sequential case (the element struct carries no last-attr
|
|
981
|
+
* edge by the 64-byte layout law; the walk is O(attr_count)
|
|
982
|
+
* and made programmatic builds quadratic). */
|
|
983
|
+
struct leptris_attribute* last =
|
|
984
|
+
(set_doc && set_doc->mut_attr_elem == elem)
|
|
985
|
+
? set_doc->mut_attr_tail
|
|
986
|
+
: leptris_elem_last_attribute(elem);
|
|
987
|
+
if (last) {
|
|
988
|
+
leptris_attr_set_next(last, attr);
|
|
989
|
+
} else {
|
|
990
|
+
leptris_elem_set_first_attribute(elem, attr);
|
|
991
|
+
}
|
|
992
|
+
leptris_elem_set_last_attribute(elem, attr);
|
|
993
|
+
if (set_doc) {
|
|
994
|
+
set_doc->mut_attr_elem = elem;
|
|
995
|
+
set_doc->mut_attr_tail = attr;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
elem->attr_count++;
|
|
999
|
+
|
|
1000
|
+
if (set_ix && set_slot != (size_t)-1) {
|
|
1001
|
+
attr_index_put(set_ix, elem, set_name_hash, attr, set_slot);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/* COW: Increment version */
|
|
1006
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(elem));
|
|
1007
|
+
|
|
1008
|
+
return LEPTRIS_OK;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Remove attribute (Public API)
|
|
1013
|
+
*/
|
|
1014
|
+
LeptrisStatus leptris_element_remove_attribute(LeptrisElement elem, const char* name) {
|
|
1015
|
+
if (!elem || !name) return LEPTRIS_ERROR_NULL_ARG;
|
|
1016
|
+
|
|
1017
|
+
struct leptris_document* rm_doc = leptris_element_get_document(elem);
|
|
1018
|
+
uint32_t rm_hash = attr_index_hash(name, strlen(name));
|
|
1019
|
+
|
|
1020
|
+
struct leptris_attribute* attr = leptris_element_get_first_attribute(elem);
|
|
1021
|
+
struct leptris_attribute* prev = NULL;
|
|
1022
|
+
|
|
1023
|
+
while (attr) {
|
|
1024
|
+
const char* attr_name = attr_cname(attr);
|
|
1025
|
+
|
|
1026
|
+
int match = 0;
|
|
1027
|
+
if (attr_name) {
|
|
1028
|
+
match = (strcmp(attr_name, name) == 0);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
if (match) {
|
|
1032
|
+
/* Found - remove from linked list */
|
|
1033
|
+
if (prev) {
|
|
1034
|
+
leptris_attr_set_next(prev, leptris_attr_next(attr));
|
|
1035
|
+
} else {
|
|
1036
|
+
/* Was first attribute - update first_attribute pointer */
|
|
1037
|
+
if (leptris_attr_next(attr)) {
|
|
1038
|
+
leptris_element_set_first_attribute(elem, leptris_attr_next(attr));
|
|
1039
|
+
} else {
|
|
1040
|
+
/* No more attributes */
|
|
1041
|
+
leptris_element_set_first_attribute(elem, NULL);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/* CRITICAL: Don't free pool-allocated attributes!
|
|
1046
|
+
* Attributes are allocated from the memory pool and will be freed
|
|
1047
|
+
* when the pool is destroyed. If we free() them here, we get undefined behavior.
|
|
1048
|
+
* Just decrement the count and let the pool handle cleanup. */
|
|
1049
|
+
|
|
1050
|
+
/* CRITICAL: Don't free attribute strings!
|
|
1051
|
+
* Attributes created by parser or programmatically use pool allocation.
|
|
1052
|
+
* Pool-allocated strings cannot be individually freed - they will be
|
|
1053
|
+
* reclaimed when the entire document/pool is freed.
|
|
1054
|
+
* Trying to free() them here causes undefined behavior (Abort trap). */
|
|
1055
|
+
|
|
1056
|
+
/* Tombstone the index entry: the attr memory stays valid
|
|
1057
|
+
* (pool-backed) but is detached — a later set_attribute
|
|
1058
|
+
* must not resurrect it. */
|
|
1059
|
+
if (rm_doc && rm_doc->mut_attr_elem == elem &&
|
|
1060
|
+
rm_doc->mut_attr_tail == attr) {
|
|
1061
|
+
rm_doc->mut_attr_elem = NULL;
|
|
1062
|
+
rm_doc->mut_attr_tail = NULL;
|
|
1063
|
+
}
|
|
1064
|
+
if (rm_doc && rm_doc->attr_index) {
|
|
1065
|
+
struct leptris_attribute* dummy;
|
|
1066
|
+
int found;
|
|
1067
|
+
size_t slot = attr_index_probe(rm_doc->attr_index, elem,
|
|
1068
|
+
rm_hash, &dummy, &found);
|
|
1069
|
+
if (found && rm_doc->attr_index->slots[slot].attr == attr) {
|
|
1070
|
+
rm_doc->attr_index->slots[slot].attr = NULL;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
elem->attr_count--;
|
|
1075
|
+
leptris_node_increment_version(LEPTRIS_ELEMENT_AS_NODE(elem));
|
|
1076
|
+
return LEPTRIS_OK;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
prev = attr;
|
|
1080
|
+
attr = leptris_attr_next(attr);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
return LEPTRIS_ERROR_NOT_FOUND; /* Attribute not found */
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/* element.c: attach a namespace declaration node to the element's
|
|
1087
|
+
* list (takes ownership; the pooled deep-copy path builds its own
|
|
1088
|
+
* pooled declarations). */
|
|
1089
|
+
int leptris_element_add_namespace(struct leptris_element* elem,
|
|
1090
|
+
struct leptris_namespace* ns);
|
|
1091
|
+
|
|
1092
|
+
/* #721: copy an element's namespace identity — the cached prefix and
|
|
1093
|
+
* namespace URI (the name is stored LOCAL; the prefix is a separate
|
|
1094
|
+
* cache slot) plus every xmlns:* declaration. Strings are duplicated
|
|
1095
|
+
* into the target pool (leptris_element_name_view shares the source
|
|
1096
|
+
* buffer cross-doc, and so do these). Call AFTER the copy is attached
|
|
1097
|
+
* or registered so get_pool/get_document resolve through the chain. */
|
|
1098
|
+
/* #804 perf: pool-threaded core of copy_element_namespaces — the
|
|
1099
|
+
* deep copier already knows the pool; resolving it through the
|
|
1100
|
+
* parent chain (root-map walk + TLS) per element dominated subtree
|
|
1101
|
+
* duplication profiles. */
|
|
1102
|
+
/* Returns 1 when any xmlns declaration was attached (the caller
|
|
1103
|
+
* sets the document's has_namespaces resolution gate). */
|
|
1104
|
+
static int copy_element_namespaces_pooled(LeptrisElement copy,
|
|
1105
|
+
LeptrisElement source,
|
|
1106
|
+
LeptrisMemoryPool* pool) {
|
|
1107
|
+
int any_decl = 0;
|
|
1108
|
+
if (!pool) return 0;
|
|
1109
|
+
char* pfx = leptris_elem_prefix(source);
|
|
1110
|
+
if (pfx) {
|
|
1111
|
+
LeptrisStringView pv = leptris_sv_from_cstr(pfx);
|
|
1112
|
+
leptris_elem_set_prefix(
|
|
1113
|
+
copy, leptris_sv_to_cstr_pooled(&pv, pool), pool);
|
|
1114
|
+
}
|
|
1115
|
+
char* uri = leptris_elem_ns_uri(source);
|
|
1116
|
+
if (uri) {
|
|
1117
|
+
LeptrisStringView uv = leptris_sv_from_cstr(uri);
|
|
1118
|
+
leptris_elem_set_ns_uri(
|
|
1119
|
+
copy, leptris_sv_to_cstr_pooled(&uv, pool), pool);
|
|
1120
|
+
}
|
|
1121
|
+
for (int i = 0;; i++) {
|
|
1122
|
+
const char* np = leptris_element_namespace_decl_prefix(source, i);
|
|
1123
|
+
const char* nu = leptris_element_namespace_decl_uri(source, i);
|
|
1124
|
+
if (!nu) break;
|
|
1125
|
+
/* Pool-owned declaration linked through the THREADED pool.
|
|
1126
|
+
* The public leptris_element_add_namespace re-resolves the
|
|
1127
|
+
* pool via get_document — the detached copy is NOT
|
|
1128
|
+
* root-registered mid-recursion, so that path silently
|
|
1129
|
+
* dropped every declaration (#812) or heap-leaked (the
|
|
1130
|
+
* mutator's fallback, PR #806). The head accessor is the
|
|
1131
|
+
* same one add_namespace writes. */
|
|
1132
|
+
const char* norm = (np && !*np) ? NULL : np;
|
|
1133
|
+
struct leptris_namespace* ns =
|
|
1134
|
+
leptris_namespace_new_pooled(norm, nu, pool);
|
|
1135
|
+
if (!ns) break;
|
|
1136
|
+
ns->next = NULL;
|
|
1137
|
+
struct leptris_namespace** head =
|
|
1138
|
+
leptris_elem_namespaces_ptr(copy, pool);
|
|
1139
|
+
if (!head) break;
|
|
1140
|
+
if (!*head) {
|
|
1141
|
+
*head = ns;
|
|
1142
|
+
} else {
|
|
1143
|
+
struct leptris_namespace* tail = *head;
|
|
1144
|
+
while (tail->next) tail = tail->next;
|
|
1145
|
+
tail->next = ns;
|
|
1146
|
+
}
|
|
1147
|
+
any_decl = 1;
|
|
1148
|
+
}
|
|
1149
|
+
return any_decl;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
static void copy_element_namespaces(LeptrisElement copy, LeptrisElement source,
|
|
1153
|
+
LeptrisElement parent) {
|
|
1154
|
+
LeptrisMemoryPool* pool = leptris_element_get_pool(parent);
|
|
1155
|
+
if (!pool) return;
|
|
1156
|
+
copy_element_namespaces_pooled(copy, source, pool);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Append copy of element (Public API)
|
|
1161
|
+
*/
|
|
1162
|
+
LeptrisElement leptris_element_append_copy(LeptrisElement parent, LeptrisElement source) {
|
|
1163
|
+
if (!parent || !source) return NULL;
|
|
1164
|
+
|
|
1165
|
+
/* CRITICAL: Check document pointer FIRST before any other access!
|
|
1166
|
+
* Use volatile to prevent compiler from reordering this check. */
|
|
1167
|
+
volatile struct leptris_document* parent_doc = leptris_element_get_document(parent);
|
|
1168
|
+
if (!parent_doc) {
|
|
1169
|
+
return NULL;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
if (!parent_doc->pool) {
|
|
1173
|
+
return NULL;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/* Verify source has document too */
|
|
1177
|
+
if (!leptris_element_get_document(source)) {
|
|
1178
|
+
return NULL; /* Source element must have a document */
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
/* Get source name as StringView (zero-copy, O(1) access) */
|
|
1182
|
+
LeptrisStringView name_view = leptris_element_name_view(source);
|
|
1183
|
+
if (leptris_sv_is_empty(&name_view)) return NULL;
|
|
1184
|
+
|
|
1185
|
+
/* Check if this is a cross-document copy */
|
|
1186
|
+
int is_cross_doc = (leptris_element_get_document(source) != leptris_element_get_document(parent));
|
|
1187
|
+
|
|
1188
|
+
/* For cross-document copies, we need to copy the name string data
|
|
1189
|
+
* because the StringView points to the source document's XML buffer */
|
|
1190
|
+
LeptrisStringView name_copy_view = name_view; /* Default: use original StringView */
|
|
1191
|
+
if (is_cross_doc) {
|
|
1192
|
+
/* Double-check that target pool is valid before allocating */
|
|
1193
|
+
if (!leptris_element_get_pool(parent)) {
|
|
1194
|
+
return NULL; /* Pool became NULL somehow */
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/* Allocate and copy name string to target document's pool */
|
|
1198
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&name_view, leptris_element_get_pool(parent));
|
|
1199
|
+
if (!name_copy) return NULL;
|
|
1200
|
+
name_copy_view = leptris_sv_from_cstr(name_copy);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/* Fast path: Simple element (no attributes, no children) - skip all loops */
|
|
1204
|
+
if (!leptris_element_get_first_attribute(source) && !leptris_elem_first_child(source)) {
|
|
1205
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1206
|
+
if (!copy) return NULL;
|
|
1207
|
+
if (leptris_element_append_child(parent, copy) != LEPTRIS_OK) {
|
|
1208
|
+
return NULL;
|
|
1209
|
+
}
|
|
1210
|
+
/* #721: namespaces — after append_child so pool/doc lookups
|
|
1211
|
+
* resolve through the parent chain. A bare <p:c/> takes this
|
|
1212
|
+
* path and must keep its binding. */
|
|
1213
|
+
copy_element_namespaces(copy, source, parent);
|
|
1214
|
+
return copy;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/* Create new element with StringView (no C string conversion!) */
|
|
1218
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1219
|
+
if (!copy) return NULL;
|
|
1220
|
+
|
|
1221
|
+
/* TODO 155 Phase A: register copy as a temporary root so recursive
|
|
1222
|
+
* child-copy calls can reach the pool via leptris_element_get_pool. */
|
|
1223
|
+
leptris_root_doc_register(copy, leptris_element_get_document(parent));
|
|
1224
|
+
|
|
1225
|
+
/* #721: namespaces — after registration so the internal
|
|
1226
|
+
* accessors can allocate the ns_cache through the pool. */
|
|
1227
|
+
copy_element_namespaces(copy, source, parent);
|
|
1228
|
+
|
|
1229
|
+
/* Copy attributes - optimized: direct StringView copy when same document */
|
|
1230
|
+
uint8_t attr_count = leptris_element_attribute_count(source);
|
|
1231
|
+
for (uint8_t i = 0; i < attr_count; i++) {
|
|
1232
|
+
struct leptris_attribute* attr = leptris_element_get_attribute_by_index(source, i);
|
|
1233
|
+
if (attr && !leptris_sv_is_empty(&attr->name_view)) {
|
|
1234
|
+
LeptrisStringView attr_name_view = attr->name_view;
|
|
1235
|
+
LeptrisStringView attr_value_view = leptris_attr_value_sv(attr);
|
|
1236
|
+
|
|
1237
|
+
/* For cross-document copies, copy the attribute string data */
|
|
1238
|
+
if (is_cross_doc) {
|
|
1239
|
+
/* Double-check that target pool is valid */
|
|
1240
|
+
if (!leptris_element_get_pool(parent)) {
|
|
1241
|
+
continue; /* Skip this attribute if pool is invalid */
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&attr->name_view, leptris_element_get_pool(parent));
|
|
1245
|
+
LeptrisStringView av_ = leptris_attr_value_sv(attr);
|
|
1246
|
+
char* value_copy =
|
|
1247
|
+
leptris_sv_to_cstr_pooled(&av_, leptris_element_get_pool(parent));
|
|
1248
|
+
if (!name_copy || !value_copy) {
|
|
1249
|
+
/* Allocation failed - skip this attribute */
|
|
1250
|
+
if (name_copy) /* Nothing to free, pool-allocated */
|
|
1251
|
+
if (value_copy) /* Nothing to free, pool-allocated */
|
|
1252
|
+
continue;
|
|
1253
|
+
}
|
|
1254
|
+
attr_name_view = leptris_sv_from_cstr(name_copy);
|
|
1255
|
+
attr_value_view = leptris_sv_from_cstr(value_copy);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/* Use pool-based fast path if available, otherwise fallback to set_attribute
|
|
1259
|
+
* Pool path is 2-3x faster (no hash lookup, no string conversion) */
|
|
1260
|
+
if (leptris_element_get_pool(parent)) {
|
|
1261
|
+
leptris_element_add_attribute(copy, attr_name_view, attr_value_view, leptris_element_get_pool(parent));
|
|
1262
|
+
} else {
|
|
1263
|
+
/* Fallback: C-string API (views are always valid C
|
|
1264
|
+
* strings under the single representation). */
|
|
1265
|
+
const char* attr_name = attr_cname(attr);
|
|
1266
|
+
const char* attr_value = attr_cvalue(attr);
|
|
1267
|
+
if (attr_name && attr_value) {
|
|
1268
|
+
leptris_element_set_attribute(copy, attr_name, attr_value);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
/* Copy children recursively */
|
|
1275
|
+
LeptrisElement child = (LeptrisElement)leptris_elem_first_child(source);
|
|
1276
|
+
|
|
1277
|
+
/* SAFETY: Verify child pointer is valid before accessing.
|
|
1278
|
+
* Small values like 0x4 indicate memory corruption or uninitialized fields. */
|
|
1279
|
+
while (child) {
|
|
1280
|
+
/* Check if pointer looks valid (not obviously corrupted)
|
|
1281
|
+
* Values less than 0x1000 are likely invalid pointers or offsets */
|
|
1282
|
+
if ((uintptr_t)child < 0x1000) {
|
|
1283
|
+
/* Invalid pointer - skip this child to prevent crash */
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
/* Additional safety: Check if pointer points to readable memory
|
|
1288
|
+
* by verifying the type field is within valid range */
|
|
1289
|
+
LeptrisNode* child_node = (LeptrisNode*)child;
|
|
1290
|
+
|
|
1291
|
+
if (child_node->type < LEPTRIS_NODE_TYPE_ELEMENT ||
|
|
1292
|
+
child_node->type > LEPTRIS_NODE_TYPE_DOCTYPE) {
|
|
1293
|
+
/* Invalid type field - likely corrupted or pointing to wrong memory */
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
if (child_node->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1298
|
+
/* Recursively copy element child */
|
|
1299
|
+
leptris_element_append_copy(copy, child);
|
|
1300
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
1301
|
+
LeptrisTextNode* text = (LeptrisTextNode*)child;
|
|
1302
|
+
/* SAFETY: Verify text pointer is valid before accessing content */
|
|
1303
|
+
if ((uintptr_t)text > 0x1000) {
|
|
1304
|
+
LeptrisTextNode* text_copy = leptris_text_create(text->content,
|
|
1305
|
+
text->content_len,
|
|
1306
|
+
leptris_element_get_pool(copy));
|
|
1307
|
+
if (text_copy) {
|
|
1308
|
+
leptris_element_append_child_internal(copy, (LeptrisNode*)text_copy);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_CDATA) {
|
|
1312
|
+
LeptrisCDATANode* cdata = (LeptrisCDATANode*)child;
|
|
1313
|
+
if ((uintptr_t)cdata > 0x1000) {
|
|
1314
|
+
LeptrisCDATANode* cdata_copy = leptris_cdata_create(cdata->content,
|
|
1315
|
+
cdata->content ? strlen(cdata->content) : 0,
|
|
1316
|
+
leptris_element_get_pool(copy));
|
|
1317
|
+
if (cdata_copy) {
|
|
1318
|
+
leptris_element_append_child_internal(copy, (LeptrisNode*)cdata_copy);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
/* COMMENT and PI children copy too (issue #696 — the copy
|
|
1323
|
+
* loop used to drop them silently at every level). */
|
|
1324
|
+
else if (child_node->type == LEPTRIS_NODE_TYPE_COMMENT) {
|
|
1325
|
+
LeptrisCommentNode* cm = (LeptrisCommentNode*)child;
|
|
1326
|
+
if ((uintptr_t)cm > 0x1000 && cm->content) {
|
|
1327
|
+
LeptrisCommentNode* cc = leptris_comment_create(
|
|
1328
|
+
cm->content, strlen(cm->content),
|
|
1329
|
+
leptris_element_get_pool(copy));
|
|
1330
|
+
if (cc)
|
|
1331
|
+
leptris_element_append_child_internal(copy,
|
|
1332
|
+
(LeptrisNode*)cc);
|
|
1333
|
+
}
|
|
1334
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_PI) {
|
|
1335
|
+
LeptrisPINode* pi = (LeptrisPINode*)child;
|
|
1336
|
+
if ((uintptr_t)pi > 0x1000) {
|
|
1337
|
+
LeptrisPINode* pc = leptris_pi_create(
|
|
1338
|
+
pi->target, pi->target ? strlen(pi->target) : 0,
|
|
1339
|
+
pi->data ? pi->data : "",
|
|
1340
|
+
pi->data ? strlen(pi->data) : 0,
|
|
1341
|
+
leptris_element_get_pool(copy));
|
|
1342
|
+
if (pc)
|
|
1343
|
+
leptris_element_append_child_internal(copy,
|
|
1344
|
+
(LeptrisNode*)pc);
|
|
1345
|
+
}
|
|
1346
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_ENTITY_REF) {
|
|
1347
|
+
LeptrisEntityRefNode* er = (LeptrisEntityRefNode*)child;
|
|
1348
|
+
if (er->name) {
|
|
1349
|
+
LeptrisEntityRefNode* ec = leptris_entity_ref_create(
|
|
1350
|
+
er->name, strlen(er->name),
|
|
1351
|
+
leptris_element_get_pool(copy));
|
|
1352
|
+
if (ec)
|
|
1353
|
+
leptris_element_append_child_internal(copy,
|
|
1354
|
+
(LeptrisNode*)ec);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
/* CRITICAL FIX: Get next sibling using generic accessor
|
|
1359
|
+
* The child variable is declared as LeptrisElement but might actually
|
|
1360
|
+
* point to a text node or other node type. Each node type has next_sibling
|
|
1361
|
+
* at a different offset, so we must use the generic accessor.
|
|
1362
|
+
* Note: child_node is already declared above at line 598 */
|
|
1363
|
+
LeptrisNode* next = leptris_node_get_next_sibling(child_node);
|
|
1364
|
+
if (!next) {
|
|
1365
|
+
/* No more siblings */
|
|
1366
|
+
break;
|
|
1367
|
+
}
|
|
1368
|
+
child = (LeptrisElement)next;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/* Append to parent */
|
|
1372
|
+
if (leptris_element_append_child(parent, copy) != LEPTRIS_OK) {
|
|
1373
|
+
/* Note: copy is pool-allocated, will be freed with document */
|
|
1374
|
+
return NULL;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
return copy;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* Prepend copy of element (Public API)
|
|
1382
|
+
*/
|
|
1383
|
+
LeptrisElement leptris_element_prepend_copy(LeptrisElement parent, LeptrisElement source) {
|
|
1384
|
+
if (!parent || !source) return NULL;
|
|
1385
|
+
|
|
1386
|
+
/* Get source name as StringView (zero-copy, O(1) access) */
|
|
1387
|
+
LeptrisStringView name_view = leptris_element_name_view(source);
|
|
1388
|
+
if (leptris_sv_is_empty(&name_view)) return NULL;
|
|
1389
|
+
|
|
1390
|
+
/* Check if this is a cross-document copy */
|
|
1391
|
+
int is_cross_doc = (leptris_element_get_document(source) != leptris_element_get_document(parent));
|
|
1392
|
+
|
|
1393
|
+
/* For cross-document copies, we need to copy the name string data
|
|
1394
|
+
* because the StringView points to the source document's XML buffer */
|
|
1395
|
+
LeptrisStringView name_copy_view = name_view; /* Default: use original StringView */
|
|
1396
|
+
if (is_cross_doc) {
|
|
1397
|
+
/* Allocate and copy name string to target document's pool */
|
|
1398
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&name_view, leptris_element_get_pool(parent));
|
|
1399
|
+
if (!name_copy) return NULL;
|
|
1400
|
+
name_copy_view = leptris_sv_from_cstr(name_copy);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/* Fast path: Simple element (no attributes, no children) */
|
|
1404
|
+
if (!leptris_element_get_first_attribute(source) && !leptris_elem_first_child(source)) {
|
|
1405
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1406
|
+
if (!copy) return NULL;
|
|
1407
|
+
if (leptris_element_prepend_child(parent, copy) != LEPTRIS_OK) {
|
|
1408
|
+
return NULL;
|
|
1409
|
+
}
|
|
1410
|
+
return copy;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/* Create new element with StringView (no C string conversion!) */
|
|
1414
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1415
|
+
if (!copy) return NULL;
|
|
1416
|
+
|
|
1417
|
+
/* TODO 155 Phase A: register copy as a temporary root so recursive
|
|
1418
|
+
* child-copy calls can reach the pool via leptris_element_get_pool. */
|
|
1419
|
+
leptris_root_doc_register(copy, leptris_element_get_document(parent));
|
|
1420
|
+
|
|
1421
|
+
/* Copy attributes - optimized: direct StringView copy when same document */
|
|
1422
|
+
uint8_t attr_count = leptris_element_attribute_count(source);
|
|
1423
|
+
for (uint8_t i = 0; i < attr_count; i++) {
|
|
1424
|
+
struct leptris_attribute* attr = leptris_element_get_attribute_by_index(source, i);
|
|
1425
|
+
if (attr && !leptris_sv_is_empty(&attr->name_view)) {
|
|
1426
|
+
LeptrisStringView attr_name_view = attr->name_view;
|
|
1427
|
+
LeptrisStringView attr_value_view = leptris_attr_value_sv(attr);
|
|
1428
|
+
|
|
1429
|
+
/* For cross-document copies, copy the attribute string data */
|
|
1430
|
+
if (is_cross_doc) {
|
|
1431
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&attr->name_view, leptris_element_get_pool(parent));
|
|
1432
|
+
LeptrisStringView av_ = leptris_attr_value_sv(attr);
|
|
1433
|
+
char* value_copy =
|
|
1434
|
+
leptris_sv_to_cstr_pooled(&av_, leptris_element_get_pool(parent));
|
|
1435
|
+
if (!name_copy || !value_copy) {
|
|
1436
|
+
/* Allocation failed - skip this attribute */
|
|
1437
|
+
if (name_copy) /* Nothing to free, pool-allocated */
|
|
1438
|
+
if (value_copy) /* Nothing to free, pool-allocated */
|
|
1439
|
+
continue;
|
|
1440
|
+
}
|
|
1441
|
+
attr_name_view = leptris_sv_from_cstr(name_copy);
|
|
1442
|
+
attr_value_view = leptris_sv_from_cstr(value_copy);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/* Use pool-based fast path if available, otherwise fallback to set_attribute
|
|
1446
|
+
* Pool path is 2-3x faster (no hash lookup, no string conversion) */
|
|
1447
|
+
if (leptris_element_get_pool(parent)) {
|
|
1448
|
+
leptris_element_add_attribute(copy, attr_name_view, attr_value_view, leptris_element_get_pool(parent));
|
|
1449
|
+
} else {
|
|
1450
|
+
/* Fallback: C-string API (views are always valid C
|
|
1451
|
+
* strings under the single representation). */
|
|
1452
|
+
const char* attr_name = attr_cname(attr);
|
|
1453
|
+
const char* attr_value = attr_cvalue(attr);
|
|
1454
|
+
if (attr_name && attr_value) {
|
|
1455
|
+
leptris_element_set_attribute(copy, attr_name, attr_value);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/* Copy children recursively */
|
|
1462
|
+
LeptrisElement child = (LeptrisElement)leptris_elem_first_child(source);
|
|
1463
|
+
while (child) {
|
|
1464
|
+
LeptrisNode* child_node = (LeptrisNode*)child;
|
|
1465
|
+
if (child_node->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1466
|
+
/* Recursively copy element child */
|
|
1467
|
+
leptris_element_append_copy(copy, child);
|
|
1468
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
1469
|
+
LeptrisTextNode* text = (LeptrisTextNode*)child;
|
|
1470
|
+
LeptrisTextNode* text_copy = leptris_text_create(text->content,
|
|
1471
|
+
text->content_len,
|
|
1472
|
+
leptris_element_get_pool(copy));
|
|
1473
|
+
if (text_copy) {
|
|
1474
|
+
leptris_element_append_child_internal(copy, (LeptrisNode*)text_copy);
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
/* Use generic accessor to get next sibling - child might be any node type */
|
|
1478
|
+
LeptrisNode* next = leptris_node_get_next_sibling(child_node);
|
|
1479
|
+
if (!next) break;
|
|
1480
|
+
child = (LeptrisElement)next;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/* Prepend to parent */
|
|
1484
|
+
if (leptris_element_prepend_child(parent, copy) != LEPTRIS_OK) {
|
|
1485
|
+
return NULL;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
return copy;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
/**
|
|
1492
|
+
* Insert copy after sibling (Public API)
|
|
1493
|
+
*/
|
|
1494
|
+
LeptrisElement leptris_element_insert_copy_after(LeptrisElement sibling, LeptrisElement source) {
|
|
1495
|
+
if (!sibling || !source) return NULL;
|
|
1496
|
+
|
|
1497
|
+
/* Get parent of sibling */
|
|
1498
|
+
LeptrisElement parent = leptris_element_parent(sibling);
|
|
1499
|
+
if (!parent) return NULL;
|
|
1500
|
+
|
|
1501
|
+
/* Get source name as StringView (zero-copy, O(1) access) */
|
|
1502
|
+
LeptrisStringView name_view = leptris_element_name_view(source);
|
|
1503
|
+
if (leptris_sv_is_empty(&name_view)) return NULL;
|
|
1504
|
+
|
|
1505
|
+
/* Check if this is a cross-document copy */
|
|
1506
|
+
int is_cross_doc = (leptris_element_get_document(source) != leptris_element_get_document(parent));
|
|
1507
|
+
|
|
1508
|
+
/* For cross-document copies, we need to copy the name string data
|
|
1509
|
+
* because the StringView points to the source document's XML buffer */
|
|
1510
|
+
LeptrisStringView name_copy_view = name_view; /* Default: use original StringView */
|
|
1511
|
+
if (is_cross_doc) {
|
|
1512
|
+
/* Allocate and copy name string to target document's pool */
|
|
1513
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&name_view, leptris_element_get_pool(parent));
|
|
1514
|
+
if (!name_copy) return NULL;
|
|
1515
|
+
name_copy_view = leptris_sv_from_cstr(name_copy);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/* Fast path: Simple element (no attributes, no children) */
|
|
1519
|
+
if (!leptris_element_get_first_attribute(source) && !leptris_elem_first_child(source)) {
|
|
1520
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1521
|
+
if (!copy) return NULL;
|
|
1522
|
+
if (leptris_element_insert_after(sibling, copy) != LEPTRIS_OK) {
|
|
1523
|
+
return NULL;
|
|
1524
|
+
}
|
|
1525
|
+
return copy;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/* Create new element with StringView (no C string conversion!) */
|
|
1529
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1530
|
+
if (!copy) return NULL;
|
|
1531
|
+
|
|
1532
|
+
/* TODO 155 Phase A: register copy as a temporary root so recursive
|
|
1533
|
+
* child-copy calls can reach the pool via leptris_element_get_pool. */
|
|
1534
|
+
leptris_root_doc_register(copy, leptris_element_get_document(parent));
|
|
1535
|
+
|
|
1536
|
+
/* Copy attributes - optimized: direct StringView copy when same document */
|
|
1537
|
+
uint8_t attr_count = leptris_element_attribute_count(source);
|
|
1538
|
+
for (uint8_t i = 0; i < attr_count; i++) {
|
|
1539
|
+
struct leptris_attribute* attr = leptris_element_get_attribute_by_index(source, i);
|
|
1540
|
+
if (attr && !leptris_sv_is_empty(&attr->name_view)) {
|
|
1541
|
+
LeptrisStringView attr_name_view = attr->name_view;
|
|
1542
|
+
LeptrisStringView attr_value_view = leptris_attr_value_sv(attr);
|
|
1543
|
+
|
|
1544
|
+
/* For cross-document copies, copy the attribute string data */
|
|
1545
|
+
if (is_cross_doc) {
|
|
1546
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&attr->name_view, leptris_element_get_pool(parent));
|
|
1547
|
+
LeptrisStringView av_ = leptris_attr_value_sv(attr);
|
|
1548
|
+
char* value_copy =
|
|
1549
|
+
leptris_sv_to_cstr_pooled(&av_, leptris_element_get_pool(parent));
|
|
1550
|
+
if (!name_copy || !value_copy) {
|
|
1551
|
+
/* Allocation failed - skip this attribute */
|
|
1552
|
+
if (name_copy) /* Nothing to free, pool-allocated */
|
|
1553
|
+
if (value_copy) /* Nothing to free, pool-allocated */
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
attr_name_view = leptris_sv_from_cstr(name_copy);
|
|
1557
|
+
attr_value_view = leptris_sv_from_cstr(value_copy);
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/* Use pool-based fast path if available, otherwise fallback to set_attribute
|
|
1561
|
+
* Pool path is 2-3x faster (no hash lookup, no string conversion) */
|
|
1562
|
+
if (leptris_element_get_pool(parent)) {
|
|
1563
|
+
leptris_element_add_attribute(copy, attr_name_view, attr_value_view, leptris_element_get_pool(parent));
|
|
1564
|
+
} else {
|
|
1565
|
+
/* Fallback: C-string API (views are always valid C
|
|
1566
|
+
* strings under the single representation). */
|
|
1567
|
+
const char* attr_name = attr_cname(attr);
|
|
1568
|
+
const char* attr_value = attr_cvalue(attr);
|
|
1569
|
+
if (attr_name && attr_value) {
|
|
1570
|
+
leptris_element_set_attribute(copy, attr_name, attr_value);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
/* Copy children recursively */
|
|
1577
|
+
LeptrisElement child = (LeptrisElement)leptris_elem_first_child(source);
|
|
1578
|
+
while (child) {
|
|
1579
|
+
LeptrisNode* child_node = (LeptrisNode*)child;
|
|
1580
|
+
if (child_node->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1581
|
+
/* Recursively copy element child */
|
|
1582
|
+
leptris_element_append_copy(copy, child);
|
|
1583
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
1584
|
+
LeptrisTextNode* text = (LeptrisTextNode*)child;
|
|
1585
|
+
LeptrisTextNode* text_copy = leptris_text_create(text->content,
|
|
1586
|
+
text->content_len,
|
|
1587
|
+
leptris_element_get_pool(copy));
|
|
1588
|
+
if (text_copy) {
|
|
1589
|
+
leptris_element_append_child_internal(copy, (LeptrisNode*)text_copy);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
/* Use generic accessor to get next sibling - child might be any node type */
|
|
1593
|
+
LeptrisNode* next = leptris_node_get_next_sibling(child_node);
|
|
1594
|
+
if (!next) break;
|
|
1595
|
+
child = (LeptrisElement)next;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
/* Insert after sibling */
|
|
1599
|
+
if (leptris_element_insert_after(sibling, copy) != LEPTRIS_OK) {
|
|
1600
|
+
return NULL;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
return copy;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* Insert copy before sibling (Public API)
|
|
1608
|
+
*/
|
|
1609
|
+
LeptrisElement leptris_element_insert_copy_before(LeptrisElement sibling, LeptrisElement source) {
|
|
1610
|
+
if (!sibling || !source) return NULL;
|
|
1611
|
+
|
|
1612
|
+
/* Get parent of sibling */
|
|
1613
|
+
LeptrisElement parent = leptris_element_parent(sibling);
|
|
1614
|
+
if (!parent) return NULL;
|
|
1615
|
+
|
|
1616
|
+
/* Get source name as StringView (zero-copy, O(1) access) */
|
|
1617
|
+
LeptrisStringView name_view = leptris_element_name_view(source);
|
|
1618
|
+
if (leptris_sv_is_empty(&name_view)) return NULL;
|
|
1619
|
+
|
|
1620
|
+
/* Check if this is a cross-document copy */
|
|
1621
|
+
int is_cross_doc = (leptris_element_get_document(source) != leptris_element_get_document(parent));
|
|
1622
|
+
|
|
1623
|
+
/* For cross-document copies, we need to copy the name string data
|
|
1624
|
+
* because the StringView points to the source document's XML buffer */
|
|
1625
|
+
LeptrisStringView name_copy_view = name_view; /* Default: use original StringView */
|
|
1626
|
+
if (is_cross_doc) {
|
|
1627
|
+
/* Allocate and copy name string to target document's pool */
|
|
1628
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&name_view, leptris_element_get_pool(parent));
|
|
1629
|
+
if (!name_copy) return NULL;
|
|
1630
|
+
name_copy_view = leptris_sv_from_cstr(name_copy);
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/* Fast path: Simple element (no attributes, no children) */
|
|
1634
|
+
if (!leptris_element_get_first_attribute(source) && !leptris_elem_first_child(source)) {
|
|
1635
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1636
|
+
if (!copy) return NULL;
|
|
1637
|
+
if (leptris_element_insert_before(sibling, copy) != LEPTRIS_OK) {
|
|
1638
|
+
return NULL;
|
|
1639
|
+
}
|
|
1640
|
+
return copy;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
/* Create new element with StringView (no C string conversion!) */
|
|
1644
|
+
LeptrisElement copy = leptris_element_create_with_view(name_copy_view, leptris_element_get_pool(parent));
|
|
1645
|
+
if (!copy) return NULL;
|
|
1646
|
+
|
|
1647
|
+
/* TODO 155 Phase A: register copy as a temporary root so recursive
|
|
1648
|
+
* child-copy calls can reach the pool via leptris_element_get_pool. */
|
|
1649
|
+
leptris_root_doc_register(copy, leptris_element_get_document(parent));
|
|
1650
|
+
|
|
1651
|
+
/* Copy attributes - optimized: direct StringView copy when same document */
|
|
1652
|
+
uint8_t attr_count = leptris_element_attribute_count(source);
|
|
1653
|
+
for (uint8_t i = 0; i < attr_count; i++) {
|
|
1654
|
+
struct leptris_attribute* attr = leptris_element_get_attribute_by_index(source, i);
|
|
1655
|
+
if (attr && !leptris_sv_is_empty(&attr->name_view)) {
|
|
1656
|
+
LeptrisStringView attr_name_view = attr->name_view;
|
|
1657
|
+
LeptrisStringView attr_value_view = leptris_attr_value_sv(attr);
|
|
1658
|
+
|
|
1659
|
+
/* For cross-document copies, copy the attribute string data */
|
|
1660
|
+
if (is_cross_doc) {
|
|
1661
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&attr->name_view, leptris_element_get_pool(parent));
|
|
1662
|
+
LeptrisStringView av_ = leptris_attr_value_sv(attr);
|
|
1663
|
+
char* value_copy =
|
|
1664
|
+
leptris_sv_to_cstr_pooled(&av_, leptris_element_get_pool(parent));
|
|
1665
|
+
if (!name_copy || !value_copy) {
|
|
1666
|
+
/* Allocation failed - skip this attribute */
|
|
1667
|
+
if (name_copy) /* Nothing to free, pool-allocated */
|
|
1668
|
+
if (value_copy) /* Nothing to free, pool-allocated */
|
|
1669
|
+
continue;
|
|
1670
|
+
}
|
|
1671
|
+
attr_name_view = leptris_sv_from_cstr(name_copy);
|
|
1672
|
+
attr_value_view = leptris_sv_from_cstr(value_copy);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
/* Use pool-based fast path if available, otherwise fallback to set_attribute
|
|
1676
|
+
* Pool path is 2-3x faster (no hash lookup, no string conversion) */
|
|
1677
|
+
if (leptris_element_get_pool(parent)) {
|
|
1678
|
+
leptris_element_add_attribute(copy, attr_name_view, attr_value_view, leptris_element_get_pool(parent));
|
|
1679
|
+
} else {
|
|
1680
|
+
/* Fallback: C-string API (views are always valid C
|
|
1681
|
+
* strings under the single representation). */
|
|
1682
|
+
const char* attr_name = attr_cname(attr);
|
|
1683
|
+
const char* attr_value = attr_cvalue(attr);
|
|
1684
|
+
if (attr_name && attr_value) {
|
|
1685
|
+
leptris_element_set_attribute(copy, attr_name, attr_value);
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/* Copy children recursively */
|
|
1692
|
+
LeptrisElement child = (LeptrisElement)leptris_elem_first_child(source);
|
|
1693
|
+
while (child) {
|
|
1694
|
+
LeptrisNode* child_node = (LeptrisNode*)child;
|
|
1695
|
+
if (child_node->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1696
|
+
/* Recursively copy element child */
|
|
1697
|
+
leptris_element_append_copy(copy, child);
|
|
1698
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
1699
|
+
LeptrisTextNode* text = (LeptrisTextNode*)child;
|
|
1700
|
+
LeptrisTextNode* text_copy = leptris_text_create(text->content,
|
|
1701
|
+
text->content_len,
|
|
1702
|
+
leptris_element_get_pool(copy));
|
|
1703
|
+
if (text_copy) {
|
|
1704
|
+
leptris_element_append_child_internal(copy, (LeptrisNode*)text_copy);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
/* Use generic accessor to get next sibling - child might be any node type */
|
|
1708
|
+
LeptrisNode* next = leptris_node_get_next_sibling(child_node);
|
|
1709
|
+
if (!next) break;
|
|
1710
|
+
child = (LeptrisElement)next;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
/* Insert before sibling */
|
|
1714
|
+
if (leptris_element_insert_before(sibling, copy) != LEPTRIS_OK) {
|
|
1715
|
+
return NULL;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
return copy;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* Remove all children (Public API) - Alias for remove_all_children
|
|
1724
|
+
*/
|
|
1725
|
+
LeptrisStatus leptris_element_remove_children(LeptrisElement elem) {
|
|
1726
|
+
return leptris_element_remove_all_children(elem);
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/* ============================================================================
|
|
1730
|
+
* Bulk Allocation for Subtree Copy (Task 40)
|
|
1731
|
+
* ============================================================================ */
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* Internal: Build a map from source elements to pre-allocated copies
|
|
1735
|
+
*
|
|
1736
|
+
* This is used during bulk copy to link elements without knowing their
|
|
1737
|
+
* final addresses ahead of time. We allocate space for the map, then
|
|
1738
|
+
* build it while copying.
|
|
1739
|
+
*
|
|
1740
|
+
* @param pool Memory pool for allocations
|
|
1741
|
+
* @param count Number of elements in subtree
|
|
1742
|
+
* @return Pointer to element array, or NULL on failure
|
|
1743
|
+
*/
|
|
1744
|
+
static LeptrisElement* leptris_element_create_copy_map(LeptrisMemoryPool* pool, size_t count) {
|
|
1745
|
+
if (!pool || count == 0) return NULL;
|
|
1746
|
+
return (LeptrisElement*)leptris_pool_alloc(pool, sizeof(LeptrisElement) * count);
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
/**
|
|
1750
|
+
* Internal: Copy subtree using pre-allocated elements (bulk allocation)
|
|
1751
|
+
*
|
|
1752
|
+
* This function assumes elements have already been allocated and stored
|
|
1753
|
+
* in the copy_map array. It initializes each element and builds parent-child
|
|
1754
|
+
* relationships.
|
|
1755
|
+
*
|
|
1756
|
+
* @param parent_copy Parent element to attach copies to
|
|
1757
|
+
* @param source Source element to copy
|
|
1758
|
+
* @param copy_map Array of pre-allocated element copies
|
|
1759
|
+
* @param copy_index Pointer to current index in copy_map (updated during traversal)
|
|
1760
|
+
* @param pool Memory pool for additional allocations (attributes, strings)
|
|
1761
|
+
* @return The copy of the source element, or NULL on failure
|
|
1762
|
+
*/
|
|
1763
|
+
static LeptrisElement leptris_element_copy_subtree_bulk_internal(
|
|
1764
|
+
LeptrisElement parent_copy,
|
|
1765
|
+
LeptrisElement source,
|
|
1766
|
+
LeptrisElement* copy_map,
|
|
1767
|
+
size_t* copy_index,
|
|
1768
|
+
LeptrisMemoryPool* pool
|
|
1769
|
+
) {
|
|
1770
|
+
if (!source || !copy_map || !copy_index) return NULL;
|
|
1771
|
+
|
|
1772
|
+
/* Get current index and advance for children */
|
|
1773
|
+
size_t this_index = *copy_index;
|
|
1774
|
+
(*copy_index)++;
|
|
1775
|
+
|
|
1776
|
+
LeptrisElement copy = copy_map[this_index];
|
|
1777
|
+
if (!copy) return NULL;
|
|
1778
|
+
|
|
1779
|
+
/* Initialize the copy element with minimal memset (only what we need) */
|
|
1780
|
+
memset(copy, 0, sizeof(struct leptris_element));
|
|
1781
|
+
|
|
1782
|
+
/* Copy base node type */
|
|
1783
|
+
copy->base.type = LEPTRIS_NODE_TYPE_ELEMENT;
|
|
1784
|
+
|
|
1785
|
+
/* name_view removed (TODO 90) — name is already pool-strdup'd
|
|
1786
|
+
* by create_with_view during the deep_copy_element call above. */
|
|
1787
|
+
|
|
1788
|
+
/* Copy prefix and namespace as StringView (TODO 90) */
|
|
1789
|
+
/* prefix_view removed (TODO 90) — prefix is copied as char* below */;
|
|
1790
|
+
/* Phase 2e-B: copy namespace_uri through ns_cache. */
|
|
1791
|
+
{
|
|
1792
|
+
char* src_uri = leptris_elem_ns_uri(source);
|
|
1793
|
+
if (src_uri) {
|
|
1794
|
+
LeptrisMemoryPool* p = leptris_element_get_pool(copy);
|
|
1795
|
+
leptris_elem_set_ns_uri(copy, src_uri, p);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
/* Set parent pointer */
|
|
1800
|
+
leptris_elem_set_parent(copy, parent_copy);
|
|
1801
|
+
|
|
1802
|
+
/* Copy attributes */
|
|
1803
|
+
copy->attr_count = source->attr_count;
|
|
1804
|
+
|
|
1805
|
+
/* Copy attribute linked list - we need to allocate attributes individually
|
|
1806
|
+
* since they're stored as a compact pointer linked list */
|
|
1807
|
+
struct leptris_attribute* src_attr = leptris_element_get_first_attribute(source);
|
|
1808
|
+
struct leptris_attribute* prev_dst_attr = NULL;
|
|
1809
|
+
|
|
1810
|
+
while (src_attr) {
|
|
1811
|
+
/* Allocate attribute from pool */
|
|
1812
|
+
struct leptris_attribute* dst_attr = (struct leptris_attribute*)leptris_pool_alloc(pool, sizeof(struct leptris_attribute));
|
|
1813
|
+
if (!dst_attr) break;
|
|
1814
|
+
|
|
1815
|
+
/* Initialize attribute */
|
|
1816
|
+
memset(dst_attr, 0, sizeof(struct leptris_attribute));
|
|
1817
|
+
|
|
1818
|
+
/* Owned copies in the DESTINATION pool (single representation,
|
|
1819
|
+
* round 4): the source's views may point into the source
|
|
1820
|
+
* document's buffer, which can be freed before this copy. */
|
|
1821
|
+
if (!leptris_sv_is_empty(&src_attr->name_view)) {
|
|
1822
|
+
char* n = leptris_pool_strdup(pool, src_attr->name_view.data);
|
|
1823
|
+
if (n) dst_attr->name_view = leptris_sv_from_cstr(n);
|
|
1824
|
+
}
|
|
1825
|
+
LeptrisStringView svv_ = leptris_attr_value_sv(src_attr);
|
|
1826
|
+
if (!leptris_sv_is_empty(&svv_)) {
|
|
1827
|
+
char* v = leptris_pool_strdup(pool, leptris_attr_value_sv(src_attr).data);
|
|
1828
|
+
if (v) leptris_attr_value_set_heap(dst_attr, leptris_sv_from_cstr(v));
|
|
1829
|
+
}
|
|
1830
|
+
dst_attr->name_hash = src_attr->name_hash; /* hash + entity flag */
|
|
1831
|
+
dst_attr->ns_cache_off = 0; /* set below if source has cache */
|
|
1832
|
+
|
|
1833
|
+
/* Copy namespace cache if present (TODO 173). */
|
|
1834
|
+
struct leptris_attr_ns_cache* src_ns = attr_get_ns_cache(src_attr);
|
|
1835
|
+
if (src_ns) {
|
|
1836
|
+
struct leptris_attr_ns_cache* dst_ns =
|
|
1837
|
+
(struct leptris_attr_ns_cache*)leptris_pool_alloc(
|
|
1838
|
+
pool, sizeof(struct leptris_attr_ns_cache));
|
|
1839
|
+
if (dst_ns) {
|
|
1840
|
+
dst_ns->prefix_view = src_ns->prefix_view;
|
|
1841
|
+
dst_ns->namespace_uri_view = src_ns->namespace_uri_view;
|
|
1842
|
+
dst_ns->prefix = src_ns->prefix
|
|
1843
|
+
? leptris_pool_strdup(pool, src_ns->prefix) : NULL;
|
|
1844
|
+
dst_ns->namespace_uri = src_ns->namespace_uri
|
|
1845
|
+
? leptris_pool_strdup(pool, src_ns->namespace_uri) : NULL;
|
|
1846
|
+
attr_set_ns_cache(dst_attr, dst_ns);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
/* Entity flag: already carried in the copied name_hash
|
|
1851
|
+
* (bit 15, round 19). */
|
|
1852
|
+
|
|
1853
|
+
/* Link to previous attribute or set as first attribute */
|
|
1854
|
+
if (!prev_dst_attr) {
|
|
1855
|
+
leptris_elem_set_first_attribute(copy, dst_attr);
|
|
1856
|
+
} else {
|
|
1857
|
+
leptris_attr_set_next(prev_dst_attr, dst_attr);
|
|
1858
|
+
}
|
|
1859
|
+
leptris_elem_set_last_attribute(copy, dst_attr);
|
|
1860
|
+
prev_dst_attr = dst_attr;
|
|
1861
|
+
src_attr = leptris_attr_next(src_attr);
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/* Copy children recursively and link them */
|
|
1865
|
+
LeptrisElement first_child = NULL;
|
|
1866
|
+
LeptrisElement last_child = NULL;
|
|
1867
|
+
|
|
1868
|
+
LeptrisElement child = (LeptrisElement)leptris_elem_first_child(source);
|
|
1869
|
+
while (child) {
|
|
1870
|
+
LeptrisNode* child_node = (LeptrisNode*)child;
|
|
1871
|
+
|
|
1872
|
+
if (child_node->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1873
|
+
/* Recursively copy element child using bulk allocation */
|
|
1874
|
+
LeptrisElement child_copy = leptris_element_copy_subtree_bulk_internal(
|
|
1875
|
+
copy, child, copy_map, copy_index, pool
|
|
1876
|
+
);
|
|
1877
|
+
|
|
1878
|
+
if (child_copy) {
|
|
1879
|
+
/* Link to parent's child list */
|
|
1880
|
+
if (!first_child) {
|
|
1881
|
+
first_child = child_copy;
|
|
1882
|
+
}
|
|
1883
|
+
last_child = child_copy;
|
|
1884
|
+
}
|
|
1885
|
+
} else if (child_node->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
1886
|
+
/* Copy text node (not bulk-allocated) */
|
|
1887
|
+
LeptrisTextNode* text = (LeptrisTextNode*)child;
|
|
1888
|
+
LeptrisTextNode* text_copy = leptris_text_create(text->content,
|
|
1889
|
+
text->content_len,
|
|
1890
|
+
leptris_element_get_pool(copy));
|
|
1891
|
+
if (text_copy) {
|
|
1892
|
+
/* Link as child using internal function */
|
|
1893
|
+
leptris_element_append_child_internal(copy, (LeptrisNode*)text_copy);
|
|
1894
|
+
if (!first_child) {
|
|
1895
|
+
first_child = (LeptrisElement)text_copy;
|
|
1896
|
+
}
|
|
1897
|
+
if (last_child) {
|
|
1898
|
+
leptris_elem_set_next_sibling(last_child, (LeptrisNode*)text_copy);
|
|
1899
|
+
}
|
|
1900
|
+
last_child = (LeptrisElement)text_copy;
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
/* Use generic accessor to get next sibling - child might be any node type */
|
|
1905
|
+
LeptrisNode* next = leptris_node_get_next_sibling(child_node);
|
|
1906
|
+
if (!next) break;
|
|
1907
|
+
child = (LeptrisElement)next;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
/* Set child pointers */
|
|
1911
|
+
leptris_elem_set_first_child(copy, (LeptrisNode*)first_child);
|
|
1912
|
+
leptris_elem_set_last_child(copy, (LeptrisNode*)last_child);
|
|
1913
|
+
|
|
1914
|
+
/* Copy child count */
|
|
1915
|
+
copy->child_count = source->child_count;
|
|
1916
|
+
|
|
1917
|
+
return copy;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* Copy subtree using bulk allocation (10-15% faster for large subtrees)
|
|
1922
|
+
*
|
|
1923
|
+
* Pre-allocates all element structures in a single contiguous block,
|
|
1924
|
+
* then initializes them. This reduces:
|
|
1925
|
+
* - Pool allocation overhead (1 call vs N calls)
|
|
1926
|
+
* - memset calls (1 call vs N calls)
|
|
1927
|
+
* - Cache misses (contiguous memory access)
|
|
1928
|
+
*
|
|
1929
|
+
* @param parent Parent element to attach copy to
|
|
1930
|
+
* @param source Source element to copy
|
|
1931
|
+
* @return Copy of the source element, or NULL on failure
|
|
1932
|
+
*/
|
|
1933
|
+
LeptrisElement leptris_element_append_copy_bulk(LeptrisElement parent, LeptrisElement source) {
|
|
1934
|
+
if (!parent || !source) return NULL;
|
|
1935
|
+
if (!leptris_element_get_document(parent) || !leptris_element_get_pool(parent)) {
|
|
1936
|
+
/* Fallback to regular copy if no pool */
|
|
1937
|
+
return leptris_element_append_copy(parent, source);
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
LeptrisMemoryPool* pool = leptris_element_get_pool(parent);
|
|
1941
|
+
|
|
1942
|
+
/* Count subtree nodes to determine allocation size */
|
|
1943
|
+
LeptrisSubtreeStats stats;
|
|
1944
|
+
leptris_element_count_subtree(source, &stats);
|
|
1945
|
+
|
|
1946
|
+
size_t total_elements = stats.element_count;
|
|
1947
|
+
if (total_elements == 0) return NULL;
|
|
1948
|
+
|
|
1949
|
+
/* Allocate all element structures in one batch */
|
|
1950
|
+
LeptrisElement* copy_map = leptris_element_create_copy_map(pool, total_elements);
|
|
1951
|
+
if (!copy_map) {
|
|
1952
|
+
/* Fallback to regular copy if batch allocation fails */
|
|
1953
|
+
return leptris_element_append_copy(parent, source);
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
/* Copy the subtree using pre-allocated elements */
|
|
1957
|
+
size_t copy_index = 0;
|
|
1958
|
+
LeptrisElement copy = leptris_element_copy_subtree_bulk_internal(
|
|
1959
|
+
NULL, source, copy_map, ©_index, pool
|
|
1960
|
+
);
|
|
1961
|
+
|
|
1962
|
+
if (!copy) {
|
|
1963
|
+
return NULL;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
/* TODO 155 Phase A: document field removed; copy reaches doc
|
|
1967
|
+
* via parent chain once appended below. */
|
|
1968
|
+
|
|
1969
|
+
/* Attach to parent */
|
|
1970
|
+
if (leptris_element_append_child(parent, copy) != LEPTRIS_OK) {
|
|
1971
|
+
return NULL;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
return copy;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
/* #804 perf: detached deep-copy core. Threads the destination pool
|
|
1978
|
+
* through the recursion — no per-node document/pool resolution, no
|
|
1979
|
+
* per-element root-map registration (a malloc each), no public-API
|
|
1980
|
+
* mutation dispatch. The TOP copy registers in the root map once so
|
|
1981
|
+
* the detached tree still resolves its document; descendants reach
|
|
1982
|
+
* it through the parent chain they already carry. Fidelity matches
|
|
1983
|
+
* leptris_element_append_copy: elements, text, cdata, comment, PI
|
|
1984
|
+
* children (issue #696), attributes, and namespace declarations
|
|
1985
|
+
* (issue #721). */
|
|
1986
|
+
static LeptrisElement copy_subtree_detached(LeptrisElement source,
|
|
1987
|
+
LeptrisElement parent_copy,
|
|
1988
|
+
LeptrisMemoryPool* pool,
|
|
1989
|
+
struct leptris_document* doc) {
|
|
1990
|
+
LeptrisStringView name_view = leptris_element_name_view(source);
|
|
1991
|
+
if (leptris_sv_is_empty(&name_view)) return NULL;
|
|
1992
|
+
char* name_copy = leptris_sv_to_cstr_pooled(&name_view, pool);
|
|
1993
|
+
if (!name_copy) return NULL;
|
|
1994
|
+
LeptrisElement copy = leptris_element_create_with_view(
|
|
1995
|
+
leptris_sv_from_cstr(name_copy), pool);
|
|
1996
|
+
if (!copy) return NULL;
|
|
1997
|
+
leptris_elem_set_parent(copy, parent_copy);
|
|
1998
|
+
|
|
1999
|
+
if (copy_element_namespaces_pooled(copy, source, pool))
|
|
2000
|
+
doc->has_namespaces = 1;
|
|
2001
|
+
|
|
2002
|
+
for (struct leptris_attribute* sa =
|
|
2003
|
+
leptris_element_get_first_attribute(source);
|
|
2004
|
+
sa; sa = leptris_attr_next(sa)) {
|
|
2005
|
+
if (leptris_sv_is_empty(&sa->name_view)) continue;
|
|
2006
|
+
char* n = leptris_pool_strdup(pool, sa->name_view.data);
|
|
2007
|
+
if (!n) continue;
|
|
2008
|
+
LeptrisStringView sav_ = leptris_attr_value_sv(sa);
|
|
2009
|
+
char* v = leptris_sv_is_empty(&sav_)
|
|
2010
|
+
? NULL
|
|
2011
|
+
: leptris_pool_strdup(pool, sav_.data);
|
|
2012
|
+
LeptrisStringView nv = leptris_sv_from_cstr(n);
|
|
2013
|
+
LeptrisStringView vv =
|
|
2014
|
+
v ? leptris_sv_from_cstr(v) : leptris_sv_from_cstr("");
|
|
2015
|
+
leptris_element_add_attribute(copy, nv, vv, pool);
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
LeptrisNodeRef first = NULL;
|
|
2019
|
+
LeptrisNodeRef last = NULL;
|
|
2020
|
+
for (LeptrisNodeRef c = leptris_elem_first_child(source); c;
|
|
2021
|
+
c = leptris_node_get_next_sibling(c)) {
|
|
2022
|
+
int ty = leptris_node_get_type(c);
|
|
2023
|
+
LeptrisNodeRef cc = NULL;
|
|
2024
|
+
if (ty == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
2025
|
+
cc = (LeptrisNodeRef)copy_subtree_detached((LeptrisElement)c,
|
|
2026
|
+
copy, pool, doc);
|
|
2027
|
+
} else if (ty == LEPTRIS_NODE_TYPE_TEXT) {
|
|
2028
|
+
LeptrisTextNode* t = (LeptrisTextNode*)c;
|
|
2029
|
+
cc = (LeptrisNodeRef)leptris_text_create(t->content,
|
|
2030
|
+
t->content_len, pool);
|
|
2031
|
+
if (cc) leptris_textnode_set_parent((LeptrisTextNode*)cc, copy);
|
|
2032
|
+
} else if (ty == LEPTRIS_NODE_TYPE_CDATA) {
|
|
2033
|
+
LeptrisCDATANode* cd = (LeptrisCDATANode*)c;
|
|
2034
|
+
cc = (LeptrisNodeRef)leptris_cdata_create(
|
|
2035
|
+
cd->content, cd->content ? strlen(cd->content) : 0, pool);
|
|
2036
|
+
if (cc) leptris_cdata_set_parent((LeptrisCDATANode*)cc, copy);
|
|
2037
|
+
} else if (ty == LEPTRIS_NODE_TYPE_COMMENT) {
|
|
2038
|
+
LeptrisCommentNode* cm = (LeptrisCommentNode*)c;
|
|
2039
|
+
cc = (LeptrisNodeRef)leptris_comment_create(
|
|
2040
|
+
cm->content, cm->content ? strlen(cm->content) : 0, pool);
|
|
2041
|
+
if (cc)
|
|
2042
|
+
leptris_comment_set_parent((LeptrisCommentNode*)cc, copy);
|
|
2043
|
+
} else if (ty == LEPTRIS_NODE_TYPE_PI) {
|
|
2044
|
+
LeptrisPINode* pi = (LeptrisPINode*)c;
|
|
2045
|
+
cc = (LeptrisNodeRef)leptris_pi_create(
|
|
2046
|
+
pi->target, pi->target ? strlen(pi->target) : 0,
|
|
2047
|
+
pi->data ? pi->data : "",
|
|
2048
|
+
pi->data ? strlen(pi->data) : 0, pool);
|
|
2049
|
+
if (cc) leptris_pi_set_parent((LeptrisPINode*)cc, copy);
|
|
2050
|
+
} else if (ty == LEPTRIS_NODE_TYPE_ENTITY_REF) {
|
|
2051
|
+
LeptrisEntityRefNode* er = (LeptrisEntityRefNode*)c;
|
|
2052
|
+
cc = (LeptrisNodeRef)leptris_entity_ref_create(
|
|
2053
|
+
er->name, er->name ? strlen(er->name) : 0, pool);
|
|
2054
|
+
if (cc)
|
|
2055
|
+
leptris_entity_ref_set_parent((LeptrisEntityRefNode*)cc, copy);
|
|
2056
|
+
}
|
|
2057
|
+
if (!cc) continue;
|
|
2058
|
+
if (!first) {
|
|
2059
|
+
first = cc;
|
|
2060
|
+
} else {
|
|
2061
|
+
leptris_node_set_next_sibling(last, cc);
|
|
2062
|
+
}
|
|
2063
|
+
last = cc;
|
|
2064
|
+
}
|
|
2065
|
+
leptris_elem_set_first_child(copy, first);
|
|
2066
|
+
leptris_elem_set_last_child(copy, last);
|
|
2067
|
+
/* Issue #213 semantics: child_count counts ELEMENT children. */
|
|
2068
|
+
copy->child_count = source->child_count;
|
|
2069
|
+
return copy;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
/* Issue #148 Phase 1: detached deep copy.
|
|
2073
|
+
*
|
|
2074
|
+
* Copies the subtree into dest_doc's pool (one register of the copy
|
|
2075
|
+
* root keeps document resolution working while detached) and
|
|
2076
|
+
* returns it with no parent — the caller attaches it. All node
|
|
2077
|
+
* kinds, attributes, and namespace declarations survive (issues
|
|
2078
|
+
* #696/#721); leptris_document_free on dest_doc releases
|
|
2079
|
+
* everything. */
|
|
2080
|
+
LEPTRIS_API LeptrisElement leptris_element_copy(LeptrisElement src,
|
|
2081
|
+
LeptrisDocument dest_doc) {
|
|
2082
|
+
if (!src || !dest_doc) return NULL;
|
|
2083
|
+
if (!dest_doc->pool) return NULL;
|
|
2084
|
+
|
|
2085
|
+
/* Trigger lazy promote on dest so the pool is initialized. */
|
|
2086
|
+
leptris_document_ensure_promoted(dest_doc);
|
|
2087
|
+
|
|
2088
|
+
LeptrisElement copy =
|
|
2089
|
+
copy_subtree_detached(src, NULL, dest_doc->pool, dest_doc);
|
|
2090
|
+
if (!copy) return NULL;
|
|
2091
|
+
|
|
2092
|
+
/* Pool-named copies carry no name backpointer — one root-map
|
|
2093
|
+
* registration keeps the detached tree resolving to dest_doc. */
|
|
2094
|
+
leptris_root_doc_register(copy, dest_doc);
|
|
2095
|
+
return copy;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
|
|
2099
|
+
/* Full-document deep copy (Issue #148 Phase 1).
|
|
2100
|
+
*
|
|
2101
|
+
* Builds a fresh LeptrisDocument then uses leptris_element_copy to
|
|
2102
|
+
* duplicate the root. Carries the XML declaration
|
|
2103
|
+
* (version/encoding/standalone) and the document-level PIs.
|
|
2104
|
+
*/
|
|
2105
|
+
LEPTRIS_API LeptrisDocument leptris_document_copy(LeptrisDocument src) {
|
|
2106
|
+
if (!src) return NULL;
|
|
2107
|
+
|
|
2108
|
+
/* Force lazy promotion so src->new_dom_root is populated. */
|
|
2109
|
+
leptris_document_ensure_promoted(src);
|
|
2110
|
+
|
|
2111
|
+
LeptrisDocument dest = (LeptrisDocument)calloc(1, sizeof(*dest));
|
|
2112
|
+
if (!dest) return NULL;
|
|
2113
|
+
dest->strict_mode = src->strict_mode;
|
|
2114
|
+
dest->ref_count = 1;
|
|
2115
|
+
|
|
2116
|
+
/* Pool — sized to source pool's used bytes for one-shot alloc. */
|
|
2117
|
+
size_t page_size = 4096;
|
|
2118
|
+
if (src->pool) {
|
|
2119
|
+
/* Estimate: same size as source's current page. */
|
|
2120
|
+
page_size = src->pool->page_size;
|
|
2121
|
+
}
|
|
2122
|
+
dest->pool = leptris_pool_create_with_page_size(page_size);
|
|
2123
|
+
if (!dest->pool) { free(dest); return NULL; }
|
|
2124
|
+
dest->page_base = leptris_pool_get_base(dest->pool);
|
|
2125
|
+
|
|
2126
|
+
/* XML declaration fields — heap-strdup; freed by leptris_document_free. */
|
|
2127
|
+
if (src->encoding) {
|
|
2128
|
+
dest->encoding = strdup(src->encoding);
|
|
2129
|
+
if (!dest->encoding) goto fail;
|
|
2130
|
+
}
|
|
2131
|
+
if (src->xml_version) {
|
|
2132
|
+
dest->xml_version = strdup(src->xml_version);
|
|
2133
|
+
if (!dest->xml_version) goto fail;
|
|
2134
|
+
}
|
|
2135
|
+
dest->standalone = src->standalone;
|
|
2136
|
+
dest->had_declaration = src->had_declaration;
|
|
2137
|
+
|
|
2138
|
+
/* Root tree. */
|
|
2139
|
+
LeptrisElement root_copy = NULL;
|
|
2140
|
+
if (src->new_dom_root) {
|
|
2141
|
+
root_copy = leptris_element_copy((LeptrisElement)src->new_dom_root,
|
|
2142
|
+
dest);
|
|
2143
|
+
if (!root_copy) goto fail;
|
|
2144
|
+
dest->new_dom_root = root_copy;
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
/* Document children (issue #580): copy each doc-level node and
|
|
2148
|
+
* splice the root copy in at its chain position — the dest chain
|
|
2149
|
+
* mirrors [prolog..., root, epilog...]. */
|
|
2150
|
+
{
|
|
2151
|
+
LeptrisNode* tail = NULL;
|
|
2152
|
+
for (LeptrisNode* c = (LeptrisNode*)src->doc_children_head; c;
|
|
2153
|
+
c = leptris_node_get_next_sibling(c)) {
|
|
2154
|
+
LeptrisNode* dup = NULL;
|
|
2155
|
+
if (c->type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
2156
|
+
if ((LeptrisElement)c == (LeptrisElement)src->new_dom_root)
|
|
2157
|
+
dup = (LeptrisNode*)root_copy;
|
|
2158
|
+
if (!dup) continue;
|
|
2159
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_PI) {
|
|
2160
|
+
LeptrisPINode* pi = (LeptrisPINode*)c;
|
|
2161
|
+
dup = (LeptrisNode*)leptris_pi_node_create(
|
|
2162
|
+
dest,
|
|
2163
|
+
pi->target ? pi->target : "",
|
|
2164
|
+
pi->data ? pi->data : "");
|
|
2165
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_COMMENT) {
|
|
2166
|
+
dup = (LeptrisNode*)leptris_comment_node_create(
|
|
2167
|
+
dest,
|
|
2168
|
+
leptris_comment_get_content((LeptrisCommentNode*)c));
|
|
2169
|
+
}
|
|
2170
|
+
if (!dup) goto fail;
|
|
2171
|
+
if (tail) leptris_node_set_next_sibling(tail, dup);
|
|
2172
|
+
else dest->doc_children_head = dup;
|
|
2173
|
+
tail = dup;
|
|
2174
|
+
}
|
|
2175
|
+
dest->doc_children_tail = tail;
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
return dest;
|
|
2179
|
+
|
|
2180
|
+
fail:
|
|
2181
|
+
leptris_document_free(dest);
|
|
2182
|
+
return NULL;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
|