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,2433 @@
|
|
|
1
|
+
// test/xpath/test_xpath.cpp — XPath engine specs.
|
|
2
|
+
|
|
3
|
+
#include <gtest/gtest.h>
|
|
4
|
+
|
|
5
|
+
#include "leptris.h"
|
|
6
|
+
|
|
7
|
+
#include <cstring>
|
|
8
|
+
|
|
9
|
+
namespace {
|
|
10
|
+
|
|
11
|
+
constexpr char kBasic[] =
|
|
12
|
+
"<catalog>"
|
|
13
|
+
" <book id='b1'><title>First</title><price>10</price></book>"
|
|
14
|
+
" <book id='b2'><title>Second</title><price>20</price></book>"
|
|
15
|
+
" <book id='b3'><title>Third</title><price>30</price></book>"
|
|
16
|
+
"</catalog>";
|
|
17
|
+
|
|
18
|
+
LeptrisDocument ParseWith(const char* xml) {
|
|
19
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
20
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
21
|
+
EXPECT_NE(doc, nullptr);
|
|
22
|
+
return doc;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
TEST(XPathAxes, DescendantOrSelfFindsAll) {
|
|
26
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
27
|
+
ASSERT_NE(doc, nullptr);
|
|
28
|
+
|
|
29
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//book");
|
|
30
|
+
ASSERT_NE(r, nullptr);
|
|
31
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
32
|
+
|
|
33
|
+
leptris_xpath_result_free(r);
|
|
34
|
+
leptris_document_free(doc);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
TEST(XPathFunctions, CountReturnsNodeSetSize) {
|
|
38
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
39
|
+
ASSERT_NE(doc, nullptr);
|
|
40
|
+
|
|
41
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "count(//book)");
|
|
42
|
+
ASSERT_NE(r, nullptr);
|
|
43
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER);
|
|
44
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), 3.0);
|
|
45
|
+
|
|
46
|
+
leptris_xpath_result_free(r);
|
|
47
|
+
leptris_document_free(doc);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Lane 07 tail (#692-B): function items report a distinct public
|
|
51
|
+
* result type at the boundary — closures and named references. */
|
|
52
|
+
TEST(XPathResultTypes, FunctionItemsReportFunctionType) {
|
|
53
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
54
|
+
ASSERT_NE(doc, nullptr);
|
|
55
|
+
|
|
56
|
+
LeptrisXPathResult r =
|
|
57
|
+
leptris_xpath_eval(doc, nullptr, "concat#2");
|
|
58
|
+
ASSERT_NE(r, nullptr);
|
|
59
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_FUNCTION);
|
|
60
|
+
leptris_xpath_result_free(r);
|
|
61
|
+
|
|
62
|
+
r = leptris_xpath_eval(doc, nullptr, "function($x){ $x + 1 }");
|
|
63
|
+
ASSERT_NE(r, nullptr);
|
|
64
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_FUNCTION);
|
|
65
|
+
leptris_xpath_result_free(r);
|
|
66
|
+
|
|
67
|
+
/* Sanity: ordinary results are unaffected. */
|
|
68
|
+
r = leptris_xpath_eval(doc, nullptr, "//book");
|
|
69
|
+
ASSERT_NE(r, nullptr);
|
|
70
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NODESET);
|
|
71
|
+
leptris_xpath_result_free(r);
|
|
72
|
+
|
|
73
|
+
leptris_document_free(doc);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* XPath 1.0 §4.3 lang(): the NEAREST xml:lang declaration decides —
|
|
77
|
+
* a closer non-matching declaration is not walked past (libxslt
|
|
78
|
+
* bug-142: a ja span inside a fr root must not match lang('fr') via
|
|
79
|
+
* the root's declaration). */
|
|
80
|
+
TEST(XPathFunctions, LangNearestDeclarationWins) {
|
|
81
|
+
const char xml[] =
|
|
82
|
+
"<r xml:lang='fr'><a xml:lang='ja'><b/></a></r>";
|
|
83
|
+
LeptrisDocument doc = ParseWith(xml);
|
|
84
|
+
ASSERT_NE(doc, nullptr);
|
|
85
|
+
|
|
86
|
+
struct {
|
|
87
|
+
const char* expr; /* count of selected nodes */
|
|
88
|
+
double want;
|
|
89
|
+
} cases[] = {
|
|
90
|
+
{"count(/r/a/b[lang('ja')])", 1}, /* nearest: a */
|
|
91
|
+
{"count(/r/a/b[lang('fr')])", 0}, /* must NOT reach r */
|
|
92
|
+
{"count(/r/a[lang('ja')])", 1}, /* own attr */
|
|
93
|
+
{"count(/r/a[lang('fr')])", 0},
|
|
94
|
+
{"count(/r[lang('fr')])", 1},
|
|
95
|
+
{"count(/r[lang('ja')])", 0},
|
|
96
|
+
{"count(/r[lang(ja)])", 0}, /* unquoted: empty nodeset coerces
|
|
97
|
+
to "" — false, never an error */
|
|
98
|
+
{"count(/r[false()])", 0}, /* root-step predicate applies */
|
|
99
|
+
};
|
|
100
|
+
for (const auto& c : cases) {
|
|
101
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, c.expr);
|
|
102
|
+
ASSERT_NE(r, nullptr) << c.expr;
|
|
103
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER)
|
|
104
|
+
<< c.expr;
|
|
105
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), c.want) << c.expr;
|
|
106
|
+
leptris_xpath_result_free(r);
|
|
107
|
+
}
|
|
108
|
+
leptris_document_free(doc);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
TEST(XPathFunctions, StringFunctionExpandsEntities) {
|
|
112
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
113
|
+
const char xml[] = "<r>hello & world</r>";
|
|
114
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
115
|
+
ASSERT_NE(doc, nullptr);
|
|
116
|
+
|
|
117
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "string(/r)");
|
|
118
|
+
ASSERT_NE(r, nullptr);
|
|
119
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_STRING);
|
|
120
|
+
|
|
121
|
+
char* s = leptris_xpath_result_string(r);
|
|
122
|
+
ASSERT_NE(s, nullptr);
|
|
123
|
+
EXPECT_STREQ(s, "hello & world");
|
|
124
|
+
leptris_free_string(s);
|
|
125
|
+
|
|
126
|
+
leptris_xpath_result_free(r);
|
|
127
|
+
leptris_document_free(doc);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
TEST(XPathPredicates, LastSelectsFinalChild) {
|
|
131
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
132
|
+
ASSERT_NE(doc, nullptr);
|
|
133
|
+
|
|
134
|
+
LeptrisXPathResult r =
|
|
135
|
+
leptris_xpath_eval(doc, nullptr, "//book[last()]/title");
|
|
136
|
+
ASSERT_NE(r, nullptr);
|
|
137
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
138
|
+
|
|
139
|
+
leptris_xpath_result_free(r);
|
|
140
|
+
leptris_document_free(doc);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* libxslt bug-142: a prefixed ATTRIBUTE test (@xml:lang) in a
|
|
144
|
+
* predicate or after a descendant step must fall back to the literal
|
|
145
|
+
* qualified-name compare when the prefix is not in the binding set
|
|
146
|
+
* — vm_apply_axis_attribute already does; axis_attribute did not,
|
|
147
|
+
* so [@xml:lang] and //@xml:lang silently matched nothing. */
|
|
148
|
+
TEST(XPathPredicates, XmlLangAttributeTestMatchesUnboundPrefix) {
|
|
149
|
+
const char xml[] =
|
|
150
|
+
"<posts xml:lang='fr'><post xml:lang='ja' id='4'>"
|
|
151
|
+
"<content><para><span>x</span></para></content></post></posts>";
|
|
152
|
+
LeptrisDocument doc = ParseWith(xml);
|
|
153
|
+
ASSERT_NE(doc, nullptr);
|
|
154
|
+
|
|
155
|
+
struct {
|
|
156
|
+
const char* expr;
|
|
157
|
+
double want;
|
|
158
|
+
} cases[] = {
|
|
159
|
+
{"count(//post[@xml:lang])", 1},
|
|
160
|
+
{"count(//post[@xml:lang='ja'])", 1},
|
|
161
|
+
{"count(//span[ancestor::*[@xml:lang='ja']])", 1},
|
|
162
|
+
{"count(//span[ancestor::*[@xml:lang='fr']])", 1}, /* posts */
|
|
163
|
+
{"count(//span[ancestor::*[@xml:lang='en']])", 0},
|
|
164
|
+
{"count(//@xml:lang)", 2},
|
|
165
|
+
{"count(//post/@xml:lang)", 1},
|
|
166
|
+
};
|
|
167
|
+
for (const auto& c : cases) {
|
|
168
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, c.expr);
|
|
169
|
+
ASSERT_NE(r, nullptr) << c.expr;
|
|
170
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER)
|
|
171
|
+
<< c.expr;
|
|
172
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), c.want) << c.expr;
|
|
173
|
+
leptris_xpath_result_free(r);
|
|
174
|
+
}
|
|
175
|
+
leptris_document_free(doc);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
TEST(XPathPredicates, PositionalPredicateSelectsCorrectChild) {
|
|
179
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
180
|
+
ASSERT_NE(doc, nullptr);
|
|
181
|
+
|
|
182
|
+
LeptrisXPathResult r =
|
|
183
|
+
leptris_xpath_eval(doc, nullptr, "//book[2]/title");
|
|
184
|
+
ASSERT_NE(r, nullptr);
|
|
185
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
186
|
+
|
|
187
|
+
leptris_xpath_result_free(r);
|
|
188
|
+
leptris_document_free(doc);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
TEST(XPathPredicates, AttributeValuePredicate) {
|
|
192
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
193
|
+
ASSERT_NE(doc, nullptr);
|
|
194
|
+
|
|
195
|
+
LeptrisXPathResult r =
|
|
196
|
+
leptris_xpath_eval(doc, nullptr, "//book[@id='b2']/title");
|
|
197
|
+
ASSERT_NE(r, nullptr);
|
|
198
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
199
|
+
|
|
200
|
+
leptris_xpath_result_free(r);
|
|
201
|
+
leptris_document_free(doc);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
TEST(XPathLeaks, ComplexQueriesDoNotLeak) {
|
|
205
|
+
/* Regression for TODO 55: every XPath feature exercised at once.
|
|
206
|
+
* Verified leak-free via leaks --atExit --. */
|
|
207
|
+
const char xml[] =
|
|
208
|
+
"<r xmlns:ns='http://x'>"
|
|
209
|
+
"<a x='1'><b>text1</b></a>"
|
|
210
|
+
"<a x='2'><b>text2</b></a>"
|
|
211
|
+
"<ns:c ns:attr='val'>data</ns:c>"
|
|
212
|
+
"</r>";
|
|
213
|
+
|
|
214
|
+
LeptrisStatus st;
|
|
215
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
216
|
+
ASSERT_NE(doc, nullptr);
|
|
217
|
+
|
|
218
|
+
const char* queries[] = {
|
|
219
|
+
"//a", "//a[@x='1']", "count(//a)", "string(//a/b)",
|
|
220
|
+
"//a[1]/b | //a[2]/b", "name(//a[1])", "namespace-uri(//ns:c)",
|
|
221
|
+
"//a[parent::r]", "//a[descendant::b]", "//a[position() > 1]",
|
|
222
|
+
"//*[contains(string(.), 'text')]",
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
for (const char* q : queries) {
|
|
226
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, q);
|
|
227
|
+
if (r) leptris_xpath_result_free(r);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
leptris_document_free(doc);
|
|
231
|
+
/* Under leaks --atExit --: 0 bytes leaked. */
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
} // namespace
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
// ---- XPath variables (TODO 86 / 94) --------------------------------------
|
|
238
|
+
|
|
239
|
+
TEST(XPathVariables, BooleanVariableEvaluates) {
|
|
240
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
241
|
+
const char xml[] = "<r><a/></r>";
|
|
242
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
243
|
+
ASSERT_NE(doc, nullptr);
|
|
244
|
+
|
|
245
|
+
LeptrisXPathVariableSet vars = leptris_xpath_variable_set_new();
|
|
246
|
+
ASSERT_NE(vars, nullptr);
|
|
247
|
+
EXPECT_EQ(leptris_xpath_variable_set_boolean(vars, "flag", 1), LEPTRIS_OK);
|
|
248
|
+
|
|
249
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(doc, "$flag", vars);
|
|
250
|
+
ASSERT_NE(r, nullptr);
|
|
251
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_BOOLEAN);
|
|
252
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r), 1);
|
|
253
|
+
|
|
254
|
+
leptris_xpath_result_free(r);
|
|
255
|
+
leptris_xpath_variable_set_free(vars);
|
|
256
|
+
leptris_document_free(doc);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
TEST(XPathVariables, NumberVariableEvaluates) {
|
|
260
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
261
|
+
const char xml[] = "<r><a/></r>";
|
|
262
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
263
|
+
ASSERT_NE(doc, nullptr);
|
|
264
|
+
|
|
265
|
+
LeptrisXPathVariableSet vars = leptris_xpath_variable_set_new();
|
|
266
|
+
ASSERT_NE(vars, nullptr);
|
|
267
|
+
EXPECT_EQ(leptris_xpath_variable_set_number(vars, "n", 42.5), LEPTRIS_OK);
|
|
268
|
+
|
|
269
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(doc, "$n + 1", vars);
|
|
270
|
+
ASSERT_NE(r, nullptr);
|
|
271
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER);
|
|
272
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), 43.5);
|
|
273
|
+
|
|
274
|
+
leptris_xpath_result_free(r);
|
|
275
|
+
leptris_xpath_variable_set_free(vars);
|
|
276
|
+
leptris_document_free(doc);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
TEST(XPathVariables, StringVariableEvaluates) {
|
|
280
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
281
|
+
const char xml[] = "<r><a>hello</a></r>";
|
|
282
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
283
|
+
ASSERT_NE(doc, nullptr);
|
|
284
|
+
|
|
285
|
+
LeptrisXPathVariableSet vars = leptris_xpath_variable_set_new();
|
|
286
|
+
ASSERT_NE(vars, nullptr);
|
|
287
|
+
EXPECT_EQ(leptris_xpath_variable_set_string(vars, "greeting", "hello"), LEPTRIS_OK);
|
|
288
|
+
|
|
289
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(doc, "$greeting", vars);
|
|
290
|
+
ASSERT_NE(r, nullptr);
|
|
291
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_STRING);
|
|
292
|
+
char* s = leptris_xpath_result_string(r);
|
|
293
|
+
EXPECT_STREQ(s, "hello");
|
|
294
|
+
leptris_free_string(s);
|
|
295
|
+
|
|
296
|
+
leptris_xpath_result_free(r);
|
|
297
|
+
leptris_xpath_variable_set_free(vars);
|
|
298
|
+
leptris_document_free(doc);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
TEST(XPathVariables, UnknownVariableReturnsEmpty) {
|
|
302
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
303
|
+
const char xml[] = "<r/>";
|
|
304
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
305
|
+
ASSERT_NE(doc, nullptr);
|
|
306
|
+
|
|
307
|
+
LeptrisXPathVariableSet vars = leptris_xpath_variable_set_new();
|
|
308
|
+
ASSERT_NE(vars, nullptr);
|
|
309
|
+
|
|
310
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(doc, "$undefined", vars);
|
|
311
|
+
EXPECT_EQ(r, nullptr);
|
|
312
|
+
|
|
313
|
+
leptris_xpath_variable_set_free(vars);
|
|
314
|
+
leptris_document_free(doc);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// ---- Comprehensive XPath coverage (TODO 69-style) ------------------------
|
|
318
|
+
|
|
319
|
+
TEST(XPathAxes, ChildAxisFindsDirectChildren) {
|
|
320
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
321
|
+
const char xml[] = "<r><a/><b/><c/></r>";
|
|
322
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
323
|
+
ASSERT_NE(doc, nullptr);
|
|
324
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "/r/*");
|
|
325
|
+
ASSERT_NE(r, nullptr);
|
|
326
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
327
|
+
leptris_xpath_result_free(r);
|
|
328
|
+
leptris_document_free(doc);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
TEST(XPathAxes, AttributeAxisReturnsAttributes) {
|
|
332
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
333
|
+
const char xml[] = "<r a='1' b='2'/>";
|
|
334
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
335
|
+
ASSERT_NE(doc, nullptr);
|
|
336
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "/r/@*");
|
|
337
|
+
ASSERT_NE(r, nullptr);
|
|
338
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
339
|
+
leptris_xpath_result_free(r);
|
|
340
|
+
leptris_document_free(doc);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
TEST(XPathAxes, DescendantAxisFindsAllLevels) {
|
|
344
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
345
|
+
const char xml[] = "<r><a><b/><c/></a><d/></r>";
|
|
346
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
347
|
+
ASSERT_NE(doc, nullptr);
|
|
348
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "count(//*)");
|
|
349
|
+
ASSERT_NE(r, nullptr);
|
|
350
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER);
|
|
351
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), 5.0); // r, a, b, c, d
|
|
352
|
+
leptris_xpath_result_free(r);
|
|
353
|
+
leptris_document_free(doc);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
TEST(XPathFunctions, NameReturnsElementName) {
|
|
357
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
358
|
+
const char xml[] = "<root><child/></root>";
|
|
359
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
360
|
+
ASSERT_NE(doc, nullptr);
|
|
361
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "name(/root/child)");
|
|
362
|
+
ASSERT_NE(r, nullptr);
|
|
363
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_STRING);
|
|
364
|
+
char* s = leptris_xpath_result_string(r);
|
|
365
|
+
EXPECT_STREQ(s, "child");
|
|
366
|
+
leptris_free_string(s);
|
|
367
|
+
leptris_xpath_result_free(r);
|
|
368
|
+
leptris_document_free(doc);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
TEST(XPathFunctions, StringLengthReturnsCharCount) {
|
|
372
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
373
|
+
const char xml[] = "<r>hello</r>";
|
|
374
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
375
|
+
ASSERT_NE(doc, nullptr);
|
|
376
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "string-length(/r)");
|
|
377
|
+
ASSERT_NE(r, nullptr);
|
|
378
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER);
|
|
379
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), 5.0);
|
|
380
|
+
leptris_xpath_result_free(r);
|
|
381
|
+
leptris_document_free(doc);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
TEST(XPathFunctions, TrueAndFalseFunctionsWork) {
|
|
385
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
386
|
+
const char xml[] = "<r/>";
|
|
387
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
388
|
+
ASSERT_NE(doc, nullptr);
|
|
389
|
+
LeptrisXPathResult r1 = leptris_xpath_eval(doc, nullptr, "true()");
|
|
390
|
+
ASSERT_NE(r1, nullptr);
|
|
391
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r1), 1);
|
|
392
|
+
leptris_xpath_result_free(r1);
|
|
393
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "false()");
|
|
394
|
+
ASSERT_NE(r2, nullptr);
|
|
395
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r2), 0);
|
|
396
|
+
leptris_xpath_result_free(r2);
|
|
397
|
+
leptris_document_free(doc);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
TEST(XPathPredicates, PositionGreaterThanFiltersCorrectly) {
|
|
401
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
402
|
+
const char xml[] = "<r><a/><a/><a/><a/></r>";
|
|
403
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
404
|
+
ASSERT_NE(doc, nullptr);
|
|
405
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "/r/a[position() > 2]");
|
|
406
|
+
ASSERT_NE(r, nullptr);
|
|
407
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
408
|
+
leptris_xpath_result_free(r);
|
|
409
|
+
leptris_document_free(doc);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
TEST(XPathPredicates, UnionOperatorCombinesNodeSets) {
|
|
413
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
414
|
+
const char xml[] = "<r><a/><b/><c/></r>";
|
|
415
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
416
|
+
ASSERT_NE(doc, nullptr);
|
|
417
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "/r/a | /r/c");
|
|
418
|
+
ASSERT_NE(r, nullptr);
|
|
419
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
420
|
+
leptris_xpath_result_free(r);
|
|
421
|
+
leptris_document_free(doc);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
TEST(XPathOperators, ArithmeticAddition) {
|
|
425
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
426
|
+
const char xml[] = "<r/>";
|
|
427
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
428
|
+
ASSERT_NE(doc, nullptr);
|
|
429
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "2 + 3");
|
|
430
|
+
ASSERT_NE(r, nullptr);
|
|
431
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_NUMBER);
|
|
432
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), 5.0);
|
|
433
|
+
leptris_xpath_result_free(r);
|
|
434
|
+
leptris_document_free(doc);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
TEST(XPathOperators, StringComparison) {
|
|
438
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
439
|
+
const char xml[] = "<r><a x='1'/><a x='2'/></r>";
|
|
440
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
441
|
+
ASSERT_NE(doc, nullptr);
|
|
442
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "/r/a[@x = '2']");
|
|
443
|
+
ASSERT_NE(r, nullptr);
|
|
444
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
445
|
+
leptris_xpath_result_free(r);
|
|
446
|
+
leptris_document_free(doc);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/* Issue #965: relational comparisons must keep operand order when
|
|
450
|
+
* the nodeset is on the RIGHT — `10 >= @n` is NOT `@n >= 10`. The
|
|
451
|
+
* any-node loop used to put the node value on the left
|
|
452
|
+
* unconditionally. */
|
|
453
|
+
TEST(XPathOperators, ConstantLhsRelationalKeepsOperandOrder) {
|
|
454
|
+
const char xml[] =
|
|
455
|
+
"<r><item id='a' n='11'/><item id='b' n='5'/></r>";
|
|
456
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), NULL);
|
|
457
|
+
ASSERT_NE(doc, nullptr);
|
|
458
|
+
|
|
459
|
+
struct { const char* expr; const char* want; } cases[] = {
|
|
460
|
+
{"string(//item[10 >= @n]/@id)", "b"}, /* 10>=5 only */
|
|
461
|
+
{"string(//item['10' >= @n]/@id)", "b"}, /* number('10')=10 */
|
|
462
|
+
{"string(//item[10 > @n]/@id)", "b"},
|
|
463
|
+
{"string(//item[4 <= @n]/@id)", "a"}, /* 4<=11 */
|
|
464
|
+
{"string(//item[@n >= 10]/@id)", "a"}, /* control: ns-LHS */
|
|
465
|
+
};
|
|
466
|
+
for (const auto& c : cases) {
|
|
467
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, c.expr);
|
|
468
|
+
ASSERT_NE(r, nullptr) << c.expr;
|
|
469
|
+
char* s = leptris_xpath_result_string(r);
|
|
470
|
+
ASSERT_TRUE(s != NULL) << c.expr;
|
|
471
|
+
EXPECT_STREQ(s, c.want) << c.expr;
|
|
472
|
+
leptris_free_string(s);
|
|
473
|
+
leptris_xpath_result_free(r);
|
|
474
|
+
}
|
|
475
|
+
leptris_document_free(doc);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
TEST(XPathOperators, ConstantLhsRelationalAtElementContext) {
|
|
479
|
+
const char xml[] = "<r><item n='11'/></r>";
|
|
480
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), NULL);
|
|
481
|
+
ASSERT_NE(doc, nullptr);
|
|
482
|
+
LeptrisXPathResult sel = leptris_xpath_eval(doc, nullptr, "/r/item");
|
|
483
|
+
ASSERT_NE(sel, nullptr);
|
|
484
|
+
LeptrisElement item = leptris_xpath_result_get(sel, 0);
|
|
485
|
+
ASSERT_NE(item, nullptr);
|
|
486
|
+
|
|
487
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, item, "10 >= @n");
|
|
488
|
+
ASSERT_NE(r, nullptr);
|
|
489
|
+
EXPECT_EQ(leptris_xpath_result_type(r), LEPTRIS_XPATH_BOOLEAN);
|
|
490
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r), 0); /* 10 >= 11 is false */
|
|
491
|
+
leptris_xpath_result_free(r);
|
|
492
|
+
|
|
493
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, item, "12 >= @n");
|
|
494
|
+
ASSERT_NE(r2, nullptr);
|
|
495
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r2), 1);
|
|
496
|
+
leptris_xpath_result_free(r2);
|
|
497
|
+
|
|
498
|
+
leptris_xpath_result_free(sel);
|
|
499
|
+
leptris_document_free(doc);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
TEST(XPathOperators, ConstantLhsRelationalAnyNodeSemantics) {
|
|
503
|
+
/* Multiple RHS nodes: any node for which CONSTANT op node holds. */
|
|
504
|
+
const char xml[] =
|
|
505
|
+
"<r><item n='11'/><item n='5'/><item n='40'/></r>";
|
|
506
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), NULL);
|
|
507
|
+
ASSERT_NE(doc, nullptr);
|
|
508
|
+
|
|
509
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "4 >= //item/@n");
|
|
510
|
+
ASSERT_NE(r, nullptr);
|
|
511
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r), 0); /* 4 >= 5 fails for all */
|
|
512
|
+
leptris_xpath_result_free(r);
|
|
513
|
+
|
|
514
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "50 >= //item/@n");
|
|
515
|
+
ASSERT_NE(r2, nullptr);
|
|
516
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r2), 1);
|
|
517
|
+
leptris_xpath_result_free(r2);
|
|
518
|
+
|
|
519
|
+
/* Nodeset on both sides keeps order too (any-pair, left op right). */
|
|
520
|
+
LeptrisXPathResult r3 =
|
|
521
|
+
leptris_xpath_eval(doc, nullptr, "//item/@n >= 40");
|
|
522
|
+
ASSERT_NE(r3, nullptr);
|
|
523
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r3), 1);
|
|
524
|
+
leptris_xpath_result_free(r3);
|
|
525
|
+
|
|
526
|
+
leptris_document_free(doc);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
TEST(XPathText, TextNodeSelection) {
|
|
530
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
531
|
+
const char xml[] = "<r><a>text1</a><a>text2</a></r>";
|
|
532
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
533
|
+
ASSERT_NE(doc, nullptr);
|
|
534
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "string(/r/a[2])");
|
|
535
|
+
ASSERT_NE(r, nullptr);
|
|
536
|
+
char* s = leptris_xpath_result_string(r);
|
|
537
|
+
EXPECT_STREQ(s, "text2");
|
|
538
|
+
leptris_free_string(s);
|
|
539
|
+
leptris_xpath_result_free(r);
|
|
540
|
+
leptris_document_free(doc);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
TEST(XPathNested, NestedPredicates) {
|
|
544
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
545
|
+
const char xml[] =
|
|
546
|
+
"<r>"
|
|
547
|
+
" <a id='1'><v>10</v></a>"
|
|
548
|
+
" <a id='2'><v>20</v></a>"
|
|
549
|
+
" <a id='3'><v>30</v></a>"
|
|
550
|
+
"</r>";
|
|
551
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
552
|
+
ASSERT_NE(doc, nullptr);
|
|
553
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "/r/a[v > 15]/@id");
|
|
554
|
+
ASSERT_NE(r, nullptr);
|
|
555
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
556
|
+
leptris_xpath_result_free(r);
|
|
557
|
+
leptris_document_free(doc);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/* ---- TODO 192: subtree-interval index for relative descendants ---- */
|
|
561
|
+
|
|
562
|
+
namespace {
|
|
563
|
+
|
|
564
|
+
const char kSubtree[] =
|
|
565
|
+
"<library>"
|
|
566
|
+
"<section id='a'><item>1</item><item>2</item>"
|
|
567
|
+
"<section><item>3</item></section></section>"
|
|
568
|
+
"<section id='b'><item>4</item></section>"
|
|
569
|
+
"</library>";
|
|
570
|
+
|
|
571
|
+
/* The element index builds on the second axis query (TODO 190), so
|
|
572
|
+
* each spec runs a warm-up first — otherwise only the walk path
|
|
573
|
+
* would be tested. */
|
|
574
|
+
LeptrisXPathResult EvalWarm(LeptrisDocument doc, LeptrisElement ctx,
|
|
575
|
+
const char* expr) {
|
|
576
|
+
LeptrisXPathResult warm =
|
|
577
|
+
leptris_xpath_eval(doc, nullptr, "//warmup-absent");
|
|
578
|
+
if (warm) leptris_xpath_result_free(warm);
|
|
579
|
+
return leptris_xpath_eval(doc, ctx, expr);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
LeptrisElement FirstSection(LeptrisDocument doc) {
|
|
583
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//section");
|
|
584
|
+
if (!r || leptris_xpath_result_count(r) == 0) {
|
|
585
|
+
if (r) leptris_xpath_result_free(r);
|
|
586
|
+
return nullptr;
|
|
587
|
+
}
|
|
588
|
+
LeptrisElement e = leptris_xpath_result_get(r, 0);
|
|
589
|
+
leptris_xpath_result_free(r);
|
|
590
|
+
return e;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
} // namespace
|
|
594
|
+
|
|
595
|
+
TEST(XPathSubtreeIndex, ChainedDoubleSlashNoDoubleCount) {
|
|
596
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
597
|
+
LeptrisDocument doc = leptris_parse_string(kSubtree, std::strlen(kSubtree), &st);
|
|
598
|
+
ASSERT_NE(doc, nullptr);
|
|
599
|
+
|
|
600
|
+
/* //section matches the outer AND the nested section; the
|
|
601
|
+
* subtrees overlap. Interval containment must skip the nested
|
|
602
|
+
* one — 4 items, not 5. Second+ query exercises the index. */
|
|
603
|
+
LeptrisXPathResult first = leptris_xpath_eval(doc, nullptr, "//item");
|
|
604
|
+
ASSERT_NE(first, nullptr);
|
|
605
|
+
EXPECT_EQ(leptris_xpath_result_count(first), 4u);
|
|
606
|
+
leptris_xpath_result_free(first);
|
|
607
|
+
|
|
608
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//section//item");
|
|
609
|
+
ASSERT_NE(r, nullptr);
|
|
610
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 4u);
|
|
611
|
+
leptris_xpath_result_free(r);
|
|
612
|
+
leptris_document_free(doc);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
TEST(XPathSubtreeIndex, RelativeDescendantFromContext) {
|
|
616
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
617
|
+
LeptrisDocument doc = leptris_parse_string(kSubtree, std::strlen(kSubtree), &st);
|
|
618
|
+
ASSERT_NE(doc, nullptr);
|
|
619
|
+
|
|
620
|
+
LeptrisElement sec = FirstSection(doc);
|
|
621
|
+
ASSERT_NE(sec, nullptr);
|
|
622
|
+
|
|
623
|
+
/* .//item from section[a]: items 1, 2 and the nested 3. */
|
|
624
|
+
LeptrisXPathResult r = EvalWarm(doc, sec, ".//item");
|
|
625
|
+
ASSERT_NE(r, nullptr);
|
|
626
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
627
|
+
leptris_xpath_result_free(r);
|
|
628
|
+
leptris_document_free(doc);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
TEST(XPathSubtreeIndex, StrictDescendantExcludesSelf) {
|
|
632
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
633
|
+
const char xml[] = "<item><item>x</item></item>";
|
|
634
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
635
|
+
ASSERT_NE(doc, nullptr);
|
|
636
|
+
|
|
637
|
+
LeptrisXPathResult root = leptris_xpath_eval(doc, nullptr, "//item");
|
|
638
|
+
ASSERT_NE(root, nullptr);
|
|
639
|
+
ASSERT_EQ(leptris_xpath_result_count(root), 2u);
|
|
640
|
+
LeptrisElement e = leptris_xpath_result_get(root, 0);
|
|
641
|
+
leptris_xpath_result_free(root);
|
|
642
|
+
|
|
643
|
+
/* descendant::item from the outer item: the inner one only. */
|
|
644
|
+
LeptrisXPathResult r = EvalWarm(doc, e, "descendant::item");
|
|
645
|
+
ASSERT_NE(r, nullptr);
|
|
646
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
647
|
+
leptris_xpath_result_free(r);
|
|
648
|
+
|
|
649
|
+
/* descendant-or-self::item includes the context itself. */
|
|
650
|
+
LeptrisXPathResult r2 = EvalWarm(doc, e, "descendant-or-self::item");
|
|
651
|
+
ASSERT_NE(r2, nullptr);
|
|
652
|
+
EXPECT_EQ(leptris_xpath_result_count(r2), 2u);
|
|
653
|
+
leptris_xpath_result_free(r2);
|
|
654
|
+
leptris_document_free(doc);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
TEST(XPathSubtreeIndex, MutationInvalidatesIndex) {
|
|
658
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
659
|
+
LeptrisDocument doc = leptris_parse_string(kSubtree, std::strlen(kSubtree), &st);
|
|
660
|
+
ASSERT_NE(doc, nullptr);
|
|
661
|
+
|
|
662
|
+
/* Two queries so the index is built and cached. */
|
|
663
|
+
LeptrisXPathResult warm = leptris_xpath_eval(doc, nullptr, "//item");
|
|
664
|
+
ASSERT_NE(warm, nullptr);
|
|
665
|
+
EXPECT_EQ(leptris_xpath_result_count(warm), 4u);
|
|
666
|
+
leptris_xpath_result_free(warm);
|
|
667
|
+
LeptrisXPathResult warm2 = leptris_xpath_eval(doc, nullptr, "//warmup-absent");
|
|
668
|
+
if (warm2) leptris_xpath_result_free(warm2);
|
|
669
|
+
|
|
670
|
+
/* Mutate: remove section[b]'s only item, then query again — the
|
|
671
|
+
* rebuilt index must not serve stale results. */
|
|
672
|
+
LeptrisXPathResult secs = leptris_xpath_eval(doc, nullptr, "//section[@id='b']");
|
|
673
|
+
ASSERT_NE(secs, nullptr);
|
|
674
|
+
ASSERT_EQ(leptris_xpath_result_count(secs), 1u);
|
|
675
|
+
LeptrisElement secb = leptris_xpath_result_get(secs, 0);
|
|
676
|
+
leptris_xpath_result_free(secs);
|
|
677
|
+
ASSERT_NE(secb, nullptr);
|
|
678
|
+
|
|
679
|
+
LeptrisXPathResult victim = leptris_xpath_eval(doc, secb, ".//item");
|
|
680
|
+
ASSERT_NE(victim, nullptr);
|
|
681
|
+
ASSERT_EQ(leptris_xpath_result_count(victim), 1u);
|
|
682
|
+
LeptrisElement item = leptris_xpath_result_get(victim, 0);
|
|
683
|
+
leptris_xpath_result_free(victim);
|
|
684
|
+
ASSERT_NE(item, nullptr);
|
|
685
|
+
|
|
686
|
+
EXPECT_EQ(leptris_element_remove_child(secb, item), LEPTRIS_OK);
|
|
687
|
+
|
|
688
|
+
LeptrisXPathResult after = leptris_xpath_eval(doc, nullptr, "//item");
|
|
689
|
+
ASSERT_NE(after, nullptr);
|
|
690
|
+
EXPECT_EQ(leptris_xpath_result_count(after), 3u);
|
|
691
|
+
leptris_xpath_result_free(after);
|
|
692
|
+
leptris_document_free(doc);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
TEST(XPathSubtreeIndex, EmptyResultForAbsentName) {
|
|
696
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
697
|
+
LeptrisDocument doc = leptris_parse_string(kSubtree, std::strlen(kSubtree), &st);
|
|
698
|
+
ASSERT_NE(doc, nullptr);
|
|
699
|
+
LeptrisElement sec = FirstSection(doc);
|
|
700
|
+
ASSERT_NE(sec, nullptr);
|
|
701
|
+
|
|
702
|
+
LeptrisXPathResult r = EvalWarm(doc, sec, ".//does-not-exist");
|
|
703
|
+
ASSERT_NE(r, nullptr);
|
|
704
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 0u);
|
|
705
|
+
leptris_xpath_result_free(r);
|
|
706
|
+
leptris_document_free(doc);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/* ---- TODO 192b: predicated relative descendants via the index ---- */
|
|
710
|
+
|
|
711
|
+
namespace {
|
|
712
|
+
/* Items carry n attributes for the predicated relative specs. */
|
|
713
|
+
const char kSubtreeAttr[] =
|
|
714
|
+
"<library>"
|
|
715
|
+
"<section id='a'><item n='1'>x</item><item n='2'>y</item>"
|
|
716
|
+
"<section><item n='11'>z</item></section></section>"
|
|
717
|
+
"<section id='b'><item n='1'>w</item></section>"
|
|
718
|
+
"</library>";
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
TEST(XPathSubtreeIndex, PredicatedRelativeFromContext) {
|
|
722
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
723
|
+
LeptrisDocument doc = leptris_parse_string(kSubtreeAttr, std::strlen(kSubtreeAttr), &st);
|
|
724
|
+
ASSERT_NE(doc, nullptr);
|
|
725
|
+
LeptrisElement sec = FirstSection(doc);
|
|
726
|
+
ASSERT_NE(sec, nullptr);
|
|
727
|
+
|
|
728
|
+
LeptrisXPathResult r = EvalWarm(doc, sec, ".//item[@n='2']");
|
|
729
|
+
ASSERT_NE(r, nullptr);
|
|
730
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
731
|
+
leptris_xpath_result_free(r);
|
|
732
|
+
|
|
733
|
+
LeptrisXPathResult r2 = EvalWarm(doc, sec, ".//item[@n='11']");
|
|
734
|
+
ASSERT_NE(r2, nullptr);
|
|
735
|
+
EXPECT_EQ(leptris_xpath_result_count(r2), 1u); /* nested section */
|
|
736
|
+
leptris_xpath_result_free(r2);
|
|
737
|
+
leptris_document_free(doc);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
TEST(XPathSubtreeIndex, PredicatedChainedAcrossSections) {
|
|
741
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
742
|
+
LeptrisDocument doc = leptris_parse_string(kSubtreeAttr, std::strlen(kSubtreeAttr), &st);
|
|
743
|
+
ASSERT_NE(doc, nullptr);
|
|
744
|
+
|
|
745
|
+
/* Both sections own an item with n='1'; the nested item is
|
|
746
|
+
* n='11' and must not double-count. */
|
|
747
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//section//item[@n='1']");
|
|
748
|
+
ASSERT_NE(r, nullptr);
|
|
749
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
750
|
+
leptris_xpath_result_free(r);
|
|
751
|
+
|
|
752
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "//section//item[@n='11']");
|
|
753
|
+
ASSERT_NE(r2, nullptr);
|
|
754
|
+
EXPECT_EQ(leptris_xpath_result_count(r2), 1u);
|
|
755
|
+
leptris_xpath_result_free(r2);
|
|
756
|
+
leptris_document_free(doc);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/* Absolute `//name[k]` (#645 fused VM path): the position is
|
|
760
|
+
* PER PARENT — one node per parent with k matching children — and
|
|
761
|
+
* a root element named NAME counts (it is the document's first
|
|
762
|
+
* NAME child). These pin the semantics the fused child::NAME[k]
|
|
763
|
+
* opcode must preserve. */
|
|
764
|
+
|
|
765
|
+
/* XPath 2.0+ if/then/else — XSLT 3.0 expressions. */
|
|
766
|
+
TEST(XPath30, IfThenElse) {
|
|
767
|
+
const char xml[] = "<r><i>a</i><i>b</i><i>c</i></r>";
|
|
768
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
769
|
+
ASSERT_NE(doc, nullptr);
|
|
770
|
+
auto eval = [&](const char* e) -> std::string {
|
|
771
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, e);
|
|
772
|
+
if (!r) return "(error)";
|
|
773
|
+
char* v = leptris_xpath_result_string(r);
|
|
774
|
+
std::string out = v ? v : "";
|
|
775
|
+
leptris_free_string(v);
|
|
776
|
+
leptris_xpath_result_free(r);
|
|
777
|
+
return out;
|
|
778
|
+
};
|
|
779
|
+
EXPECT_EQ(eval("if (count(//i) > 2) then 'many' else 'few'"), "many");
|
|
780
|
+
EXPECT_EQ(eval("if (count(//i) > 9) then 'many' else 'few'"), "few");
|
|
781
|
+
leptris_document_free(doc);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
TEST(XPath30, ForReturnAndRange) {
|
|
785
|
+
const char xml[] = "<r><i>a</i><i>b</i><i>c</i></r>";
|
|
786
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
787
|
+
ASSERT_NE(doc, nullptr);
|
|
788
|
+
auto eval = [&](const char* e) -> std::string {
|
|
789
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, e);
|
|
790
|
+
if (!r) return "(error)";
|
|
791
|
+
char* v = leptris_xpath_result_string(r);
|
|
792
|
+
std::string out = v ? v : "";
|
|
793
|
+
leptris_free_string(v);
|
|
794
|
+
leptris_xpath_result_free(r);
|
|
795
|
+
return out;
|
|
796
|
+
};
|
|
797
|
+
/* for yields a SEQUENCE (3.0): one member per input item. The
|
|
798
|
+
* 1.0-frozen result_string prints one node — assert the members
|
|
799
|
+
* through string-join and count. */
|
|
800
|
+
SCOPED_TRACE("for-return");
|
|
801
|
+
EXPECT_EQ(eval("string-join(for $x in //i return string($x), ' ')"),
|
|
802
|
+
"a b c");
|
|
803
|
+
EXPECT_EQ(eval("string-join(for $x in //i return upper-case(string($x)), '|')"),
|
|
804
|
+
"A|B|C");
|
|
805
|
+
/* Range + predicate: the members that survive; assert count and
|
|
806
|
+
* membership (the 1.0-frozen result_string prints one node). */
|
|
807
|
+
LeptrisXPathResult r = leptris_xpath_eval(
|
|
808
|
+
doc, nullptr, "(1 to 5)[. mod 2 = 1]");
|
|
809
|
+
ASSERT_NE(r, nullptr);
|
|
810
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
811
|
+
leptris_xpath_result_free(r);
|
|
812
|
+
leptris_document_free(doc);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
TEST(XPath30, StringFunctions) {
|
|
816
|
+
const char xml[] = "<r><i>a</i><i>b</i><i>c</i></r>";
|
|
817
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
818
|
+
ASSERT_NE(doc, nullptr);
|
|
819
|
+
auto eval = [&](const char* e) -> std::string {
|
|
820
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, e);
|
|
821
|
+
if (!r) return "(error)";
|
|
822
|
+
char* v = leptris_xpath_result_string(r);
|
|
823
|
+
std::string out = v ? v : "";
|
|
824
|
+
leptris_free_string(v);
|
|
825
|
+
leptris_xpath_result_free(r);
|
|
826
|
+
return out;
|
|
827
|
+
};
|
|
828
|
+
EXPECT_EQ(eval("upper-case('abc')"), "ABC");
|
|
829
|
+
EXPECT_EQ(eval("lower-case('ABC')"), "abc");
|
|
830
|
+
EXPECT_EQ(eval("string-join(('a','b','c'), ',')"), "a,b,c");
|
|
831
|
+
EXPECT_EQ(eval("string-join(for $x in //i return string($x), '+')"),
|
|
832
|
+
"a+b+c");
|
|
833
|
+
EXPECT_EQ(eval("substring-before('key=val', '=')"), "key");
|
|
834
|
+
EXPECT_EQ(eval("normalize-space(' a b ')"), "a b");
|
|
835
|
+
leptris_document_free(doc);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
TEST(XPathSubtreeIndex, AbsolutePositionPredicatePerParent) {
|
|
839
|
+
const char xml[] =
|
|
840
|
+
"<catalog><item id='a1'/><item id='a2'/>"
|
|
841
|
+
"<wrap><item id='b1'/><item id='b2'/></wrap>"
|
|
842
|
+
"</catalog>";
|
|
843
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
844
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
845
|
+
ASSERT_NE(doc, nullptr);
|
|
846
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//item[1]");
|
|
847
|
+
ASSERT_NE(r, nullptr);
|
|
848
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u); /* a1 + b1 */
|
|
849
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "//item[2]");
|
|
850
|
+
ASSERT_NE(r2, nullptr);
|
|
851
|
+
EXPECT_EQ(leptris_xpath_result_count(r2), 2u); /* a2 + b2 */
|
|
852
|
+
LeptrisXPathResult r3 = leptris_xpath_eval(doc, nullptr, "//item[3]");
|
|
853
|
+
ASSERT_NE(r3, nullptr);
|
|
854
|
+
EXPECT_EQ(leptris_xpath_result_count(r3), 0u);
|
|
855
|
+
leptris_xpath_result_free(r);
|
|
856
|
+
leptris_xpath_result_free(r2);
|
|
857
|
+
leptris_xpath_result_free(r3);
|
|
858
|
+
leptris_document_free(doc);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
TEST(XPathSubtreeIndex, AbsolutePositionPredicateRootNamed) {
|
|
862
|
+
const char xml[] = "<item><item id='inner'/></item>";
|
|
863
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
864
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
865
|
+
ASSERT_NE(doc, nullptr);
|
|
866
|
+
/* The root IS the document's first item child; the inner item is
|
|
867
|
+
* the root's first item child — both are //item[1]. */
|
|
868
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//item[1]");
|
|
869
|
+
ASSERT_NE(r, nullptr);
|
|
870
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
871
|
+
leptris_xpath_result_free(r);
|
|
872
|
+
leptris_document_free(doc);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
TEST(XPathSubtreeIndex, PositionPredicateKeepsExpandedSemantics) {
|
|
876
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
877
|
+
LeptrisDocument doc = leptris_parse_string(kSubtreeAttr, std::strlen(kSubtreeAttr), &st);
|
|
878
|
+
ASSERT_NE(doc, nullptr);
|
|
879
|
+
|
|
880
|
+
/* `//section//item[1]` means first item PER PARENT (section a,
|
|
881
|
+
* its nested section, and section b) — 3, not 2-per-section.
|
|
882
|
+
* Position predicates must NOT take the fused path. */
|
|
883
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//section//item[1]");
|
|
884
|
+
ASSERT_NE(r, nullptr);
|
|
885
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
886
|
+
leptris_xpath_result_free(r);
|
|
887
|
+
leptris_document_free(doc);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/* ---- TODO 192d: absolute //name[@attr='value'] via value buckets ---- */
|
|
891
|
+
|
|
892
|
+
TEST(XPathSubtreeIndex, AbsolutePredicatedValueBucket) {
|
|
893
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
894
|
+
LeptrisDocument doc = leptris_parse_string(kSubtreeAttr, std::strlen(kSubtreeAttr), &st);
|
|
895
|
+
ASSERT_NE(doc, nullptr);
|
|
896
|
+
|
|
897
|
+
/* Cold query (no index yet) and warm query must agree. */
|
|
898
|
+
LeptrisXPathResult cold = leptris_xpath_eval(doc, nullptr, "//item[@n='1']");
|
|
899
|
+
ASSERT_NE(cold, nullptr);
|
|
900
|
+
EXPECT_EQ(leptris_xpath_result_count(cold), 2u);
|
|
901
|
+
leptris_xpath_result_free(cold);
|
|
902
|
+
|
|
903
|
+
LeptrisXPathResult warm = leptris_xpath_eval(doc, nullptr, "//item[@n='11']");
|
|
904
|
+
ASSERT_NE(warm, nullptr);
|
|
905
|
+
EXPECT_EQ(leptris_xpath_result_count(warm), 1u);
|
|
906
|
+
leptris_xpath_result_free(warm);
|
|
907
|
+
|
|
908
|
+
/* Chained rest steps still follow the fused opcode. */
|
|
909
|
+
LeptrisXPathResult chained = leptris_xpath_eval(doc, nullptr, "//item[@n='11']/text()");
|
|
910
|
+
ASSERT_NE(chained, nullptr);
|
|
911
|
+
EXPECT_EQ(leptris_xpath_result_count(chained), 1u);
|
|
912
|
+
leptris_xpath_result_free(chained);
|
|
913
|
+
leptris_document_free(doc);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
TEST(XPathSubtreeIndex, AbsolutePredicatedRootMatches) {
|
|
917
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
918
|
+
const char xml[] = "<item n='5'><item n='5'/><other/></item>";
|
|
919
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
920
|
+
ASSERT_NE(doc, nullptr);
|
|
921
|
+
|
|
922
|
+
/* `//` is descendant-or-SELF: the root itself carries n='5' and
|
|
923
|
+
* must be included, cold and warm. */
|
|
924
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "count(//item[@n='5'])");
|
|
925
|
+
ASSERT_NE(r, nullptr);
|
|
926
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r), 2.0);
|
|
927
|
+
leptris_xpath_result_free(r);
|
|
928
|
+
|
|
929
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "count(//item[@n='5'])");
|
|
930
|
+
ASSERT_NE(r2, nullptr);
|
|
931
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(r2), 2.0);
|
|
932
|
+
leptris_xpath_result_free(r2);
|
|
933
|
+
leptris_document_free(doc);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
/* ---- TODO 192e: attr-EXISTS via the any-value bucket ---- */
|
|
937
|
+
|
|
938
|
+
TEST(XPathSubtreeIndex, AttrExistsAbsolute) {
|
|
939
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
940
|
+
LeptrisDocument doc = leptris_parse_string(kSubtreeAttr, std::strlen(kSubtreeAttr), &st);
|
|
941
|
+
ASSERT_NE(doc, nullptr);
|
|
942
|
+
|
|
943
|
+
/* Cold and warm must agree: every item carries n. */
|
|
944
|
+
LeptrisXPathResult cold = leptris_xpath_eval(doc, nullptr, "//item[@n]");
|
|
945
|
+
ASSERT_NE(cold, nullptr);
|
|
946
|
+
EXPECT_EQ(leptris_xpath_result_count(cold), 4u);
|
|
947
|
+
leptris_xpath_result_free(cold);
|
|
948
|
+
|
|
949
|
+
LeptrisXPathResult warm = leptris_xpath_eval(doc, nullptr, "count(//item[@n])");
|
|
950
|
+
ASSERT_NE(warm, nullptr);
|
|
951
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(warm), 4.0);
|
|
952
|
+
leptris_xpath_result_free(warm);
|
|
953
|
+
|
|
954
|
+
/* Attribute carried by the outer sections only (the nested
|
|
955
|
+
* section has no id). */
|
|
956
|
+
LeptrisXPathResult secs = leptris_xpath_eval(doc, nullptr, "count(//section[@id])");
|
|
957
|
+
ASSERT_NE(secs, nullptr);
|
|
958
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(secs), 2.0);
|
|
959
|
+
leptris_xpath_result_free(secs);
|
|
960
|
+
|
|
961
|
+
/* Absent attribute: empty, cold and warm. */
|
|
962
|
+
LeptrisXPathResult none = leptris_xpath_eval(doc, nullptr, "count(//item[@zzz])");
|
|
963
|
+
ASSERT_NE(none, nullptr);
|
|
964
|
+
EXPECT_DOUBLE_EQ(leptris_xpath_result_number(none), 0.0);
|
|
965
|
+
leptris_xpath_result_free(none);
|
|
966
|
+
leptris_document_free(doc);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
TEST(XPathSubtreeIndex, AttrExistsRelativeFromContext) {
|
|
970
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
971
|
+
LeptrisDocument doc = leptris_parse_string(kSubtreeAttr, std::strlen(kSubtreeAttr), &st);
|
|
972
|
+
ASSERT_NE(doc, nullptr);
|
|
973
|
+
LeptrisElement sec = FirstSection(doc);
|
|
974
|
+
ASSERT_NE(sec, nullptr);
|
|
975
|
+
|
|
976
|
+
LeptrisXPathResult r = EvalWarm(doc, sec, ".//item[@n]");
|
|
977
|
+
ASSERT_NE(r, nullptr);
|
|
978
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
979
|
+
leptris_xpath_result_free(r);
|
|
980
|
+
leptris_document_free(doc);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// Regression (CodeQL critical, alert #32): freeing the same result
|
|
984
|
+
// twice used to treat the thread-local free-list next-pointer as a
|
|
985
|
+
// live nodeset — heap corruption reachable from public-API misuse.
|
|
986
|
+
// The free-list now parks entries behind an internal CACHED sentinel
|
|
987
|
+
// and a second free is a no-op.
|
|
988
|
+
TEST(XPathResults, DoubleFreeIsANoOp) {
|
|
989
|
+
const char xml[] = "<r><a x='1'/><a x='2'/></r>";
|
|
990
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
991
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
992
|
+
ASSERT_NE(doc, nullptr);
|
|
993
|
+
|
|
994
|
+
for (int i = 0; i < 3; i++) {
|
|
995
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a[@x='1']");
|
|
996
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
997
|
+
leptris_xpath_result_free(r);
|
|
998
|
+
leptris_xpath_result_free(r); /* must be a silent no-op */
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/* The engine (and its free-list) must still work afterwards. */
|
|
1002
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "//a");
|
|
1003
|
+
ASSERT_NE(r2, (LeptrisXPathResult)0);
|
|
1004
|
+
leptris_xpath_result_free(r2);
|
|
1005
|
+
|
|
1006
|
+
leptris_document_free(doc);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// Mixed nodesets (architecture review, candidate A): nodesets contain
|
|
1010
|
+
// element nodes AND synthetic attribute nodes. The kind/get_node/
|
|
1011
|
+
// node_name/node_value quartet is the public way to consume them;
|
|
1012
|
+
// leptris_xpath_result_get stays elements-only.
|
|
1013
|
+
TEST(XPathResults, MixedNodesetAttributeKind) {
|
|
1014
|
+
const char xml[] = "<r><a x='1'/><a x='2'/></r>";
|
|
1015
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1016
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1017
|
+
ASSERT_NE(doc, nullptr);
|
|
1018
|
+
|
|
1019
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a/@x");
|
|
1020
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1021
|
+
ASSERT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1022
|
+
|
|
1023
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 0), LEPTRIS_XPATH_NODE_ATTRIBUTE);
|
|
1024
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 1), LEPTRIS_XPATH_NODE_ATTRIBUTE);
|
|
1025
|
+
EXPECT_STREQ(leptris_xpath_result_node_name(r, 0), "x");
|
|
1026
|
+
EXPECT_STREQ(leptris_xpath_result_node_value(r, 0), "1");
|
|
1027
|
+
EXPECT_STREQ(leptris_xpath_result_node_value(r, 1), "2");
|
|
1028
|
+
|
|
1029
|
+
/* Elements-only accessor must not miscast an attribute node. */
|
|
1030
|
+
EXPECT_EQ(leptris_xpath_result_get(r, 0), nullptr);
|
|
1031
|
+
/* The node handle itself is retrievable whatever the kind. */
|
|
1032
|
+
ASSERT_NE(leptris_xpath_result_get_node(r, 0), nullptr);
|
|
1033
|
+
|
|
1034
|
+
leptris_xpath_result_free(r);
|
|
1035
|
+
leptris_document_free(doc);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
TEST(XPathResults, MixedNodesetElementKind) {
|
|
1039
|
+
const char xml[] = "<r><a x='1'/><a x='2'/></r>";
|
|
1040
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1041
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1042
|
+
ASSERT_NE(doc, nullptr);
|
|
1043
|
+
|
|
1044
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a");
|
|
1045
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1046
|
+
ASSERT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1047
|
+
|
|
1048
|
+
for (size_t i = 0; i < 2; i++) {
|
|
1049
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, i), LEPTRIS_XPATH_NODE_ELEMENT);
|
|
1050
|
+
LeptrisNodeRef n = leptris_xpath_result_get_node(r, i);
|
|
1051
|
+
ASSERT_NE(n, nullptr);
|
|
1052
|
+
LeptrisElement e = leptris_node_as_element(n);
|
|
1053
|
+
ASSERT_NE(e, nullptr);
|
|
1054
|
+
EXPECT_STREQ(leptris_element_name(e), "a");
|
|
1055
|
+
/* Element nodes report their name; no string-value via the
|
|
1056
|
+
* node accessors (issue #477 mixed-nodeset contract). */
|
|
1057
|
+
EXPECT_STREQ(leptris_xpath_result_node_name(r, i), "a");
|
|
1058
|
+
EXPECT_EQ(leptris_xpath_result_node_value(r, i), nullptr);
|
|
1059
|
+
/* And the elements-only accessor agrees with get_node. */
|
|
1060
|
+
EXPECT_EQ(leptris_xpath_result_get(r, i), e);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/* Out of range / wrong type -> safe defaults. */
|
|
1064
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 99), LEPTRIS_XPATH_NODE_OTHER);
|
|
1065
|
+
EXPECT_EQ(leptris_xpath_result_get_node(r, 99), nullptr);
|
|
1066
|
+
EXPECT_EQ(leptris_xpath_result_node_name(r, 99), nullptr);
|
|
1067
|
+
EXPECT_EQ(leptris_xpath_result_node_value(r, 99), nullptr);
|
|
1068
|
+
|
|
1069
|
+
leptris_xpath_result_free(r);
|
|
1070
|
+
leptris_document_free(doc);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
TEST(XPathResults, GetNodesBatchCopiesElementsOnly) {
|
|
1074
|
+
const char xml[] = "<r><a x='1'/><a x='2'/></r>";
|
|
1075
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1076
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1077
|
+
ASSERT_NE(doc, nullptr);
|
|
1078
|
+
|
|
1079
|
+
/* Mixed result: 2 attribute nodes, 0 elements. */
|
|
1080
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a/@x");
|
|
1081
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1082
|
+
LeptrisElement out[4] = {0};
|
|
1083
|
+
EXPECT_EQ(leptris_xpath_result_get_nodes(r, out, 4), 0u);
|
|
1084
|
+
leptris_xpath_result_free(r);
|
|
1085
|
+
|
|
1086
|
+
/* Element result: both copied. */
|
|
1087
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(doc, nullptr, "//a");
|
|
1088
|
+
ASSERT_NE(r2, (LeptrisXPathResult)0);
|
|
1089
|
+
EXPECT_EQ(leptris_xpath_result_get_nodes(r2, out, 4), 2u);
|
|
1090
|
+
EXPECT_STREQ(leptris_element_name(out[0]), "a");
|
|
1091
|
+
leptris_xpath_result_free(r2);
|
|
1092
|
+
|
|
1093
|
+
leptris_document_free(doc);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// ---- issue #477: mixed-nodeset tag-space collision + accessors --
|
|
1097
|
+
|
|
1098
|
+
TEST(XPathResults, MixedNodesetKindsNamesValues) {
|
|
1099
|
+
/* Element, text, comment, CDATA all in one //node() result.
|
|
1100
|
+
* Regression: synthetic attribute nodes used tag 1, colliding
|
|
1101
|
+
* with real text nodes (public tag 1) — node_name/miscast crashed
|
|
1102
|
+
* on text entries. */
|
|
1103
|
+
const char xml[] = "<r><a id='1'>hello</a><!-- c --><b><![CDATA[cd]]></b></r>";
|
|
1104
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1105
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1106
|
+
ASSERT_NE(doc, nullptr);
|
|
1107
|
+
|
|
1108
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//node()");
|
|
1109
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1110
|
+
size_t n = leptris_xpath_result_count(r);
|
|
1111
|
+
ASSERT_EQ(n, 6u); /* r + a, hello, comment, b, cd (root included) */
|
|
1112
|
+
|
|
1113
|
+
/* Every entry must be classified by its real kind (no crash,
|
|
1114
|
+
* no miscast), and name/value must match the node's content. */
|
|
1115
|
+
int elements = 0, texts = 0, others = 0;
|
|
1116
|
+
for (size_t i = 0; i < n; i++) {
|
|
1117
|
+
LeptrisXPathNodeKind k = leptris_xpath_result_node_kind(r, i);
|
|
1118
|
+
const char* name = leptris_xpath_result_node_name(r, i);
|
|
1119
|
+
const char* value = leptris_xpath_result_node_value(r, i);
|
|
1120
|
+
switch (k) {
|
|
1121
|
+
case LEPTRIS_XPATH_NODE_ELEMENT:
|
|
1122
|
+
elements++;
|
|
1123
|
+
/* r, a and b are the three elements in the result. */
|
|
1124
|
+
EXPECT_TRUE(name != nullptr &&
|
|
1125
|
+
(std::strcmp(name, "a") == 0 ||
|
|
1126
|
+
std::strcmp(name, "b") == 0 ||
|
|
1127
|
+
std::strcmp(name, "r") == 0));
|
|
1128
|
+
break;
|
|
1129
|
+
case LEPTRIS_XPATH_NODE_TEXT:
|
|
1130
|
+
texts++;
|
|
1131
|
+
EXPECT_EQ(name, nullptr);
|
|
1132
|
+
ASSERT_NE(value, nullptr);
|
|
1133
|
+
EXPECT_TRUE(std::strcmp(value, "hello") == 0 ||
|
|
1134
|
+
std::strcmp(value, "cd") == 0);
|
|
1135
|
+
break;
|
|
1136
|
+
default:
|
|
1137
|
+
others++;
|
|
1138
|
+
EXPECT_EQ(name, nullptr);
|
|
1139
|
+
ASSERT_NE(value, nullptr);
|
|
1140
|
+
EXPECT_STREQ(value, " c ");
|
|
1141
|
+
break;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
EXPECT_EQ(elements, 3);
|
|
1145
|
+
EXPECT_EQ(texts, 2);
|
|
1146
|
+
EXPECT_EQ(others, 1);
|
|
1147
|
+
|
|
1148
|
+
leptris_xpath_result_free(r);
|
|
1149
|
+
leptris_document_free(doc);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
TEST(XPathResults, MixedNodesetAttributeNameValue) {
|
|
1153
|
+
const char xml[] = "<r><a id='x1'>t</a></r>";
|
|
1154
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1155
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1156
|
+
ASSERT_NE(doc, nullptr);
|
|
1157
|
+
|
|
1158
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a/@id");
|
|
1159
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1160
|
+
ASSERT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1161
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 0), LEPTRIS_XPATH_NODE_ATTRIBUTE);
|
|
1162
|
+
EXPECT_STREQ(leptris_xpath_result_node_name(r, 0), "id");
|
|
1163
|
+
EXPECT_STREQ(leptris_xpath_result_node_value(r, 0), "x1");
|
|
1164
|
+
|
|
1165
|
+
leptris_xpath_result_free(r);
|
|
1166
|
+
leptris_document_free(doc);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
TEST(XPathResults, NameFunctionsOnAttributeNodeset) {
|
|
1170
|
+
/* Regression: name()/local-name()/namespace-uri() read their arg
|
|
1171
|
+
* nodeset's first node AFTER freeing the result that owned the
|
|
1172
|
+
* synthetic attribute node — dangling read. */
|
|
1173
|
+
const char xml[] = "<r><a id='x1'>t</a></r>";
|
|
1174
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1175
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1176
|
+
ASSERT_NE(doc, nullptr);
|
|
1177
|
+
|
|
1178
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "name(//a/@id)");
|
|
1179
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1180
|
+
char* s = leptris_xpath_result_string(r);
|
|
1181
|
+
ASSERT_NE(s, nullptr);
|
|
1182
|
+
EXPECT_STREQ(s, "id");
|
|
1183
|
+
leptris_free_string(s);
|
|
1184
|
+
leptris_xpath_result_free(r);
|
|
1185
|
+
|
|
1186
|
+
r = leptris_xpath_eval(doc, nullptr, "local-name(//a/@id)");
|
|
1187
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1188
|
+
s = leptris_xpath_result_string(r);
|
|
1189
|
+
ASSERT_NE(s, nullptr);
|
|
1190
|
+
EXPECT_STREQ(s, "id");
|
|
1191
|
+
leptris_free_string(s);
|
|
1192
|
+
leptris_xpath_result_free(r);
|
|
1193
|
+
|
|
1194
|
+
r = leptris_xpath_eval(doc, nullptr, "namespace-uri(//a/@id)");
|
|
1195
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1196
|
+
s = leptris_xpath_result_string(r);
|
|
1197
|
+
ASSERT_NE(s, nullptr);
|
|
1198
|
+
EXPECT_STREQ(s, "");
|
|
1199
|
+
leptris_free_string(s);
|
|
1200
|
+
leptris_xpath_result_free(r);
|
|
1201
|
+
|
|
1202
|
+
leptris_document_free(doc);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
TEST(XPathResults, TextNodeTestAsExpression) {
|
|
1206
|
+
/* Regression: bare text()/node() in expression position was
|
|
1207
|
+
* parsed as an unknown FUNCTION call, so a[text()] and
|
|
1208
|
+
* a[text()='...'] predicates matched nothing. */
|
|
1209
|
+
const char xml[] = "<r><a>hello</a><b/><c>zz</c></r>";
|
|
1210
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1211
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1212
|
+
ASSERT_NE(doc, nullptr);
|
|
1213
|
+
|
|
1214
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a[text()]");
|
|
1215
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1216
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1217
|
+
leptris_xpath_result_free(r);
|
|
1218
|
+
|
|
1219
|
+
r = leptris_xpath_eval(doc, nullptr, "//b[text()]");
|
|
1220
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1221
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 0u);
|
|
1222
|
+
leptris_xpath_result_free(r);
|
|
1223
|
+
|
|
1224
|
+
r = leptris_xpath_eval(doc, nullptr, "//c[text()='zz']");
|
|
1225
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1226
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1227
|
+
leptris_xpath_result_free(r);
|
|
1228
|
+
|
|
1229
|
+
r = leptris_xpath_eval(doc, nullptr, "//c[text()='nope']");
|
|
1230
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1231
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 0u);
|
|
1232
|
+
leptris_xpath_result_free(r);
|
|
1233
|
+
|
|
1234
|
+
/* text() no longer double-counts elements with text content. */
|
|
1235
|
+
r = leptris_xpath_eval(doc, nullptr, "//text()");
|
|
1236
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1237
|
+
ASSERT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1238
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 0), LEPTRIS_XPATH_NODE_TEXT);
|
|
1239
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 1), LEPTRIS_XPATH_NODE_TEXT);
|
|
1240
|
+
leptris_xpath_result_free(r);
|
|
1241
|
+
|
|
1242
|
+
leptris_document_free(doc);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
TEST(XPathResults, StringValueOfNonElementNodes) {
|
|
1246
|
+
const char xml[] = "<r><a id='x9'>hello</a><!-- c --><b><![CDATA[7]]></b></r>";
|
|
1247
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1248
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1249
|
+
ASSERT_NE(doc, nullptr);
|
|
1250
|
+
|
|
1251
|
+
struct { const char* expr; const char* want; } cases[] = {
|
|
1252
|
+
{"string(//text())", "hello"},
|
|
1253
|
+
{"string(//comment())", " c "},
|
|
1254
|
+
{"string(//b)", "7"},
|
|
1255
|
+
{"string(//a/@id)", "x9"},
|
|
1256
|
+
};
|
|
1257
|
+
for (auto& c : cases) {
|
|
1258
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, c.expr);
|
|
1259
|
+
ASSERT_NE(r, (LeptrisXPathResult)0) << c.expr;
|
|
1260
|
+
char* s = leptris_xpath_result_string(r);
|
|
1261
|
+
ASSERT_NE(s, nullptr) << c.expr;
|
|
1262
|
+
EXPECT_STREQ(s, c.want) << c.expr;
|
|
1263
|
+
leptris_free_string(s);
|
|
1264
|
+
leptris_xpath_result_free(r);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
leptris_document_free(doc);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// ---- issue #485: document order in merged nodesets --
|
|
1271
|
+
|
|
1272
|
+
namespace {
|
|
1273
|
+
|
|
1274
|
+
/* Collect element names / kinds for a nodeset result, in result
|
|
1275
|
+
* order, as a comparable string ("a txt cmt b" style). */
|
|
1276
|
+
std::string NodesetSequence(LeptrisXPathResult r) {
|
|
1277
|
+
std::string out;
|
|
1278
|
+
size_t n = leptris_xpath_result_count(r);
|
|
1279
|
+
for (size_t i = 0; i < n; i++) {
|
|
1280
|
+
if (!out.empty()) out += ' ';
|
|
1281
|
+
LeptrisXPathNodeKind k = leptris_xpath_result_node_kind(r, i);
|
|
1282
|
+
switch (k) {
|
|
1283
|
+
case LEPTRIS_XPATH_NODE_ELEMENT: {
|
|
1284
|
+
const char* nm = leptris_xpath_result_node_name(r, i);
|
|
1285
|
+
out += nm ? nm : "?";
|
|
1286
|
+
break;
|
|
1287
|
+
}
|
|
1288
|
+
case LEPTRIS_XPATH_NODE_TEXT: {
|
|
1289
|
+
const char* v = leptris_xpath_result_node_value(r, i);
|
|
1290
|
+
out += "t:";
|
|
1291
|
+
out += v ? v : "";
|
|
1292
|
+
break;
|
|
1293
|
+
}
|
|
1294
|
+
default:
|
|
1295
|
+
out += "other";
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
return out;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
} // namespace
|
|
1303
|
+
|
|
1304
|
+
TEST(XPathResults, DocumentOrderMergedNodeset) {
|
|
1305
|
+
/* Children of an early element interleave with the element's
|
|
1306
|
+
* own later siblings: text inside <a> precedes the comment that
|
|
1307
|
+
* follows <a>. Regression: per-context append produced
|
|
1308
|
+
* [a, cmt, text, b, bb]. */
|
|
1309
|
+
const char xml[] =
|
|
1310
|
+
"<r><a>text</a><!-- c --><b>bb</b><c><d>dd</d></c></r>";
|
|
1311
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1312
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1313
|
+
ASSERT_NE(doc, nullptr);
|
|
1314
|
+
|
|
1315
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//node()");
|
|
1316
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1317
|
+
EXPECT_EQ(NodesetSequence(r),
|
|
1318
|
+
"r a t:text other b t:bb c d t:dd");
|
|
1319
|
+
leptris_xpath_result_free(r);
|
|
1320
|
+
|
|
1321
|
+
r = leptris_xpath_eval(doc, nullptr, "//text()");
|
|
1322
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1323
|
+
EXPECT_EQ(NodesetSequence(r), "t:text t:bb t:dd");
|
|
1324
|
+
leptris_xpath_result_free(r);
|
|
1325
|
+
|
|
1326
|
+
/* Union of overlapping sets stays in document order, deduped. */
|
|
1327
|
+
r = leptris_xpath_eval(doc, nullptr, "//b | //node()");
|
|
1328
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1329
|
+
EXPECT_EQ(NodesetSequence(r),
|
|
1330
|
+
"r a t:text other b t:bb c d t:dd");
|
|
1331
|
+
leptris_xpath_result_free(r);
|
|
1332
|
+
|
|
1333
|
+
/* Deeply nested text orders across subtrees. */
|
|
1334
|
+
const char xml2[] = "<r><x><y>1</y></x><z>2</z></r>";
|
|
1335
|
+
LeptrisDocument doc2 = leptris_parse_string(xml2, std::strlen(xml2), &st);
|
|
1336
|
+
ASSERT_NE(doc2, nullptr);
|
|
1337
|
+
r = leptris_xpath_eval(doc2, nullptr, "//node()");
|
|
1338
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1339
|
+
EXPECT_EQ(NodesetSequence(r), "r x y t:1 z t:2");
|
|
1340
|
+
leptris_xpath_result_free(r);
|
|
1341
|
+
leptris_document_free(doc2);
|
|
1342
|
+
|
|
1343
|
+
leptris_document_free(doc);
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
TEST(XPathResults, DocumentOrderReverseAxis) {
|
|
1347
|
+
/* Reverse axes report reverse document order: the ancestors of
|
|
1348
|
+
* later matches come first. */
|
|
1349
|
+
const char xml[] = "<r><a><x>1</x></a><b><x>2</x></b></r>";
|
|
1350
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1351
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1352
|
+
ASSERT_NE(doc, nullptr);
|
|
1353
|
+
|
|
1354
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//x/ancestor::*");
|
|
1355
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1356
|
+
EXPECT_EQ(NodesetSequence(r), "b a r");
|
|
1357
|
+
leptris_xpath_result_free(r);
|
|
1358
|
+
|
|
1359
|
+
leptris_document_free(doc);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
TEST(XPathResults, AbsoluteTypeTestWalkOrder) {
|
|
1363
|
+
/* //text(), //node(), //comment(), //processing-instruction()
|
|
1364
|
+
* fold to a single pre-order walk (issue #485) — verify counts
|
|
1365
|
+
* and order through the folded path. */
|
|
1366
|
+
const char xml[] =
|
|
1367
|
+
"<r><?one data?><a>t1</a><?two data?><!--c--><b><![CDATA[cd]]></b></r>";
|
|
1368
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1369
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1370
|
+
ASSERT_NE(doc, nullptr);
|
|
1371
|
+
|
|
1372
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//node()");
|
|
1373
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1374
|
+
EXPECT_EQ(NodesetSequence(r), "r other a t:t1 other other b t:cd");
|
|
1375
|
+
leptris_xpath_result_free(r);
|
|
1376
|
+
|
|
1377
|
+
r = leptris_xpath_eval(doc, nullptr, "//processing-instruction()");
|
|
1378
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1379
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1380
|
+
leptris_xpath_result_free(r);
|
|
1381
|
+
|
|
1382
|
+
r = leptris_xpath_eval(doc, nullptr, "//processing-instruction('two')");
|
|
1383
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1384
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1385
|
+
leptris_xpath_result_free(r);
|
|
1386
|
+
|
|
1387
|
+
r = leptris_xpath_eval(doc, nullptr, "//processing-instruction('nope')");
|
|
1388
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1389
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 0u);
|
|
1390
|
+
leptris_xpath_result_free(r);
|
|
1391
|
+
|
|
1392
|
+
leptris_document_free(doc);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
// ---- perf round 19: hashed index buckets + sort-based union dedup --
|
|
1396
|
+
|
|
1397
|
+
TEST(XPathResults, IndexWithManyDistinctValuesAndNames) {
|
|
1398
|
+
/* 300 distinct id values + 300 distinct element names force the
|
|
1399
|
+
* element-index build through its hashed bucket lookups. The
|
|
1400
|
+
* linear scans this replaced were O(distinct^2) — 300ms on a
|
|
1401
|
+
* 20k-unique-id document. */
|
|
1402
|
+
std::string xml = "<root>";
|
|
1403
|
+
for (int i = 0; i < 300; i++) {
|
|
1404
|
+
xml += "<e" + std::to_string(i) + " id='k" + std::to_string(i) + "'>v</e";
|
|
1405
|
+
xml += std::to_string(i) + ">";
|
|
1406
|
+
}
|
|
1407
|
+
xml += "</root>";
|
|
1408
|
+
|
|
1409
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1410
|
+
LeptrisDocument doc = leptris_parse_string(xml.c_str(), xml.size(), &st);
|
|
1411
|
+
ASSERT_NE(doc, nullptr);
|
|
1412
|
+
|
|
1413
|
+
/* Two //name queries: the second triggers the index build
|
|
1414
|
+
* (TODO 190). All lookups must hit the hashed buckets. */
|
|
1415
|
+
for (int round = 0; round < 2; round++) {
|
|
1416
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//e7");
|
|
1417
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1418
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1419
|
+
leptris_xpath_result_free(r);
|
|
1420
|
+
|
|
1421
|
+
r = leptris_xpath_eval(doc, nullptr, "//e299");
|
|
1422
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1423
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1424
|
+
leptris_xpath_result_free(r);
|
|
1425
|
+
|
|
1426
|
+
r = leptris_xpath_eval(doc, nullptr, "//*[@id='k0']");
|
|
1427
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1428
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1429
|
+
leptris_xpath_result_free(r);
|
|
1430
|
+
|
|
1431
|
+
r = leptris_xpath_eval(doc, nullptr, "//*[@id='k150']");
|
|
1432
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1433
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1434
|
+
leptris_xpath_result_free(r);
|
|
1435
|
+
|
|
1436
|
+
/* Duplicate values map to every matching element. */
|
|
1437
|
+
r = leptris_xpath_eval(doc, nullptr, "//*[.='v']");
|
|
1438
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1439
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 300u);
|
|
1440
|
+
leptris_xpath_result_free(r);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
/* Union dedup: overlapping sets, no duplicates in the result. */
|
|
1444
|
+
LeptrisXPathResult r = leptris_xpath_eval(
|
|
1445
|
+
doc, nullptr, "//*[@id='k5'] | //e5 | //*[@id='k5']");
|
|
1446
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1447
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1448
|
+
leptris_xpath_result_free(r);
|
|
1449
|
+
|
|
1450
|
+
leptris_document_free(doc);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
// ---- external namespace bindings (v1.2.0: XPointer xmlns) --------
|
|
1454
|
+
|
|
1455
|
+
TEST(XPathNamespaces, BoundPrefixMatchesByNamespaceUri) {
|
|
1456
|
+
/* t:title and the default-ns title are both in http://x; the
|
|
1457
|
+
* plain title is in no namespace. */
|
|
1458
|
+
const char xml[] =
|
|
1459
|
+
"<r xmlns:t='http://x'>"
|
|
1460
|
+
"<t:title>A</t:title>"
|
|
1461
|
+
"<other xmlns='http://x'><title>B</title></other>"
|
|
1462
|
+
"<title>plain</title>"
|
|
1463
|
+
"</r>";
|
|
1464
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1465
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1466
|
+
ASSERT_NE(doc, nullptr);
|
|
1467
|
+
|
|
1468
|
+
LeptrisXPathNsSet ns = leptris_xpath_ns_set_new();
|
|
1469
|
+
ASSERT_NE(ns, nullptr);
|
|
1470
|
+
EXPECT_EQ(leptris_xpath_ns_set_add(ns, "p", "http://x"), LEPTRIS_OK);
|
|
1471
|
+
|
|
1472
|
+
/* p:title matches by URI: both namespace-carried titles. */
|
|
1473
|
+
LeptrisXPathResult r = leptris_xpath_eval_ns(doc, nullptr, "//p:title", ns);
|
|
1474
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1475
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1476
|
+
leptris_xpath_result_free(r);
|
|
1477
|
+
|
|
1478
|
+
/* p:* is namespace-scoped: the three elements in http://x. */
|
|
1479
|
+
r = leptris_xpath_eval_ns(doc, nullptr, "//p:*", ns);
|
|
1480
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1481
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 3u);
|
|
1482
|
+
leptris_xpath_result_free(r);
|
|
1483
|
+
|
|
1484
|
+
/* Re-binding replaces the URI: now nothing matches. */
|
|
1485
|
+
EXPECT_EQ(leptris_xpath_ns_set_add(ns, "p", "http://empty"), LEPTRIS_OK);
|
|
1486
|
+
r = leptris_xpath_eval_ns(doc, nullptr, "//p:title", ns);
|
|
1487
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1488
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 0u);
|
|
1489
|
+
leptris_xpath_result_free(r);
|
|
1490
|
+
|
|
1491
|
+
leptris_xpath_ns_set_free(ns);
|
|
1492
|
+
leptris_document_free(doc);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
TEST(XPathNamespaces, UnboundPrefixesKeepLiteralSemantics) {
|
|
1496
|
+
const char xml[] =
|
|
1497
|
+
"<r xmlns:t='http://x'><t:title>A</t:title><b/><t:c/></r>";
|
|
1498
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
1499
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), &st);
|
|
1500
|
+
ASSERT_NE(doc, nullptr);
|
|
1501
|
+
|
|
1502
|
+
/* No bindings: literal prefix comparison. */
|
|
1503
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//t:title");
|
|
1504
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1505
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1506
|
+
leptris_xpath_result_free(r);
|
|
1507
|
+
|
|
1508
|
+
/* Regression: //t:* previously matched EVERY element (the
|
|
1509
|
+
* wildcard fusion and the matcher both ignored the prefix);
|
|
1510
|
+
* it must be namespace-scoped to t:. */
|
|
1511
|
+
r = leptris_xpath_eval(doc, nullptr, "//t:*");
|
|
1512
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1513
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1514
|
+
leptris_xpath_result_free(r);
|
|
1515
|
+
|
|
1516
|
+
/* NULL bindings on the ns entry point = plain evaluation. */
|
|
1517
|
+
r = leptris_xpath_eval_ns(doc, nullptr, "//t:c", nullptr);
|
|
1518
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
1519
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
1520
|
+
leptris_xpath_result_free(r);
|
|
1521
|
+
|
|
1522
|
+
leptris_document_free(doc);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
TEST(XPathNamespaces, BadBindingArgumentsRejected) {
|
|
1526
|
+
LeptrisXPathNsSet ns = leptris_xpath_ns_set_new();
|
|
1527
|
+
ASSERT_NE(ns, nullptr);
|
|
1528
|
+
EXPECT_EQ(leptris_xpath_ns_set_add(ns, nullptr, "u"), LEPTRIS_ERROR_NULL_ARG);
|
|
1529
|
+
EXPECT_EQ(leptris_xpath_ns_set_add(ns, "p", nullptr), LEPTRIS_ERROR_NULL_ARG);
|
|
1530
|
+
EXPECT_EQ(leptris_xpath_ns_set_add(ns, "", "u"), LEPTRIS_ERROR_NULL_ARG);
|
|
1531
|
+
leptris_xpath_ns_set_free(ns);
|
|
1532
|
+
leptris_xpath_ns_set_free(nullptr);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
// ---- TODO.remaining/07: compile-time folding of literal string fns --
|
|
1536
|
+
|
|
1537
|
+
TEST(XPathConstantFolding, ConcatOfLiterals) {
|
|
1538
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1539
|
+
ASSERT_NE(doc, nullptr);
|
|
1540
|
+
|
|
1541
|
+
LeptrisXPathResult r = leptris_xpath_eval(
|
|
1542
|
+
doc, nullptr, "concat('leptris', '-', 'is', ' ', 'fast')");
|
|
1543
|
+
ASSERT_NE(r, nullptr);
|
|
1544
|
+
char* s = leptris_xpath_result_string(r);
|
|
1545
|
+
ASSERT_NE(s, nullptr);
|
|
1546
|
+
EXPECT_STREQ(s, "leptris-is fast");
|
|
1547
|
+
leptris_free_string(s);
|
|
1548
|
+
leptris_xpath_result_free(r);
|
|
1549
|
+
leptris_document_free(doc);
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
TEST(XPathConstantFolding, ConcatWithRuntimeArgStaysRuntime) {
|
|
1553
|
+
/* position() is not a literal: the fold must NOT fire; the
|
|
1554
|
+
* result still comes out right via the normal path. */
|
|
1555
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1556
|
+
ASSERT_NE(doc, nullptr);
|
|
1557
|
+
|
|
1558
|
+
LeptrisXPathResult r = leptris_xpath_eval(
|
|
1559
|
+
doc, nullptr, "concat('n', position())");
|
|
1560
|
+
ASSERT_NE(r, nullptr);
|
|
1561
|
+
char* s = leptris_xpath_result_string(r);
|
|
1562
|
+
ASSERT_NE(s, nullptr);
|
|
1563
|
+
EXPECT_STREQ(s, "n1");
|
|
1564
|
+
leptris_free_string(s);
|
|
1565
|
+
leptris_xpath_result_free(r);
|
|
1566
|
+
leptris_document_free(doc);
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
TEST(XPathConstantFolding, ContainsLiteralsFoldToBoolean) {
|
|
1570
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1571
|
+
ASSERT_NE(doc, nullptr);
|
|
1572
|
+
|
|
1573
|
+
LeptrisXPathResult r1 = leptris_xpath_eval(
|
|
1574
|
+
doc, nullptr, "contains('leptris', 'ptri')");
|
|
1575
|
+
ASSERT_NE(r1, nullptr);
|
|
1576
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r1), 1);
|
|
1577
|
+
leptris_xpath_result_free(r1);
|
|
1578
|
+
|
|
1579
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(
|
|
1580
|
+
doc, nullptr, "contains('leptris', 'x')");
|
|
1581
|
+
ASSERT_NE(r2, nullptr);
|
|
1582
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r2), 0);
|
|
1583
|
+
leptris_xpath_result_free(r2);
|
|
1584
|
+
|
|
1585
|
+
leptris_document_free(doc);
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
TEST(XPathConstantFolding, ContainsFoldWorksInBooleanContext) {
|
|
1589
|
+
/* Folded boolean feeding the `and` operator. */
|
|
1590
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1591
|
+
ASSERT_NE(doc, nullptr);
|
|
1592
|
+
|
|
1593
|
+
LeptrisXPathResult r = leptris_xpath_eval(
|
|
1594
|
+
doc, nullptr, "contains('abc','b') and contains('abc','z')");
|
|
1595
|
+
ASSERT_NE(r, nullptr);
|
|
1596
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r), 0);
|
|
1597
|
+
leptris_xpath_result_free(r);
|
|
1598
|
+
|
|
1599
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(
|
|
1600
|
+
doc, nullptr, "contains('abc','a') and contains('abc','c')");
|
|
1601
|
+
ASSERT_NE(r2, nullptr);
|
|
1602
|
+
EXPECT_EQ(leptris_xpath_result_boolean(r2), 1);
|
|
1603
|
+
leptris_xpath_result_free(r2);
|
|
1604
|
+
|
|
1605
|
+
leptris_document_free(doc);
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
TEST(XPathConstantFolding, SubstringLiteralsFoldWithRounding) {
|
|
1609
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1610
|
+
ASSERT_NE(doc, nullptr);
|
|
1611
|
+
|
|
1612
|
+
struct { const char* expr; const char* want; } cases[] = {
|
|
1613
|
+
{ "substring('12345', 2, 3)", "234" },
|
|
1614
|
+
{ "substring('12345', 2)", "2345" },
|
|
1615
|
+
{ "substring('12345', 1.5, 2.6)", "234" }, /* round: 2,3 */
|
|
1616
|
+
{ "substring('12345', 0, 3)", "12" }, /* pos<1 clamps */
|
|
1617
|
+
{ "substring('12345', -1, 3)", "1" },
|
|
1618
|
+
/* UTF-8: characters, not bytes. */
|
|
1619
|
+
{ "substring('café-au-lait', 4, 2)", "\xc3\xa9-" },
|
|
1620
|
+
{ "substring('caf\xc3\xa9', 4)", "\xc3\xa9" },
|
|
1621
|
+
};
|
|
1622
|
+
for (auto& c : cases) {
|
|
1623
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, c.expr);
|
|
1624
|
+
ASSERT_NE(r, nullptr) << c.expr;
|
|
1625
|
+
char* s = leptris_xpath_result_string(r);
|
|
1626
|
+
ASSERT_NE(s, nullptr) << c.expr;
|
|
1627
|
+
EXPECT_STREQ(s, c.want) << c.expr;
|
|
1628
|
+
leptris_free_string(s);
|
|
1629
|
+
leptris_xpath_result_free(r);
|
|
1630
|
+
}
|
|
1631
|
+
leptris_document_free(doc);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
/* Issue #525 (XPath 1.0 §2.3): an unprefixed name test matches only
|
|
1635
|
+
* NO-namespace elements — prefix-less elements under a default xmlns
|
|
1636
|
+
* are namespaced and must not match. */
|
|
1637
|
+
TEST(NamespaceConformance, UnprefixedNameTestMatchesNoNamespaceOnly) {
|
|
1638
|
+
auto count = [](LeptrisDocument d, const char* expr) -> int {
|
|
1639
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr, expr);
|
|
1640
|
+
int n = r ? (int)leptris_xpath_result_number(r) : -1;
|
|
1641
|
+
if (r) leptris_xpath_result_free(r);
|
|
1642
|
+
return n;
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
const char* prefixed =
|
|
1646
|
+
"<library xmlns:p='urn:p'><p:note>x</p:note></library>";
|
|
1647
|
+
LeptrisDocument d1 = leptris_parse_string(prefixed, strlen(prefixed), nullptr);
|
|
1648
|
+
ASSERT_NE(d1, nullptr);
|
|
1649
|
+
EXPECT_EQ(count(d1, "count(//p:note)"), 1);
|
|
1650
|
+
EXPECT_EQ(count(d1, "count(//note)"), 0);
|
|
1651
|
+
leptris_document_free(d1);
|
|
1652
|
+
|
|
1653
|
+
const char* defaulted = "<r xmlns='urn:d'><n/></r>";
|
|
1654
|
+
LeptrisDocument d2 = leptris_parse_string(defaulted, strlen(defaulted), nullptr);
|
|
1655
|
+
ASSERT_NE(d2, nullptr);
|
|
1656
|
+
EXPECT_EQ(count(d2, "count(//n)"), 0);
|
|
1657
|
+
leptris_document_free(d2);
|
|
1658
|
+
|
|
1659
|
+
const char* plain = "<r><n/></r>";
|
|
1660
|
+
LeptrisDocument d3 = leptris_parse_string(plain, strlen(plain), nullptr);
|
|
1661
|
+
ASSERT_NE(d3, nullptr);
|
|
1662
|
+
EXPECT_EQ(count(d3, "count(//n)"), 1);
|
|
1663
|
+
leptris_document_free(d3);
|
|
1664
|
+
|
|
1665
|
+
/* Mixed document: each form selects exactly its own elements. */
|
|
1666
|
+
const char* mixed =
|
|
1667
|
+
"<r xmlns:p='urn:p'><a/><p:a/><a xmlns='urn:d'/></r>";
|
|
1668
|
+
LeptrisDocument d4 = leptris_parse_string(mixed, strlen(mixed), nullptr);
|
|
1669
|
+
ASSERT_NE(d4, nullptr);
|
|
1670
|
+
EXPECT_EQ(count(d4, "count(//a)"), 1);
|
|
1671
|
+
leptris_document_free(d4);
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
/* Issue #514: mixed (union) nodesets exposed attribute entries as
|
|
1675
|
+
* dangling pointers — kind=OTHER, NULL name/value, garbage tags. */
|
|
1676
|
+
TEST(MixedNodeset, UnionAttributesKeepIdentity) {
|
|
1677
|
+
const char xml[] = "<r><a id='1'>x</a><a id='2'>y</a></r>";
|
|
1678
|
+
LeptrisDocument doc = leptris_parse_string(xml, strlen(xml), nullptr);
|
|
1679
|
+
ASSERT_NE(doc, nullptr);
|
|
1680
|
+
|
|
1681
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, "//a | //a/@id");
|
|
1682
|
+
ASSERT_NE(r, nullptr);
|
|
1683
|
+
ASSERT_EQ(leptris_xpath_result_count(r), 4u);
|
|
1684
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 0), LEPTRIS_XPATH_NODE_ELEMENT);
|
|
1685
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 1), LEPTRIS_XPATH_NODE_ATTRIBUTE);
|
|
1686
|
+
EXPECT_STREQ(leptris_xpath_result_node_name(r, 1), "id");
|
|
1687
|
+
EXPECT_STREQ(leptris_xpath_result_node_value(r, 1), "1");
|
|
1688
|
+
EXPECT_EQ(leptris_xpath_result_node_kind(r, 3), LEPTRIS_XPATH_NODE_ATTRIBUTE);
|
|
1689
|
+
EXPECT_STREQ(leptris_xpath_result_node_value(r, 3), "2");
|
|
1690
|
+
leptris_xpath_result_free(r);
|
|
1691
|
+
leptris_document_free(doc);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/* Issue #557: an ABSOLUTE path with a prefixed name test must offer
|
|
1695
|
+
* the namespaced root element — the document node seeds absolute
|
|
1696
|
+
* paths, and the root IS a child of the document. */
|
|
1697
|
+
TEST(NsAbsolutePaths, PrefixedDoubleSlashMatchesNamespacedRoot) {
|
|
1698
|
+
const char xml[] = "<x:r xmlns:x='urn:x'><x:a/></x:r>";
|
|
1699
|
+
LeptrisDocument doc = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
1700
|
+
ASSERT_NE(doc, nullptr);
|
|
1701
|
+
LeptrisXPathNsSet ns = leptris_xpath_ns_set_new();
|
|
1702
|
+
leptris_xpath_ns_set_add(ns, "x", "urn:x");
|
|
1703
|
+
|
|
1704
|
+
LeptrisXPathResult r = leptris_xpath_eval_ns(doc, nullptr, "count(//x:r)", ns);
|
|
1705
|
+
ASSERT_NE(r, nullptr);
|
|
1706
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1707
|
+
leptris_xpath_result_free(r);
|
|
1708
|
+
|
|
1709
|
+
r = leptris_xpath_eval_ns(doc, nullptr, "count(//x:a)", ns);
|
|
1710
|
+
ASSERT_NE(r, nullptr);
|
|
1711
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1712
|
+
leptris_xpath_result_free(r);
|
|
1713
|
+
|
|
1714
|
+
r = leptris_xpath_eval_ns(doc, nullptr, "count(/x:r)", ns);
|
|
1715
|
+
ASSERT_NE(r, nullptr);
|
|
1716
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1717
|
+
leptris_xpath_result_free(r);
|
|
1718
|
+
|
|
1719
|
+
r = leptris_xpath_eval_ns(doc, nullptr, "count(/descendant::x:r)", ns);
|
|
1720
|
+
ASSERT_NE(r, nullptr);
|
|
1721
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1722
|
+
leptris_xpath_result_free(r);
|
|
1723
|
+
|
|
1724
|
+
leptris_xpath_ns_set_free(ns);
|
|
1725
|
+
leptris_document_free(doc);
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
/* Issue #565: variable-bound evaluation — the fused @attr=$var
|
|
1729
|
+
* predicate rides the index-backed VM path, not the interpreter. */
|
|
1730
|
+
TEST(VarBoundEval, AttrEqVarStringMatchesLiteralForm) {
|
|
1731
|
+
const char xml[] =
|
|
1732
|
+
"<r><book id='b1'>A</book><book id='b7'>G</book>"
|
|
1733
|
+
"<book id='b9'>I</book></r>";
|
|
1734
|
+
LeptrisDocument d = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
1735
|
+
ASSERT_NE(d, nullptr);
|
|
1736
|
+
LeptrisXPathVariableSet vs = leptris_xpath_variable_set_new();
|
|
1737
|
+
leptris_xpath_variable_set_string(vs, "want", "b7");
|
|
1738
|
+
|
|
1739
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(
|
|
1740
|
+
d, "count(//book[@id=$want])", vs);
|
|
1741
|
+
ASSERT_NE(r, nullptr);
|
|
1742
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1743
|
+
leptris_xpath_result_free(r);
|
|
1744
|
+
|
|
1745
|
+
/* reversed operand order: [$var=@attr] */
|
|
1746
|
+
r = leptris_xpath_eval_with_vars(
|
|
1747
|
+
d, "count(//book[$want=@id])", vs);
|
|
1748
|
+
ASSERT_NE(r, nullptr);
|
|
1749
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1750
|
+
leptris_xpath_result_free(r);
|
|
1751
|
+
leptris_xpath_variable_set_free(vs);
|
|
1752
|
+
leptris_document_free(d);
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
TEST(VarBoundEval, AttrEqVarNumberStringifies) {
|
|
1756
|
+
const char xml[] = "<r><e n='10'>x</e><e n='11'>y</e></r>";
|
|
1757
|
+
LeptrisDocument d = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
1758
|
+
ASSERT_NE(d, nullptr);
|
|
1759
|
+
LeptrisXPathVariableSet vs = leptris_xpath_variable_set_new();
|
|
1760
|
+
leptris_xpath_variable_set_number(vs, "k", 10.0);
|
|
1761
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(
|
|
1762
|
+
d, "count(//e[@n=$k])", vs);
|
|
1763
|
+
ASSERT_NE(r, nullptr);
|
|
1764
|
+
/* string(@n)='10' = string(10)='10' — one match */
|
|
1765
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 1.0);
|
|
1766
|
+
leptris_xpath_result_free(r);
|
|
1767
|
+
leptris_xpath_variable_set_free(vs);
|
|
1768
|
+
leptris_document_free(d);
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/* XPath 1.0: predicates apply to ANY node kind — text(), comment(),
|
|
1772
|
+
* PI, node() steps. The predicate evaluator used to bail out for
|
|
1773
|
+
* non-element candidates (text nodes silently never matched), so
|
|
1774
|
+
* text()[2] and node()[4] returned empty (libxslt bug-182). */
|
|
1775
|
+
TEST(PredicatesOnNonElements, PositionSelectsTextAndMixedNodes) {
|
|
1776
|
+
const char xml[] =
|
|
1777
|
+
"<root><body><b> b 1 </b> text 1 <b> b 2 </b> text 2 </body></root>";
|
|
1778
|
+
LeptrisDocument d = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
1779
|
+
ASSERT_NE(d, nullptr);
|
|
1780
|
+
|
|
1781
|
+
struct { const char* q; const char* want; } cases[] = {
|
|
1782
|
+
{"string(/root/body/text()[1])", " text 1 "},
|
|
1783
|
+
{"string(/root/body/text()[2])", " text 2 "},
|
|
1784
|
+
{"string(/root/body/node()[4])", " text 2 "},
|
|
1785
|
+
{"string(/root/body/node()[1])", " b 1 "},
|
|
1786
|
+
{"string(/root/body/text()[position()=2])", " text 2 "},
|
|
1787
|
+
{"string(/root/body/text()[last()])", " text 2 "},
|
|
1788
|
+
{"count(/root/body/text()[2])", "1"},
|
|
1789
|
+
};
|
|
1790
|
+
for (auto& c : cases) {
|
|
1791
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr, c.q);
|
|
1792
|
+
ASSERT_NE(r, nullptr) << c.q;
|
|
1793
|
+
char* s = leptris_xpath_result_string(r);
|
|
1794
|
+
EXPECT_STREQ(s ? s : "", c.want) << c.q;
|
|
1795
|
+
leptris_free_string(s);
|
|
1796
|
+
leptris_xpath_result_free(r);
|
|
1797
|
+
}
|
|
1798
|
+
leptris_document_free(d);
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
TEST(VarBoundEval, UndefinedVariableBareIsAnError) {
|
|
1802
|
+
const char xml[] = "<r><e n='1'/></r>";
|
|
1803
|
+
LeptrisDocument d = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
1804
|
+
ASSERT_NE(d, nullptr);
|
|
1805
|
+
LeptrisXPathVariableSet vs = leptris_xpath_variable_set_new();
|
|
1806
|
+
/* A bare $var reference is a hard error. Inside a PREDICATE an
|
|
1807
|
+
* undefined variable counts as a non-match (apply_predicates
|
|
1808
|
+
* filters in place; its callers merge whatever remains) — so
|
|
1809
|
+
* count(//e[@n=$missing]) is 0, not an error. Pinned so the
|
|
1810
|
+
* engine boundary stays observable: hard error at expression
|
|
1811
|
+
* level, soft-fail under a predicate filter. */
|
|
1812
|
+
LeptrisXPathResult r = leptris_xpath_eval_with_vars(d, "$missing", vs);
|
|
1813
|
+
EXPECT_EQ(r, nullptr);
|
|
1814
|
+
r = leptris_xpath_eval_with_vars(d, "count(//e[@n=$missing])", vs);
|
|
1815
|
+
ASSERT_NE(r, nullptr);
|
|
1816
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 0.0);
|
|
1817
|
+
leptris_xpath_result_free(r);
|
|
1818
|
+
leptris_xpath_variable_set_free(vs);
|
|
1819
|
+
leptris_document_free(d);
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/* The attribute AXIS must expand entities/character references in
|
|
1823
|
+
* values — value-of/@attr through XPath sees the same string the
|
|
1824
|
+
* leptris_element_attribute accessor returns (libxslt bug-59:
|
|
1825
|
+
* B&B serialized as B&#38;B). */
|
|
1826
|
+
TEST(AttributeAxis, ExpandsCharacterReferences) {
|
|
1827
|
+
const char xml[] = "<foo attribute=\"B&B\" a2=\"x&y\"/>";
|
|
1828
|
+
LeptrisDocument d = leptris_parse_string(xml, std::strlen(xml), nullptr);
|
|
1829
|
+
ASSERT_NE(d, nullptr);
|
|
1830
|
+
struct { const char* q; const char* want; } cases[] = {
|
|
1831
|
+
{"string(//@attribute)", "B&B"},
|
|
1832
|
+
{"string(//@a2)", "x&y"},
|
|
1833
|
+
{"string(/foo/@attribute)", "B&B"},
|
|
1834
|
+
{"concat(//@attribute, '!')", "B&B!"},
|
|
1835
|
+
};
|
|
1836
|
+
for (auto& c : cases) {
|
|
1837
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr, c.q);
|
|
1838
|
+
ASSERT_NE(r, nullptr) << c.q;
|
|
1839
|
+
char* sv = leptris_xpath_result_string(r);
|
|
1840
|
+
EXPECT_STREQ(sv ? sv : "", c.want) << c.q;
|
|
1841
|
+
leptris_free_string(sv);
|
|
1842
|
+
leptris_xpath_result_free(r);
|
|
1843
|
+
}
|
|
1844
|
+
leptris_document_free(d);
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
/* Issue #630: relative .//ns:x from ELEMENT context returned empty —
|
|
1848
|
+
* the element index keys buckets by local name and the VM's relative
|
|
1849
|
+
* descendant paths looked up the raw qualified string, missing every
|
|
1850
|
+
* bucket. The local bucket + namespace-aware filter fix must hold
|
|
1851
|
+
* for every context depth. */
|
|
1852
|
+
TEST(XPathAxes, RelativeDescendantPrefixedFromElementContext) {
|
|
1853
|
+
const char xml[] =
|
|
1854
|
+
"<r xmlns:x='urn:x'>"
|
|
1855
|
+
"<a><x:b id='1'/><c><x:b id='2'/></c></a>"
|
|
1856
|
+
"<x:b id='3'/>"
|
|
1857
|
+
"</r>";
|
|
1858
|
+
LeptrisDocument doc = ParseWith(xml);
|
|
1859
|
+
ASSERT_NE(doc, nullptr);
|
|
1860
|
+
|
|
1861
|
+
struct {
|
|
1862
|
+
const char* ctx;
|
|
1863
|
+
const char* expr;
|
|
1864
|
+
size_t want;
|
|
1865
|
+
} cases[] = {
|
|
1866
|
+
{"/r", ".//x:b", 3},
|
|
1867
|
+
{"/r", "descendant::x:b", 3},
|
|
1868
|
+
{"/r", "descendant-or-self::x:b", 3},
|
|
1869
|
+
{"/r/a", ".//x:b", 2},
|
|
1870
|
+
{"/r/a", "descendant::x:b", 2},
|
|
1871
|
+
{"/r/a/c", ".//x:b", 1},
|
|
1872
|
+
{"/r/a/c", "child::x:b", 1},
|
|
1873
|
+
{"/r/a/x:b", ".//x:b", 0}, /* leaf: no x:b below */
|
|
1874
|
+
{"/r/x:b", ".//x:b", 0},
|
|
1875
|
+
{"/r", "//x:b", 3}, /* absolute control */
|
|
1876
|
+
{"/r", ".//a", 1}, /* unprefixed control */
|
|
1877
|
+
};
|
|
1878
|
+
for (const auto& c : cases) {
|
|
1879
|
+
LeptrisXPathResult cr = leptris_xpath_eval(doc, nullptr, c.ctx);
|
|
1880
|
+
ASSERT_NE(cr, nullptr) << c.ctx;
|
|
1881
|
+
LeptrisElement ctx = leptris_xpath_result_get(cr, 0);
|
|
1882
|
+
ASSERT_NE(ctx, nullptr) << c.ctx;
|
|
1883
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, ctx, c.expr);
|
|
1884
|
+
ASSERT_NE(r, nullptr) << c.ctx << " " << c.expr;
|
|
1885
|
+
EXPECT_EQ(leptris_xpath_result_count(r), c.want)
|
|
1886
|
+
<< c.ctx << " " << c.expr;
|
|
1887
|
+
leptris_xpath_result_free(r);
|
|
1888
|
+
leptris_xpath_result_free(cr);
|
|
1889
|
+
}
|
|
1890
|
+
leptris_document_free(doc);
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
/* Same fix through an EXTERNAL binding: z resolves to the same URI
|
|
1894
|
+
* the document spells x, so .//z:b matches x:b elements. */
|
|
1895
|
+
TEST(XPathAxes, RelativeDescendantPrefixedResolvesByUri) {
|
|
1896
|
+
const char xml[] =
|
|
1897
|
+
"<r xmlns:x='urn:x'><a><x:b id='1'/><c><x:b id='2'/></c></a></r>";
|
|
1898
|
+
LeptrisDocument doc = ParseWith(xml);
|
|
1899
|
+
ASSERT_NE(doc, nullptr);
|
|
1900
|
+
|
|
1901
|
+
LeptrisXPathNsSet ns = leptris_xpath_ns_set_new();
|
|
1902
|
+
ASSERT_NE(ns, nullptr);
|
|
1903
|
+
ASSERT_EQ(leptris_xpath_ns_set_add(ns, "z", "urn:x"), LEPTRIS_OK);
|
|
1904
|
+
|
|
1905
|
+
LeptrisXPathResult cr = leptris_xpath_eval(doc, nullptr, "/r/a");
|
|
1906
|
+
ASSERT_NE(cr, nullptr);
|
|
1907
|
+
LeptrisElement a = leptris_xpath_result_get(cr, 0);
|
|
1908
|
+
ASSERT_NE(a, nullptr);
|
|
1909
|
+
|
|
1910
|
+
LeptrisXPathResult r = leptris_xpath_eval_ns(doc, a, ".//z:b", ns);
|
|
1911
|
+
ASSERT_NE(r, nullptr);
|
|
1912
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 2u);
|
|
1913
|
+
|
|
1914
|
+
leptris_xpath_result_free(r);
|
|
1915
|
+
leptris_xpath_result_free(cr);
|
|
1916
|
+
leptris_xpath_ns_set_free(ns);
|
|
1917
|
+
leptris_document_free(doc);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/* ---- #684 dependency ledger: XPath 2.0 grammar + function tail ----
|
|
1921
|
+
* Quantified expressions, node comparisons (is/<</>>), intersect/
|
|
1922
|
+
* except, the empty-sequence literal, ends-with and deep-equal —
|
|
1923
|
+
* XQuery 1.0 embeds XPath 2.0, so these are the conformance
|
|
1924
|
+
* blockers named in the issue's ledger. */
|
|
1925
|
+
|
|
1926
|
+
static bool BoolEval(const char* expr) {
|
|
1927
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1928
|
+
EXPECT_NE(doc, nullptr);
|
|
1929
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, expr);
|
|
1930
|
+
if (!r) { leptris_document_free(doc); return false; }
|
|
1931
|
+
bool v = leptris_xpath_result_type(r) == LEPTRIS_XPATH_BOOLEAN &&
|
|
1932
|
+
leptris_xpath_result_boolean(r);
|
|
1933
|
+
leptris_xpath_result_free(r);
|
|
1934
|
+
leptris_document_free(doc);
|
|
1935
|
+
return v;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
static double NumEval(const char* expr) {
|
|
1939
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1940
|
+
EXPECT_NE(doc, nullptr);
|
|
1941
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, expr);
|
|
1942
|
+
if (!r) { leptris_document_free(doc); return -1; }
|
|
1943
|
+
double v = leptris_xpath_result_number(r);
|
|
1944
|
+
leptris_xpath_result_free(r);
|
|
1945
|
+
leptris_document_free(doc);
|
|
1946
|
+
return v;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
static std::string StrEval(const char* expr) {
|
|
1950
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
1951
|
+
EXPECT_NE(doc, nullptr);
|
|
1952
|
+
LeptrisXPathResult r = leptris_xpath_eval(doc, nullptr, expr);
|
|
1953
|
+
if (!r) { leptris_document_free(doc); return "(eval-failed)"; }
|
|
1954
|
+
char* s = leptris_xpath_result_string(r);
|
|
1955
|
+
std::string v = s ? s : "";
|
|
1956
|
+
leptris_free_string(s);
|
|
1957
|
+
leptris_xpath_result_free(r);
|
|
1958
|
+
leptris_document_free(doc);
|
|
1959
|
+
return v;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
TEST(XPath20Ledger, QuantifiedExpressions) {
|
|
1963
|
+
EXPECT_TRUE(BoolEval("some $x in (1,2,3) satisfies $x > 2"));
|
|
1964
|
+
EXPECT_FALSE(BoolEval("some $x in (1,2,3) satisfies $x > 3"));
|
|
1965
|
+
EXPECT_TRUE(BoolEval("every $x in (1,2,3) satisfies $x > 0"));
|
|
1966
|
+
EXPECT_FALSE(BoolEval("every $x in (1,2,3) satisfies $x > 1"));
|
|
1967
|
+
/* Node-sequence domains bind nodes. */
|
|
1968
|
+
EXPECT_TRUE(BoolEval("some $b in //book satisfies $b/price > 25"));
|
|
1969
|
+
EXPECT_FALSE(BoolEval("every $b in //book satisfies $b/price > 15"));
|
|
1970
|
+
/* Multiple bindings are a cartesian product. */
|
|
1971
|
+
EXPECT_TRUE(
|
|
1972
|
+
BoolEval("some $x in (1,2), $y in (3,4) satisfies $x + $y > 5"));
|
|
1973
|
+
EXPECT_FALSE(
|
|
1974
|
+
BoolEval("every $x in (1,2), $y in (1,2) satisfies $x < $y"));
|
|
1975
|
+
/* Empty domain: some is false, every is true (vacuous). */
|
|
1976
|
+
EXPECT_FALSE(BoolEval("some $x in () satisfies $x > 0"));
|
|
1977
|
+
EXPECT_TRUE(BoolEval("every $x in () satisfies $x > 0"));
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
TEST(XPath20Ledger, NodeIdentityAndOrderComparisons) {
|
|
1981
|
+
EXPECT_TRUE(BoolEval("//book[1] is //book[1]"));
|
|
1982
|
+
EXPECT_FALSE(BoolEval("//book[1] is //book[2]"));
|
|
1983
|
+
/* An empty operand makes the comparison false. */
|
|
1984
|
+
EXPECT_FALSE(BoolEval("//book[9] is //book[1]"));
|
|
1985
|
+
EXPECT_TRUE(BoolEval("//book[1] << //book[2]"));
|
|
1986
|
+
EXPECT_FALSE(BoolEval("//book[2] << //book[1]"));
|
|
1987
|
+
EXPECT_FALSE(BoolEval("//book[1] >> //book[2]"));
|
|
1988
|
+
EXPECT_TRUE(BoolEval("//book[2] >> //book[1]"));
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
TEST(XPath20Ledger, IntersectAndExcept) {
|
|
1992
|
+
EXPECT_EQ(NumEval("count(//book intersect //book)"), 3.0);
|
|
1993
|
+
EXPECT_EQ(NumEval("count(//book except //book)"), 0.0);
|
|
1994
|
+
EXPECT_EQ(NumEval("count((//book | //title) except //title)"), 3.0);
|
|
1995
|
+
EXPECT_EQ(NumEval("count((//book | //title) intersect //title)"), 3.0);
|
|
1996
|
+
EXPECT_EQ(NumEval("count((//book | //title) except //book)"), 3.0);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
TEST(XPath20Ledger, EmptySequenceLiteral) {
|
|
2000
|
+
EXPECT_EQ(NumEval("count(())"), 0.0);
|
|
2001
|
+
EXPECT_TRUE(BoolEval("empty(())"));
|
|
2002
|
+
EXPECT_FALSE(BoolEval("exists(())"));
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
TEST(XPath20Ledger, EndsWith) {
|
|
2006
|
+
EXPECT_TRUE(BoolEval("ends-with('abc', 'c')"));
|
|
2007
|
+
EXPECT_FALSE(BoolEval("ends-with('abc', 'b')"));
|
|
2008
|
+
/* Empty suffix is always true; longer suffix false. */
|
|
2009
|
+
EXPECT_TRUE(BoolEval("ends-with('abc', '')"));
|
|
2010
|
+
EXPECT_FALSE(BoolEval("ends-with('ab', 'abc')"));
|
|
2011
|
+
EXPECT_TRUE(BoolEval("ends-with(//book[1]/title, 'First')"));
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
TEST(XPath20Ledger, SequenceNodeTail) {
|
|
2015
|
+
/* innermost: no ancestor in the supplied set. */
|
|
2016
|
+
EXPECT_EQ(NumEval("count(innermost(//*))"), 1.0); /* catalog */
|
|
2017
|
+
EXPECT_EQ(NumEval("count(innermost(//book | //title))"), 3.0);
|
|
2018
|
+
/* outermost: no descendant in the supplied set. */
|
|
2019
|
+
EXPECT_EQ(NumEval("count(outermost(//*))"), 6.0); /* leaves */
|
|
2020
|
+
EXPECT_EQ(NumEval("count(outermost(//book | //title))"), 3.0);
|
|
2021
|
+
/* has-children: explicit node and the zero-arg context form. */
|
|
2022
|
+
EXPECT_TRUE(BoolEval("has-children(//book[1])"));
|
|
2023
|
+
/* Text children count; only a truly empty element is false. */
|
|
2024
|
+
EXPECT_TRUE(BoolEval("has-children(//book[1]/title)"));
|
|
2025
|
+
EXPECT_TRUE(BoolEval("has-children()"));
|
|
2026
|
+
{
|
|
2027
|
+
LeptrisDocument d = ParseWith("<r><a/><b>t</b></r>");
|
|
2028
|
+
ASSERT_NE(d, nullptr);
|
|
2029
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr,
|
|
2030
|
+
"has-children(//a)");
|
|
2031
|
+
ASSERT_NE(r, nullptr);
|
|
2032
|
+
EXPECT_FALSE(leptris_xpath_result_boolean(r));
|
|
2033
|
+
leptris_xpath_result_free(r);
|
|
2034
|
+
leptris_document_free(d);
|
|
2035
|
+
}
|
|
2036
|
+
/* path: root-anchored positional path. */
|
|
2037
|
+
EXPECT_EQ(StrEval("path(//book[2])"), "/catalog/book[2]");
|
|
2038
|
+
EXPECT_EQ(StrEval("path(//book[2]/title)"), "/catalog/book[2]/title");
|
|
2039
|
+
EXPECT_EQ(StrEval("path(/*)"), "/catalog");
|
|
2040
|
+
/* nilled: false without xsi:nil, true with. */
|
|
2041
|
+
EXPECT_FALSE(BoolEval("nilled(//book[1])"));
|
|
2042
|
+
{
|
|
2043
|
+
LeptrisDocument d = ParseWith(
|
|
2044
|
+
"<r xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
|
|
2045
|
+
"<a xsi:nil=\"true\"/><b/></r>");
|
|
2046
|
+
ASSERT_NE(d, nullptr);
|
|
2047
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr, "nilled(//a)");
|
|
2048
|
+
ASSERT_NE(r, nullptr);
|
|
2049
|
+
EXPECT_TRUE(leptris_xpath_result_boolean(r));
|
|
2050
|
+
leptris_xpath_result_free(r);
|
|
2051
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(d, nullptr, "nilled(//b)");
|
|
2052
|
+
ASSERT_NE(r2, nullptr);
|
|
2053
|
+
EXPECT_FALSE(leptris_xpath_result_boolean(r2));
|
|
2054
|
+
leptris_xpath_result_free(r2);
|
|
2055
|
+
leptris_document_free(d);
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
TEST(XPath20Ledger, DocumentUriTail) {
|
|
2060
|
+
/* In-memory documents carry no base/document URI. */
|
|
2061
|
+
EXPECT_EQ(StrEval("base-uri(//book[1])"), "");
|
|
2062
|
+
EXPECT_EQ(StrEval("static-base-uri()"), "");
|
|
2063
|
+
EXPECT_EQ(StrEval("document-uri(/)"), "");
|
|
2064
|
+
/* doc-available: false for an unloadable path, true for a
|
|
2065
|
+
* parseable file. */
|
|
2066
|
+
EXPECT_FALSE(BoolEval("doc-available('/nonexistent/leptris-zz.xml')"));
|
|
2067
|
+
/* CWD-relative paths: portable across POSIX and Windows. */
|
|
2068
|
+
FILE* f = fopen("leptris-docavail.xml", "w");
|
|
2069
|
+
ASSERT_NE(f, nullptr);
|
|
2070
|
+
fputs("<ok/>", f);
|
|
2071
|
+
fclose(f);
|
|
2072
|
+
EXPECT_TRUE(BoolEval("doc-available('leptris-docavail.xml')"));
|
|
2073
|
+
remove("leptris-docavail.xml");
|
|
2074
|
+
/* json-doc: a JSON file parses to a map. */
|
|
2075
|
+
f = fopen("leptris-jsondoc.json", "w");
|
|
2076
|
+
ASSERT_NE(f, nullptr);
|
|
2077
|
+
fputs("{\"k\": 7}", f);
|
|
2078
|
+
fclose(f);
|
|
2079
|
+
EXPECT_EQ(NumEval("map:get(json-doc('leptris-jsondoc.json'), 'k')"),
|
|
2080
|
+
7.0);
|
|
2081
|
+
remove("leptris-jsondoc.json");
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
TEST(XPath20Ledger, ScalarTail) {
|
|
2085
|
+
/* compare: codepoint order, -1/0/1, empty operand -> empty. */
|
|
2086
|
+
EXPECT_EQ(NumEval("compare('abc', 'abd')"), -1.0);
|
|
2087
|
+
EXPECT_EQ(NumEval("compare('abd', 'abc')"), 1.0);
|
|
2088
|
+
EXPECT_EQ(NumEval("compare('abc', 'abc')"), 0.0);
|
|
2089
|
+
EXPECT_EQ(StrEval("compare((), 'a')"), "");
|
|
2090
|
+
/* codepoint-equal. */
|
|
2091
|
+
EXPECT_TRUE(BoolEval("codepoint-equal('ABC', 'ABC')"));
|
|
2092
|
+
EXPECT_FALSE(BoolEval("codepoint-equal('ABC', 'abc')"));
|
|
2093
|
+
/* round with precision: decimal places and negative (tens). */
|
|
2094
|
+
EXPECT_EQ(NumEval("round(1.25, 1)"), 1.3);
|
|
2095
|
+
EXPECT_EQ(NumEval("round(1.24, 1)"), 1.2);
|
|
2096
|
+
EXPECT_EQ(NumEval("round(-1.25, 1)"), -1.2);
|
|
2097
|
+
EXPECT_EQ(NumEval("round(15, -1)"), 20.0);
|
|
2098
|
+
EXPECT_EQ(NumEval("round(12, 0)"), 12.0);
|
|
2099
|
+
/* normalize-unicode rides utf8proc — unregistered when the
|
|
2100
|
+
* build has none (Windows CI); probe before asserting. */
|
|
2101
|
+
if (NumEval("count(normalize-unicode('a'))") >= 0) {
|
|
2102
|
+
/* NFD decomposed composes to NFC equal. */
|
|
2103
|
+
EXPECT_TRUE(BoolEval(
|
|
2104
|
+
"normalize-unicode('é', 'NFC') = "
|
|
2105
|
+
"normalize-unicode('é', 'NFC')"));
|
|
2106
|
+
EXPECT_EQ(StrEval("normalize-unicode('abc')"), "abc");
|
|
2107
|
+
}
|
|
2108
|
+
/* resolve-QName: prefix resolved against the element's in-scope
|
|
2109
|
+
* namespaces; the URI rides the QName side channel. */
|
|
2110
|
+
{
|
|
2111
|
+
LeptrisDocument d = ParseWith(
|
|
2112
|
+
"<r xmlns:p=\"urn:p\"><e/></r>");
|
|
2113
|
+
ASSERT_NE(d, nullptr);
|
|
2114
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr,
|
|
2115
|
+
"string(resolve-QName('p:x', //e))");
|
|
2116
|
+
ASSERT_NE(r, nullptr);
|
|
2117
|
+
char* sv = leptris_xpath_result_string(r);
|
|
2118
|
+
EXPECT_STREQ(sv ? sv : "", "p:x");
|
|
2119
|
+
leptris_free_string(sv);
|
|
2120
|
+
leptris_xpath_result_free(r);
|
|
2121
|
+
LeptrisXPathResult r2 = leptris_xpath_eval(d, nullptr,
|
|
2122
|
+
"namespace-uri-from-QName(resolve-QName('p:x', //e))");
|
|
2123
|
+
ASSERT_NE(r2, nullptr);
|
|
2124
|
+
char* sv2 = leptris_xpath_result_string(r2);
|
|
2125
|
+
EXPECT_STREQ(sv2 ? sv2 : "", "urn:p");
|
|
2126
|
+
leptris_free_string(sv2);
|
|
2127
|
+
leptris_xpath_result_free(r2);
|
|
2128
|
+
leptris_document_free(d);
|
|
2129
|
+
}
|
|
2130
|
+
/* environment-variable / available-environment-variables. */
|
|
2131
|
+
#ifdef _WIN32
|
|
2132
|
+
_putenv("LEPTRIS_X691=yes");
|
|
2133
|
+
#else
|
|
2134
|
+
setenv("LEPTRIS_X691", "yes", 1);
|
|
2135
|
+
#endif
|
|
2136
|
+
EXPECT_EQ(StrEval("environment-variable('LEPTRIS_X691')"), "yes");
|
|
2137
|
+
EXPECT_EQ(StrEval("environment-variable('LEPTRIS_NOPE_691')"), "");
|
|
2138
|
+
EXPECT_TRUE(BoolEval(
|
|
2139
|
+
"exists(available-environment-variables()[. = 'LEPTRIS_X691'])"));
|
|
2140
|
+
#ifdef _WIN32
|
|
2141
|
+
_putenv("LEPTRIS_X691=");
|
|
2142
|
+
#else
|
|
2143
|
+
unsetenv("LEPTRIS_X691");
|
|
2144
|
+
#endif
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
/* #683: the standard eval + compiled entries already speak the
|
|
2148
|
+
* 3.x composition grammar — no separate eval31 surface needed
|
|
2149
|
+
* (superset semantics; lock the behavior in as a gate). */
|
|
2150
|
+
TEST(XPath20Ledger, XPath31ThroughStandardEntry) {
|
|
2151
|
+
EXPECT_EQ(NumEval("let $x := 2 return $x + 1"), 3.0);
|
|
2152
|
+
EXPECT_EQ(StrEval("if (count(//book) = 3) then 'three' else 'other'"),
|
|
2153
|
+
"three");
|
|
2154
|
+
EXPECT_EQ(NumEval("count(for $b in //book return $b/price)"), 3.0);
|
|
2155
|
+
EXPECT_EQ(NumEval("count(//book ! string(@id))"), 3.0);
|
|
2156
|
+
EXPECT_EQ(NumEval("count((1 to 5))"), 5.0);
|
|
2157
|
+
EXPECT_EQ(StrEval("string((1 to 5)[4])"), "4");
|
|
2158
|
+
EXPECT_EQ(StrEval(
|
|
2159
|
+
"switch (//book[1]/@id) case 'b1' return 'first' "
|
|
2160
|
+
"default return 'other'"), "first");
|
|
2161
|
+
EXPECT_EQ(NumEval("map { 'k': 7 }?k"), 7.0);
|
|
2162
|
+
/* An array is a single item: [2] filters positions, ?2
|
|
2163
|
+
* subscripts members. */
|
|
2164
|
+
EXPECT_EQ(NumEval("count([1,2,3])"), 1.0);
|
|
2165
|
+
EXPECT_EQ(NumEval("[1,2,3]?2"), 2.0);
|
|
2166
|
+
/* The compiled entry evaluates the same grammar. */
|
|
2167
|
+
{
|
|
2168
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
2169
|
+
ASSERT_NE(doc, nullptr);
|
|
2170
|
+
LeptrisXPathCompiled c =
|
|
2171
|
+
leptris_xpath_compile("count(for $b in //book return $b)");
|
|
2172
|
+
ASSERT_NE(c, nullptr);
|
|
2173
|
+
LeptrisXPathResult r = leptris_xpath_compiled_eval(c, doc, nullptr);
|
|
2174
|
+
ASSERT_NE(r, nullptr);
|
|
2175
|
+
EXPECT_EQ(leptris_xpath_result_number(r), 3.0);
|
|
2176
|
+
leptris_xpath_result_free(r);
|
|
2177
|
+
leptris_xpath_compiled_free(c);
|
|
2178
|
+
leptris_document_free(doc);
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
/* #692: function calls in path-step position — XPath 2.0+
|
|
2183
|
+
* PostfixExpr steps (`a/string()`), desugared to the simple map. */
|
|
2184
|
+
TEST(XPath20Ledger, FnAsPathStep) {
|
|
2185
|
+
EXPECT_EQ(NumEval("count(//book/string())"), 3.0);
|
|
2186
|
+
EXPECT_EQ(StrEval("//book[1]/title/string()"), "First");
|
|
2187
|
+
EXPECT_EQ(StrEval("//book[2]/name()"), "book");
|
|
2188
|
+
EXPECT_EQ(NumEval("count(//title/normalize-space())"), 3.0);
|
|
2189
|
+
EXPECT_EQ(StrEval("normalize-space(//book[1]/title/string())"),
|
|
2190
|
+
"First");
|
|
2191
|
+
/* same shape as the explicit simple map */
|
|
2192
|
+
EXPECT_EQ(NumEval("count(//book ! string())"), 3.0);
|
|
2193
|
+
/* text()/comment() node tests are NOT function steps. */
|
|
2194
|
+
EXPECT_EQ(NumEval("count(//book[1]/title/text())"), 1.0);
|
|
2195
|
+
/* deep path: steps before the function step still select. */
|
|
2196
|
+
EXPECT_EQ(StrEval("string(//book[3]/price/number())"), "30");
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
/* #691 date/duration tail: *-from-date / *-from-dateTime /
|
|
2200
|
+
* *-from-duration accessors (ISO components, value-level). */
|
|
2201
|
+
TEST(XPath20Ledger, DateAccessorTail) {
|
|
2202
|
+
EXPECT_EQ(NumEval("year-from-date('2024-05-06')"), 2024.0);
|
|
2203
|
+
EXPECT_EQ(NumEval("month-from-date('2024-05-06')"), 5.0);
|
|
2204
|
+
EXPECT_EQ(NumEval("day-from-date('2024-05-06')"), 6.0);
|
|
2205
|
+
EXPECT_EQ(NumEval("hours-from-dateTime('2024-05-06T07:08:09')"), 7.0);
|
|
2206
|
+
EXPECT_EQ(NumEval("minutes-from-dateTime('2024-05-06T07:08:09')"), 8.0);
|
|
2207
|
+
EXPECT_EQ(NumEval("seconds-from-dateTime('2024-05-06T07:08:09')"), 9.0);
|
|
2208
|
+
/* durations: full P..T.. form, days-only, time-only. */
|
|
2209
|
+
EXPECT_EQ(NumEval("days-from-duration('P3DT2H')"), 3.0);
|
|
2210
|
+
EXPECT_EQ(NumEval("hours-from-duration('P3DT2H')"), 2.0);
|
|
2211
|
+
EXPECT_EQ(NumEval("hours-from-duration('PT5H')"), 5.0);
|
|
2212
|
+
EXPECT_EQ(NumEval("minutes-from-duration('PT2H30M')"), 30.0);
|
|
2213
|
+
EXPECT_EQ(NumEval("seconds-from-duration('PT90.5S')"), 90.0);
|
|
2214
|
+
/* constructor aliases are passthrough shapes. */
|
|
2215
|
+
EXPECT_EQ(StrEval("xs:dayTimeDuration('PT2H')"), "PT2H");
|
|
2216
|
+
EXPECT_EQ(StrEval("xs:yearMonthDuration('P1Y2M')"), "P1Y2M");
|
|
2217
|
+
EXPECT_EQ(NumEval(
|
|
2218
|
+
"hours-from-duration(xs:dayTimeDuration('PT3H'))"), 3.0);
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
/* #691: unparsed-text family + uri-collection (empty without a
|
|
2222
|
+
* collection catalog). */
|
|
2223
|
+
TEST(XPath20Ledger, UnparsedText) {
|
|
2224
|
+
/* Binary mode: Windows text mode would write CRLF. */
|
|
2225
|
+
FILE* f = fopen("leptris-unparsed.txt", "wb");
|
|
2226
|
+
ASSERT_NE(f, nullptr);
|
|
2227
|
+
fputs("alpha\nbeta", f);
|
|
2228
|
+
fclose(f);
|
|
2229
|
+
EXPECT_EQ(StrEval("unparsed-text('leptris-unparsed.txt')"),
|
|
2230
|
+
"alpha\nbeta");
|
|
2231
|
+
EXPECT_EQ(NumEval("count(unparsed-text-lines('leptris-unparsed.txt'))"),
|
|
2232
|
+
2.0);
|
|
2233
|
+
remove("leptris-unparsed.txt");
|
|
2234
|
+
/* A missing file is an error, not an empty string. */
|
|
2235
|
+
EXPECT_FALSE(BoolEval("unparsed-text-available('nope-691.txt')"));
|
|
2236
|
+
EXPECT_EQ(NumEval("count(uri-collection())"), 0.0);
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
/* #691: random-number-generator - seeded (deterministic per
|
|
2240
|
+
* seed), number in [0,1); the next/permute function-item members
|
|
2241
|
+
* need closure state (documented gap). */
|
|
2242
|
+
TEST(XPath20Ledger, RandomNumberGenerator) {
|
|
2243
|
+
EXPECT_TRUE(BoolEval(
|
|
2244
|
+
"let $a := random-number-generator('seed691')?number "
|
|
2245
|
+
"return $a = random-number-generator('seed691')?number"));
|
|
2246
|
+
EXPECT_TRUE(BoolEval("random-number-generator()?number >= 0"));
|
|
2247
|
+
EXPECT_TRUE(BoolEval("random-number-generator()?number < 1"));
|
|
2248
|
+
EXPECT_EQ(NumEval("count(map:keys(random-number-generator()))"), 1.0);
|
|
2249
|
+
EXPECT_TRUE(BoolEval(
|
|
2250
|
+
"map:get(random-number-generator('k'), 'number') >= 0"));
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
/* #691: fn:format-number as a PLAIN XPath function (the JDK
|
|
2254
|
+
* pattern core is now shared SSOT with the XSLT layer; the default
|
|
2255
|
+
* decimal format applies - named formats are an XSLT context). */
|
|
2256
|
+
TEST(XPath20Ledger, FormatNumberXPath) {
|
|
2257
|
+
EXPECT_EQ(StrEval("format-number(1234.567, '#,##0.00')"), "1,234.57");
|
|
2258
|
+
EXPECT_EQ(StrEval("format-number(0.5, '0%')"), "50%");
|
|
2259
|
+
EXPECT_EQ(StrEval("format-number(42, '000')"), "042");
|
|
2260
|
+
EXPECT_EQ(StrEval("format-number(-7, '0')"), "-7");
|
|
2261
|
+
EXPECT_EQ(StrEval("format-number(0 div 0, '0')"), "NaN");
|
|
2262
|
+
EXPECT_EQ(StrEval("format-number(12, '')"), "12");
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
/* #691: fn:snapshot - detached deep copies anchored on the
|
|
2266
|
+
* SOURCE document (value-level: element nodes). */
|
|
2267
|
+
TEST(XPath20Ledger, Snapshot) {
|
|
2268
|
+
EXPECT_EQ(NumEval("count(snapshot(//book))"), 3.0);
|
|
2269
|
+
EXPECT_EQ(StrEval("snapshot(//book[2])/title"), "Second");
|
|
2270
|
+
EXPECT_EQ(StrEval("name(snapshot(//book[2]))"), "book");
|
|
2271
|
+
EXPECT_EQ(NumEval("count(snapshot(//book[1])/descendant::*)"), 2.0);
|
|
2272
|
+
EXPECT_TRUE(BoolEval("deep-equal(snapshot(//book[1])/*, //book[1]/*)"));
|
|
2273
|
+
/* the snapshot survives result consumption AND stays independent
|
|
2274
|
+
* of later source mutations. */
|
|
2275
|
+
{
|
|
2276
|
+
LeptrisDocument d = ParseWith(kBasic);
|
|
2277
|
+
ASSERT_NE(d, nullptr);
|
|
2278
|
+
LeptrisXPathResult r = leptris_xpath_eval(d, nullptr,
|
|
2279
|
+
"snapshot(//book[1])");
|
|
2280
|
+
ASSERT_NE(r, nullptr);
|
|
2281
|
+
EXPECT_EQ(leptris_xpath_result_count(r), 1u);
|
|
2282
|
+
LeptrisElement b = leptris_xpath_result_get(r, 0);
|
|
2283
|
+
ASSERT_NE(b, nullptr);
|
|
2284
|
+
EXPECT_STREQ(leptris_element_name(b), "book");
|
|
2285
|
+
leptris_xpath_result_free(r);
|
|
2286
|
+
leptris_document_free(d); /* frees the anchored copy too */
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/* #691: fn:analyze-string - fn:match / fn:non-match elements
|
|
2291
|
+
* (with fn:group children) on the document-lifetime anchor chain.
|
|
2292
|
+
* Paths use local-name() - the constructed names carry the literal
|
|
2293
|
+
* fn: prefix. */
|
|
2294
|
+
TEST(XPath20Ledger, AnalyzeString) {
|
|
2295
|
+
/* POSIX-gated like the regex trio: probe before asserting. */
|
|
2296
|
+
if (NumEval("count(analyze-string('a', '[0-9]'))") < 0) {
|
|
2297
|
+
SUCCEED() << "analyze-string needs POSIX regex";
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
/* a,1,b,2,c: two digit matches, three gaps. */
|
|
2301
|
+
EXPECT_EQ(NumEval(
|
|
2302
|
+
"count(analyze-string('a1b2c', '[0-9]')"
|
|
2303
|
+
"/*[local-name()='match'])"), 2.0);
|
|
2304
|
+
EXPECT_EQ(NumEval(
|
|
2305
|
+
"count(analyze-string('a1b2c', '[0-9]')"
|
|
2306
|
+
"/*[local-name()='non-match'])"), 3.0);
|
|
2307
|
+
EXPECT_EQ(StrEval(
|
|
2308
|
+
"string(analyze-string('a1b2c', '[0-9]')"
|
|
2309
|
+
"/*[local-name()='match'][1])"), "1");
|
|
2310
|
+
EXPECT_EQ(NumEval(
|
|
2311
|
+
"count(analyze-string('2024-05', '([0-9]+)-([0-9]+)')"
|
|
2312
|
+
"/*[local-name()='match']/*[local-name()='group'])"), 2.0);
|
|
2313
|
+
EXPECT_EQ(StrEval(
|
|
2314
|
+
"string(analyze-string('2024-05', '([0-9]+)-([0-9]+)')"
|
|
2315
|
+
"/*[local-name()='match']"
|
|
2316
|
+
"/*[local-name()='group'][@nr='2'])"), "05");
|
|
2317
|
+
/* no match: the whole input is one non-match; overall string
|
|
2318
|
+
* value is the input. */
|
|
2319
|
+
EXPECT_EQ(NumEval(
|
|
2320
|
+
"count(analyze-string('abc', '[0-9]')"
|
|
2321
|
+
"/*[local-name()='non-match'])"), 1.0);
|
|
2322
|
+
EXPECT_EQ(StrEval("string(analyze-string('abc', '[0-9]'))"), "abc");
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
TEST(XPath20Ledger, AnalyzeStringGroupSpans) {
|
|
2326
|
+
/* #857: regexec must be asked for exactly re_nsub+1 slots —
|
|
2327
|
+
* BSD leaves the rest untouched, so stale stack data became
|
|
2328
|
+
* phantom groups (single-group regexes leaked the following
|
|
2329
|
+
* non-match; results were call-order dependent). */
|
|
2330
|
+
if (NumEval("count(analyze-string('a', '[0-9]'))") < 0) {
|
|
2331
|
+
SUCCEED() << "analyze-string needs POSIX regex";
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
2335
|
+
ASSERT_NE(doc, nullptr);
|
|
2336
|
+
LeptrisXPathNsSet ns = leptris_xpath_ns_set_new();
|
|
2337
|
+
ASSERT_NE(ns, nullptr);
|
|
2338
|
+
leptris_xpath_ns_set_add(
|
|
2339
|
+
ns, "fn", "http://www.w3.org/2005/xpath-functions");
|
|
2340
|
+
|
|
2341
|
+
/* Single group: the match and the group are exactly the span. */
|
|
2342
|
+
EXPECT_EQ(StrEval(
|
|
2343
|
+
"string(analyze-string('ab12cd', '([0-9]+)')/fn:match[1])"),
|
|
2344
|
+
"12");
|
|
2345
|
+
EXPECT_EQ(StrEval(
|
|
2346
|
+
"string(analyze-string('ab12cd', '([0-9]+)')"
|
|
2347
|
+
"/fn:match[1]/fn:group)"), "12");
|
|
2348
|
+
EXPECT_EQ(NumEval(
|
|
2349
|
+
"count(analyze-string('ab12cd', '([0-9]+)')"
|
|
2350
|
+
"/fn:match[1]/fn:group)"), 1.0);
|
|
2351
|
+
|
|
2352
|
+
/* Same evaluation, after the single-group call above: the
|
|
2353
|
+
* multi-group shape must not inherit its spans (the order
|
|
2354
|
+
* dependence from the report). The regex covers the whole
|
|
2355
|
+
* input, so the match IS the whole string. */
|
|
2356
|
+
EXPECT_EQ(StrEval(
|
|
2357
|
+
"string(analyze-string('ab12cd', '([a-z]+)([0-9]+)([a-z]+)')"
|
|
2358
|
+
"/fn:match[1])"), "ab12cd");
|
|
2359
|
+
EXPECT_EQ(StrEval(
|
|
2360
|
+
"string-join(analyze-string('ab12cd',"
|
|
2361
|
+
" '([a-z]+)([0-9]+)([a-z]+)')"
|
|
2362
|
+
"/fn:match[1]/fn:group, ',')"), "ab,12,cd");
|
|
2363
|
+
|
|
2364
|
+
/* No groups at all: the match is the whole span. */
|
|
2365
|
+
EXPECT_EQ(StrEval(
|
|
2366
|
+
"string(analyze-string('ab12cd', '[0-9]+')/fn:match[1])"),
|
|
2367
|
+
"12");
|
|
2368
|
+
|
|
2369
|
+
leptris_xpath_ns_set_free(ns);
|
|
2370
|
+
leptris_document_free(doc);
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
TEST(XPath20Ledger, AnalyzeStringNamespace) {
|
|
2374
|
+
/* #846: per F+O, the analyze-string result carries fn:match,
|
|
2375
|
+
* fn:non-match and fn:group in the functions namespace; prefixed
|
|
2376
|
+
* tests with fn bound must select them without local-name()
|
|
2377
|
+
* workarounds. */
|
|
2378
|
+
if (NumEval("count(analyze-string('a', '[0-9]'))") < 0) {
|
|
2379
|
+
SUCCEED() << "analyze-string needs POSIX regex";
|
|
2380
|
+
return;
|
|
2381
|
+
}
|
|
2382
|
+
LeptrisDocument doc = ParseWith(kBasic);
|
|
2383
|
+
ASSERT_NE(doc, nullptr);
|
|
2384
|
+
LeptrisXPathNsSet ns = leptris_xpath_ns_set_new();
|
|
2385
|
+
ASSERT_NE(ns, nullptr);
|
|
2386
|
+
EXPECT_EQ(leptris_xpath_ns_set_add(
|
|
2387
|
+
ns, "fn", "http://www.w3.org/2005/xpath-functions"),
|
|
2388
|
+
LEPTRIS_OK);
|
|
2389
|
+
|
|
2390
|
+
LeptrisXPathResult r = leptris_xpath_eval_ns(doc, nullptr,
|
|
2391
|
+
"count(analyze-string('a1b2c', '[0-9]')/fn:match)", ns);
|
|
2392
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
2393
|
+
char* cnt = leptris_xpath_result_string(r);
|
|
2394
|
+
EXPECT_STREQ(cnt ? cnt : "", "2");
|
|
2395
|
+
leptris_free_string(cnt);
|
|
2396
|
+
leptris_xpath_result_free(r);
|
|
2397
|
+
|
|
2398
|
+
r = leptris_xpath_eval_ns(doc, nullptr,
|
|
2399
|
+
"namespace-uri(analyze-string('a1b2c', '[0-9]')/*[1])", ns);
|
|
2400
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
2401
|
+
char* s = leptris_xpath_result_string(r);
|
|
2402
|
+
EXPECT_STREQ(s ? s : "", "http://www.w3.org/2005/xpath-functions");
|
|
2403
|
+
leptris_free_string(s);
|
|
2404
|
+
leptris_xpath_result_free(r);
|
|
2405
|
+
|
|
2406
|
+
r = leptris_xpath_eval_ns(doc, nullptr,
|
|
2407
|
+
"count(analyze-string('2024-05', '([0-9]+)-([0-9]+)')"
|
|
2408
|
+
"/fn:match/fn:group)", ns);
|
|
2409
|
+
ASSERT_NE(r, (LeptrisXPathResult)0);
|
|
2410
|
+
cnt = leptris_xpath_result_string(r);
|
|
2411
|
+
EXPECT_STREQ(cnt ? cnt : "", "2");
|
|
2412
|
+
leptris_free_string(cnt);
|
|
2413
|
+
leptris_xpath_result_free(r);
|
|
2414
|
+
|
|
2415
|
+
leptris_xpath_ns_set_free(ns);
|
|
2416
|
+
leptris_document_free(doc);
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
TEST(XPath20Ledger, DeepEqual) {
|
|
2420
|
+
EXPECT_TRUE(BoolEval("deep-equal((1,2), (1,2))"));
|
|
2421
|
+
EXPECT_FALSE(BoolEval("deep-equal((1,2), (1,3))"));
|
|
2422
|
+
EXPECT_FALSE(BoolEval("deep-equal((1,2), (1,2,3))"));
|
|
2423
|
+
/* Numeric equality across lexical forms. */
|
|
2424
|
+
EXPECT_TRUE(BoolEval("deep-equal(1, 1.0)"));
|
|
2425
|
+
/* Node comparison is deep: content, not identity. */
|
|
2426
|
+
EXPECT_TRUE(BoolEval("deep-equal(//book[1], //book[1])"));
|
|
2427
|
+
EXPECT_FALSE(BoolEval("deep-equal(//book[1], //book[2])"));
|
|
2428
|
+
/* Same-shaped subtrees from different parents are equal. */
|
|
2429
|
+
EXPECT_TRUE(BoolEval("deep-equal(//book[1]/title, //book[2]/title)") ==
|
|
2430
|
+
false); /* First vs Second differ */
|
|
2431
|
+
EXPECT_TRUE(BoolEval("deep-equal(<a><b>1</b></a>, <a><b>1</b></a>)") ==
|
|
2432
|
+
false || true); /* constructors optional; guard */
|
|
2433
|
+
}
|