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,2418 @@
|
|
|
1
|
+
/* xslt/xslt_parse.c — stylesheet compilation (TODO.transform 02/03).
|
|
2
|
+
*
|
|
3
|
+
* Parses an XSLT 1.0 stylesheet (an XML document) into the
|
|
4
|
+
* instruction forest: every select/test/name is compiled ONCE via
|
|
5
|
+
* leptris_xpath_compile; literal result elements carry their
|
|
6
|
+
* qualified name + namespace. xsl:include is inlined; xsl:import
|
|
7
|
+
* becomes a higher import_rank (lower precedence). Whitespace-only
|
|
8
|
+
* text in the STYLESHEET is dropped (§4.8 stripping) outside
|
|
9
|
+
* xsl:text.
|
|
10
|
+
*
|
|
11
|
+
* Multi-file loading: import/include resolve `href` via
|
|
12
|
+
* leptris_parse_file (v1 base = CWD); a depth guard prevents
|
|
13
|
+
* cycles. Includes keep the same import_rank; imports increment
|
|
14
|
+
* it. Variables have a per-parse name table for duplicate marking.
|
|
15
|
+
*/
|
|
16
|
+
#include "xslt_internal.h"
|
|
17
|
+
#include "../dom/text.h"
|
|
18
|
+
#include <stdlib.h>
|
|
19
|
+
#include <stdio.h>
|
|
20
|
+
|
|
21
|
+
#define XSLT_INCLUDE_DEPTH_MAX 64
|
|
22
|
+
|
|
23
|
+
typedef struct {
|
|
24
|
+
char** paths;
|
|
25
|
+
size_t len, cap;
|
|
26
|
+
} XsltImportChain;
|
|
27
|
+
|
|
28
|
+
static int chain_has(XsltImportChain* c, const char* p);
|
|
29
|
+
static int chain_push(XsltImportChain* c, const char* p);
|
|
30
|
+
static void chain_pop(XsltImportChain* c);
|
|
31
|
+
|
|
32
|
+
/* Text content of a node child (TEXT/CDATA). */
|
|
33
|
+
static const char* leptris_node_text(LeptrisNodeRef n) {
|
|
34
|
+
if (!n) return NULL;
|
|
35
|
+
if (leptris_node_get_type(n) == LEPTRIS_NODE_TYPE_TEXT ||
|
|
36
|
+
leptris_node_get_type(n) == LEPTRIS_NODE_TYPE_CDATA) {
|
|
37
|
+
return leptris_text_get_content((LeptrisTextNode*)n);
|
|
38
|
+
}
|
|
39
|
+
return NULL;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#define XSLT_NS "http://www.w3.org/1999/XSL/Transform"
|
|
43
|
+
|
|
44
|
+
typedef struct {
|
|
45
|
+
LeptrisDocument doc;
|
|
46
|
+
XsltStylesheet* sheet;
|
|
47
|
+
int import_rank;
|
|
48
|
+
int errors; /* any compile failure fails the sheet */
|
|
49
|
+
XsltImportChain chain; /* paths seen so far for cycle detection */
|
|
50
|
+
} SheetParser;
|
|
51
|
+
|
|
52
|
+
static int chain_has(XsltImportChain* c, const char* p) {
|
|
53
|
+
for (size_t i = 0; i < c->len; i++)
|
|
54
|
+
if (strcmp(c->paths[i], p) == 0) return 1;
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
static int chain_push(XsltImportChain* c, const char* p) {
|
|
58
|
+
if (c->len == c->cap) {
|
|
59
|
+
size_t nc = c->cap ? c->cap * 2 : 8;
|
|
60
|
+
char** np = (char**)realloc(c->paths, nc * sizeof(char*));
|
|
61
|
+
if (!np) return 0;
|
|
62
|
+
c->paths = np; c->cap = nc;
|
|
63
|
+
}
|
|
64
|
+
c->paths[c->len] = leptris_strdup(p);
|
|
65
|
+
if (!c->paths[c->len]) return 0;
|
|
66
|
+
c->len++;
|
|
67
|
+
return 1;
|
|
68
|
+
}
|
|
69
|
+
static void chain_pop(XsltImportChain* c) {
|
|
70
|
+
if (c->len) { free(c->paths[--c->len]); c->paths[c->len] = NULL; }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static int node_is_xsl(LeptrisElement e, const char* local) {
|
|
74
|
+
if (!e) return 0;
|
|
75
|
+
const char* pfx = leptris_element_prefix(e);
|
|
76
|
+
if (!pfx || strcmp(pfx, "xsl") != 0) {
|
|
77
|
+
/* Also accept default-namespaced stylesheets. */
|
|
78
|
+
const char* uri = leptris_element_get_namespace_uri(e);
|
|
79
|
+
if (!uri || strcmp(uri, XSLT_NS) != 0) return 0;
|
|
80
|
+
} else {
|
|
81
|
+
const char* uri = leptris_element_get_namespace_uri(e);
|
|
82
|
+
if (uri && strcmp(uri, XSLT_NS) != 0) return 0;
|
|
83
|
+
}
|
|
84
|
+
const char* n = leptris_element_get_name(e);
|
|
85
|
+
if (!n) return 0;
|
|
86
|
+
const char* colon = strchr(n, ':');
|
|
87
|
+
const char* local_n = colon ? colon + 1 : n;
|
|
88
|
+
return strcmp(local_n, local) == 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#define EXSLT_FUNCTIONS_NS "http://exslt.org/functions"
|
|
92
|
+
|
|
93
|
+
/* EXSLT func module element (any prefix bound to the functions ns). */
|
|
94
|
+
static int node_is_exslt_func(LeptrisElement e, const char* local) {
|
|
95
|
+
if (!e) return 0;
|
|
96
|
+
const char* uri = leptris_element_get_namespace_uri(e);
|
|
97
|
+
if (!uri || strcmp(uri, EXSLT_FUNCTIONS_NS) != 0) return 0;
|
|
98
|
+
const char* n = leptris_element_get_name(e);
|
|
99
|
+
if (!n) return 0;
|
|
100
|
+
const char* colon = strchr(n, ':');
|
|
101
|
+
const char* local_n = colon ? colon + 1 : n;
|
|
102
|
+
return strcmp(local_n, local) == 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static LeptrisXPathCompiled compile_attr_sp(SheetParser* sp,
|
|
106
|
+
LeptrisElement e,
|
|
107
|
+
const char* attr) {
|
|
108
|
+
const char* v = leptris_element_attribute(e, attr);
|
|
109
|
+
if (!v || !v[0]) return NULL;
|
|
110
|
+
/* XQuery-only brace syntax must fail loudly (#692: some brace
|
|
111
|
+
* shapes phantom-compiled to silent empty). The compiler runs
|
|
112
|
+
* FIRST; braces are real tokens (TOK_LBRACE/TOK_COLON) accepted
|
|
113
|
+
* ONLY by the map-constructor grammar, so any other brace shape
|
|
114
|
+
* fails the parse right here — loud by construction. (The old
|
|
115
|
+
* post-compile brace backstop was retired when map constructors
|
|
116
|
+
* made brace-bearing selects legitimate.) */
|
|
117
|
+
LeptrisXPathCompiled c = leptris_xpath_compile(v);
|
|
118
|
+
if (!c) {
|
|
119
|
+
if (sp) sp->errors = 1;
|
|
120
|
+
return NULL;
|
|
121
|
+
}
|
|
122
|
+
return c;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/* Portable, reentrant tokenizer (strtok_r is POSIX-only; the
|
|
127
|
+
* import/include recursion also makes plain strtok unsafe). */
|
|
128
|
+
static char* xslt_strtok(char* s, const char* delims, char** save) {
|
|
129
|
+
char* p = s ? s : *save;
|
|
130
|
+
if (!p) return NULL;
|
|
131
|
+
while (*p) {
|
|
132
|
+
const char* d = delims;
|
|
133
|
+
int hit = 0;
|
|
134
|
+
while (*d) { if (*p == *d) { hit = 1; break; } d++; }
|
|
135
|
+
if (!hit) break;
|
|
136
|
+
p++;
|
|
137
|
+
}
|
|
138
|
+
if (!*p) { *save = p; return NULL; }
|
|
139
|
+
char* tok = p;
|
|
140
|
+
while (*p) {
|
|
141
|
+
const char* d = delims;
|
|
142
|
+
int hit = 0;
|
|
143
|
+
while (*d) { if (*p == *d) { hit = 1; break; } d++; }
|
|
144
|
+
if (hit) break;
|
|
145
|
+
p++;
|
|
146
|
+
}
|
|
147
|
+
if (*p) { *p = 0; *save = p + 1; }
|
|
148
|
+
else *save = p;
|
|
149
|
+
return tok;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
static XsltInstr* instr_new(XsltInstrKind k) {
|
|
154
|
+
XsltInstr* in = (XsltInstr*)calloc(1, sizeof(*in));
|
|
155
|
+
if (in) in->kind = k;
|
|
156
|
+
return in;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static void instr_append(XsltInstr** list, XsltInstr* in) {
|
|
160
|
+
if (!in) return;
|
|
161
|
+
if (!*list) { *list = in; return; }
|
|
162
|
+
XsltInstr* t = *list;
|
|
163
|
+
while (t->next) t = t->next;
|
|
164
|
+
t->next = in;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static char* resolve_set_uri(LeptrisElement e, const char* qname);
|
|
168
|
+
|
|
169
|
+
/* Collect use-attribute-sets into name list (comma-separated,
|
|
170
|
+
* whitespace ignored). Stores copy of each name on the
|
|
171
|
+
* instruction. Returns count. */
|
|
172
|
+
static size_t collect_attr_sets(XsltInstr* in, LeptrisElement e) {
|
|
173
|
+
const char* v = leptris_element_attribute(e, "use-attribute-sets");
|
|
174
|
+
if (!v || !*v)
|
|
175
|
+
v = leptris_element_attribute(e, "xsl:use-attribute-sets");
|
|
176
|
+
if (!v || !*v) return 0;
|
|
177
|
+
char* dup = leptris_strdup(v);
|
|
178
|
+
if (!dup) return 0;
|
|
179
|
+
size_t cap = 0, cnt = 0;
|
|
180
|
+
char** arr = NULL;
|
|
181
|
+
char** uris = NULL;
|
|
182
|
+
char* save = NULL;
|
|
183
|
+
for (char* tok = xslt_strtok(dup, " \t\n,", &save); tok;
|
|
184
|
+
tok = xslt_strtok(NULL, " \t\n,", &save)) {
|
|
185
|
+
if (cnt == cap) {
|
|
186
|
+
cap = cap ? cap * 2 : 4;
|
|
187
|
+
char** na = (char**)realloc(arr, cap * sizeof(char*));
|
|
188
|
+
char** nu = (char**)realloc(uris, cap * sizeof(char*));
|
|
189
|
+
if (!na || !nu) { free(na); free(nu); break; }
|
|
190
|
+
arr = na; uris = nu;
|
|
191
|
+
}
|
|
192
|
+
arr[cnt] = leptris_strdup(tok);
|
|
193
|
+
uris[cnt] = resolve_set_uri(e, tok);
|
|
194
|
+
cnt++;
|
|
195
|
+
}
|
|
196
|
+
free(dup);
|
|
197
|
+
in->attr_set_names = arr;
|
|
198
|
+
in->attr_set_uris = uris;
|
|
199
|
+
in->attr_set_count = cnt;
|
|
200
|
+
return cnt;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static XsltSort* parse_sorts(SheetParser* sp, LeptrisElement parent) {
|
|
204
|
+
XsltSort* head = NULL;
|
|
205
|
+
XsltSort** tail = &head;
|
|
206
|
+
for (LeptrisElement c = leptris_element_first_child_any(parent); c;
|
|
207
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
208
|
+
if (!node_is_xsl(c, "sort")) continue;
|
|
209
|
+
XsltSort* s = (XsltSort*)calloc(1, sizeof(*s));
|
|
210
|
+
if (!s) continue;
|
|
211
|
+
s->select = compile_attr_sp(sp, c, "select");
|
|
212
|
+
const char* dt = leptris_element_attribute(c, "data-type");
|
|
213
|
+
s->numeric = dt && strcmp(dt, "number") == 0;
|
|
214
|
+
const char* od = leptris_element_attribute(c, "order");
|
|
215
|
+
s->descending = od && strcmp(od, "descending") == 0;
|
|
216
|
+
const char* co = leptris_element_attribute(c, "case-order");
|
|
217
|
+
s->case_upper_first = co ? strcmp(co, "upper-first") == 0 : -1;
|
|
218
|
+
*tail = s;
|
|
219
|
+
tail = &s->next;
|
|
220
|
+
}
|
|
221
|
+
return head;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Forward: the instruction compiler and the content compiler. */
|
|
225
|
+
static XsltInstr* parse_instruction(SheetParser* sp, LeptrisElement e);
|
|
226
|
+
static XsltInstr* parse_content_ws(SheetParser* sp, LeptrisElement list,
|
|
227
|
+
int preserve_ws);
|
|
228
|
+
#define parse_content(sp, list) parse_content_ws(sp, list, 0)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
/* §4/§5.3: collect the in-scope namespace bindings for a stylesheet
|
|
232
|
+
* element (its own xmlns decls plus every ancestor's, innermost
|
|
233
|
+
* wins). Returns NULL when nothing is declared — the hot path. */
|
|
234
|
+
static LeptrisXPathNsSet build_ns_context(LeptrisElement e) {
|
|
235
|
+
LeptrisXPathNsSet set = NULL;
|
|
236
|
+
for (LeptrisElement a = e; a;
|
|
237
|
+
a = leptris_node_parent((LeptrisNodeRef)a)) {
|
|
238
|
+
for (int i = 0;; i++) {
|
|
239
|
+
const char* pfx = leptris_element_namespace_decl_prefix(a, i);
|
|
240
|
+
const char* uri = leptris_element_namespace_decl_uri(a, i);
|
|
241
|
+
/* A NULL PREFIX is the default namespace declaration —
|
|
242
|
+
* it does NOT end the list (only a missing URI does);
|
|
243
|
+
* bug-50-: the default on the stylesheet root stopped
|
|
244
|
+
* the walk before later prefixes (tst) were seen. */
|
|
245
|
+
if (!uri) break;
|
|
246
|
+
if (!pfx || !*pfx) continue;
|
|
247
|
+
if (!set) set = leptris_xpath_ns_set_new();
|
|
248
|
+
if (set) leptris_xpath_ns_set_add(set, pfx, uri);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return set;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Expanded-name URI for a prefixed attribute-set reference (NULL
|
|
255
|
+
* when unprefixed or unbound) — declarations and references may
|
|
256
|
+
* spell different prefixes for the same URI (bug-190). */
|
|
257
|
+
static char* resolve_set_uri(LeptrisElement e, const char* qname) {
|
|
258
|
+
const char* colon = strchr(qname, ':');
|
|
259
|
+
if (!colon || colon == qname) return NULL;
|
|
260
|
+
LeptrisXPathNsSet ns = build_ns_context(e);
|
|
261
|
+
if (!ns) return NULL;
|
|
262
|
+
const char* u = leptris_xpath_ns_lookup(
|
|
263
|
+
(const struct leptris_xpath_ns_map*)ns, qname,
|
|
264
|
+
(size_t)(colon - qname));
|
|
265
|
+
char* r = u ? leptris_strdup(u) : NULL;
|
|
266
|
+
leptris_xpath_ns_set_free(ns);
|
|
267
|
+
return r;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
/* §7.1.1: the namespace declarations a literal result element
|
|
272
|
+
* copies into the result — its in-scope bindings minus the XSLT
|
|
273
|
+
* namespace (and the xsl prefix). Innermost binding wins per
|
|
274
|
+
* prefix; the default namespace (if any) is returned separately. */
|
|
275
|
+
|
|
276
|
+
static int xs_ns_strcmp(const char* a, const char* b) {
|
|
277
|
+
return strcmp(a ? a : "", b ? b : "");
|
|
278
|
+
}
|
|
279
|
+
static int prefix_excluded(SheetParser* sp, LeptrisElement e,
|
|
280
|
+
const char* pfx) {
|
|
281
|
+
/* Sheet-wide exclude-result-prefixes / extension-element-
|
|
282
|
+
* prefixes, plus any xsl:exclude-result-prefixes on the
|
|
283
|
+
* instruction element itself (v1: not the full ancestor walk). */
|
|
284
|
+
for (size_t i = 0; i < sp->sheet->exclude_count; i++)
|
|
285
|
+
|
|
286
|
+
if (xs_ns_strcmp(sp->sheet->exclude_pfx[i], pfx) == 0) return 1;
|
|
287
|
+
const char* loc = leptris_element_attribute(e,
|
|
288
|
+
"xsl:exclude-result-"
|
|
289
|
+
"prefixes");
|
|
290
|
+
if (!loc || !*loc)
|
|
291
|
+
loc = leptris_element_attribute(e, "exclude-result-prefixes");
|
|
292
|
+
if (loc && *loc) {
|
|
293
|
+
char* dup = leptris_strdup(loc);
|
|
294
|
+
if (dup) {
|
|
295
|
+
char* save = NULL;
|
|
296
|
+
for (char* tok = xslt_strtok(dup, " \t\n,", &save); tok;
|
|
297
|
+
tok = xslt_strtok(NULL, " \t\n,", &save)) {
|
|
298
|
+
if (xs_ns_strcmp(tok, pfx) == 0) { free(dup); return 1; }
|
|
299
|
+
}
|
|
300
|
+
free(dup);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return 0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
static void build_ns_copy(SheetParser* sp, LeptrisElement e,
|
|
307
|
+
char*** out_pfx, char*** out_uri,
|
|
308
|
+
size_t* out_count, char** out_default,
|
|
309
|
+
size_t* out_default_pos) {
|
|
310
|
+
*out_pfx = NULL; *out_uri = NULL; *out_count = 0; *out_default = NULL;
|
|
311
|
+
*out_default_pos = (size_t)-1;
|
|
312
|
+
char** pfx = NULL;
|
|
313
|
+
char** uri = NULL;
|
|
314
|
+
size_t cnt = 0, cap = 0;
|
|
315
|
+
char* deflt = NULL;
|
|
316
|
+
size_t dpos = (size_t)-1;
|
|
317
|
+
for (LeptrisElement a = e; a;
|
|
318
|
+
a = leptris_node_parent((LeptrisNodeRef)a)) {
|
|
319
|
+
for (int i = 0;; i++) {
|
|
320
|
+
const char* p = leptris_element_namespace_decl_prefix(a, i);
|
|
321
|
+
const char* u = leptris_element_namespace_decl_uri(a, i);
|
|
322
|
+
/* End of declarations: accessor returns no URI. A NULL
|
|
323
|
+
* PREFIX is the default namespace. */
|
|
324
|
+
if (!u) break;
|
|
325
|
+
if (xs_ns_strcmp(u, XSLT_NS) == 0) continue; /* never copy XSLT */
|
|
326
|
+
if (prefix_excluded(sp, a, p)) continue;
|
|
327
|
+
if (!p || !*p) {
|
|
328
|
+
if (!deflt) {
|
|
329
|
+
deflt = leptris_strdup(u);
|
|
330
|
+
/* Source position: how many prefixed entries
|
|
331
|
+
* precede it decides its emission slot. */
|
|
332
|
+
dpos = cnt;
|
|
333
|
+
}
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
int have = 0;
|
|
337
|
+
for (size_t k = 0; k < cnt; k++)
|
|
338
|
+
if (xs_ns_strcmp(pfx[k], p) == 0) {
|
|
339
|
+
have = 1; break;
|
|
340
|
+
}
|
|
341
|
+
if (have) continue;
|
|
342
|
+
if (cnt == cap) {
|
|
343
|
+
cap = cap ? cap * 2 : 4;
|
|
344
|
+
pfx = (char**)realloc(pfx, cap * sizeof(char*));
|
|
345
|
+
uri = (char**)realloc(uri, cap * sizeof(char*));
|
|
346
|
+
}
|
|
347
|
+
pfx[cnt] = leptris_strdup(p);
|
|
348
|
+
uri[cnt] = leptris_strdup(u);
|
|
349
|
+
cnt++;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (cnt || deflt) {
|
|
353
|
+
*out_pfx = pfx; *out_uri = uri; *out_count = cnt;
|
|
354
|
+
*out_default = deflt;
|
|
355
|
+
*out_default_pos = dpos;
|
|
356
|
+
} else {
|
|
357
|
+
free(pfx); free(uri);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
static XsltInstr* parse_instruction(SheetParser* sp, LeptrisElement e) {
|
|
362
|
+
const char* name = leptris_element_get_name(e);
|
|
363
|
+
const char* colon = name ? strchr(name, ':') : NULL;
|
|
364
|
+
const char* local = colon ? colon + 1 : name;
|
|
365
|
+
int is_xsl = node_is_xsl(e, local ? local : "");
|
|
366
|
+
|
|
367
|
+
if (!is_xsl) {
|
|
368
|
+
/* EXSLT func:result: the user-function yield instruction. */
|
|
369
|
+
if (node_is_exslt_func(e, "result")) {
|
|
370
|
+
XsltInstr* in = instr_new(XSLT_INSTR_FUNC_RESULT);
|
|
371
|
+
if (!in) return NULL;
|
|
372
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
373
|
+
/* The select resolves with the ENCLOSING function's
|
|
374
|
+
* in-scope bindings (bug-225: exsl:node-set's prefix
|
|
375
|
+
* otherwise has no ns_set at eval time). */
|
|
376
|
+
in->ns = build_ns_context((LeptrisElement)e);
|
|
377
|
+
in->child = parse_content(sp, e);
|
|
378
|
+
return in;
|
|
379
|
+
}
|
|
380
|
+
/* EXSLT func:param: a VARIABLE with template-parameter
|
|
381
|
+
* semantics — the call binds the argument; the walker skips
|
|
382
|
+
* it (is_param) like xsl:param. */
|
|
383
|
+
if (node_is_exslt_func(e, "param")) {
|
|
384
|
+
XsltInstr* in = instr_new(XSLT_INSTR_VARIABLE);
|
|
385
|
+
if (!in) return NULL;
|
|
386
|
+
const char* pn = leptris_element_attribute(e, "name");
|
|
387
|
+
in->name = leptris_strdup(pn);
|
|
388
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
389
|
+
in->ns = build_ns_context((LeptrisElement)e);
|
|
390
|
+
in->is_param = 1;
|
|
391
|
+
return in;
|
|
392
|
+
}
|
|
393
|
+
/* §15: an element in an extension namespace is an unknown
|
|
394
|
+
* extension element — compile to its xsl:fallback children
|
|
395
|
+
* only (bug-220); the element itself and non-fallback
|
|
396
|
+
* children are dropped. */
|
|
397
|
+
{
|
|
398
|
+
const char* epfx = leptris_element_prefix(e);
|
|
399
|
+
if (epfx && *epfx && sp->sheet->ext_count) {
|
|
400
|
+
int is_ext = 0;
|
|
401
|
+
for (size_t i = 0; i < sp->sheet->ext_count; i++)
|
|
402
|
+
if (strcmp(sp->sheet->ext_pfx[i], epfx) == 0) {
|
|
403
|
+
is_ext = 1; break;
|
|
404
|
+
}
|
|
405
|
+
if (is_ext) {
|
|
406
|
+
XsltInstr* fin = instr_new(XSLT_INSTR_UNKNOWN_XSL);
|
|
407
|
+
if (!fin) return NULL;
|
|
408
|
+
fin->name = leptris_strdup(name);
|
|
409
|
+
XsltInstr** ftail = &fin->child;
|
|
410
|
+
for (LeptrisElement c =
|
|
411
|
+
leptris_element_first_child_any(e); c;
|
|
412
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
413
|
+
if (!node_is_xsl(c, "fallback")) continue;
|
|
414
|
+
XsltInstr* content = parse_content(sp, c);
|
|
415
|
+
if (!content) continue;
|
|
416
|
+
*ftail = content;
|
|
417
|
+
while (*ftail) ftail = &(*ftail)->next;
|
|
418
|
+
}
|
|
419
|
+
return fin;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
/* Literal result element. The stored name is the FULL QName
|
|
424
|
+
* (prefix:local) — element_name() yields only the local
|
|
425
|
+
* part, and xsl:namespace-alias + namespace output need the
|
|
426
|
+
* prefix. */
|
|
427
|
+
XsltInstr* in = instr_new(XSLT_INSTR_RESULT_ELEM);
|
|
428
|
+
if (!in) return NULL;
|
|
429
|
+
const char* pfx = leptris_element_prefix(e);
|
|
430
|
+
char qname[256];
|
|
431
|
+
if (pfx && pfx[0])
|
|
432
|
+
snprintf(qname, sizeof(qname), "%s:%s", pfx,
|
|
433
|
+
name ? name : "");
|
|
434
|
+
else
|
|
435
|
+
snprintf(qname, sizeof(qname), "%s", name ? name : "");
|
|
436
|
+
in->name = leptris_strdup(qname);
|
|
437
|
+
in->ns_uri = leptris_strdup(
|
|
438
|
+
leptris_element_get_namespace_uri(e) ? leptris_element_get_namespace_uri(e) : "");
|
|
439
|
+
XsltLAttr** atail = &in->attrs;
|
|
440
|
+
size_t na = leptris_element_attribute_count(e);
|
|
441
|
+
for (size_t i = 0; i < na; i++) {
|
|
442
|
+
const char* an = leptris_element_attribute_name_at(e, i);
|
|
443
|
+
const char* av = leptris_element_attribute_value_at(e, i);
|
|
444
|
+
if (!an || !av) continue;
|
|
445
|
+
if (strcmp(an, "xmlns") == 0 ||
|
|
446
|
+
strncmp(an, "xmlns:", 6) == 0) continue;
|
|
447
|
+
/* Attributes in the XSLT namespace are directives
|
|
448
|
+
* (xsl:use-attribute-sets, xsl:version, xsl:exclude-,
|
|
449
|
+
* xsl:extension-element-prefixes) — never literal
|
|
450
|
+
* output. The unprefixed spelling is tolerated too
|
|
451
|
+
* (read by collect_attr_sets). */
|
|
452
|
+
if (strncmp(an, "xsl:", 4) == 0 ||
|
|
453
|
+
strcmp(an, "use-attribute-sets") == 0) continue;
|
|
454
|
+
XsltLAttr* la = (XsltLAttr*)calloc(1, sizeof(*la));
|
|
455
|
+
if (!la) continue;
|
|
456
|
+
la->name = leptris_strdup(an);
|
|
457
|
+
la->value = leptris_strdup(av);
|
|
458
|
+
*atail = la;
|
|
459
|
+
atail = &la->next;
|
|
460
|
+
}
|
|
461
|
+
collect_attr_sets(in, e);
|
|
462
|
+
/* §7.1.1: namespace declarations copied into the result. */
|
|
463
|
+
build_ns_copy(sp, e, &in->ns_out_pfx, &in->ns_out_uri,
|
|
464
|
+
&in->ns_out_count, &in->ns_out_default,
|
|
465
|
+
&in->ns_out_default_pos);
|
|
466
|
+
in->child = parse_content(sp, e);
|
|
467
|
+
return in;
|
|
468
|
+
}
|
|
469
|
+
if (strcmp(local, "namespace") == 0) {
|
|
470
|
+
/* §11.7 (2.0): construct a namespace node on the pending
|
|
471
|
+
* parent — @name prefix, content = URI. */
|
|
472
|
+
XsltInstr* in = instr_new(XSLT_INSTR_NAMESPACE);
|
|
473
|
+
if (!in) return NULL;
|
|
474
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
475
|
+
in->child = parse_content(sp, e);
|
|
476
|
+
return in;
|
|
477
|
+
}
|
|
478
|
+
if (strcmp(local, "document") == 0) {
|
|
479
|
+
/* §11.8 (2.0): content becomes children of the pending
|
|
480
|
+
* parent (a document constructor in sequence content is
|
|
481
|
+
* the content itself). */
|
|
482
|
+
XsltInstr* in = instr_new(XSLT_INSTR_DOCUMENT);
|
|
483
|
+
if (!in) return NULL;
|
|
484
|
+
in->child = parse_content(sp, e);
|
|
485
|
+
return in;
|
|
486
|
+
}
|
|
487
|
+
if (strcmp(local, "on-completion") == 0) {
|
|
488
|
+
/* 3.0 §12.5: runs after xsl:iterate completes without
|
|
489
|
+
* xsl:break. */
|
|
490
|
+
XsltInstr* in = instr_new(XSLT_INSTR_ON_COMPLETION);
|
|
491
|
+
if (!in) return NULL;
|
|
492
|
+
in->child = parse_content(sp, e);
|
|
493
|
+
return in;
|
|
494
|
+
}
|
|
495
|
+
if (strcmp(local, "merge") == 0) {
|
|
496
|
+
/* 3.0 §14.3: children are merge-source* + one merge-action. */
|
|
497
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MERGE);
|
|
498
|
+
if (!in) return NULL;
|
|
499
|
+
in->child = parse_content(sp, e);
|
|
500
|
+
return in;
|
|
501
|
+
}
|
|
502
|
+
if (strcmp(local, "merge-source") == 0) {
|
|
503
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MERGE_SOURCE);
|
|
504
|
+
if (!in) return NULL;
|
|
505
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
506
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
507
|
+
/* Children are merge-key declarations. */
|
|
508
|
+
in->child = parse_content(sp, e);
|
|
509
|
+
return in;
|
|
510
|
+
}
|
|
511
|
+
if (strcmp(local, "merge-key") == 0) {
|
|
512
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MERGE_KEY);
|
|
513
|
+
if (!in) return NULL;
|
|
514
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
515
|
+
/* @order="descending" flips the sort; reused field (v1
|
|
516
|
+
* honors the FIRST key's order across the composite). */
|
|
517
|
+
const char* od = leptris_element_attribute(e, "order");
|
|
518
|
+
in->num_start_at = (od && strcmp(od, "descending") == 0);
|
|
519
|
+
return in;
|
|
520
|
+
}
|
|
521
|
+
if (strcmp(local, "merge-action") == 0) {
|
|
522
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MERGE_ACTION);
|
|
523
|
+
if (!in) return NULL;
|
|
524
|
+
in->child = parse_content(sp, e);
|
|
525
|
+
return in;
|
|
526
|
+
}
|
|
527
|
+
if (strcmp(local, "result-document") == 0) {
|
|
528
|
+
/* 2.0/3.0 §11.8: content is serialized to the href FILE
|
|
529
|
+
* (v1: static href, xml method); the principal result is
|
|
530
|
+
* unchanged. */
|
|
531
|
+
XsltInstr* in = instr_new(XSLT_INSTR_RESULT_DOCUMENT);
|
|
532
|
+
if (!in) return NULL;
|
|
533
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "href"));
|
|
534
|
+
in->child = parse_content(sp, e);
|
|
535
|
+
return in;
|
|
536
|
+
}
|
|
537
|
+
if (strcmp(local, "map") == 0) {
|
|
538
|
+
/* 3.0 §18: children are xsl:map-entry declarations. */
|
|
539
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MAP);
|
|
540
|
+
if (!in) return NULL;
|
|
541
|
+
in->child = parse_content(sp, e);
|
|
542
|
+
return in;
|
|
543
|
+
}
|
|
544
|
+
if (strcmp(local, "map-entry") == 0) {
|
|
545
|
+
/* §18: @key is an EXPRESSION (Saxon-HE 12.7 verified:
|
|
546
|
+
* key="'k'" — a bare name would be a path). Value: @select
|
|
547
|
+
* or the content. */
|
|
548
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MAP_ENTRY);
|
|
549
|
+
if (!in) return NULL;
|
|
550
|
+
in->test = compile_attr_sp(sp, e, "key");
|
|
551
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
552
|
+
in->child = parse_content(sp, e);
|
|
553
|
+
return in;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (strcmp(local, "text") == 0) {
|
|
557
|
+
XsltInstr* in = instr_new(XSLT_INSTR_TEXT);
|
|
558
|
+
if (!in) return NULL;
|
|
559
|
+
const char* t = leptris_element_child_value(e);
|
|
560
|
+
in->text = leptris_strdup(t ? t : "");
|
|
561
|
+
in->tvt = sp->sheet->expand_text && strchr(in->text, '{') != NULL;
|
|
562
|
+
const char* doe = leptris_element_attribute(e, "disable-output-escaping");
|
|
563
|
+
in->doe = doe && strcmp(doe, "yes") == 0;
|
|
564
|
+
return in;
|
|
565
|
+
}
|
|
566
|
+
if (strcmp(local, "sequence") == 0 ||
|
|
567
|
+
strcmp(local, "perform-sort") == 0) {
|
|
568
|
+
/* 3.0 §12.7/§14: one instruction — perform-sort is the
|
|
569
|
+
* sequence with xsl:sort children applied. */
|
|
570
|
+
XsltInstr* in = instr_new(XSLT_INSTR_SEQUENCE);
|
|
571
|
+
if (!in) return NULL;
|
|
572
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
573
|
+
in->sorts = parse_sorts(sp, e);
|
|
574
|
+
return in;
|
|
575
|
+
}
|
|
576
|
+
if (strcmp(local, "value-of") == 0) {
|
|
577
|
+
XsltInstr* in = instr_new(XSLT_INSTR_VALUE_OF);
|
|
578
|
+
if (!in) return NULL;
|
|
579
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
580
|
+
/* select="." fast path (#682): the string-value of the
|
|
581
|
+
* context node needs no evaluation — flag it at parse
|
|
582
|
+
* time. Whitespace around the dot is legal XPath; a '{'
|
|
583
|
+
* means the 3.0 attribute is a value template, never a
|
|
584
|
+
* bare dot. */
|
|
585
|
+
const char* sel = leptris_element_attribute(e, "select");
|
|
586
|
+
if (sel) {
|
|
587
|
+
while (*sel == ' ' || *sel == '\t' || *sel == '\r' ||
|
|
588
|
+
*sel == '\n') sel++;
|
|
589
|
+
const char* end = sel;
|
|
590
|
+
while (*end) end++;
|
|
591
|
+
while (end > sel && (end[-1] == ' ' || end[-1] == '\t' ||
|
|
592
|
+
end[-1] == '\r' || end[-1] == '\n'))
|
|
593
|
+
end--;
|
|
594
|
+
in->select_is_dot = end - sel == 1 && *sel == '.' &&
|
|
595
|
+
!strchr(sel, '{');
|
|
596
|
+
/* select="@name" fast path (#682): a single unprefixed
|
|
597
|
+
* attribute step — leptris_element_attribute's bare-name
|
|
598
|
+
* rule (no-namespace only, #542) is exactly the XPath
|
|
599
|
+
* unprefixed attribute name test. Prefixed names keep
|
|
600
|
+
* the full path (prefix-error semantics differ). */
|
|
601
|
+
if (end - sel >= 2 && *sel == '@' && !strchr(sel, '{')) {
|
|
602
|
+
const char* nm = sel + 1;
|
|
603
|
+
int ok = (*nm == '_' || (*nm >= 'a' && *nm <= 'z') ||
|
|
604
|
+
(*nm >= 'A' && *nm <= 'Z'));
|
|
605
|
+
for (const char* c = nm + ok; ok && c < end; c++) {
|
|
606
|
+
if (*c == ':' || *c == '{') { ok = 0; break; }
|
|
607
|
+
if (!(*c == '_' || *c == '-' || *c == '.' ||
|
|
608
|
+
(*c >= 'a' && *c <= 'z') ||
|
|
609
|
+
(*c >= 'A' && *c <= 'Z') ||
|
|
610
|
+
(*c >= '0' && *c <= '9')))
|
|
611
|
+
{ ok = 0; break; }
|
|
612
|
+
}
|
|
613
|
+
if (ok) in->select_attr_name = nm;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
const char* doe = leptris_element_attribute(e, "disable-output-escaping");
|
|
617
|
+
in->doe = doe && strcmp(doe, "yes") == 0;
|
|
618
|
+
return in;
|
|
619
|
+
}
|
|
620
|
+
if (strcmp(local, "for-each") == 0) {
|
|
621
|
+
XsltInstr* in = instr_new(XSLT_INSTR_FOR_EACH);
|
|
622
|
+
if (!in) return NULL;
|
|
623
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
624
|
+
in->sorts = parse_sorts(sp, e);
|
|
625
|
+
in->child = parse_content(sp, e);
|
|
626
|
+
return in;
|
|
627
|
+
}
|
|
628
|
+
if (strcmp(local, "iterate") == 0) {
|
|
629
|
+
XsltInstr* in = instr_new(XSLT_INSTR_ITERATE);
|
|
630
|
+
if (!in) return NULL;
|
|
631
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
632
|
+
/* Leading xsl:param children are the iteration state; the
|
|
633
|
+
* walker skips is_param VARIABLEs, so the body plays straight
|
|
634
|
+
* from in->child. */
|
|
635
|
+
in->child = parse_content(sp, e);
|
|
636
|
+
return in;
|
|
637
|
+
}
|
|
638
|
+
if (strcmp(local, "for-each-group") == 0) {
|
|
639
|
+
XsltInstr* in = instr_new(XSLT_INSTR_FOR_EACH_GROUP);
|
|
640
|
+
if (!in) return NULL;
|
|
641
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
642
|
+
in->group_by = compile_attr_sp(sp, e, "group-by");
|
|
643
|
+
if (!in->group_by) {
|
|
644
|
+
in->group_by = compile_attr_sp(sp, e, "group-adjacent");
|
|
645
|
+
in->group_adjacent = (in->group_by != NULL);
|
|
646
|
+
}
|
|
647
|
+
/* Single-alternative patterns; the standard matcher does the
|
|
648
|
+
* per-item match. */
|
|
649
|
+
const char* gsw =
|
|
650
|
+
leptris_element_attribute(e, "group-starting-with");
|
|
651
|
+
const char* gew =
|
|
652
|
+
leptris_element_attribute(e, "group-ending-with");
|
|
653
|
+
for (int pi = 0; pi < 2; pi++) {
|
|
654
|
+
const char* src = pi == 0 ? gsw : gew;
|
|
655
|
+
if (!src || !*src) continue;
|
|
656
|
+
XsltPattern* p = (XsltPattern*)calloc(1, sizeof(*p));
|
|
657
|
+
if (p) {
|
|
658
|
+
p->expr = leptris_xpath_compile(src);
|
|
659
|
+
if (p->expr) {
|
|
660
|
+
xslt_pattern_compile_steps(p, src);
|
|
661
|
+
if (pi == 0) in->group_starting = p;
|
|
662
|
+
else in->group_ending = p;
|
|
663
|
+
} else {
|
|
664
|
+
free(p);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
in->child = parse_content(sp, e);
|
|
669
|
+
return in;
|
|
670
|
+
}
|
|
671
|
+
if (strcmp(local, "evaluate") == 0) {
|
|
672
|
+
XsltInstr* in = instr_new(XSLT_INSTR_EVALUATE);
|
|
673
|
+
if (!in) return NULL;
|
|
674
|
+
in->select = compile_attr_sp(sp, e, "xpath");
|
|
675
|
+
in->context_item = compile_attr_sp(sp, e, "context-item");
|
|
676
|
+
/* Children are xsl:with-param for the dynamic phase. */
|
|
677
|
+
in->child = parse_content(sp, e);
|
|
678
|
+
return in;
|
|
679
|
+
}
|
|
680
|
+
if (strcmp(local, "analyze-string") == 0) {
|
|
681
|
+
XsltInstr* in = instr_new(XSLT_INSTR_ANALYZE_STRING);
|
|
682
|
+
if (!in) return NULL;
|
|
683
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
684
|
+
const char* rx = leptris_element_attribute(e, "regex");
|
|
685
|
+
if (rx) in->regex = leptris_strdup(rx);
|
|
686
|
+
const char* rf = leptris_element_attribute(e, "regex-flags");
|
|
687
|
+
if (rf) in->regex_flags = leptris_strdup(rf);
|
|
688
|
+
in->child = parse_content(sp, e);
|
|
689
|
+
return in;
|
|
690
|
+
}
|
|
691
|
+
if (strcmp(local, "matching-substring") == 0 ||
|
|
692
|
+
strcmp(local, "non-matching-substring") == 0) {
|
|
693
|
+
XsltInstr* in = instr_new(
|
|
694
|
+
local[0] == 'm' ? XSLT_INSTR_MATCHING_SUBSTRING
|
|
695
|
+
: XSLT_INSTR_NONMATCHING_SUBSTRING);
|
|
696
|
+
if (!in) return NULL;
|
|
697
|
+
in->child = parse_content(sp, e);
|
|
698
|
+
return in;
|
|
699
|
+
}
|
|
700
|
+
if (strcmp(local, "try") == 0 || strcmp(local, "catch") == 0) {
|
|
701
|
+
/* §17: xsl:catch is only valid as a CHILD of xsl:try. A
|
|
702
|
+
* misplaced catch is a static error (Saxon: XTSE0010) —
|
|
703
|
+
* silently skipping it turned a catchable error into an
|
|
704
|
+
* unexplained NULL transform (issue #669). */
|
|
705
|
+
if (local[0] == 'c') {
|
|
706
|
+
LeptrisElement parent =
|
|
707
|
+
leptris_node_parent((LeptrisNodeRef)e);
|
|
708
|
+
if (!parent || !node_is_xsl(parent, "try")) {
|
|
709
|
+
sp->errors = 1;
|
|
710
|
+
return NULL;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
XsltInstr* in = instr_new(
|
|
714
|
+
local[0] == 't' ? XSLT_INSTR_TRY : XSLT_INSTR_CATCH);
|
|
715
|
+
if (!in) return NULL;
|
|
716
|
+
in->child = parse_content(sp, e);
|
|
717
|
+
return in;
|
|
718
|
+
}
|
|
719
|
+
if (strcmp(local, "on-empty") == 0 ||
|
|
720
|
+
strcmp(local, "on-non-empty") == 0 ||
|
|
721
|
+
strcmp(local, "where-populated") == 0) {
|
|
722
|
+
XsltInstr* in = instr_new(
|
|
723
|
+
strcmp(local, "on-empty") == 0 ? XSLT_INSTR_ON_EMPTY
|
|
724
|
+
: strcmp(local, "on-non-empty") == 0
|
|
725
|
+
? XSLT_INSTR_ON_NON_EMPTY : XSLT_INSTR_WHERE_POPULATED);
|
|
726
|
+
if (!in) return NULL;
|
|
727
|
+
in->child = parse_content(sp, e);
|
|
728
|
+
return in;
|
|
729
|
+
}
|
|
730
|
+
if (strcmp(local, "fork") == 0) {
|
|
731
|
+
/* 3.0 §14: non-streaming fork = the child sequences run
|
|
732
|
+
* sequentially into the same destination (Saxon-HE). */
|
|
733
|
+
XsltInstr* in = instr_new(XSLT_INSTR_FORK);
|
|
734
|
+
if (!in) return NULL;
|
|
735
|
+
in->child = parse_content(sp, e);
|
|
736
|
+
return in;
|
|
737
|
+
}
|
|
738
|
+
if (strcmp(local, "next-match") == 0) {
|
|
739
|
+
XsltInstr* in = instr_new(XSLT_INSTR_NEXT_MATCH);
|
|
740
|
+
if (!in) return NULL;
|
|
741
|
+
in->child = parse_content(sp, e); /* with-params */
|
|
742
|
+
return in;
|
|
743
|
+
}
|
|
744
|
+
if (strcmp(local, "next-iteration") == 0) {
|
|
745
|
+
XsltInstr* in = instr_new(XSLT_INSTR_NEXT_ITERATION);
|
|
746
|
+
if (!in) return NULL;
|
|
747
|
+
in->child = parse_content(sp, e); /* xsl:with-param rebinds */
|
|
748
|
+
return in;
|
|
749
|
+
}
|
|
750
|
+
if (strcmp(local, "break") == 0) {
|
|
751
|
+
XsltInstr* in = instr_new(XSLT_INSTR_BREAK);
|
|
752
|
+
if (!in) return NULL;
|
|
753
|
+
in->child = parse_content(sp, e); /* processed, then loop ends */
|
|
754
|
+
return in;
|
|
755
|
+
}
|
|
756
|
+
if (strcmp(local, "if") == 0) {
|
|
757
|
+
XsltInstr* in = instr_new(XSLT_INSTR_IF);
|
|
758
|
+
if (!in) return NULL;
|
|
759
|
+
in->test = compile_attr_sp(sp, e, "test");
|
|
760
|
+
in->child = parse_content(sp, e);
|
|
761
|
+
return in;
|
|
762
|
+
}
|
|
763
|
+
if (strcmp(local, "choose") == 0) {
|
|
764
|
+
XsltInstr* in = instr_new(XSLT_INSTR_CHOOSE);
|
|
765
|
+
if (!in) return NULL;
|
|
766
|
+
in->child = parse_content(sp, e); /* WHEN/OTHERWISE arms */
|
|
767
|
+
return in;
|
|
768
|
+
}
|
|
769
|
+
if (strcmp(local, "when") == 0) {
|
|
770
|
+
XsltInstr* in = instr_new(XSLT_INSTR_WHEN);
|
|
771
|
+
if (!in) return NULL;
|
|
772
|
+
in->test = compile_attr_sp(sp, e, "test");
|
|
773
|
+
in->child = parse_content(sp, e);
|
|
774
|
+
return in;
|
|
775
|
+
}
|
|
776
|
+
if (strcmp(local, "otherwise") == 0) {
|
|
777
|
+
XsltInstr* in = instr_new(XSLT_INSTR_OTHERWISE);
|
|
778
|
+
if (!in) return NULL;
|
|
779
|
+
in->child = parse_content(sp, e);
|
|
780
|
+
return in;
|
|
781
|
+
}
|
|
782
|
+
if (strcmp(local, "variable") == 0 || strcmp(local, "param") == 0) {
|
|
783
|
+
XsltInstr* in = instr_new(XSLT_INSTR_VARIABLE);
|
|
784
|
+
if (!in) return NULL;
|
|
785
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
786
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
787
|
+
in->is_param = (local[0] == 'p'); /* xsl:param (§11.6) */
|
|
788
|
+
const char* tu = leptris_element_attribute(e, "tunnel");
|
|
789
|
+
in->tunnel = in->is_param && tu && strcmp(tu, "yes") == 0;
|
|
790
|
+
if (in->is_param) {
|
|
791
|
+
/* 4.0 @default: evaluated when no with-param binds
|
|
792
|
+
* (takes precedence over the sequence constructor). */
|
|
793
|
+
in->num_count = compile_attr_sp(sp, e, "default");
|
|
794
|
+
}
|
|
795
|
+
/* §11.1: the select resolves with the DECLARING element's
|
|
796
|
+
* in-scope bindings — top-level variables of included
|
|
797
|
+
* sheets carry their own (bug-36-). */
|
|
798
|
+
in->ns = build_ns_context((LeptrisElement)e);
|
|
799
|
+
in->child = parse_content(sp, e);
|
|
800
|
+
return in;
|
|
801
|
+
}
|
|
802
|
+
if (strcmp(local, "apply-imports") == 0) {
|
|
803
|
+
return instr_new(XSLT_INSTR_APPLY_IMPORTS);
|
|
804
|
+
}
|
|
805
|
+
if (strcmp(local, "with-param") == 0) {
|
|
806
|
+
XsltInstr* in = instr_new(XSLT_INSTR_WITH_PARAM);
|
|
807
|
+
if (!in) return NULL;
|
|
808
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
809
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
810
|
+
const char* tu = leptris_element_attribute(e, "tunnel");
|
|
811
|
+
in->tunnel = tu && strcmp(tu, "yes") == 0;
|
|
812
|
+
in->child = parse_content(sp, e);
|
|
813
|
+
return in;
|
|
814
|
+
}
|
|
815
|
+
if (strcmp(local, "call-template") == 0) {
|
|
816
|
+
XsltInstr* in = instr_new(XSLT_INSTR_CALL_TEMPLATE);
|
|
817
|
+
if (!in) return NULL;
|
|
818
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
819
|
+
in->child = parse_content(sp, e); /* with-params */
|
|
820
|
+
return in;
|
|
821
|
+
}
|
|
822
|
+
if (strcmp(local, "apply-templates") == 0) {
|
|
823
|
+
XsltInstr* in = instr_new(XSLT_INSTR_APPLY_TEMPLATES);
|
|
824
|
+
if (!in) return NULL;
|
|
825
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
826
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "mode"));
|
|
827
|
+
in->sorts = parse_sorts(sp, e);
|
|
828
|
+
in->child = parse_content(sp, e); /* with-params */
|
|
829
|
+
return in;
|
|
830
|
+
}
|
|
831
|
+
if (strcmp(local, "copy-of") == 0) {
|
|
832
|
+
XsltInstr* in = instr_new(XSLT_INSTR_COPY_OF);
|
|
833
|
+
if (!in) return NULL;
|
|
834
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
835
|
+
return in;
|
|
836
|
+
}
|
|
837
|
+
if (strcmp(local, "copy") == 0) {
|
|
838
|
+
XsltInstr* in = instr_new(XSLT_INSTR_COPY);
|
|
839
|
+
if (!in) return NULL;
|
|
840
|
+
collect_attr_sets(in, e);
|
|
841
|
+
/* §7.1.1: namespace declarations copied into the result. */
|
|
842
|
+
build_ns_copy(sp, e, &in->ns_out_pfx, &in->ns_out_uri,
|
|
843
|
+
&in->ns_out_count, &in->ns_out_default,
|
|
844
|
+
&in->ns_out_default_pos);
|
|
845
|
+
/* 3.0 §9.9: copy/@select deep-copies the selected nodes
|
|
846
|
+
* (the node-kind copy semantics apply per item). */
|
|
847
|
+
in->select = compile_attr_sp(sp, e, "select");
|
|
848
|
+
in->child = parse_content(sp, e);
|
|
849
|
+
return in;
|
|
850
|
+
}
|
|
851
|
+
if (strcmp(local, "element") == 0) {
|
|
852
|
+
XsltInstr* in = instr_new(XSLT_INSTR_ELEMENT);
|
|
853
|
+
if (!in) return NULL;
|
|
854
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
855
|
+
{
|
|
856
|
+
const char* ns = leptris_element_attribute(e, "namespace");
|
|
857
|
+
if (!ns || !*ns) {
|
|
858
|
+
/* libxslt honors a default xmlns= declaration on the
|
|
859
|
+
* xsl:element instruction (stored as a ns decl, not
|
|
860
|
+
* an attribute). */
|
|
861
|
+
for (int i = 0;; i++) {
|
|
862
|
+
const char* p =
|
|
863
|
+
leptris_element_namespace_decl_prefix(e, i);
|
|
864
|
+
const char* u =
|
|
865
|
+
leptris_element_namespace_decl_uri(e, i);
|
|
866
|
+
if (!u) break;
|
|
867
|
+
if (!p || !*p) { ns = u; break; }
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
in->ns_uri = leptris_strdup(ns ? ns : "");
|
|
871
|
+
}
|
|
872
|
+
collect_attr_sets(in, e);
|
|
873
|
+
/* §7.1.1: namespace declarations copied into the result. */
|
|
874
|
+
build_ns_copy(sp, e, &in->ns_out_pfx, &in->ns_out_uri,
|
|
875
|
+
&in->ns_out_count, &in->ns_out_default,
|
|
876
|
+
&in->ns_out_default_pos);
|
|
877
|
+
in->child = parse_content(sp, e);
|
|
878
|
+
return in;
|
|
879
|
+
}
|
|
880
|
+
if (strcmp(local, "attribute") == 0) {
|
|
881
|
+
XsltInstr* in = instr_new(XSLT_INSTR_ATTRIBUTE);
|
|
882
|
+
if (!in) return NULL;
|
|
883
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
884
|
+
/* §7.1.3: the namespace attribute (an AVT at exec time). */
|
|
885
|
+
in->ns_uri = leptris_strdup(
|
|
886
|
+
leptris_element_attribute(e, "namespace"));
|
|
887
|
+
in->child = parse_content(sp, e);
|
|
888
|
+
return in;
|
|
889
|
+
}
|
|
890
|
+
if (strcmp(local, "comment") == 0) {
|
|
891
|
+
XsltInstr* in = instr_new(XSLT_INSTR_COMMENT);
|
|
892
|
+
if (!in) return NULL;
|
|
893
|
+
in->child = parse_content(sp, e);
|
|
894
|
+
return in;
|
|
895
|
+
}
|
|
896
|
+
if (strcmp(local, "processing-instruction") == 0) {
|
|
897
|
+
XsltInstr* in = instr_new(XSLT_INSTR_PI);
|
|
898
|
+
if (!in) return NULL;
|
|
899
|
+
in->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
900
|
+
in->child = parse_content(sp, e);
|
|
901
|
+
return in;
|
|
902
|
+
}
|
|
903
|
+
if (strcmp(local, "message") == 0) {
|
|
904
|
+
XsltInstr* in = instr_new(XSLT_INSTR_MESSAGE);
|
|
905
|
+
if (!in) return NULL;
|
|
906
|
+
const char* term = leptris_element_attribute(e, "terminate");
|
|
907
|
+
in->terminate = term && strcmp(term, "yes") == 0;
|
|
908
|
+
in->child = parse_content(sp, e);
|
|
909
|
+
return in;
|
|
910
|
+
}
|
|
911
|
+
if (strcmp(local, "number") == 0) {
|
|
912
|
+
XsltInstr* in = instr_new(XSLT_INSTR_NUMBER);
|
|
913
|
+
if (!in) return NULL;
|
|
914
|
+
const char* lvl = leptris_element_attribute(e, "level");
|
|
915
|
+
in->num_level = (lvl && strcmp(lvl, "multiple") == 0) ? 1
|
|
916
|
+
: (lvl && strcmp(lvl, "any") == 0) ? 2 : 0;
|
|
917
|
+
in->num_value = compile_attr_sp(sp, e, "value");
|
|
918
|
+
in->num_count = compile_attr_sp(sp, e, "count");
|
|
919
|
+
in->num_from = compile_attr_sp(sp, e, "from");
|
|
920
|
+
in->num_format = leptris_strdup(
|
|
921
|
+
leptris_element_attribute(e, "format")
|
|
922
|
+
? leptris_element_attribute(e, "format") : "1");
|
|
923
|
+
const char* gs = leptris_element_attribute(e, "grouping-size");
|
|
924
|
+
in->num_group_size = gs ? atoi(gs) : 0;
|
|
925
|
+
const char* gp = leptris_element_attribute(e, "grouping-separator");
|
|
926
|
+
in->num_group_sep = gp ? gp[0] : 0;
|
|
927
|
+
const char* lv = leptris_element_attribute(e, "letter-value");
|
|
928
|
+
in->letter_value = lv ? leptris_strdup(lv) : NULL;
|
|
929
|
+
const char* sa = leptris_element_attribute(e, "start-at");
|
|
930
|
+
in->num_start_at = sa ? atol(sa) : 0;
|
|
931
|
+
return in;
|
|
932
|
+
}
|
|
933
|
+
/* Unknown xsl: instruction (§2.5/§15): a fallback container.
|
|
934
|
+
* Any xsl:fallback children execute when the element is
|
|
935
|
+
* instantiated; without them it is a no-op (forward-compatible
|
|
936
|
+
* processing — an error only when the element is actually
|
|
937
|
+
* selected, which the container materializes). */
|
|
938
|
+
XsltInstr* in = instr_new(XSLT_INSTR_UNKNOWN_XSL);
|
|
939
|
+
if (!in) return NULL;
|
|
940
|
+
in->name = leptris_strdup(name);
|
|
941
|
+
/* Merge every xsl:fallback child's content into one sequence;
|
|
942
|
+
* op_unknown_xsl executes it directly. */
|
|
943
|
+
XsltInstr** tail = &in->child;
|
|
944
|
+
for (LeptrisElement c = leptris_element_first_child_any(e); c;
|
|
945
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
946
|
+
if (!node_is_xsl(c, "fallback")) continue;
|
|
947
|
+
XsltInstr* content = parse_content(sp, c);
|
|
948
|
+
if (!content) continue;
|
|
949
|
+
*tail = content;
|
|
950
|
+
while (*tail) tail = &(*tail)->next;
|
|
951
|
+
}
|
|
952
|
+
return in;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
static XsltInstr* parse_content_ws(SheetParser* sp, LeptrisElement list,
|
|
957
|
+
int preserve_ws) {
|
|
958
|
+
XsltInstr* out = NULL;
|
|
959
|
+
/* §2.4: an xml:space="preserve" ancestor overrides stripping. */
|
|
960
|
+
if (!preserve_ws)
|
|
961
|
+
for (LeptrisElement a = list; a;
|
|
962
|
+
a = leptris_node_parent((LeptrisNodeRef)a)) {
|
|
963
|
+
const char* xs = leptris_element_attribute(a, "xml:space");
|
|
964
|
+
if (xs && strcmp(xs, "preserve") == 0) { preserve_ws = 1; break; }
|
|
965
|
+
if (xs && strcmp(xs, "default") == 0) break;
|
|
966
|
+
}
|
|
967
|
+
/* Is the CONTAINING element a literal result element? Blank
|
|
968
|
+
* nodes at its edges survive (indentation) when no xsl
|
|
969
|
+
* instruction neighbors them. */
|
|
970
|
+
for (LeptrisNodeRef n = leptris_node_first_child(leptris_element_as_node(list));
|
|
971
|
+
n; n = leptris_node_next_sibling(n)) {
|
|
972
|
+
int type = leptris_node_get_type(n);
|
|
973
|
+
if (type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
974
|
+
/* §4.8: stylesheet whitespace-only text is stripped. */
|
|
975
|
+
const char* t = leptris_node_text(n);
|
|
976
|
+
if (!t) continue;
|
|
977
|
+
if (!preserve_ws) {
|
|
978
|
+
int ws_only = 1;
|
|
979
|
+
for (const char* p = t; *p; p++) {
|
|
980
|
+
if (*p != ' ' && *p != '\t' && *p != '\n' &&
|
|
981
|
+
*p != '\r') {
|
|
982
|
+
ws_only = 0;
|
|
983
|
+
break;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if (ws_only) {
|
|
987
|
+
/* §2.4 (xsltproc-verified): whitespace-only text
|
|
988
|
+
* nodes in the stylesheet are ALWAYS stripped —
|
|
989
|
+
* inside literal result elements too (indentation
|
|
990
|
+
* does not survive); xsl:text passes
|
|
991
|
+
* preserve_ws, and xml:space=preserve parents
|
|
992
|
+
* keep theirs. */
|
|
993
|
+
if (!preserve_ws) continue;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
XsltInstr* in = instr_new(XSLT_INSTR_TEXT);
|
|
997
|
+
if (in) {
|
|
998
|
+
in->text = leptris_strdup(t);
|
|
999
|
+
in->tvt = sp->sheet->expand_text &&
|
|
1000
|
+
strchr(in->text, '{') != NULL;
|
|
1001
|
+
}
|
|
1002
|
+
instr_append(&out, in);
|
|
1003
|
+
} else if (type == LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1004
|
+
XsltInstr* in = parse_instruction(sp, (LeptrisElement)n);
|
|
1005
|
+
if (in && !in->ns && sp->sheet->sheet_has_ns)
|
|
1006
|
+
in->ns = build_ns_context((LeptrisElement)n);
|
|
1007
|
+
instr_append(&out, in);
|
|
1008
|
+
}
|
|
1009
|
+
/* Literal comment/PI nodes in template content are DROPPED
|
|
1010
|
+
* (xsltproc-verified): only xsl:comment/xsl:processing-
|
|
1011
|
+
* instruction emit them (§7.4). */
|
|
1012
|
+
}
|
|
1013
|
+
return out;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/* Default pattern priority — the exact §5.5 table:
|
|
1017
|
+
* QName (or processing-instruction(Literal)) preceded by an axis
|
|
1018
|
+
* specifier .......................................... 0
|
|
1019
|
+
* NCName:* preceded by an axis specifier ............. -0.25
|
|
1020
|
+
* otherwise, a bare NodeTest (* / node() /
|
|
1021
|
+
* processing-instruction()) with an axis ........... -0.5
|
|
1022
|
+
* otherwise (paths, predicates, ...) .................... 0.5
|
|
1023
|
+
* The caller computes per-alternative values (split on '|'). */
|
|
1024
|
+
static double default_priority(const char* pattern) {
|
|
1025
|
+
if (!pattern || !*pattern) return 0.5;
|
|
1026
|
+
/* Multi-step or any predicate → 0.5. */
|
|
1027
|
+
if (strchr(pattern, '/') || strchr(pattern, '[')) return 0.5;
|
|
1028
|
+
|
|
1029
|
+
/* Single step: strip leading axis specifiers. */
|
|
1030
|
+
const char* p = pattern;
|
|
1031
|
+
while (*p == ' ') p++;
|
|
1032
|
+
if (strncmp(p, "child::", 7) == 0) p += 7;
|
|
1033
|
+
else if (strncmp(p, "attribute::", 11) == 0) p += 11;
|
|
1034
|
+
else if (*p == '@') p++;
|
|
1035
|
+
while (*p == ' ') p++;
|
|
1036
|
+
|
|
1037
|
+
if (strncmp(p, "processing-instruction(", 23) == 0) {
|
|
1038
|
+
const char* arg = p + 23;
|
|
1039
|
+
/* literal present? ' " ... */
|
|
1040
|
+
return (*arg == '\'' || *arg == '"') ? 0.0 : -0.5;
|
|
1041
|
+
}
|
|
1042
|
+
size_t len = strlen(p);
|
|
1043
|
+
while (len > 0 && p[len-1] == ' ') len--;
|
|
1044
|
+
char leaf[128];
|
|
1045
|
+
if (len >= sizeof(leaf)) return 0.5;
|
|
1046
|
+
memcpy(leaf, p, len); leaf[len] = 0;
|
|
1047
|
+
|
|
1048
|
+
/* NCName:* → -0.25. */
|
|
1049
|
+
char* colon = strchr(leaf, ':');
|
|
1050
|
+
if (colon && strcmp(colon, ":*") == 0) return -0.25;
|
|
1051
|
+
/* Bare NodeTests. */
|
|
1052
|
+
if (strcmp(leaf, "*") == 0 || strcmp(leaf, "node()") == 0 ||
|
|
1053
|
+
strcmp(leaf, "comment()") == 0 || strcmp(leaf, "text()") == 0)
|
|
1054
|
+
return -0.5;
|
|
1055
|
+
if (strncmp(leaf, "processing-instruction", 22) == 0) return -0.5;
|
|
1056
|
+
/* Function-call patterns (id(...), key(...)) fall to the
|
|
1057
|
+
* "otherwise" row — NOT the bare-QName 0.0 (bug-113). */
|
|
1058
|
+
if (strchr(leaf, '(')) return 0.5;
|
|
1059
|
+
/* QName (possibly prefixed). */
|
|
1060
|
+
return 0.0;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/* Split "a|b|c" into alternatives (respecting brackets — v1 splits
|
|
1064
|
+
* on top-level '|' outside [] and ()). */
|
|
1065
|
+
static char** split_alternatives(const char* pattern, size_t* count) {
|
|
1066
|
+
size_t n = 1;
|
|
1067
|
+
int depth = 0;
|
|
1068
|
+
for (const char* p = pattern; *p; p++) {
|
|
1069
|
+
if (*p == '[' || *p == '(') depth++;
|
|
1070
|
+
else if (*p == ']' || *p == ')') depth--;
|
|
1071
|
+
else if (*p == '|' && depth == 0) n++;
|
|
1072
|
+
}
|
|
1073
|
+
char** parts = (char**)calloc(n, sizeof(char*));
|
|
1074
|
+
if (!parts) return NULL;
|
|
1075
|
+
const char* start = pattern;
|
|
1076
|
+
size_t i = 0;
|
|
1077
|
+
depth = 0;
|
|
1078
|
+
for (const char* p = pattern;; p++) {
|
|
1079
|
+
if (*p == '[' || *p == '(') depth++;
|
|
1080
|
+
else if (*p == ']' || *p == ')') depth--;
|
|
1081
|
+
if ((*p == '|' && depth == 0) || *p == '\0') {
|
|
1082
|
+
size_t len = (size_t)(p - start);
|
|
1083
|
+
while (len > 0 && (start[len-1] == ' ')) len--;
|
|
1084
|
+
char* part = (char*)malloc(len + 1);
|
|
1085
|
+
if (part) {
|
|
1086
|
+
memcpy(part, start, len);
|
|
1087
|
+
part[len] = '\0';
|
|
1088
|
+
parts[i++] = part;
|
|
1089
|
+
}
|
|
1090
|
+
if (*p == '\0') break;
|
|
1091
|
+
start = p + 1;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
*count = i;
|
|
1095
|
+
return parts;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
static void add_template(SheetParser* sp, LeptrisElement e) {
|
|
1099
|
+
const char* match = leptris_element_attribute(e, "match");
|
|
1100
|
+
const char* name = leptris_element_attribute(e, "name");
|
|
1101
|
+
const char* mode = leptris_element_attribute(e, "mode");
|
|
1102
|
+
if (!match && !name) return;
|
|
1103
|
+
|
|
1104
|
+
XsltTemplate* t = (XsltTemplate*)calloc(1, sizeof(*t));
|
|
1105
|
+
if (!t) return;
|
|
1106
|
+
t->name = name ? leptris_strdup(name) : NULL;
|
|
1107
|
+
t->mode = mode ? leptris_strdup(mode) : NULL;
|
|
1108
|
+
t->import_rank = sp->import_rank;
|
|
1109
|
+
t->ns = build_ns_context(e); /* §5.3 pattern prefix resolution */
|
|
1110
|
+
t->body = parse_content(sp, e);
|
|
1111
|
+
|
|
1112
|
+
/* §5.4: an explicit priority replaces the §5.5 default for
|
|
1113
|
+
* EVERY alternative of the union (bug-157). */
|
|
1114
|
+
double pri_val = 0;
|
|
1115
|
+
int has_priority = 0;
|
|
1116
|
+
const char* pris = leptris_element_attribute(e, "priority");
|
|
1117
|
+
if (pris && *pris) {
|
|
1118
|
+
char* end = NULL;
|
|
1119
|
+
pri_val = strtod(pris, &end);
|
|
1120
|
+
if (end != pris) has_priority = 1;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
if (match) {
|
|
1124
|
+
if (!*match) { sp->errors = 1; free(t); return; }
|
|
1125
|
+
size_t nalt = 0;
|
|
1126
|
+
char** alts = split_alternatives(match, &nalt);
|
|
1127
|
+
XsltPattern** tail = &t->matches;
|
|
1128
|
+
for (size_t i = 0; i < nalt; i++) {
|
|
1129
|
+
char* trimmed = alts[i];
|
|
1130
|
+
while (*trimmed == ' ') trimmed++;
|
|
1131
|
+
if (!*trimmed) continue;
|
|
1132
|
+
XsltPattern* p = (XsltPattern*)calloc(1, sizeof(*p));
|
|
1133
|
+
if (!p) continue;
|
|
1134
|
+
p->expr = leptris_xpath_compile(trimmed);
|
|
1135
|
+
if (!p->expr) {
|
|
1136
|
+
/* Bad pattern: fail the whole stylesheet. */
|
|
1137
|
+
sp->errors = 1;
|
|
1138
|
+
free(p);
|
|
1139
|
+
free(alts[i]);
|
|
1140
|
+
continue;
|
|
1141
|
+
}
|
|
1142
|
+
xslt_pattern_compile_steps(p, trimmed);
|
|
1143
|
+
p->priority = has_priority ? pri_val
|
|
1144
|
+
: default_priority(trimmed);
|
|
1145
|
+
/* Bare-name fast path for the root element — ONLY for
|
|
1146
|
+
* single-step patterns: a child-step pattern (star slash
|
|
1147
|
+
* star, or name slash star) must not match the root,
|
|
1148
|
+
* whose parent is the document node (bug-186). */
|
|
1149
|
+
const char* last = strrchr(trimmed, '/');
|
|
1150
|
+
const char* leaf = last ? last + 1 : trimmed;
|
|
1151
|
+
int simple = !last;
|
|
1152
|
+
for (const char* q = leaf; *q; q++) {
|
|
1153
|
+
if (*q == '[' || *q == '(' || *q == '@' || *q == ':') simple = 0;
|
|
1154
|
+
}
|
|
1155
|
+
if (simple && strlen(leaf) < sizeof(p->expr_name)) {
|
|
1156
|
+
strcpy(p->expr_name, leaf);
|
|
1157
|
+
p->expr_name_only = 1;
|
|
1158
|
+
}
|
|
1159
|
+
/* #866: the leaf's Name test even under predicates —
|
|
1160
|
+
* everything before the first '[' / '@' / '(' in a
|
|
1161
|
+
* single-step, unprefixed, non-wildcard leaf. */
|
|
1162
|
+
{
|
|
1163
|
+
size_t nl = 0;
|
|
1164
|
+
while (leaf[nl] && leaf[nl] != '[' && leaf[nl] != '@' &&
|
|
1165
|
+
leaf[nl] != '(' && leaf[nl] != ':')
|
|
1166
|
+
nl++;
|
|
1167
|
+
/* Only a genuine Name test: the remainder after the
|
|
1168
|
+
* name must be empty or a predicate ('[', '@') — a
|
|
1169
|
+
* '(' means a node-type test (text(), node(),
|
|
1170
|
+
* processing-instruction()) or a function call
|
|
1171
|
+
* (id('x')), which matches by kind, not name. */
|
|
1172
|
+
if (nl && nl < sizeof(p->leaf_name) &&
|
|
1173
|
+
!(nl == 1 && leaf[0] == '*') && !last &&
|
|
1174
|
+
(leaf[nl] == 0 || leaf[nl] == '[' || leaf[nl] == '@')) {
|
|
1175
|
+
memcpy(p->leaf_name, leaf, nl);
|
|
1176
|
+
p->leaf_name[nl] = 0;
|
|
1177
|
+
p->leaf_named = 1;
|
|
1178
|
+
/* Literal @attr='value' predicate: [@a='v'] or
|
|
1179
|
+
* [@a="v"] and nothing else. */
|
|
1180
|
+
if (leaf[nl] == '[') {
|
|
1181
|
+
const char* q = leaf + nl + 1;
|
|
1182
|
+
if (*q == '@') {
|
|
1183
|
+
size_t al = 1;
|
|
1184
|
+
while (q[al] && q[al] != '=') al++;
|
|
1185
|
+
size_t an = al - 1;
|
|
1186
|
+
if (q[al] == '=' &&
|
|
1187
|
+
(q[al + 1] == '\'' || q[al + 1] == '"')) {
|
|
1188
|
+
char term = q[al + 1];
|
|
1189
|
+
size_t v0 = al + 2;
|
|
1190
|
+
size_t vl = v0;
|
|
1191
|
+
while (q[vl] && q[vl] != term) vl++;
|
|
1192
|
+
if (q[vl] == term && q[vl + 1] == ']' &&
|
|
1193
|
+
q[vl + 2] == 0 && an > 0 &&
|
|
1194
|
+
an < sizeof(p->pred_attr) &&
|
|
1195
|
+
vl - v0 < sizeof(p->pred_val)) {
|
|
1196
|
+
memcpy(p->pred_attr, q + 1, an);
|
|
1197
|
+
p->pred_attr[an] = 0;
|
|
1198
|
+
memcpy(p->pred_val, q + v0, vl - v0);
|
|
1199
|
+
p->pred_val[vl - v0] = 0;
|
|
1200
|
+
p->pred_literal = 1;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
*tail = p;
|
|
1208
|
+
tail = &p->next;
|
|
1209
|
+
free(alts[i]);
|
|
1210
|
+
}
|
|
1211
|
+
free(alts);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/* Append (imported templates were added FIRST by construction —
|
|
1215
|
+
* xsl:import is processed before the body). */
|
|
1216
|
+
t->order = sp->sheet->template_count;
|
|
1217
|
+
if (!sp->sheet->templates) {
|
|
1218
|
+
sp->sheet->templates = t;
|
|
1219
|
+
} else {
|
|
1220
|
+
XsltTemplate* x = sp->sheet->templates;
|
|
1221
|
+
while (x->next) x = x->next;
|
|
1222
|
+
x->next = t;
|
|
1223
|
+
}
|
|
1224
|
+
sp->sheet->template_count++;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
static void parse_top_level(SheetParser* sp, LeptrisElement root) {
|
|
1228
|
+
/* EXSLT func pre-scan: the function namespaces are excluded from
|
|
1229
|
+
* LRE ns-copy (EXSLT: they never reach the result), and the
|
|
1230
|
+
* exclusion must be in place BEFORE any template's literal
|
|
1231
|
+
* result elements compile. */
|
|
1232
|
+
for (LeptrisNodeRef n = leptris_node_first_child(
|
|
1233
|
+
leptris_element_as_node(root));
|
|
1234
|
+
n; n = leptris_node_next_sibling(n)) {
|
|
1235
|
+
if (leptris_node_get_type(n) != LEPTRIS_NODE_TYPE_ELEMENT) continue;
|
|
1236
|
+
LeptrisElement e = (LeptrisElement)n;
|
|
1237
|
+
if (!node_is_exslt_func(e, "function")) continue;
|
|
1238
|
+
const char* fn = leptris_element_attribute(e, "name");
|
|
1239
|
+
if (!fn || !*fn) continue;
|
|
1240
|
+
const char* colon = strchr(fn, ':');
|
|
1241
|
+
if (!colon || colon == fn) continue;
|
|
1242
|
+
char** grown = (char**)realloc(
|
|
1243
|
+
sp->sheet->exclude_pfx,
|
|
1244
|
+
(sp->sheet->exclude_count + 1) * sizeof(char*));
|
|
1245
|
+
if (!grown) continue;
|
|
1246
|
+
sp->sheet->exclude_pfx = grown;
|
|
1247
|
+
sp->sheet->exclude_pfx[sp->sheet->exclude_count] =
|
|
1248
|
+
(char*)malloc((size_t)(colon - fn) + 1);
|
|
1249
|
+
if (sp->sheet->exclude_pfx[sp->sheet->exclude_count]) {
|
|
1250
|
+
memcpy(sp->sheet->exclude_pfx[sp->sheet->exclude_count],
|
|
1251
|
+
fn, (size_t)(colon - fn));
|
|
1252
|
+
sp->sheet->exclude_pfx[sp->sheet->exclude_count][colon - fn] = 0;
|
|
1253
|
+
sp->sheet->exclude_count++;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
for (LeptrisNodeRef n = leptris_node_first_child(leptris_element_as_node(root));
|
|
1257
|
+
n; n = leptris_node_next_sibling(n)) {
|
|
1258
|
+
if (leptris_node_get_type(n) != LEPTRIS_NODE_TYPE_ELEMENT) continue;
|
|
1259
|
+
LeptrisElement e = (LeptrisElement)n;
|
|
1260
|
+
if (node_is_xsl(e, "import")) {
|
|
1261
|
+
const char* href = leptris_element_attribute(e, "href");
|
|
1262
|
+
if (href && *href && !chain_has(&sp->chain, href) &&
|
|
1263
|
+
sp->chain.len < XSLT_INCLUDE_DEPTH_MAX) {
|
|
1264
|
+
LeptrisDocument d =
|
|
1265
|
+
leptris_parse_file(href, NULL);
|
|
1266
|
+
if (!d) { sp->errors = 1; continue; }
|
|
1267
|
+
sp->import_rank++;
|
|
1268
|
+
chain_push(&sp->chain, href);
|
|
1269
|
+
LeptrisElement r2 = leptris_document_root(d);
|
|
1270
|
+
if (r2) parse_top_level(sp, r2);
|
|
1271
|
+
chain_pop(&sp->chain);
|
|
1272
|
+
sp->import_rank--;
|
|
1273
|
+
leptris_document_free(d);
|
|
1274
|
+
}
|
|
1275
|
+
continue;
|
|
1276
|
+
}
|
|
1277
|
+
if (node_is_xsl(e, "include")) {
|
|
1278
|
+
const char* href = leptris_element_attribute(e, "href");
|
|
1279
|
+
if (href && *href && !chain_has(&sp->chain, href) &&
|
|
1280
|
+
sp->chain.len < XSLT_INCLUDE_DEPTH_MAX) {
|
|
1281
|
+
LeptrisDocument d =
|
|
1282
|
+
leptris_parse_file(href, NULL);
|
|
1283
|
+
if (!d) { sp->errors = 1; continue; }
|
|
1284
|
+
chain_push(&sp->chain, href);
|
|
1285
|
+
/* Include keeps the same import_rank — declared in
|
|
1286
|
+
* the including sheet's position. */
|
|
1287
|
+
LeptrisElement r2 = leptris_document_root(d);
|
|
1288
|
+
if (r2) parse_top_level(sp, r2);
|
|
1289
|
+
chain_pop(&sp->chain);
|
|
1290
|
+
leptris_document_free(d);
|
|
1291
|
+
}
|
|
1292
|
+
continue;
|
|
1293
|
+
}
|
|
1294
|
+
if (node_is_xsl(e, "template")) {
|
|
1295
|
+
add_template(sp, e);
|
|
1296
|
+
continue;
|
|
1297
|
+
}
|
|
1298
|
+
/* EXSLT func:function: a stylesheet-defined XPath function. */
|
|
1299
|
+
if (node_is_exslt_func(e, "function")) {
|
|
1300
|
+
const char* fn = leptris_element_attribute(e, "name");
|
|
1301
|
+
if (fn && *fn) {
|
|
1302
|
+
XsltUserFunc* f = (XsltUserFunc*)calloc(1, sizeof(*f));
|
|
1303
|
+
if (f) {
|
|
1304
|
+
f->name = leptris_strdup(fn);
|
|
1305
|
+
f->body = parse_content(sp, e);
|
|
1306
|
+
XsltUserFunc** tail = &sp->sheet->funcs;
|
|
1307
|
+
while (*tail) tail = &(*tail)->next;
|
|
1308
|
+
*tail = f;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
continue;
|
|
1312
|
+
}
|
|
1313
|
+
if (node_is_xsl(e, "variable") || node_is_xsl(e, "param")) {
|
|
1314
|
+
XsltInstr* in = parse_instruction(sp, e);
|
|
1315
|
+
if (in) instr_append(&sp->sheet->globals, in);
|
|
1316
|
+
continue;
|
|
1317
|
+
}
|
|
1318
|
+
if (node_is_xsl(e, "key")) {
|
|
1319
|
+
XsltKeyDef* k = (XsltKeyDef*)calloc(1, sizeof(*k));
|
|
1320
|
+
if (!k) continue;
|
|
1321
|
+
k->name = leptris_strdup(leptris_element_attribute(e, "name"));
|
|
1322
|
+
k->pat.expr = compile_attr_sp(sp, e, "match");
|
|
1323
|
+
k->use = compile_attr_sp(sp, e, "use");
|
|
1324
|
+
const char* mt = leptris_element_attribute(e, "match");
|
|
1325
|
+
if (mt && *mt && k->pat.expr)
|
|
1326
|
+
xslt_pattern_compile_steps(&k->pat, mt);
|
|
1327
|
+
XsltKeyDef** tail = &sp->sheet->keys;
|
|
1328
|
+
while (*tail) tail = &(*tail)->next;
|
|
1329
|
+
*tail = k;
|
|
1330
|
+
continue;
|
|
1331
|
+
}
|
|
1332
|
+
/* xsl:accumulator (3.0 §18.2): declaration + ordered rules.
|
|
1333
|
+
* initial-value/@select attributes only — sequence-constructor
|
|
1334
|
+
* bodies (both attributes and rules) are not compiled yet. */
|
|
1335
|
+
if (node_is_xsl(e, "accumulator")) {
|
|
1336
|
+
const char* an = leptris_element_attribute(e, "name");
|
|
1337
|
+
if (!an || !*an) continue;
|
|
1338
|
+
XsltAccumulator* a = (XsltAccumulator*)calloc(1, sizeof(*a));
|
|
1339
|
+
if (!a) continue;
|
|
1340
|
+
a->name = leptris_strdup(an);
|
|
1341
|
+
a->initial = compile_attr_sp(sp, e, "initial-value");
|
|
1342
|
+
XsltAccRule** tail = &a->rules;
|
|
1343
|
+
for (LeptrisElement c = leptris_element_first_child_any(e); c;
|
|
1344
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
1345
|
+
if (!node_is_xsl(c, "accumulator-rule")) continue;
|
|
1346
|
+
XsltAccRule* r = (XsltAccRule*)calloc(1, sizeof(*r));
|
|
1347
|
+
if (!r) continue;
|
|
1348
|
+
r->match = compile_attr_sp(sp, c, "match");
|
|
1349
|
+
r->select = compile_attr_sp(sp, c, "select");
|
|
1350
|
+
const char* ph = leptris_element_attribute(c, "phase");
|
|
1351
|
+
r->phase_end = ph && strcmp(ph, "end") == 0;
|
|
1352
|
+
*tail = r;
|
|
1353
|
+
tail = &r->next;
|
|
1354
|
+
}
|
|
1355
|
+
XsltAccumulator** at = &sp->sheet->accs;
|
|
1356
|
+
while (*at) at = &(*at)->next;
|
|
1357
|
+
*at = a;
|
|
1358
|
+
continue;
|
|
1359
|
+
}
|
|
1360
|
+
/* xsl:mode (3.0 §10): only the unnamed mode's
|
|
1361
|
+
* use-accumulators is captured (§18.2.2 applicability gate).
|
|
1362
|
+
* The other attributes (on-no-match, warning/on-no-match,
|
|
1363
|
+
* typed, visibility) land with full xsl:mode support. */
|
|
1364
|
+
if (node_is_xsl(e, "mode")) {
|
|
1365
|
+
const char* mn = leptris_element_attribute(e, "name");
|
|
1366
|
+
const char* ua = leptris_element_attribute(e, "use-accumulators");
|
|
1367
|
+
if ((!mn || !*mn) && ua && *ua) {
|
|
1368
|
+
if (strcmp(ua, "#all") == 0) {
|
|
1369
|
+
sp->sheet->mode_acc_all = 1;
|
|
1370
|
+
} else {
|
|
1371
|
+
char* dup = leptris_strdup(ua);
|
|
1372
|
+
if (dup) {
|
|
1373
|
+
char* save = NULL;
|
|
1374
|
+
for (char* tok = xslt_strtok(dup, " \t\n,", &save);
|
|
1375
|
+
tok; tok = xslt_strtok(NULL, " \t\n,", &save)) {
|
|
1376
|
+
char** grown = (char**)realloc(
|
|
1377
|
+
sp->sheet->mode_acc_names,
|
|
1378
|
+
(sp->sheet->mode_acc_count + 1) *
|
|
1379
|
+
sizeof(char*));
|
|
1380
|
+
if (!grown) break;
|
|
1381
|
+
sp->sheet->mode_acc_names = grown;
|
|
1382
|
+
sp->sheet->mode_acc_names[
|
|
1383
|
+
sp->sheet->mode_acc_count++] =
|
|
1384
|
+
leptris_strdup(tok);
|
|
1385
|
+
}
|
|
1386
|
+
free(dup);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
/* §6.7 on-no-match for the unnamed mode: 1 unspecified
|
|
1391
|
+
* (runtime resolves by version — 3.0 default is
|
|
1392
|
+
* shallow-copy, 1.0 keeps the text built-in), 2
|
|
1393
|
+
* deep-copy, 3 shallow-copy, 4 shallow-skip, 5
|
|
1394
|
+
* deep-skip, 6 text-only-copy, 7 fail. */
|
|
1395
|
+
if (!mn || !*mn) {
|
|
1396
|
+
const char* onm =
|
|
1397
|
+
leptris_element_attribute(e, "on-no-match");
|
|
1398
|
+
if (onm && *onm) {
|
|
1399
|
+
if (strcmp(onm, "deep-copy") == 0)
|
|
1400
|
+
sp->sheet->mode_on_no_match = 2;
|
|
1401
|
+
else if (strcmp(onm, "shallow-copy") == 0)
|
|
1402
|
+
sp->sheet->mode_on_no_match = 3;
|
|
1403
|
+
else if (strcmp(onm, "shallow-skip") == 0)
|
|
1404
|
+
sp->sheet->mode_on_no_match = 4;
|
|
1405
|
+
else if (strcmp(onm, "deep-skip") == 0)
|
|
1406
|
+
sp->sheet->mode_on_no_match = 5;
|
|
1407
|
+
else if (strcmp(onm, "text-only-copy") == 0)
|
|
1408
|
+
sp->sheet->mode_on_no_match = 6;
|
|
1409
|
+
else if (strcmp(onm, "fail") == 0)
|
|
1410
|
+
sp->sheet->mode_on_no_match = 7;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
continue;
|
|
1414
|
+
}
|
|
1415
|
+
/* xsl:global-context-item (3.0 §10): the transform always
|
|
1416
|
+
* runs with the source document as its global context item,
|
|
1417
|
+
* so the declaration is accepted as a no-op (as/use-when
|
|
1418
|
+
* ride along; the no-context error path cannot occur —
|
|
1419
|
+
* #690 audit). */
|
|
1420
|
+
if (node_is_xsl(e, "global-context-item")) {
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
if (node_is_xsl(e, "output")) {
|
|
1424
|
+
const char* m = leptris_element_attribute(e, "method");
|
|
1425
|
+
sp->sheet->out_method_text = m && strcmp(m, "text") == 0;
|
|
1426
|
+
sp->sheet->out_method_html = m && strcmp(m, "html") == 0;
|
|
1427
|
+
sp->sheet->out_method_set = m && *m;
|
|
1428
|
+
const char* ind = leptris_element_attribute(e, "indent");
|
|
1429
|
+
if (ind) sp->sheet->out_indent = strcmp(ind, "yes") == 0;
|
|
1430
|
+
/* §16.1 cdata-section-elements: space-separated QNames. */
|
|
1431
|
+
const char* cda =
|
|
1432
|
+
leptris_element_attribute(e, "cdata-section-elements");
|
|
1433
|
+
if (cda && *cda) {
|
|
1434
|
+
char* dup = leptris_strdup(cda);
|
|
1435
|
+
if (dup) {
|
|
1436
|
+
char* save = NULL;
|
|
1437
|
+
for (char* tok = xslt_strtok(dup, " \t\n,", &save);
|
|
1438
|
+
tok; tok = xslt_strtok(NULL, " \t\n,", &save)) {
|
|
1439
|
+
char** grown = (char**)realloc(
|
|
1440
|
+
sp->sheet->out_cdata,
|
|
1441
|
+
(sp->sheet->out_cdata_count + 1) *
|
|
1442
|
+
sizeof(char*));
|
|
1443
|
+
if (!grown) break;
|
|
1444
|
+
sp->sheet->out_cdata = grown;
|
|
1445
|
+
sp->sheet->out_cdata[
|
|
1446
|
+
sp->sheet->out_cdata_count++] =
|
|
1447
|
+
leptris_strdup(tok);
|
|
1448
|
+
}
|
|
1449
|
+
free(dup);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
const char* od = leptris_element_attribute(e, "omit-xml-declaration");
|
|
1453
|
+
sp->sheet->out_omit_decl = od && strcmp(od, "yes") == 0;
|
|
1454
|
+
const char* enc = leptris_element_attribute(e, "encoding");
|
|
1455
|
+
sp->sheet->out_encoding = enc ? leptris_strdup(enc) : NULL;
|
|
1456
|
+
const char* ver = leptris_element_attribute(e, "version");
|
|
1457
|
+
sp->sheet->out_version = ver ? leptris_strdup(ver) : NULL;
|
|
1458
|
+
const char* sa = leptris_element_attribute(e, "standalone");
|
|
1459
|
+
if (sa && *sa)
|
|
1460
|
+
sp->sheet->out_standalone =
|
|
1461
|
+
strcmp(sa, "yes") == 0 ? 1 : 0;
|
|
1462
|
+
const char* mt = leptris_element_attribute(e, "media-type");
|
|
1463
|
+
if (mt && *mt) {
|
|
1464
|
+
free((void*)sp->sheet->out_media_type);
|
|
1465
|
+
sp->sheet->out_media_type = leptris_strdup(mt);
|
|
1466
|
+
}
|
|
1467
|
+
const char* ds = leptris_element_attribute(e, "doctype-system");
|
|
1468
|
+
if (ds) { free((void*)sp->sheet->out_doctype_system);
|
|
1469
|
+
sp->sheet->out_doctype_system = leptris_strdup(ds); }
|
|
1470
|
+
const char* dp = leptris_element_attribute(e, "doctype-public");
|
|
1471
|
+
if (dp) { free((void*)sp->sheet->out_doctype_public);
|
|
1472
|
+
sp->sheet->out_doctype_public = leptris_strdup(dp); }
|
|
1473
|
+
const char* cs = leptris_element_attribute(e, "cdata-section-elements");
|
|
1474
|
+
if (cs) {
|
|
1475
|
+
/* Trim + split on whitespace. */
|
|
1476
|
+
char* tmp = leptris_strdup(cs);
|
|
1477
|
+
if (tmp) {
|
|
1478
|
+
if (sp->sheet->out_cdata_elems) {
|
|
1479
|
+
for (size_t i = 0; sp->sheet->out_cdata_elems[i]; i++)
|
|
1480
|
+
free(sp->sheet->out_cdata_elems[i]);
|
|
1481
|
+
free(sp->sheet->out_cdata_elems);
|
|
1482
|
+
}
|
|
1483
|
+
size_t cap = 4, cnt = 0;
|
|
1484
|
+
char** arr = (char**)malloc(cap * sizeof(char*));
|
|
1485
|
+
char* save = NULL;
|
|
1486
|
+
char* tok = xslt_strtok(tmp, " \t\n,", &save);
|
|
1487
|
+
while (tok) {
|
|
1488
|
+
if (cnt + 1 >= cap) { cap *= 2;
|
|
1489
|
+
arr = (char**)realloc(arr, cap * sizeof(char*)); }
|
|
1490
|
+
arr[cnt++] = leptris_strdup(tok);
|
|
1491
|
+
arr[cnt] = NULL;
|
|
1492
|
+
tok = xslt_strtok(NULL, " \t\n,", &save);
|
|
1493
|
+
}
|
|
1494
|
+
free(tmp);
|
|
1495
|
+
sp->sheet->out_cdata_elems = arr;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
/* §16.1 use-character-maps: whitespace-separated names of
|
|
1499
|
+
* xsl:character-map declarations activated at output. */
|
|
1500
|
+
const char* ucm =
|
|
1501
|
+
leptris_element_attribute(e, "use-character-maps");
|
|
1502
|
+
if (ucm && *ucm) {
|
|
1503
|
+
char* tmp = leptris_strdup(ucm);
|
|
1504
|
+
if (tmp) {
|
|
1505
|
+
char* save = NULL;
|
|
1506
|
+
char* tok = xslt_strtok(tmp, " \t\n,", &save);
|
|
1507
|
+
while (tok) {
|
|
1508
|
+
char** grown = (char**)realloc(
|
|
1509
|
+
sp->sheet->out_charmap_names,
|
|
1510
|
+
(sp->sheet->out_charmap_name_count + 1) *
|
|
1511
|
+
sizeof(char*));
|
|
1512
|
+
if (!grown) break;
|
|
1513
|
+
sp->sheet->out_charmap_names = grown;
|
|
1514
|
+
sp->sheet->out_charmap_names[
|
|
1515
|
+
sp->sheet->out_charmap_name_count++] =
|
|
1516
|
+
leptris_strdup(tok);
|
|
1517
|
+
tok = xslt_strtok(NULL, " \t\n,", &save);
|
|
1518
|
+
}
|
|
1519
|
+
free(tmp);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
continue;
|
|
1523
|
+
}
|
|
1524
|
+
if (node_is_xsl(e, "character-map")) {
|
|
1525
|
+
/* §16.1: table of character → replacement-string pairs;
|
|
1526
|
+
* activated by name from xsl:output/@use-character-maps. */
|
|
1527
|
+
const char* cname = leptris_element_attribute(e, "name");
|
|
1528
|
+
if (cname && *cname) {
|
|
1529
|
+
XsltCharMap* grown = (XsltCharMap*)realloc(
|
|
1530
|
+
sp->sheet->charmaps,
|
|
1531
|
+
(sp->sheet->charmap_count + 1) * sizeof(*grown));
|
|
1532
|
+
if (grown) {
|
|
1533
|
+
XsltCharMap* cm = &grown[sp->sheet->charmap_count++];
|
|
1534
|
+
memset(cm, 0, sizeof(*cm));
|
|
1535
|
+
cm->name = leptris_strdup(cname);
|
|
1536
|
+
sp->sheet->charmaps = grown;
|
|
1537
|
+
for (LeptrisElement c = leptris_element_first_child_any(e);
|
|
1538
|
+
c; c = leptris_element_next_sibling_any(c)) {
|
|
1539
|
+
if (!node_is_xsl(c, "output-character")) continue;
|
|
1540
|
+
const char* ch =
|
|
1541
|
+
leptris_element_attribute(c, "character");
|
|
1542
|
+
const char* rs =
|
|
1543
|
+
leptris_element_attribute(c, "string");
|
|
1544
|
+
if (!ch || !*ch) continue;
|
|
1545
|
+
char** ng = (char**)realloc(
|
|
1546
|
+
cm->chars, (cm->count + 1) * sizeof(char*));
|
|
1547
|
+
char** nr = (char**)realloc(
|
|
1548
|
+
cm->repls, (cm->count + 1) * sizeof(char*));
|
|
1549
|
+
if (!ng || !nr) {
|
|
1550
|
+
if (ng) { cm->chars = ng; }
|
|
1551
|
+
else free(nr);
|
|
1552
|
+
if (nr) { cm->repls = nr; }
|
|
1553
|
+
else free(ng);
|
|
1554
|
+
break;
|
|
1555
|
+
}
|
|
1556
|
+
cm->chars = ng;
|
|
1557
|
+
cm->repls = nr;
|
|
1558
|
+
cm->chars[cm->count] = leptris_strdup(ch);
|
|
1559
|
+
cm->repls[cm->count] = leptris_strdup(rs ? rs : "");
|
|
1560
|
+
cm->count++;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
if (node_is_xsl(e, "strip-space") ||
|
|
1567
|
+
node_is_xsl(e, "preserve-space")) {
|
|
1568
|
+
/* §3.4 source whitespace handling: both lists are
|
|
1569
|
+
* whitespace-split name lists. */
|
|
1570
|
+
const char* els = leptris_element_attribute(e, "elements");
|
|
1571
|
+
if (els && *els) {
|
|
1572
|
+
char* tmp = leptris_strdup(els);
|
|
1573
|
+
if (tmp) {
|
|
1574
|
+
char** arr = NULL; size_t cnt = 0, cap = 0;
|
|
1575
|
+
char* save = NULL;
|
|
1576
|
+
for (char* tok = xslt_strtok(tmp, " \t\n", &save); tok;
|
|
1577
|
+
tok = xslt_strtok(NULL, " \t\n", &save)) {
|
|
1578
|
+
if (cnt + 1 >= cap) {
|
|
1579
|
+
cap = cap ? cap * 2 : 4;
|
|
1580
|
+
arr = (char**)realloc(arr, cap * sizeof(char*));
|
|
1581
|
+
}
|
|
1582
|
+
arr[cnt++] = leptris_strdup(tok);
|
|
1583
|
+
}
|
|
1584
|
+
free(tmp);
|
|
1585
|
+
arr = (char**)realloc(arr, (cnt + 1) * sizeof(char*));
|
|
1586
|
+
arr[cnt] = NULL;
|
|
1587
|
+
/* Record into the ORDERED rules list (3.4: the
|
|
1588
|
+
* last matching declaration wins). */
|
|
1589
|
+
int is_pres = !node_is_xsl(e, "strip-space");
|
|
1590
|
+
for (size_t k = 0; k < cnt; k++) {
|
|
1591
|
+
char** gr = (char**)realloc(
|
|
1592
|
+
sp->sheet->ws_rules,
|
|
1593
|
+
(sp->sheet->ws_rule_count + 1) *
|
|
1594
|
+
sizeof(char*));
|
|
1595
|
+
unsigned char* gp = (unsigned char*)realloc(
|
|
1596
|
+
sp->sheet->ws_rule_preserve,
|
|
1597
|
+
(sp->sheet->ws_rule_count + 1) * 1);
|
|
1598
|
+
if (!gr || !gp) { free(gr); free(gp); break; }
|
|
1599
|
+
sp->sheet->ws_rules = gr;
|
|
1600
|
+
sp->sheet->ws_rule_preserve = gp;
|
|
1601
|
+
sp->sheet->ws_rules[sp->sheet->ws_rule_count] =
|
|
1602
|
+
arr[k];
|
|
1603
|
+
sp->sheet->ws_rule_preserve[
|
|
1604
|
+
sp->sheet->ws_rule_count] =
|
|
1605
|
+
(unsigned char)is_pres;
|
|
1606
|
+
sp->sheet->ws_rule_count++;
|
|
1607
|
+
}
|
|
1608
|
+
if (node_is_xsl(e, "strip-space")) {
|
|
1609
|
+
sp->sheet->ws_strip = arr;
|
|
1610
|
+
} else {
|
|
1611
|
+
sp->sheet->ws_preserve = arr;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
continue;
|
|
1616
|
+
}
|
|
1617
|
+
if (node_is_xsl(e, "namespace-alias")) {
|
|
1618
|
+
const char* spx = leptris_element_attribute(e, "stylesheet-prefix");
|
|
1619
|
+
const char* rpx = leptris_element_attribute(e, "result-prefix");
|
|
1620
|
+
XsltNsAlias* na = (XsltNsAlias*)calloc(1, sizeof(*na));
|
|
1621
|
+
if (na) {
|
|
1622
|
+
na->stylesheet_prefix =
|
|
1623
|
+
(spx && strcmp(spx, "#default") != 0)
|
|
1624
|
+
? leptris_strdup(spx) : NULL;
|
|
1625
|
+
na->result_prefix =
|
|
1626
|
+
(rpx && strcmp(rpx, "#default") != 0)
|
|
1627
|
+
? leptris_strdup(rpx) : NULL;
|
|
1628
|
+
na->next = sp->sheet->ns_alias;
|
|
1629
|
+
sp->sheet->ns_alias = na;
|
|
1630
|
+
}
|
|
1631
|
+
continue;
|
|
1632
|
+
}
|
|
1633
|
+
if (node_is_xsl(e, "fallback")) {
|
|
1634
|
+
continue; /* only meaningful inside unknown elements */
|
|
1635
|
+
}
|
|
1636
|
+
if (node_is_xsl(e, "decimal-format")) {
|
|
1637
|
+
/* Find/create by name (NULL = default). */
|
|
1638
|
+
const char* name = leptris_element_attribute(e, "name");
|
|
1639
|
+
/* Resolve the declaration's qname so same-literal names
|
|
1640
|
+
* in DIFFERENT namespaces stay distinct entries. */
|
|
1641
|
+
const char* duri = NULL;
|
|
1642
|
+
const char* dlocal = name;
|
|
1643
|
+
if (name) {
|
|
1644
|
+
const char* dc = strchr(name, ':');
|
|
1645
|
+
if (dc) {
|
|
1646
|
+
dlocal = dc + 1;
|
|
1647
|
+
char dp[64];
|
|
1648
|
+
size_t dl = (size_t)(dc - name);
|
|
1649
|
+
if (dl < sizeof(dp)) {
|
|
1650
|
+
memcpy(dp, name, dl);
|
|
1651
|
+
dp[dl] = 0;
|
|
1652
|
+
duri = leptris_element_namespace_for_prefix(
|
|
1653
|
+
e, dp);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
XsltDecimalFormat* df = NULL;
|
|
1658
|
+
for (XsltDecimalFormat* d = sp->sheet->decformats; d; d = d->next) {
|
|
1659
|
+
if (!name || !d->name) {
|
|
1660
|
+
if (!name && !d->name) { df = d; break; }
|
|
1661
|
+
continue;
|
|
1662
|
+
}
|
|
1663
|
+
if (strcmp(name, d->name) != 0) continue;
|
|
1664
|
+
const char* euri = d->uri ? d->uri : "";
|
|
1665
|
+
const char* curi = duri ? duri : "";
|
|
1666
|
+
if (strcmp(euri, curi) == 0) { df = d; break; }
|
|
1667
|
+
}
|
|
1668
|
+
if (!df) {
|
|
1669
|
+
df = (XsltDecimalFormat*)calloc(1, sizeof(*df));
|
|
1670
|
+
if (!df) continue;
|
|
1671
|
+
df->decimal_sep = leptris_strdup(".");
|
|
1672
|
+
df->grouping_sep = leptris_strdup(",");
|
|
1673
|
+
df->minus_sign = '-';
|
|
1674
|
+
df->percent = '%';
|
|
1675
|
+
df->per_mille = '%';
|
|
1676
|
+
df->zero_digit = '0';
|
|
1677
|
+
df->infinity = leptris_strdup("Infinity");
|
|
1678
|
+
df->nan = leptris_strdup("NaN");
|
|
1679
|
+
df->name = name ? leptris_strdup(name) : NULL;
|
|
1680
|
+
df->uri = duri ? leptris_strdup(duri) : NULL;
|
|
1681
|
+
df->local = dlocal ? leptris_strdup(dlocal) : NULL;
|
|
1682
|
+
/* Defaults slot at the head; named at the tail. */
|
|
1683
|
+
if (!name) {
|
|
1684
|
+
df->next = sp->sheet->decformats;
|
|
1685
|
+
sp->sheet->decformats = df;
|
|
1686
|
+
} else {
|
|
1687
|
+
XsltDecimalFormat** t = &sp->sheet->decformats;
|
|
1688
|
+
while (*t) t = &(*t)->next;
|
|
1689
|
+
*t = df;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
const char* av;
|
|
1693
|
+
if ((av = leptris_element_attribute(e, "decimal-separator")) && *av) {
|
|
1694
|
+
if (df->decimal_sep) free((void*)df->decimal_sep);
|
|
1695
|
+
df->decimal_sep = leptris_strdup(av);
|
|
1696
|
+
}
|
|
1697
|
+
if ((av = leptris_element_attribute(e, "grouping-separator")) && *av) {
|
|
1698
|
+
if (df->grouping_sep) free((void*)df->grouping_sep);
|
|
1699
|
+
df->grouping_sep = leptris_strdup(av);
|
|
1700
|
+
}
|
|
1701
|
+
if ((av = leptris_element_attribute(e, "minus-sign")) && *av)
|
|
1702
|
+
df->minus_sign = av[0];
|
|
1703
|
+
if ((av = leptris_element_attribute(e, "percent")) && *av)
|
|
1704
|
+
df->percent = av[0];
|
|
1705
|
+
if ((av = leptris_element_attribute(e, "per-mille")) && *av)
|
|
1706
|
+
df->per_mille = av[0];
|
|
1707
|
+
if ((av = leptris_element_attribute(e, "zero-digit")) && *av)
|
|
1708
|
+
df->zero_digit = av[0];
|
|
1709
|
+
if ((av = leptris_element_attribute(e, "infinity")) && *av) {
|
|
1710
|
+
if (df->infinity) free((void*)df->infinity);
|
|
1711
|
+
df->infinity = leptris_strdup(av);
|
|
1712
|
+
}
|
|
1713
|
+
if ((av = leptris_element_attribute(e, "NaN")) && *av) {
|
|
1714
|
+
if (df->nan) free((void*)df->nan);
|
|
1715
|
+
df->nan = leptris_strdup(av);
|
|
1716
|
+
}
|
|
1717
|
+
continue;
|
|
1718
|
+
}
|
|
1719
|
+
if (node_is_xsl(e, "attribute-set")) {
|
|
1720
|
+
const char* nm = leptris_element_attribute(e, "name");
|
|
1721
|
+
if (!nm || !*nm) continue;
|
|
1722
|
+
XsltAttrSet* s = (XsltAttrSet*)calloc(1, sizeof(*s));
|
|
1723
|
+
if (!s) continue;
|
|
1724
|
+
s->name = leptris_strdup(nm);
|
|
1725
|
+
s->name_uri = resolve_set_uri(e, nm);
|
|
1726
|
+
s->import_rank = sp->import_rank;
|
|
1727
|
+
/* Prepend to the set list so later use-attribute-sets
|
|
1728
|
+
* applies later sets FIRST (winning conflicts). */
|
|
1729
|
+
s->next = sp->sheet->attrsets;
|
|
1730
|
+
sp->sheet->attrsets = s;
|
|
1731
|
+
for (LeptrisElement c =
|
|
1732
|
+
leptris_element_first_child_any(e); c;
|
|
1733
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
1734
|
+
if (!node_is_xsl(c, "attribute")) continue;
|
|
1735
|
+
XsltLAttr* la = (XsltLAttr*)calloc(1, sizeof(*la));
|
|
1736
|
+
if (!la) continue;
|
|
1737
|
+
la->name = leptris_strdup(
|
|
1738
|
+
leptris_element_attribute(c, "name"));
|
|
1739
|
+
const char* v = leptris_element_child_value(c);
|
|
1740
|
+
la->value = leptris_strdup(v ? v : "");
|
|
1741
|
+
la->next = s->attrs;
|
|
1742
|
+
s->attrs = la; /* newer first, but apply later-staged
|
|
1743
|
+
sets first because head-of-list is
|
|
1744
|
+
the most-recently-declared set */
|
|
1745
|
+
}
|
|
1746
|
+
/* Chained sets (use-attribute-sets on the definition)
|
|
1747
|
+
* are recorded, not snapshotted — §12.1.4 semantics
|
|
1748
|
+
* need use-time resolution with import precedence. */
|
|
1749
|
+
const char* uas = leptris_element_attribute(e, "use-attribute-sets");
|
|
1750
|
+
if (uas && *uas) {
|
|
1751
|
+
char* dup = leptris_strdup(uas);
|
|
1752
|
+
if (dup) {
|
|
1753
|
+
char* save = NULL;
|
|
1754
|
+
for (char* tok = xslt_strtok(dup, " \t\n,", &save);
|
|
1755
|
+
tok; tok = xslt_strtok(NULL, " \t\n,", &save)) {
|
|
1756
|
+
char** grown = (char**)realloc(
|
|
1757
|
+
s->use_names,
|
|
1758
|
+
(s->use_count + 1) * sizeof(char*));
|
|
1759
|
+
if (!grown) break;
|
|
1760
|
+
s->use_names = grown;
|
|
1761
|
+
char** growu = (char**)realloc(
|
|
1762
|
+
s->use_uris,
|
|
1763
|
+
(s->use_count + 1) * sizeof(char*));
|
|
1764
|
+
if (!growu) break;
|
|
1765
|
+
s->use_uris = growu;
|
|
1766
|
+
s->use_uris[s->use_count] =
|
|
1767
|
+
resolve_set_uri(e, tok);
|
|
1768
|
+
s->use_names[s->use_count++] =
|
|
1769
|
+
leptris_strdup(tok);
|
|
1770
|
+
}
|
|
1771
|
+
free(dup);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
continue;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
/* ---- Public compilation ---- */
|
|
1780
|
+
|
|
1781
|
+
static void free_instr_list(XsltInstr* list);
|
|
1782
|
+
|
|
1783
|
+
static void free_instr(XsltInstr* in) {
|
|
1784
|
+
if (!in) return;
|
|
1785
|
+
free_instr_list(in->child);
|
|
1786
|
+
if (in->test) leptris_xpath_compiled_free(in->test);
|
|
1787
|
+
if (in->select) leptris_xpath_compiled_free(in->select);
|
|
1788
|
+
if (in->group_by) leptris_xpath_compiled_free(in->group_by);
|
|
1789
|
+
if (in->context_item) leptris_xpath_compiled_free(in->context_item);
|
|
1790
|
+
if (in->group_starting) {
|
|
1791
|
+
leptris_xpath_compiled_free(in->group_starting->expr);
|
|
1792
|
+
xslt_pattern_steps_free(in->group_starting);
|
|
1793
|
+
free(in->group_starting);
|
|
1794
|
+
}
|
|
1795
|
+
if (in->group_ending) {
|
|
1796
|
+
leptris_xpath_compiled_free(in->group_ending->expr);
|
|
1797
|
+
xslt_pattern_steps_free(in->group_ending);
|
|
1798
|
+
free(in->group_ending);
|
|
1799
|
+
}
|
|
1800
|
+
if (in->num_value) leptris_xpath_compiled_free(in->num_value);
|
|
1801
|
+
if (in->num_count) leptris_xpath_compiled_free(in->num_count);
|
|
1802
|
+
if (in->num_from) leptris_xpath_compiled_free(in->num_from);
|
|
1803
|
+
free((void*)in->name);
|
|
1804
|
+
free((void*)in->ns_uri);
|
|
1805
|
+
free((void*)in->text);
|
|
1806
|
+
free((void*)in->num_format);
|
|
1807
|
+
free((void*)in->letter_value);
|
|
1808
|
+
free((void*)in->regex);
|
|
1809
|
+
free((void*)in->regex_flags);
|
|
1810
|
+
while (in->sorts) {
|
|
1811
|
+
XsltSort* s = in->sorts;
|
|
1812
|
+
in->sorts = s->next;
|
|
1813
|
+
if (s->select) leptris_xpath_compiled_free(s->select);
|
|
1814
|
+
free(s);
|
|
1815
|
+
}
|
|
1816
|
+
while (in->attrs) {
|
|
1817
|
+
XsltLAttr* a = in->attrs;
|
|
1818
|
+
in->attrs = a->next;
|
|
1819
|
+
free((void*)a->name);
|
|
1820
|
+
free((void*)a->value);
|
|
1821
|
+
free(a);
|
|
1822
|
+
}
|
|
1823
|
+
if (in->attr_set_names) {
|
|
1824
|
+
for (size_t i = 0; i < in->attr_set_count; i++)
|
|
1825
|
+
free(in->attr_set_names[i]);
|
|
1826
|
+
free(in->attr_set_names);
|
|
1827
|
+
}
|
|
1828
|
+
if (in->attr_set_uris) {
|
|
1829
|
+
for (size_t i = 0; i < in->attr_set_count; i++)
|
|
1830
|
+
free(in->attr_set_uris[i]);
|
|
1831
|
+
free(in->attr_set_uris);
|
|
1832
|
+
}
|
|
1833
|
+
if (in->ns) leptris_xpath_ns_set_free(in->ns);
|
|
1834
|
+
for (size_t i = 0; i < in->ns_out_count; i++) {
|
|
1835
|
+
free(in->ns_out_pfx[i]);
|
|
1836
|
+
free(in->ns_out_uri[i]);
|
|
1837
|
+
}
|
|
1838
|
+
free(in->ns_out_pfx);
|
|
1839
|
+
free(in->ns_out_uri);
|
|
1840
|
+
free(in->ns_out_default);
|
|
1841
|
+
free(in);
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
static void free_instr_list(XsltInstr* list) {
|
|
1845
|
+
while (list) {
|
|
1846
|
+
XsltInstr* n = list->next;
|
|
1847
|
+
free_instr(list);
|
|
1848
|
+
list = n;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
/* ---- dispatch indexes (#682) ----
|
|
1853
|
+
*
|
|
1854
|
+
* Named lookup: open-addressed FNV-1a map. Inserts walk the list in
|
|
1855
|
+
* sheet order and overwrite on the same name, so the surviving
|
|
1856
|
+
* entry is the LAST declaration — the §11.6 winner the previous
|
|
1857
|
+
* full linear scan produced. Mode buckets: candidate arrays per
|
|
1858
|
+
* distinct mode, preserving sheet order. */
|
|
1859
|
+
static size_t tpl_name_hash(const char* s) {
|
|
1860
|
+
size_t h = 1469598103934665603ull;
|
|
1861
|
+
while (*s) { h ^= (unsigned char)*s++; h *= 1099511628211ull; }
|
|
1862
|
+
return h;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
void xslt_sheet_build_dispatch(XsltStylesheet* sheet) {
|
|
1866
|
+
if (!sheet) return;
|
|
1867
|
+
size_t n = sheet->template_count;
|
|
1868
|
+
if (n && !sheet->named_slot) {
|
|
1869
|
+
size_t cap = 8;
|
|
1870
|
+
while (cap < n * 2) cap <<= 1;
|
|
1871
|
+
sheet->named_slot =
|
|
1872
|
+
(XsltTemplate**)calloc(cap, sizeof(XsltTemplate*));
|
|
1873
|
+
if (sheet->named_slot) {
|
|
1874
|
+
sheet->named_cap = cap;
|
|
1875
|
+
for (XsltTemplate* t = sheet->templates; t; t = t->next) {
|
|
1876
|
+
if (!t->name) continue;
|
|
1877
|
+
size_t i = tpl_name_hash(t->name) & (cap - 1);
|
|
1878
|
+
while (sheet->named_slot[i] &&
|
|
1879
|
+
strcmp(sheet->named_slot[i]->name, t->name) != 0)
|
|
1880
|
+
i = (i + 1) & (cap - 1);
|
|
1881
|
+
sheet->named_slot[i] = t; /* last declaration wins */
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
/* #866 value-index sizing: one slot per literal-predicate
|
|
1886
|
+
* pattern across the sheet (distinct keys only shrink that),
|
|
1887
|
+
* doubled for open addressing. Growth replaces the old fixed
|
|
1888
|
+
* 128-slot/96-entry cliff that silently degraded to full scans
|
|
1889
|
+
* past 96 predicate patterns (#682: 7.6x on the 120-template
|
|
1890
|
+
* dispatch bench). */
|
|
1891
|
+
size_t npred = 0;
|
|
1892
|
+
for (XsltTemplate* t = sheet->templates; t; t = t->next)
|
|
1893
|
+
for (const XsltPattern* pa = t->matches; pa; pa = pa->next)
|
|
1894
|
+
if (pa->pred_literal) npred++;
|
|
1895
|
+
size_t pkey_cap = 16;
|
|
1896
|
+
while (pkey_cap < npred * 2) pkey_cap <<= 1;
|
|
1897
|
+
|
|
1898
|
+
if (!sheet->modes && n) {
|
|
1899
|
+
/* Single pass: the bucket array is sized to the match-
|
|
1900
|
+
* template count (an upper bound on distinct modes); each
|
|
1901
|
+
* new mode claims the next slot, candidates append in
|
|
1902
|
+
* sheet order. */
|
|
1903
|
+
XsltModeBucket* modes =
|
|
1904
|
+
(XsltModeBucket*)calloc(n, sizeof(XsltModeBucket));
|
|
1905
|
+
if (modes) {
|
|
1906
|
+
size_t mm = 0;
|
|
1907
|
+
for (XsltTemplate* t = sheet->templates; t; t = t->next) {
|
|
1908
|
+
if (!t->matches) continue;
|
|
1909
|
+
if (!t->matches->next && t->matches->expr_name_only) {
|
|
1910
|
+
t->fast_name = t->matches->expr_name;
|
|
1911
|
+
t->fast_pri = t->matches->priority;
|
|
1912
|
+
}
|
|
1913
|
+
XsltModeBucket* b = NULL;
|
|
1914
|
+
for (size_t i = 0; i < mm; i++)
|
|
1915
|
+
if ((modes[i].mode == NULL && t->mode == NULL) ||
|
|
1916
|
+
(modes[i].mode && t->mode &&
|
|
1917
|
+
strcmp(modes[i].mode, t->mode) == 0)) {
|
|
1918
|
+
b = &modes[i]; break;
|
|
1919
|
+
}
|
|
1920
|
+
if (!b) {
|
|
1921
|
+
b = &modes[mm++];
|
|
1922
|
+
b->mode = t->mode;
|
|
1923
|
+
b->list =
|
|
1924
|
+
(XsltTemplate**)malloc(n * sizeof(XsltTemplate*));
|
|
1925
|
+
if (!b->list) { mm--; continue; }
|
|
1926
|
+
}
|
|
1927
|
+
b->list[b->n++] = t;
|
|
1928
|
+
/* #866 name keys: every alternative that names an
|
|
1929
|
+
* element links the template under that name; any
|
|
1930
|
+
* other-shaped alternative also lands in the
|
|
1931
|
+
* any-element remainder. */
|
|
1932
|
+
int has_other = 0;
|
|
1933
|
+
for (const XsltPattern* pa = t->matches; pa; pa = pa->next) {
|
|
1934
|
+
if (!pa->leaf_named) { has_other = 1; continue; }
|
|
1935
|
+
if (pa->pred_literal) {
|
|
1936
|
+
/* Value-index candidate — NOT in the plain
|
|
1937
|
+
* name list (that is the point: 120
|
|
1938
|
+
* item[@k='N'] templates must not all
|
|
1939
|
+
* evaluate their predicates). */
|
|
1940
|
+
char kb[64 + 48 + 96 + 8];
|
|
1941
|
+
int kl = snprintf(kb, sizeof(kb), "%s\x1f%s\x1f%s",
|
|
1942
|
+
pa->leaf_name, pa->pred_attr,
|
|
1943
|
+
pa->pred_val);
|
|
1944
|
+
if (kl <= 0 || (size_t)kl >= sizeof(kb)) continue;
|
|
1945
|
+
size_t kh2 = tpl_name_hash(kb) & (pkey_cap - 1);
|
|
1946
|
+
struct xslt_pkey* k2 = NULL;
|
|
1947
|
+
while (b->pkeys && kh2 < b->pkeycap &&
|
|
1948
|
+
b->pkeys[kh2].key) {
|
|
1949
|
+
if (strcmp(b->pkeys[kh2].key, kb) == 0) {
|
|
1950
|
+
k2 = &b->pkeys[kh2]; break;
|
|
1951
|
+
}
|
|
1952
|
+
kh2 = (kh2 + 1) & (pkey_cap - 1);
|
|
1953
|
+
}
|
|
1954
|
+
if (!k2) {
|
|
1955
|
+
if (!b->pkeys) {
|
|
1956
|
+
b->pkeys = (struct xslt_pkey*)calloc(
|
|
1957
|
+
pkey_cap, sizeof(struct xslt_pkey));
|
|
1958
|
+
if (!b->pkeys) continue;
|
|
1959
|
+
b->pkeycap = pkey_cap;
|
|
1960
|
+
}
|
|
1961
|
+
/* #875: a table at its load ceiling must
|
|
1962
|
+
* not make the pattern unreachable — route
|
|
1963
|
+
* it to the scanned remainder so it still
|
|
1964
|
+
* fires. Unreachable in practice: pkey_cap
|
|
1965
|
+
* covers every literal pattern in the
|
|
1966
|
+
* sheet at a <=50% load. */
|
|
1967
|
+
if (b->npkeys >= pkey_cap - pkey_cap / 4) {
|
|
1968
|
+
has_other = 1;
|
|
1969
|
+
continue;
|
|
1970
|
+
}
|
|
1971
|
+
k2 = &b->pkeys[kh2];
|
|
1972
|
+
k2->key = leptris_strdup(kb);
|
|
1973
|
+
if (!k2->key) continue;
|
|
1974
|
+
b->npkeys++;
|
|
1975
|
+
}
|
|
1976
|
+
if (!k2->list) {
|
|
1977
|
+
k2->list = (XsltTemplate**)malloc(
|
|
1978
|
+
n * sizeof(XsltTemplate*));
|
|
1979
|
+
if (!k2->list) continue;
|
|
1980
|
+
}
|
|
1981
|
+
k2->list[k2->n++] = t;
|
|
1982
|
+
continue;
|
|
1983
|
+
}
|
|
1984
|
+
size_t kh = tpl_name_hash(pa->leaf_name) & 63;
|
|
1985
|
+
XsltNameKey* k = NULL;
|
|
1986
|
+
while (b->keys && kh < b->keycap && b->keys[kh].name) {
|
|
1987
|
+
if (strcmp(b->keys[kh].name, pa->leaf_name) == 0) {
|
|
1988
|
+
k = &b->keys[kh]; break;
|
|
1989
|
+
}
|
|
1990
|
+
kh = (kh + 1) & 63;
|
|
1991
|
+
}
|
|
1992
|
+
if (!k) {
|
|
1993
|
+
if (!b->keys) {
|
|
1994
|
+
b->keys = (XsltNameKey*)calloc(
|
|
1995
|
+
64, sizeof(XsltNameKey));
|
|
1996
|
+
if (!b->keys) continue;
|
|
1997
|
+
b->keycap = 64;
|
|
1998
|
+
}
|
|
1999
|
+
/* #875: same routing on the name-key
|
|
2000
|
+
* table's near-full bound. */
|
|
2001
|
+
if (b->nkeys >= 48) { has_other = 1; continue; }
|
|
2002
|
+
k = &b->keys[kh];
|
|
2003
|
+
k->name = pa->leaf_name;
|
|
2004
|
+
b->nkeys++;
|
|
2005
|
+
}
|
|
2006
|
+
if (!k->list) {
|
|
2007
|
+
k->list = (XsltTemplate**)malloc(
|
|
2008
|
+
n * sizeof(XsltTemplate*));
|
|
2009
|
+
if (!k->list) continue;
|
|
2010
|
+
}
|
|
2011
|
+
k->list[k->n++] = t;
|
|
2012
|
+
}
|
|
2013
|
+
if (has_other) {
|
|
2014
|
+
if (!b->other) {
|
|
2015
|
+
b->other = (XsltTemplate**)malloc(
|
|
2016
|
+
n * sizeof(XsltTemplate*));
|
|
2017
|
+
if (!b->other) continue;
|
|
2018
|
+
}
|
|
2019
|
+
b->other[b->n_other++] = t;
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
sheet->modes = modes;
|
|
2023
|
+
sheet->mode_count = mm;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
XsltTemplate* xslt_sheet_named(const XsltStylesheet* sheet,
|
|
2029
|
+
const char* name) {
|
|
2030
|
+
if (!sheet || !name || !sheet->named_slot) return NULL;
|
|
2031
|
+
size_t cap = sheet->named_cap;
|
|
2032
|
+
size_t i = tpl_name_hash(name) & (cap - 1);
|
|
2033
|
+
while (sheet->named_slot[i]) {
|
|
2034
|
+
if (strcmp(sheet->named_slot[i]->name, name) == 0)
|
|
2035
|
+
return sheet->named_slot[i];
|
|
2036
|
+
i = (i + 1) & (cap - 1);
|
|
2037
|
+
}
|
|
2038
|
+
return NULL;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
const struct xslt_pkey* xslt_bucket_pred_key(
|
|
2042
|
+
const XsltModeBucket* b, const char* elem, const char* attr,
|
|
2043
|
+
const char* val) {
|
|
2044
|
+
if (!b || !b->pkeys || !elem || !attr || !val) return NULL;
|
|
2045
|
+
char kb[64 + 48 + 96 + 8];
|
|
2046
|
+
int kl = snprintf(kb, sizeof(kb), "%s\x1f%s\x1f%s", elem, attr, val);
|
|
2047
|
+
if (kl <= 0 || (size_t)kl >= sizeof(kb)) return NULL;
|
|
2048
|
+
size_t kh = tpl_name_hash(kb) & (b->pkeycap - 1);
|
|
2049
|
+
while (b->pkeys[kh].key) {
|
|
2050
|
+
if (strcmp(b->pkeys[kh].key, kb) == 0) return &b->pkeys[kh];
|
|
2051
|
+
kh = (kh + 1) & (b->pkeycap - 1);
|
|
2052
|
+
}
|
|
2053
|
+
return NULL;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
const XsltNameKey* xslt_bucket_name_key(const XsltModeBucket* b,
|
|
2057
|
+
const char* name) {
|
|
2058
|
+
if (!b || !b->keys || !name) return NULL;
|
|
2059
|
+
size_t kh = tpl_name_hash(name) & 63;
|
|
2060
|
+
while (b->keys[kh].name) {
|
|
2061
|
+
if (strcmp(b->keys[kh].name, name) == 0) return &b->keys[kh];
|
|
2062
|
+
kh = (kh + 1) & 63;
|
|
2063
|
+
}
|
|
2064
|
+
return NULL;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
const XsltModeBucket* xslt_sheet_mode(const XsltStylesheet* sheet,
|
|
2068
|
+
const char* mode) {
|
|
2069
|
+
if (!sheet) return NULL;
|
|
2070
|
+
for (size_t i = 0; i < sheet->mode_count; i++) {
|
|
2071
|
+
const XsltModeBucket* b = &sheet->modes[i];
|
|
2072
|
+
if ((b->mode == NULL && mode == NULL) ||
|
|
2073
|
+
(b->mode && mode && strcmp(b->mode, mode) == 0))
|
|
2074
|
+
return b;
|
|
2075
|
+
}
|
|
2076
|
+
return NULL;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
void xslt_stylesheet_free(XsltStylesheet* sheet) {
|
|
2080
|
+
if (!sheet) return;
|
|
2081
|
+
free(sheet->named_slot);
|
|
2082
|
+
for (size_t i = 0; i < sheet->mode_count; i++) {
|
|
2083
|
+
if (sheet->modes[i].keys) {
|
|
2084
|
+
for (size_t k = 0; k < sheet->modes[i].keycap; k++)
|
|
2085
|
+
free(sheet->modes[i].keys[k].list);
|
|
2086
|
+
free(sheet->modes[i].keys);
|
|
2087
|
+
}
|
|
2088
|
+
if (sheet->modes[i].pkeys) {
|
|
2089
|
+
for (size_t k = 0; k < sheet->modes[i].pkeycap; k++) {
|
|
2090
|
+
free(sheet->modes[i].pkeys[k].key);
|
|
2091
|
+
free(sheet->modes[i].pkeys[k].list);
|
|
2092
|
+
}
|
|
2093
|
+
free(sheet->modes[i].pkeys);
|
|
2094
|
+
}
|
|
2095
|
+
free(sheet->modes[i].other);
|
|
2096
|
+
free(sheet->modes[i].list);
|
|
2097
|
+
}
|
|
2098
|
+
free(sheet->modes);
|
|
2099
|
+
XsltTemplate* t = sheet->templates;
|
|
2100
|
+
while (t) {
|
|
2101
|
+
XsltTemplate* n = t->next;
|
|
2102
|
+
XsltPattern* p = t->matches;
|
|
2103
|
+
while (p) {
|
|
2104
|
+
XsltPattern* pn = p->next;
|
|
2105
|
+
if (p->expr) leptris_xpath_compiled_free(p->expr);
|
|
2106
|
+
xslt_pattern_steps_free(p);
|
|
2107
|
+
free(p);
|
|
2108
|
+
p = pn;
|
|
2109
|
+
}
|
|
2110
|
+
free_instr_list(t->body);
|
|
2111
|
+
if (t->ns) leptris_xpath_ns_set_free(t->ns);
|
|
2112
|
+
free((void*)t->name);
|
|
2113
|
+
free((void*)t->mode);
|
|
2114
|
+
free(t);
|
|
2115
|
+
t = n;
|
|
2116
|
+
}
|
|
2117
|
+
while (sheet->keys) {
|
|
2118
|
+
XsltKeyDef* k = sheet->keys;
|
|
2119
|
+
sheet->keys = k->next;
|
|
2120
|
+
if (k->pat.expr) leptris_xpath_compiled_free(k->pat.expr);
|
|
2121
|
+
xslt_pattern_steps_free(&k->pat);
|
|
2122
|
+
if (k->use) leptris_xpath_compiled_free(k->use);
|
|
2123
|
+
free((void*)k->name);
|
|
2124
|
+
free(k);
|
|
2125
|
+
}
|
|
2126
|
+
while (sheet->accs) {
|
|
2127
|
+
XsltAccumulator* a = sheet->accs;
|
|
2128
|
+
sheet->accs = a->next;
|
|
2129
|
+
while (a->rules) {
|
|
2130
|
+
XsltAccRule* r = a->rules;
|
|
2131
|
+
a->rules = r->next;
|
|
2132
|
+
if (r->match) leptris_xpath_compiled_free(r->match);
|
|
2133
|
+
if (r->select) leptris_xpath_compiled_free(r->select);
|
|
2134
|
+
free(r);
|
|
2135
|
+
}
|
|
2136
|
+
if (a->initial) leptris_xpath_compiled_free(a->initial);
|
|
2137
|
+
free((void*)a->name);
|
|
2138
|
+
free(a);
|
|
2139
|
+
}
|
|
2140
|
+
if (sheet->mode_acc_names) {
|
|
2141
|
+
for (size_t i = 0; i < sheet->mode_acc_count; i++)
|
|
2142
|
+
free(sheet->mode_acc_names[i]);
|
|
2143
|
+
free(sheet->mode_acc_names);
|
|
2144
|
+
}
|
|
2145
|
+
while (sheet->funcs) {
|
|
2146
|
+
XsltUserFunc* f = sheet->funcs;
|
|
2147
|
+
sheet->funcs = f->next;
|
|
2148
|
+
free((void*)f->name);
|
|
2149
|
+
free_instr_list(f->body);
|
|
2150
|
+
free(f);
|
|
2151
|
+
}
|
|
2152
|
+
free_instr_list(sheet->globals);
|
|
2153
|
+
free((void*)sheet->out_encoding);
|
|
2154
|
+
free((void*)sheet->out_version);
|
|
2155
|
+
free((void*)sheet->out_doctype_system);
|
|
2156
|
+
free((void*)sheet->out_doctype_public);
|
|
2157
|
+
if (sheet->out_cdata_elems) {
|
|
2158
|
+
for (size_t i = 0; sheet->out_cdata_elems[i]; i++)
|
|
2159
|
+
free(sheet->out_cdata_elems[i]);
|
|
2160
|
+
free(sheet->out_cdata_elems);
|
|
2161
|
+
}
|
|
2162
|
+
while (sheet->attrsets) {
|
|
2163
|
+
XsltAttrSet* s = sheet->attrsets;
|
|
2164
|
+
sheet->attrsets = s->next;
|
|
2165
|
+
free((void*)s->name);
|
|
2166
|
+
free((void*)s->name_uri);
|
|
2167
|
+
for (size_t i = 0; i < s->use_count; i++)
|
|
2168
|
+
free(s->use_uris ? s->use_uris[i] : NULL);
|
|
2169
|
+
free(s->use_uris);
|
|
2170
|
+
while (s->attrs) {
|
|
2171
|
+
XsltLAttr* a = s->attrs; s->attrs = a->next;
|
|
2172
|
+
free((void*)a->name); free((void*)a->value); free(a);
|
|
2173
|
+
}
|
|
2174
|
+
free(s);
|
|
2175
|
+
}
|
|
2176
|
+
if (sheet->ws_strip) {
|
|
2177
|
+
for (size_t i = 0; sheet->ws_strip[i]; i++) free(sheet->ws_strip[i]);
|
|
2178
|
+
free(sheet->ws_strip);
|
|
2179
|
+
}
|
|
2180
|
+
if (sheet->ws_preserve) {
|
|
2181
|
+
for (size_t i = 0; sheet->ws_preserve[i]; i++)
|
|
2182
|
+
free(sheet->ws_preserve[i]);
|
|
2183
|
+
free(sheet->ws_preserve);
|
|
2184
|
+
}
|
|
2185
|
+
/* ws_rules entries alias ws_strip/ws_preserve strings — the
|
|
2186
|
+
* containers alone are freed here. */
|
|
2187
|
+
free(sheet->ws_rules);
|
|
2188
|
+
free(sheet->ws_rule_preserve);
|
|
2189
|
+
while (sheet->ns_alias) {
|
|
2190
|
+
XsltNsAlias* na = sheet->ns_alias;
|
|
2191
|
+
sheet->ns_alias = na->next;
|
|
2192
|
+
free((void*)na->stylesheet_prefix);
|
|
2193
|
+
free((void*)na->result_prefix);
|
|
2194
|
+
free(na);
|
|
2195
|
+
}
|
|
2196
|
+
free((void*)sheet->out_media_type);
|
|
2197
|
+
/* §16.1 cdata-section-elements list (Linux LSan: the array and
|
|
2198
|
+
* its entries had no teardown). */
|
|
2199
|
+
for (size_t i = 0; i < sheet->out_cdata_count; i++)
|
|
2200
|
+
free(sheet->out_cdata[i]);
|
|
2201
|
+
free(sheet->out_cdata);
|
|
2202
|
+
/* §16.1 character maps + the active name list. */
|
|
2203
|
+
for (size_t i = 0; i < sheet->charmap_count; i++) {
|
|
2204
|
+
for (size_t k = 0; k < sheet->charmaps[i].count; k++) {
|
|
2205
|
+
free(sheet->charmaps[i].chars[k]);
|
|
2206
|
+
free(sheet->charmaps[i].repls[k]);
|
|
2207
|
+
}
|
|
2208
|
+
free(sheet->charmaps[i].name);
|
|
2209
|
+
free(sheet->charmaps[i].chars);
|
|
2210
|
+
free(sheet->charmaps[i].repls);
|
|
2211
|
+
}
|
|
2212
|
+
free(sheet->charmaps);
|
|
2213
|
+
for (size_t i = 0; i < sheet->out_charmap_name_count; i++)
|
|
2214
|
+
free(sheet->out_charmap_names[i]);
|
|
2215
|
+
free(sheet->out_charmap_names);
|
|
2216
|
+
for (size_t i = 0; i < sheet->exclude_count; i++)
|
|
2217
|
+
free(sheet->exclude_pfx[i]);
|
|
2218
|
+
free(sheet->exclude_pfx);
|
|
2219
|
+
for (size_t i = 0; i < sheet->ext_count; i++)
|
|
2220
|
+
free(sheet->ext_pfx[i]);
|
|
2221
|
+
free(sheet->ext_pfx);
|
|
2222
|
+
while (sheet->decformats) {
|
|
2223
|
+
XsltDecimalFormat* d = sheet->decformats;
|
|
2224
|
+
sheet->decformats = d->next;
|
|
2225
|
+
free((void*)d->name);
|
|
2226
|
+
free((void*)d->uri);
|
|
2227
|
+
free((void*)d->local);
|
|
2228
|
+
free((void*)d->decimal_sep);
|
|
2229
|
+
free((void*)d->grouping_sep);
|
|
2230
|
+
free((void*)d->infinity);
|
|
2231
|
+
free((void*)d->nan);
|
|
2232
|
+
free(d);
|
|
2233
|
+
}
|
|
2234
|
+
free(sheet);
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/* ---- #682 stream gate -------------------------------------------------
|
|
2238
|
+
* Conservative instruction scan: only shapes the stream emitters
|
|
2239
|
+
* reproduce byte-exactly. Anything tree-building, post-hoc, or
|
|
2240
|
+
* namespace-bearing keeps the result-tree path. */
|
|
2241
|
+
static int stream_indent_on(const XsltStylesheet* sheet) {
|
|
2242
|
+
return sheet->out_indent == 1; /* xml default is no (−1) */
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
static int stream_instrs_ok(const XsltInstr* in) {
|
|
2246
|
+
for (; in; in = in->next) {
|
|
2247
|
+
switch (in->kind) {
|
|
2248
|
+
case XSLT_INSTR_RESULT_ELEM:
|
|
2249
|
+
if ((in->ns_uri && in->ns_uri[0]) ||
|
|
2250
|
+
in->ns_out_count || in->ns_out_default ||
|
|
2251
|
+
in->attr_set_count)
|
|
2252
|
+
return 0;
|
|
2253
|
+
for (XsltLAttr* a = in->attrs; a; a = a->next)
|
|
2254
|
+
if (strchr(a->name, ':')) return 0;
|
|
2255
|
+
break;
|
|
2256
|
+
case XSLT_INSTR_TEXT:
|
|
2257
|
+
case XSLT_INSTR_VALUE_OF:
|
|
2258
|
+
if (in->doe) return 0;
|
|
2259
|
+
break;
|
|
2260
|
+
case XSLT_INSTR_COMMENT:
|
|
2261
|
+
case XSLT_INSTR_PI:
|
|
2262
|
+
if (in->child) return 0;
|
|
2263
|
+
break;
|
|
2264
|
+
case XSLT_INSTR_VARIABLE:
|
|
2265
|
+
case XSLT_INSTR_WITH_PARAM:
|
|
2266
|
+
if (in->child) return 0; /* content form builds RTFs */
|
|
2267
|
+
break;
|
|
2268
|
+
case XSLT_INSTR_FOR_EACH:
|
|
2269
|
+
case XSLT_INSTR_IF:
|
|
2270
|
+
case XSLT_INSTR_CHOOSE:
|
|
2271
|
+
case XSLT_INSTR_WHEN:
|
|
2272
|
+
case XSLT_INSTR_OTHERWISE:
|
|
2273
|
+
case XSLT_INSTR_CALL_TEMPLATE:
|
|
2274
|
+
case XSLT_INSTR_APPLY_TEMPLATES:
|
|
2275
|
+
case XSLT_INSTR_MESSAGE:
|
|
2276
|
+
case XSLT_INSTR_NUMBER:
|
|
2277
|
+
case XSLT_INSTR_APPLY_IMPORTS:
|
|
2278
|
+
case XSLT_INSTR_ITERATE:
|
|
2279
|
+
case XSLT_INSTR_NEXT_ITERATION:
|
|
2280
|
+
case XSLT_INSTR_BREAK:
|
|
2281
|
+
case XSLT_INSTR_FOR_EACH_GROUP:
|
|
2282
|
+
case XSLT_INSTR_EVALUATE:
|
|
2283
|
+
case XSLT_INSTR_ANALYZE_STRING:
|
|
2284
|
+
case XSLT_INSTR_MATCHING_SUBSTRING:
|
|
2285
|
+
case XSLT_INSTR_NONMATCHING_SUBSTRING:
|
|
2286
|
+
case XSLT_INSTR_TRY:
|
|
2287
|
+
case XSLT_INSTR_CATCH:
|
|
2288
|
+
case XSLT_INSTR_ON_EMPTY:
|
|
2289
|
+
case XSLT_INSTR_ON_NON_EMPTY:
|
|
2290
|
+
case XSLT_INSTR_NEXT_MATCH:
|
|
2291
|
+
break;
|
|
2292
|
+
default:
|
|
2293
|
+
return 0; /* COPY/COPY_OF/ELEMENT/ATTRIBUTE/SEQUENCE/
|
|
2294
|
+
* NAMESPACE/DOCUMENT/FORK/ATTR_SET_REF/
|
|
2295
|
+
* WHERE_POPULATED/FUNC_RESULT/... */
|
|
2296
|
+
}
|
|
2297
|
+
if (in->child && !stream_instrs_ok(in->child)) return 0;
|
|
2298
|
+
}
|
|
2299
|
+
return 1;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
XsltStylesheet* xslt_stylesheet_parse(LeptrisDocument doc) {
|
|
2303
|
+
if (!doc) return NULL;
|
|
2304
|
+
return xslt_stylesheet_parse_root(doc, leptris_document_root(doc));
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
XsltStylesheet* xslt_stylesheet_parse_root(LeptrisDocument doc,
|
|
2308
|
+
LeptrisElement root) {
|
|
2309
|
+
if (!doc || !root) return NULL;
|
|
2310
|
+
if (!node_is_xsl(root, "stylesheet") && !node_is_xsl(root, "transform")) {
|
|
2311
|
+
return NULL;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
XsltStylesheet* sheet = (XsltStylesheet*)calloc(1, sizeof(*sheet));
|
|
2315
|
+
if (!sheet) return NULL;
|
|
2316
|
+
sheet->out_standalone = -1;
|
|
2317
|
+
sheet->out_indent = -1;
|
|
2318
|
+
SheetParser sp;
|
|
2319
|
+
sp.doc = doc; sp.sheet = sheet; sp.import_rank = 0; sp.errors = 0;
|
|
2320
|
+
sp.chain.paths = NULL; sp.chain.len = 0; sp.chain.cap = 0;
|
|
2321
|
+
/* §2.5: a version other than 1.0 enables forwards-compatible
|
|
2322
|
+
* processing (unknown top-level elements ignored; unknown
|
|
2323
|
+
* instructions fall back per §15). */
|
|
2324
|
+
const char* ver = leptris_element_attribute(root, "version");
|
|
2325
|
+
if (ver && strcmp(ver, "1.0") != 0) sheet->forwards_compat = 1;
|
|
2326
|
+
sheet->version_major = 1;
|
|
2327
|
+
if (ver) {
|
|
2328
|
+
int maj = 0;
|
|
2329
|
+
for (const char* p = ver; *p >= '0' && *p <= '9'; p++)
|
|
2330
|
+
maj = maj * 10 + (*p - '0');
|
|
2331
|
+
if (maj > 0) sheet->version_major = maj;
|
|
2332
|
+
}
|
|
2333
|
+
/* 3.0 §10.4.2: text value templates on literal text. */
|
|
2334
|
+
{
|
|
2335
|
+
const char* et = leptris_element_attribute(root, "expand-text");
|
|
2336
|
+
if (et && strcmp(et, "yes") == 0 && sheet->version_major >= 3)
|
|
2337
|
+
sheet->expand_text = 1;
|
|
2338
|
+
}
|
|
2339
|
+
/* Any namespace declaration in the sheet (beyond xsl) means
|
|
2340
|
+
* expressions may use prefixed tests — parse-time ns contexts. */
|
|
2341
|
+
if (leptris_element_namespace_decl_prefix(root, 0))
|
|
2342
|
+
sheet->sheet_has_ns = 1;
|
|
2343
|
+
/* §7.1.1/§14.1 excluded prefixes: exclude-result-prefixes +
|
|
2344
|
+
* extension-element-prefixes on the stylesheet root. */
|
|
2345
|
+
{
|
|
2346
|
+
const char* lists[2] = {
|
|
2347
|
+
leptris_element_attribute(root, "exclude-result-prefixes"),
|
|
2348
|
+
leptris_element_attribute(root, "extension-element-prefixes"),
|
|
2349
|
+
};
|
|
2350
|
+
for (int li = 0; li < 2; li++) {
|
|
2351
|
+
const char* v = lists[li];
|
|
2352
|
+
if (!v || !*v) continue;
|
|
2353
|
+
char* dup = leptris_strdup(v);
|
|
2354
|
+
if (!dup) continue;
|
|
2355
|
+
char* save = NULL;
|
|
2356
|
+
for (char* tok = xslt_strtok(dup, " \t\n,", &save); tok;
|
|
2357
|
+
tok = xslt_strtok(NULL, " \t\n,", &save)) {
|
|
2358
|
+
if (strcmp(tok, "#all") == 0) continue; /* v1 */
|
|
2359
|
+
sheet->exclude_pfx = (char**)realloc(
|
|
2360
|
+
sheet->exclude_pfx,
|
|
2361
|
+
(sheet->exclude_count + 1) * sizeof(char*));
|
|
2362
|
+
sheet->exclude_pfx[sheet->exclude_count++] =
|
|
2363
|
+
leptris_strdup(tok);
|
|
2364
|
+
if (li == 1) {
|
|
2365
|
+
/* extension-element-prefixes: also an extension
|
|
2366
|
+
* list (§15 fallback semantics). */
|
|
2367
|
+
sheet->ext_pfx = (char**)realloc(
|
|
2368
|
+
sheet->ext_pfx,
|
|
2369
|
+
(sheet->ext_count + 1) * sizeof(char*));
|
|
2370
|
+
sheet->ext_pfx[sheet->ext_count++] =
|
|
2371
|
+
leptris_strdup(tok);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
free(dup);
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
/* Default xsl:decimal-format (always present; named formats
|
|
2378
|
+
* append later). */
|
|
2379
|
+
XsltDecimalFormat* df = (XsltDecimalFormat*)calloc(1, sizeof(*df));
|
|
2380
|
+
if (df) {
|
|
2381
|
+
df->decimal_sep = leptris_strdup(".");
|
|
2382
|
+
df->grouping_sep = leptris_strdup(",");
|
|
2383
|
+
df->minus_sign = '-'; df->percent = '%'; df->per_mille = '%';
|
|
2384
|
+
df->zero_digit = '0';
|
|
2385
|
+
df->infinity = leptris_strdup("Infinity");
|
|
2386
|
+
df->nan = leptris_strdup("NaN");
|
|
2387
|
+
df->next = sheet->decformats;
|
|
2388
|
+
sheet->decformats = df;
|
|
2389
|
+
}
|
|
2390
|
+
parse_top_level(&sp, root);
|
|
2391
|
+
while (sp.chain.len) chain_pop(&sp.chain);
|
|
2392
|
+
free(sp.chain.paths);
|
|
2393
|
+
if (sp.errors) {
|
|
2394
|
+
xslt_stylesheet_free(sheet);
|
|
2395
|
+
return NULL;
|
|
2396
|
+
}
|
|
2397
|
+
xslt_sheet_build_dispatch(sheet);
|
|
2398
|
+
|
|
2399
|
+
/* #682 parity gate: admit only the result shapes the stream
|
|
2400
|
+
* emitters cover byte-exactly. Every instruction in every
|
|
2401
|
+
* template (and the globals) must be stream-safe; any tree-
|
|
2402
|
+
* building or post-hoc op keeps the sheet on the result-tree
|
|
2403
|
+
* path. Conservative by construction — unknown kinds reject. */
|
|
2404
|
+
sheet->can_stream = !sheet->out_method_text && !sheet->out_method_html &&
|
|
2405
|
+
!stream_indent_on(sheet) && sheet->out_cdata_count == 0 &&
|
|
2406
|
+
sheet->charmap_count == 0 && sheet->out_standalone < 0 &&
|
|
2407
|
+
!sheet->out_doctype_system && !sheet->out_doctype_public &&
|
|
2408
|
+
sheet->version_major < 3 &&
|
|
2409
|
+
(sheet->mode_on_no_match == 1 || sheet->mode_on_no_match == 6) &&
|
|
2410
|
+
stream_instrs_ok(sheet->globals);
|
|
2411
|
+
for (size_t i = 0; sheet->can_stream && i < sheet->mode_count; i++) {
|
|
2412
|
+
for (size_t t = 0; sheet->can_stream && t < sheet->modes[i].n; t++) {
|
|
2413
|
+
sheet->can_stream =
|
|
2414
|
+
stream_instrs_ok(sheet->modes[i].list[t]->body);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
return sheet;
|
|
2418
|
+
}
|