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,2333 @@
|
|
|
1
|
+
/* lib/src/serialize/serialize.c - XML Serialization Implementation
|
|
2
|
+
* Copyright (c) 2024, Ribose Inc.
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL PRINCIPLES:
|
|
5
|
+
* 1. Character-perfect output - must match input exactly
|
|
6
|
+
* 2. No escaping in CDATA - CDATA content is literal
|
|
7
|
+
* 3. Proper escaping elsewhere - text needs <>&"' escaped
|
|
8
|
+
* 4. Document order - traverse children in correct order
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "serialize.h"
|
|
12
|
+
#include "../include/leptris.h" /* LEPTRIS_API (visibility attribute) */
|
|
13
|
+
#include "../dom/node.h" /* LeptrisNodeVTable + leptris_node_vtable_for */
|
|
14
|
+
#include "../leptris_internal.h"
|
|
15
|
+
#include "../common/entities.h"
|
|
16
|
+
#include "../common/string_view.h"
|
|
17
|
+
#include "../common/simd_text.h"
|
|
18
|
+
/* LeptrisSerializeOptions comes from leptris/types.h via leptris_internal.h's
|
|
19
|
+
* pool.h include. No local redefinition — it would conflict with the
|
|
20
|
+
* public type. */
|
|
21
|
+
#include <string.h>
|
|
22
|
+
#include <stdio.h>
|
|
23
|
+
#include <stdint.h>
|
|
24
|
+
#include <stddef.h>
|
|
25
|
+
#include <ctype.h>
|
|
26
|
+
|
|
27
|
+
/* Initial buffer capacity */
|
|
28
|
+
#define INITIAL_BUFFER_CAPACITY 1024
|
|
29
|
+
|
|
30
|
+
/* ============================================================================
|
|
31
|
+
* Buffer Management
|
|
32
|
+
* ============================================================================ */
|
|
33
|
+
|
|
34
|
+
SerializeBuffer* buffer_create(int indent_spaces) {
|
|
35
|
+
SerializeBuffer* buf = LEPTRIS_ALLOC(SerializeBuffer);
|
|
36
|
+
if (!buf) return NULL;
|
|
37
|
+
|
|
38
|
+
buf->capacity = INITIAL_BUFFER_CAPACITY;
|
|
39
|
+
buf->data = LEPTRIS_ALLOC_N(char, buf->capacity);
|
|
40
|
+
if (!buf->data) {
|
|
41
|
+
LEPTRIS_FREE(buf);
|
|
42
|
+
return NULL;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
buf->size = 0;
|
|
46
|
+
buf->data[0] = '\0';
|
|
47
|
+
buf->indent = 0;
|
|
48
|
+
buf->indent_spaces = indent_spaces;
|
|
49
|
+
buf->indent_unit = NULL; /* #633: callers opt in per unit string */
|
|
50
|
+
buf->html_method = 0;
|
|
51
|
+
buf->indent_text = 0;
|
|
52
|
+
buf->expand_empty = 0;
|
|
53
|
+
buf->at_line_start = 0;
|
|
54
|
+
/* Leave the xhtml mode OFF until a caller with extended options
|
|
55
|
+
* enables it — an unset flag here otherwise serializes empties as
|
|
56
|
+
* <x></x> wherever the malloc garbage is nonzero (Linux ASAN). */
|
|
57
|
+
buf->xhtml = 0;
|
|
58
|
+
buf->xhtml_encoding = NULL;
|
|
59
|
+
buf->ws_mixed = 0;
|
|
60
|
+
buf->cdata_names = NULL; /* callers with cdata-section-elements
|
|
61
|
+
* install theirs; every other buffer
|
|
62
|
+
* must read "none", not heap garbage */
|
|
63
|
+
buf->cdata_count = 0;
|
|
64
|
+
buf->alloc_failed = 0;
|
|
65
|
+
|
|
66
|
+
return buf;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
void buffer_ensure_capacity(SerializeBuffer* buf, size_t needed) {
|
|
70
|
+
/* Invariant: buf->size <= buf->capacity. Use subtraction so the
|
|
71
|
+
* remaining-space check can never wrap. */
|
|
72
|
+
if (needed <= buf->capacity - buf->size) return;
|
|
73
|
+
|
|
74
|
+
/* Grow by doubling, overflow-safe. If doubling would exceed SIZE_MAX,
|
|
75
|
+
* clamp to SIZE_MAX — caller's append will fail to find space and the
|
|
76
|
+
* alloc_failed flag will be set. */
|
|
77
|
+
size_t new_cap = buf->capacity > 0 ? buf->capacity : INITIAL_BUFFER_CAPACITY;
|
|
78
|
+
while (new_cap - buf->size < needed) {
|
|
79
|
+
if (new_cap > (SIZE_MAX / 2)) {
|
|
80
|
+
new_cap = SIZE_MAX;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
new_cap *= 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* If we still don't fit (only possible if new_cap == SIZE_MAX and the
|
|
87
|
+
* request is genuinely too large), bail without touching buf->capacity. */
|
|
88
|
+
if (new_cap - buf->size < needed) {
|
|
89
|
+
buf->alloc_failed = 1;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
char* new_data = LEPTRIS_REALLOC_N(buf->data, char, new_cap);
|
|
94
|
+
if (!new_data) {
|
|
95
|
+
/* Realloc failed: buf->data and buf->capacity are unchanged
|
|
96
|
+
* (preserves the valid state). Mark the failure so the caller
|
|
97
|
+
* can detect it; subsequent appends will silently truncate. */
|
|
98
|
+
buf->alloc_failed = 1;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
buf->data = new_data;
|
|
103
|
+
buf->capacity = new_cap;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
void buffer_append(SerializeBuffer* buf, const char* str) {
|
|
107
|
+
if (!str) return;
|
|
108
|
+
|
|
109
|
+
size_t len = strlen(str);
|
|
110
|
+
buffer_ensure_capacity(buf, len + 1);
|
|
111
|
+
|
|
112
|
+
memcpy(buf->data + buf->size, str, len);
|
|
113
|
+
buf->size += len;
|
|
114
|
+
buf->data[buf->size] = '\0';
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
void buffer_append_len(SerializeBuffer* buf, const char* str, size_t len) {
|
|
118
|
+
if (!str || len == 0) return;
|
|
119
|
+
|
|
120
|
+
buffer_ensure_capacity(buf, len + 1);
|
|
121
|
+
|
|
122
|
+
memcpy(buf->data + buf->size, str, len);
|
|
123
|
+
buf->size += len;
|
|
124
|
+
buf->data[buf->size] = '\0';
|
|
125
|
+
buf->at_line_start = (len > 0 && str[len - 1] == '\n');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
void buffer_append_char(SerializeBuffer* buf, char c) {
|
|
129
|
+
buffer_ensure_capacity(buf, 2);
|
|
130
|
+
|
|
131
|
+
buf->data[buf->size++] = c;
|
|
132
|
+
buf->data[buf->size] = '\0';
|
|
133
|
+
buf->at_line_start = (c == '\n');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
void buffer_append_indent(SerializeBuffer* buf) {
|
|
137
|
+
if (!buf || buf->indent_spaces <= 0) return;
|
|
138
|
+
/* §16.2 html method: newline-only layout — libxml2's HTML dump
|
|
139
|
+
* never nests with spaces. */
|
|
140
|
+
if (buf->html_method) return;
|
|
141
|
+
|
|
142
|
+
if (buf->indent_unit && buf->indent_unit[0]) {
|
|
143
|
+
size_t ul = strlen(buf->indent_unit);
|
|
144
|
+
int levels = buf->indent;
|
|
145
|
+
buffer_ensure_capacity(buf, levels * ul + 1);
|
|
146
|
+
for (int i = 0; i < levels; i++) {
|
|
147
|
+
memcpy(buf->data + buf->size, buf->indent_unit, ul);
|
|
148
|
+
buf->size += ul;
|
|
149
|
+
}
|
|
150
|
+
buf->data[buf->size] = '\0';
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
int spaces = buf->indent * buf->indent_spaces;
|
|
155
|
+
buffer_ensure_capacity(buf, spaces + 1);
|
|
156
|
+
|
|
157
|
+
for (int i = 0; i < spaces; i++) {
|
|
158
|
+
buf->data[buf->size++] = ' ';
|
|
159
|
+
}
|
|
160
|
+
buf->data[buf->size] = '\0';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
void buffer_append_newline(SerializeBuffer* buf) {
|
|
164
|
+
if (!buf || buf->indent_spaces <= 0) return;
|
|
165
|
+
/* #129 indent_text collapses consecutive breaks; every other
|
|
166
|
+
* mode keeps the historical (stacking) newline sites — html
|
|
167
|
+
* layout relies on them. */
|
|
168
|
+
if (buf->indent_text && buf->at_line_start) return;
|
|
169
|
+
buffer_append_char(buf, '\n');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
char* buffer_to_string(SerializeBuffer* buf) {
|
|
173
|
+
if (!buf) return NULL;
|
|
174
|
+
|
|
175
|
+
/* Allocate exact size needed */
|
|
176
|
+
char* result = LEPTRIS_ALLOC_N(char, buf->size + 1);
|
|
177
|
+
if (result) {
|
|
178
|
+
memcpy(result, buf->data, buf->size + 1);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
void buffer_free(SerializeBuffer* buf) {
|
|
185
|
+
if (buf) {
|
|
186
|
+
if (buf->data) {
|
|
187
|
+
LEPTRIS_FREE(buf->data);
|
|
188
|
+
}
|
|
189
|
+
LEPTRIS_FREE(buf);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
int buffer_has_error(SerializeBuffer* buf) {
|
|
194
|
+
return buf ? buf->alloc_failed : 1;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* ============================================================================
|
|
198
|
+
* XML Entity Escaping
|
|
199
|
+
* ============================================================================ */
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
/* Inline escaped-text emitter (TODO 194d): writes into a caller-
|
|
203
|
+
* reserved worst-case buffer (6 bytes per input byte), preserving
|
|
204
|
+
* the entity semantics of the previous per-run walkers — entity
|
|
205
|
+
* references emit as-is (text mode), bare & escapes, quotes are
|
|
206
|
+
* ordinary in text mode and escaped in attribute mode. */
|
|
207
|
+
/* Escape-class table (serialize endgame): the run scan was 3-4
|
|
208
|
+
* compares per byte — the dominant serializer cost at 57% of the
|
|
209
|
+
* text-heavy profile. One indexed load + one test per byte, the
|
|
210
|
+
* same chartype-table shape as the parser (common/chartype.h) and
|
|
211
|
+
* pugixml's g_escape_table. Bit 1 = must escape in text mode
|
|
212
|
+
* (& < >), bit 2 = additional attr-mode chars (" '). */
|
|
213
|
+
static const unsigned char leptris_escape_table[256] = {
|
|
214
|
+
['&'] = 3, ['<'] = 3, ['>'] = 3,
|
|
215
|
+
['"'] = 2, ['\''] = 2,
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/* Long-run threshold (round 20): three SIMD finds cost ~60ns of
|
|
219
|
+
* dispatch; the per-byte table scan reaches that around 256 bytes
|
|
220
|
+
* of run. Text-heavy documents (one multi-hundred-KB text node,
|
|
221
|
+
* no specials) spent their entire serialize time in the per-byte
|
|
222
|
+
* scan — this is the shape the matrix benchmark loses 1.27x on. */
|
|
223
|
+
#define ESCAPE_SIMD_RUN 256
|
|
224
|
+
|
|
225
|
+
static char* emit_escaped_inline(char* out, const char* content,
|
|
226
|
+
size_t len, int attr_mode) {
|
|
227
|
+
unsigned mode = attr_mode ? 3u : 1u;
|
|
228
|
+
/* Control characters escape as numeric references: attributes
|
|
229
|
+
* escape \t \n \r (attribute-value normalization would eat
|
|
230
|
+
* them); text escapes \r (newline translation). libxslt-
|
|
231
|
+
* verified behavior. Rare: pre-scan and take the plain path
|
|
232
|
+
* when absent so the SIMD hot loop is untouched. */
|
|
233
|
+
int has_ctrl = 0;
|
|
234
|
+
for (size_t k = 0; k < len; k++) {
|
|
235
|
+
char c = content[k];
|
|
236
|
+
if (c == '\r' || (attr_mode && (c == '\t' || c == '\n'))) {
|
|
237
|
+
has_ctrl = 1;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
size_t i = 0;
|
|
242
|
+
if (has_ctrl) {
|
|
243
|
+
while (i < len) {
|
|
244
|
+
char c = content[i];
|
|
245
|
+
if (c == '\r' || (attr_mode && (c == '\t' || c == '\n'))) {
|
|
246
|
+
out += sprintf(out, "&#%d;", (int)(unsigned char)c);
|
|
247
|
+
} else if (c == '&') {
|
|
248
|
+
memcpy(out, "&", 5); out += 5;
|
|
249
|
+
} else if (c == '<') {
|
|
250
|
+
memcpy(out, "<", 4); out += 4;
|
|
251
|
+
} else if (c == '>') {
|
|
252
|
+
memcpy(out, ">", 4); out += 4;
|
|
253
|
+
} else if (attr_mode && c == '"') {
|
|
254
|
+
memcpy(out, """, 6); out += 6;
|
|
255
|
+
} else if (attr_mode && c == '\'') {
|
|
256
|
+
/* libxml2 leaves apostrophes raw in double-quoted
|
|
257
|
+
* attribute values (bug-86). */
|
|
258
|
+
*out++ = c;
|
|
259
|
+
} else {
|
|
260
|
+
*out++ = c;
|
|
261
|
+
}
|
|
262
|
+
i++;
|
|
263
|
+
}
|
|
264
|
+
return out;
|
|
265
|
+
}
|
|
266
|
+
while (i < len) {
|
|
267
|
+
size_t run = i;
|
|
268
|
+
if (!attr_mode && len - i >= ESCAPE_SIMD_RUN) {
|
|
269
|
+
/* Text mode over a long remainder: SIMD-find the first
|
|
270
|
+
* of & < > (three passes beat one per-byte pass by an
|
|
271
|
+
* order of magnitude at multi-KB lengths). */
|
|
272
|
+
size_t rem = len - i;
|
|
273
|
+
ptrdiff_t h1 = leptris_text_find(&content[i], rem, '&');
|
|
274
|
+
ptrdiff_t h2 = leptris_text_find(&content[i], rem, '<');
|
|
275
|
+
ptrdiff_t h3 = leptris_text_find(&content[i], rem, '>');
|
|
276
|
+
ptrdiff_t best = -1;
|
|
277
|
+
if (h1 >= 0) best = h1;
|
|
278
|
+
if (h2 >= 0 && (best < 0 || h2 < best)) best = h2;
|
|
279
|
+
if (h3 >= 0 && (best < 0 || h3 < best)) best = h3;
|
|
280
|
+
if (best < 0) {
|
|
281
|
+
memcpy(out, &content[i], rem);
|
|
282
|
+
out += rem;
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
run = i + (size_t)best;
|
|
286
|
+
} else {
|
|
287
|
+
while (run < len &&
|
|
288
|
+
!(leptris_escape_table[(unsigned char)content[run]] & mode)) {
|
|
289
|
+
run++;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (run > i) {
|
|
293
|
+
memcpy(out, &content[i], run - i);
|
|
294
|
+
out += run - i;
|
|
295
|
+
i = run;
|
|
296
|
+
if (i >= len) break;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (content[i] == '&') {
|
|
300
|
+
size_t j = i + 1;
|
|
301
|
+
int found_semicolon = 0;
|
|
302
|
+
while (j < len && j < i + 12) {
|
|
303
|
+
if (content[j] == ';') { found_semicolon = 1; break; }
|
|
304
|
+
if (!isalnum((unsigned char)content[j]) && content[j] != '#' && content[j] != '-') break;
|
|
305
|
+
j++;
|
|
306
|
+
}
|
|
307
|
+
if (!attr_mode && found_semicolon && j > i + 1) {
|
|
308
|
+
size_t n = j - i + 1;
|
|
309
|
+
memcpy(out, &content[i], n);
|
|
310
|
+
out += n;
|
|
311
|
+
i = j + 1;
|
|
312
|
+
} else {
|
|
313
|
+
memcpy(out, "&", 5);
|
|
314
|
+
out += 5;
|
|
315
|
+
i++;
|
|
316
|
+
}
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
if (content[i] == '<') { memcpy(out, "<", 4); out += 4; }
|
|
320
|
+
else if (content[i] == '>') { memcpy(out, ">", 4); out += 4; }
|
|
321
|
+
else if (attr_mode && content[i] == '"') { memcpy(out, """, 6); out += 6; }
|
|
322
|
+
else { *out++ = content[i]; } /* apostrophe: raw (libxml2) */
|
|
323
|
+
i++;
|
|
324
|
+
}
|
|
325
|
+
return out;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* Escape special XML characters in text content.
|
|
329
|
+
* Ordinary-character RUNS are bulk-appended (one capacity check +
|
|
330
|
+
* one memcpy per run) instead of per-character appends — the
|
|
331
|
+
* per-byte path was the serializer's dominant cost (TODO 194). */
|
|
332
|
+
/* ============================================================================
|
|
333
|
+
* Node Serialization Functions
|
|
334
|
+
* ============================================================================ */
|
|
335
|
+
|
|
336
|
+
/* §16.1 cdata-section-elements: does this element's QName match? */
|
|
337
|
+
static int is_cdata_element(SerializeBuffer* buf, LeptrisElement e) {
|
|
338
|
+
if (!buf || !buf->cdata_count || !e) return 0;
|
|
339
|
+
const char* local = leptris_element_get_name(e);
|
|
340
|
+
if (!local) return 0;
|
|
341
|
+
const char* prefix = leptris_element_get_prefix(e);
|
|
342
|
+
int has_pfx = prefix && *prefix;
|
|
343
|
+
char qn[256];
|
|
344
|
+
if (has_pfx)
|
|
345
|
+
snprintf(qn, sizeof(qn), "%s:%s", prefix, local);
|
|
346
|
+
else
|
|
347
|
+
snprintf(qn, sizeof(qn), "%s", local);
|
|
348
|
+
for (size_t i = 0; i < buf->cdata_count; i++) {
|
|
349
|
+
if (!buf->cdata_names[i]) continue;
|
|
350
|
+
if (strcmp(buf->cdata_names[i], qn) == 0) return 1;
|
|
351
|
+
/* An unprefixed entry also matches a no-namespace element. */
|
|
352
|
+
if (!strchr(buf->cdata_names[i], ':') && !has_pfx &&
|
|
353
|
+
strcmp(buf->cdata_names[i], local) == 0) return 1;
|
|
354
|
+
}
|
|
355
|
+
return 0;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* §16.2 HTML element descriptor table (libxml2 html40ElementTable
|
|
359
|
+
* parity, sorted for bsearch). EMPTY mirrors the table's empty flag;
|
|
360
|
+
* INLINE mirrors its isinline flag (values 1 and 2 both inline).
|
|
361
|
+
* Absent elements return 0 — unknown markup never joins the HTML
|
|
362
|
+
* indent decisions. */
|
|
363
|
+
typedef struct {
|
|
364
|
+
const char* name;
|
|
365
|
+
unsigned char flags;
|
|
366
|
+
} HtmlElemFlags;
|
|
367
|
+
|
|
368
|
+
static const HtmlElemFlags kHtmlElems[] = {
|
|
369
|
+
{ "a", HTML_F_INLINE }, { "abbr", HTML_F_INLINE },
|
|
370
|
+
{ "acronym", HTML_F_INLINE }, { "address", HTML_F_BLOCK },
|
|
371
|
+
{ "applet", HTML_F_INLINE }, { "area", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
372
|
+
{ "b", HTML_F_INLINE }, { "base", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
373
|
+
{ "basefont", HTML_F_EMPTY | HTML_F_INLINE },
|
|
374
|
+
{ "bdo", HTML_F_INLINE },
|
|
375
|
+
{ "bgsound", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
376
|
+
{ "big", HTML_F_INLINE }, { "blockquote", HTML_F_BLOCK },
|
|
377
|
+
{ "body", HTML_F_BLOCK },
|
|
378
|
+
{ "br", HTML_F_EMPTY | HTML_F_INLINE }, { "button", HTML_F_INLINE },
|
|
379
|
+
{ "caption", HTML_F_BLOCK }, { "center", HTML_F_BLOCK },
|
|
380
|
+
{ "cite", HTML_F_INLINE },
|
|
381
|
+
{ "code", HTML_F_INLINE }, { "col", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
382
|
+
{ "colgroup", HTML_F_BLOCK }, { "dd", HTML_F_BLOCK },
|
|
383
|
+
{ "del", HTML_F_INLINE },
|
|
384
|
+
{ "dfn", HTML_F_INLINE }, { "dir", HTML_F_BLOCK },
|
|
385
|
+
{ "div", HTML_F_BLOCK }, { "dl", HTML_F_BLOCK },
|
|
386
|
+
{ "dt", HTML_F_BLOCK }, { "em", HTML_F_INLINE },
|
|
387
|
+
{ "embed", HTML_F_EMPTY | HTML_F_INLINE },
|
|
388
|
+
{ "fieldset", HTML_F_BLOCK },
|
|
389
|
+
{ "font", HTML_F_INLINE }, { "form", HTML_F_BLOCK },
|
|
390
|
+
{ "frame", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
391
|
+
{ "frameset", HTML_F_BLOCK }, { "h1", HTML_F_BLOCK },
|
|
392
|
+
{ "h2", HTML_F_BLOCK }, { "h3", HTML_F_BLOCK },
|
|
393
|
+
{ "h4", HTML_F_BLOCK }, { "h5", HTML_F_BLOCK },
|
|
394
|
+
{ "h6", HTML_F_BLOCK }, { "head", HTML_F_BLOCK },
|
|
395
|
+
{ "hr", HTML_F_EMPTY | HTML_F_BLOCK }, { "html", HTML_F_BLOCK },
|
|
396
|
+
{ "i", HTML_F_INLINE }, { "iframe", HTML_F_INLINE | HTML_F_RAW },
|
|
397
|
+
{ "img", HTML_F_EMPTY | HTML_F_INLINE },
|
|
398
|
+
{ "input", HTML_F_EMPTY | HTML_F_INLINE }, { "ins", HTML_F_INLINE },
|
|
399
|
+
{ "isindex", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
400
|
+
{ "kbd", HTML_F_INLINE },
|
|
401
|
+
{ "keygen", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
402
|
+
{ "label", HTML_F_INLINE },
|
|
403
|
+
{ "legend", HTML_F_BLOCK }, { "li", HTML_F_BLOCK },
|
|
404
|
+
{ "link", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
405
|
+
{ "map", HTML_F_INLINE }, { "menu", HTML_F_BLOCK },
|
|
406
|
+
{ "meta", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
407
|
+
{ "noembed", HTML_F_BLOCK | HTML_F_RAW }, { "noframes", HTML_F_BLOCK | HTML_F_RAW },
|
|
408
|
+
{ "noscript", HTML_F_BLOCK },
|
|
409
|
+
{ "object", HTML_F_INLINE }, { "ol", HTML_F_BLOCK },
|
|
410
|
+
{ "optgroup", HTML_F_BLOCK },
|
|
411
|
+
{ "option", HTML_F_BLOCK }, { "p", HTML_F_BLOCK },
|
|
412
|
+
{ "param", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
413
|
+
{ "plaintext", HTML_F_BLOCK | HTML_F_RAW }, { "pre", HTML_F_BLOCK },
|
|
414
|
+
{ "q", HTML_F_INLINE }, { "s", HTML_F_INLINE },
|
|
415
|
+
{ "samp", HTML_F_INLINE },
|
|
416
|
+
{ "script", HTML_F_INLINE | HTML_F_RAW }, { "select", HTML_F_INLINE },
|
|
417
|
+
{ "small", HTML_F_INLINE },
|
|
418
|
+
{ "source", HTML_F_EMPTY | HTML_F_BLOCK },
|
|
419
|
+
{ "span", HTML_F_INLINE }, { "strike", HTML_F_INLINE },
|
|
420
|
+
{ "strong", HTML_F_INLINE }, { "style", HTML_F_BLOCK | HTML_F_RAW },
|
|
421
|
+
{ "sub", HTML_F_INLINE },
|
|
422
|
+
{ "sup", HTML_F_INLINE }, { "table", HTML_F_BLOCK },
|
|
423
|
+
{ "tbody", HTML_F_BLOCK },
|
|
424
|
+
{ "td", HTML_F_BLOCK }, { "textarea", HTML_F_INLINE },
|
|
425
|
+
{ "tfoot", HTML_F_BLOCK },
|
|
426
|
+
{ "th", HTML_F_BLOCK }, { "thead", HTML_F_BLOCK },
|
|
427
|
+
{ "title", HTML_F_BLOCK }, { "tr", HTML_F_BLOCK },
|
|
428
|
+
{ "track", HTML_F_EMPTY | HTML_F_BLOCK }, { "tt", HTML_F_INLINE },
|
|
429
|
+
{ "u", HTML_F_INLINE }, { "ul", HTML_F_BLOCK },
|
|
430
|
+
{ "var", HTML_F_INLINE },
|
|
431
|
+
{ "wbr", HTML_F_EMPTY | HTML_F_BLOCK }, { "xmp", HTML_F_INLINE | HTML_F_RAW },
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
int html_elem_flags(const char* name, size_t len) {
|
|
435
|
+
if (!name || !len) return 0;
|
|
436
|
+
size_t lo = 0, hi = sizeof(kHtmlElems) / sizeof(kHtmlElems[0]);
|
|
437
|
+
while (lo < hi) {
|
|
438
|
+
size_t mid = lo + (hi - lo) / 2;
|
|
439
|
+
int c = strncmp(kHtmlElems[mid].name, name, len);
|
|
440
|
+
if (c == 0 && kHtmlElems[mid].name[len] == '\0')
|
|
441
|
+
return (int)kHtmlElems[mid].flags;
|
|
442
|
+
if (c < 0) lo = mid + 1;
|
|
443
|
+
else hi = mid;
|
|
444
|
+
}
|
|
445
|
+
return 0;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* HTML names are matched case-insensitively; the serializer sees the
|
|
449
|
+
* document's spelling, so lowercase into a bounded scratch first. */
|
|
450
|
+
static int html_elem_flags_ci(const char* name, size_t len) {
|
|
451
|
+
char lower[16];
|
|
452
|
+
if (!name || !len || len >= sizeof(lower)) return 0;
|
|
453
|
+
for (size_t i = 0; i < len; i++)
|
|
454
|
+
lower[i] = (char)tolower((unsigned char)name[i]);
|
|
455
|
+
return html_elem_flags(lower, len);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* HTML element semantics (void/raw/inline/block site rules) apply
|
|
459
|
+
* only to UNPREFIXED names: a namespaced s:img is a foreign
|
|
460
|
+
* element, not the HTML void img — it keeps its close tag and
|
|
461
|
+
* takes no break rules (bug-117). */
|
|
462
|
+
static int html_elem_sem_flags(const LeptrisElement e) {
|
|
463
|
+
if (!e) return 0;
|
|
464
|
+
const char* pfx = leptris_element_get_prefix(e);
|
|
465
|
+
if (pfx && pfx[0]) return 0;
|
|
466
|
+
const char* n = e->name;
|
|
467
|
+
if (!n) return 0;
|
|
468
|
+
size_t nl = (e->name_len != 0xFF) ? (size_t)e->name_len : strlen(n);
|
|
469
|
+
return html_elem_flags_ci(n, nl);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* ---- libxml2 XHTML serialization (xmlsave.c xhtmlNodeDumpOutput) ---- */
|
|
473
|
+
|
|
474
|
+
#define LEPTRIS_XHTML_NS "http://www.w3.org/1999/xhtml"
|
|
475
|
+
|
|
476
|
+
/* xhtmlIsEmpty: exactly these 13 names may minimize as <x /> —
|
|
477
|
+
* deliberately NOT the html-method void table, which carries extra
|
|
478
|
+
* HTML5 names libxml2's XHTML path does not know. */
|
|
479
|
+
static int xhtml_is_empty_name(const char* name, size_t len) {
|
|
480
|
+
static const char k[] = "area\0base\0basefont\0br\0col\0frame\0hr\0"
|
|
481
|
+
"img\0input\0isindex\0link\0meta\0param";
|
|
482
|
+
const char* p = k;
|
|
483
|
+
const char* end = k + sizeof(k) - 1;
|
|
484
|
+
while (p < end) {
|
|
485
|
+
size_t l = (size_t)(end - p);
|
|
486
|
+
const char* z = memchr(p, '\0', l);
|
|
487
|
+
size_t wl = z ? (size_t)(z - p) : l;
|
|
488
|
+
if (wl == len && memcmp(p, name, len) == 0) return 1;
|
|
489
|
+
p += wl + 1;
|
|
490
|
+
}
|
|
491
|
+
return 0;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/* libxml2 C.2/C.3: the empty-name rule applies only to no-namespace
|
|
495
|
+
* (or XHTML-namespace) elements. */
|
|
496
|
+
static int xhtml_is_empty_elem(LeptrisElement e, const char* name,
|
|
497
|
+
size_t nl) {
|
|
498
|
+
if (!xhtml_is_empty_name(name, nl)) return 0;
|
|
499
|
+
const char* u = leptris_element_get_namespace_uri(e);
|
|
500
|
+
return u == NULL || strcmp(u, LEPTRIS_XHTML_NS) == 0;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
static int ser_case_eq(const char* a, const char* b) {
|
|
504
|
+
while (*a && *b) {
|
|
505
|
+
if (tolower((unsigned char)*a) != tolower((unsigned char)*b))
|
|
506
|
+
return 0;
|
|
507
|
+
a++; b++;
|
|
508
|
+
}
|
|
509
|
+
return *a == *b;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* head injects the Content-Type meta unless a child meta already
|
|
513
|
+
* carries http-equiv="Content-Type" (xmlStrcasecmp parity). */
|
|
514
|
+
static int xhtml_head_wants_meta(LeptrisElement head) {
|
|
515
|
+
for (LeptrisNode* m = leptris_node_first_child_internal(
|
|
516
|
+
(LeptrisNode*)head);
|
|
517
|
+
m; m = leptris_node_get_next_sibling(m)) {
|
|
518
|
+
if (m->type != LEPTRIS_NODE_TYPE_ELEMENT) continue;
|
|
519
|
+
LeptrisElement me = (LeptrisElement)m;
|
|
520
|
+
const char* mn = me->name;
|
|
521
|
+
size_t mnl = (me->name_len != 0xFF)
|
|
522
|
+
? (size_t)me->name_len : (mn ? strlen(mn) : 0);
|
|
523
|
+
if (!mn || mnl != 4 || memcmp(mn, "meta", 4) != 0) continue;
|
|
524
|
+
const char* he = leptris_element_attribute(me, "http-equiv");
|
|
525
|
+
if (he && ser_case_eq(he, "Content-Type")) return 0;
|
|
526
|
+
}
|
|
527
|
+
return 1;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
static void emit_xhtml_meta(SerializeBuffer* buf) {
|
|
531
|
+
buffer_append(buf, "<meta http-equiv=\"Content-Type\" "
|
|
532
|
+
"content=\"text/html; charset=");
|
|
533
|
+
buffer_append(buf, buf->xhtml_encoding ? buf->xhtml_encoding
|
|
534
|
+
: "UTF-8");
|
|
535
|
+
buffer_append(buf, "\" />");
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/* §16.2 newline sites (libxml2 htmlNodeDumpInternal parity). The
|
|
539
|
+
* p/pre/param first-byte rule gates the PARENT-side sites only — a
|
|
540
|
+
* block child named p* still takes its after-close newline when its
|
|
541
|
+
* parent allows it. */
|
|
542
|
+
static int html_breaks_block(const char* name, size_t len, int flags) {
|
|
543
|
+
(void)len;
|
|
544
|
+
return (flags & HTML_F_BLOCK) && name != NULL;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/* Site 1: newline after this element's opening tag — block element,
|
|
548
|
+
* first child exists and is not text, more than one child. */
|
|
549
|
+
static int html_break_before_children(LeptrisElement elem,
|
|
550
|
+
const char* name, size_t len,
|
|
551
|
+
int flags) {
|
|
552
|
+
if (!html_breaks_block(name, len, flags)) return 0;
|
|
553
|
+
if (name[0] == 'p') return 0;
|
|
554
|
+
LeptrisNode* first =
|
|
555
|
+
leptris_node_first_child_internal((LeptrisNode*)elem);
|
|
556
|
+
if (!first || first->type == LEPTRIS_NODE_TYPE_TEXT) return 0;
|
|
557
|
+
return leptris_node_get_next_sibling(first) != NULL;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/* Site 3: newline before this element's closing tag — block element,
|
|
561
|
+
* more than one child, last child is not text. */
|
|
562
|
+
static int html_break_before_close(LeptrisElement elem,
|
|
563
|
+
const char* name, size_t len,
|
|
564
|
+
int flags) {
|
|
565
|
+
if (!html_breaks_block(name, len, flags)) return 0;
|
|
566
|
+
if (name[0] == 'p') return 0;
|
|
567
|
+
LeptrisNode* c =
|
|
568
|
+
leptris_node_first_child_internal((LeptrisNode*)elem);
|
|
569
|
+
if (!c) return 0;
|
|
570
|
+
LeptrisNode* last = c;
|
|
571
|
+
while (leptris_node_get_next_sibling(last))
|
|
572
|
+
last = leptris_node_get_next_sibling(last);
|
|
573
|
+
if (last == c) return 0; /* single child: libxml2 keeps inline */
|
|
574
|
+
return last->type != LEPTRIS_NODE_TYPE_TEXT;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/* Site 2/4 (merged): newline after this element's closing tag (or
|
|
578
|
+
* lone void tag) — block element, a non-text next sibling exists,
|
|
579
|
+
* and the parent is not a p* element. */
|
|
580
|
+
static int html_break_after_elem(LeptrisElement elem,
|
|
581
|
+
const char* name, size_t len,
|
|
582
|
+
int flags) {
|
|
583
|
+
if (!html_breaks_block(name, len, flags)) return 0;
|
|
584
|
+
LeptrisNode* next =
|
|
585
|
+
leptris_node_get_next_sibling((LeptrisNode*)elem);
|
|
586
|
+
if (!next || next->type == LEPTRIS_NODE_TYPE_TEXT) return 0;
|
|
587
|
+
LeptrisElement parent = leptris_element_get_parent(elem);
|
|
588
|
+
if (parent && parent->name && parent->name[0] == 'p') return 0;
|
|
589
|
+
return 1;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/* Emit the CDATA BODY, splitting "]]>" across section closes. The
|
|
593
|
+
* caller owns the surrounding <![CDATA[ / ]]> brackets (run merging).
|
|
594
|
+
* The close scan runs to len-3 INCLUSIVE — a "]]>" at the very END
|
|
595
|
+
* of the span is a close too (the old j+2<len bound missed it and
|
|
596
|
+
* emitted it raw, terminating the section early — bug-132). */
|
|
597
|
+
static void emit_cdata_body(SerializeBuffer* buf, const char* s, size_t len) {
|
|
598
|
+
size_t i = 0;
|
|
599
|
+
while (i < len) {
|
|
600
|
+
const char* close = NULL;
|
|
601
|
+
for (size_t j = i; j + 3 <= len; j++) {
|
|
602
|
+
if (s[j] == ']' && s[j+1] == ']' && s[j+2] == '>') {
|
|
603
|
+
close = s + j;
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
/* chunk ends after "]]"; the '>' carries into the reopened
|
|
608
|
+
* section (i advances by chunk only). */
|
|
609
|
+
size_t chunk = close ? (size_t)(close - (s + i)) + 2 : len - i;
|
|
610
|
+
buffer_append_len(buf, s + i, chunk);
|
|
611
|
+
if (close) buffer_append(buf, "]]><![CDATA[");
|
|
612
|
+
i += chunk;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/* Standalone single-node CDATA emission (fallback sites). */
|
|
617
|
+
static void emit_cdata(SerializeBuffer* buf, const char* s, size_t len) {
|
|
618
|
+
size_t i = 0;
|
|
619
|
+
while (i < len) {
|
|
620
|
+
const char* close = NULL;
|
|
621
|
+
for (size_t j = i; j + 3 <= len; j++) {
|
|
622
|
+
if (s[j] == ']' && s[j+1] == ']' && s[j+2] == '>') {
|
|
623
|
+
close = s + j;
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
/* chunk ends after "]]"; the '>' opens the next section. */
|
|
628
|
+
size_t chunk = close ? (size_t)(close - (s + i)) + 2 : len - i;
|
|
629
|
+
buffer_append(buf, "<![CDATA[");
|
|
630
|
+
buffer_append_len(buf, s + i, chunk);
|
|
631
|
+
buffer_append(buf, "]]>");
|
|
632
|
+
i += chunk;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/* libxslt rule: whitespace-only text is never wrapped in CDATA. */
|
|
637
|
+
static int text_is_ws_only(const char* s, size_t len) {
|
|
638
|
+
for (size_t i = 0; i < len; i++) {
|
|
639
|
+
char c = s[i];
|
|
640
|
+
if (c != ' ' && c != '\t' && c != '\n' && c != '\r') return 0;
|
|
641
|
+
}
|
|
642
|
+
return 1;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/* Convert one text node's content per §16.1: CDATA unless the text
|
|
646
|
+
* is whitespace-only (libxslt keeps ws plain). */
|
|
647
|
+
static void emit_cdata_checked(SerializeBuffer* buf, const char* s) {
|
|
648
|
+
if (!s) return;
|
|
649
|
+
size_t l = strlen(s);
|
|
650
|
+
if (text_is_ws_only(s, l)) {
|
|
651
|
+
buffer_append_len(buf, s, l);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
emit_cdata(buf, s, l);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
void serialize_text_internal(LeptrisTextNode* text, SerializeBuffer* buf) {
|
|
659
|
+
if (!text) return;
|
|
660
|
+
|
|
661
|
+
/* Materialize + expand entities on first access. For borrowed
|
|
662
|
+
* text nodes (the direct_parse fast path), this expands
|
|
663
|
+
* predefined entities (& → &) and, when a DTD is present
|
|
664
|
+
* on the document, custom entities (&foo; → declared value).
|
|
665
|
+
* Without this call the serializer reads raw borrowed bytes
|
|
666
|
+
* and emits unexpanded entity references. */
|
|
667
|
+
const char* content = leptris_text_get_content(text);
|
|
668
|
+
if (!content) return;
|
|
669
|
+
size_t content_len = text->content_len;
|
|
670
|
+
|
|
671
|
+
/* disable-output-escaping (XSLT §16.4) / method=html script and
|
|
672
|
+
* style content: emit the string-value verbatim — no entity
|
|
673
|
+
* escaping, characters pass through as-is. */
|
|
674
|
+
if (text->base.raw) {
|
|
675
|
+
buffer_append_len(buf, content, content_len);
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/* Run-batched (TODO 194b): bulk-append ordinary bytes up to the
|
|
680
|
+
* next special character; the entity lookahead only runs at '&'.
|
|
681
|
+
* Quotes and apostrophes are ordinary in text content. */
|
|
682
|
+
size_t i = 0;
|
|
683
|
+
while (i < content_len) {
|
|
684
|
+
size_t run = i;
|
|
685
|
+
while (run < content_len) {
|
|
686
|
+
char c = content[run];
|
|
687
|
+
if (c == '&' || c == '<' || c == '>') break;
|
|
688
|
+
run++;
|
|
689
|
+
}
|
|
690
|
+
if (run > i) {
|
|
691
|
+
buffer_append_len(buf, &content[i], run - i);
|
|
692
|
+
i = run;
|
|
693
|
+
if (i >= content_len) break;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
if (content[i] == '&') {
|
|
697
|
+
/* Look ahead for ';' to detect entity reference */
|
|
698
|
+
size_t j = i + 1;
|
|
699
|
+
int found_semicolon = 0;
|
|
700
|
+
while (j < text->content_len && j < i + 12) {
|
|
701
|
+
if (content[j] == ';') {
|
|
702
|
+
found_semicolon = 1;
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
if (!isalnum((unsigned char)content[j]) && content[j] != '#' && content[j] != '-') {
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
j++;
|
|
709
|
+
}
|
|
710
|
+
if (found_semicolon && j > i + 1) {
|
|
711
|
+
buffer_append_len(buf, &content[i], j - i + 1);
|
|
712
|
+
i = j + 1;
|
|
713
|
+
} else {
|
|
714
|
+
buffer_append_len(buf, "&", 5);
|
|
715
|
+
i++;
|
|
716
|
+
}
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (content[i] == '<') {
|
|
721
|
+
buffer_append_len(buf, "<", 4);
|
|
722
|
+
} else {
|
|
723
|
+
buffer_append_len(buf, ">", 4);
|
|
724
|
+
}
|
|
725
|
+
i++;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
void serialize_comment_internal(LeptrisCommentNode* comment, SerializeBuffer* buf) {
|
|
730
|
+
if (!comment || !comment->content) return;
|
|
731
|
+
|
|
732
|
+
buffer_append(buf, "<!--");
|
|
733
|
+
buffer_append(buf, comment->content);
|
|
734
|
+
buffer_append(buf, "-->");
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
void serialize_cdata_internal(LeptrisCDATANode* cdata, SerializeBuffer* buf) {
|
|
738
|
+
if (!cdata || !cdata->content) return;
|
|
739
|
+
|
|
740
|
+
buffer_append(buf, "<![CDATA[");
|
|
741
|
+
/* XML 1.0 §2.7: "]]>" cannot appear inside a CDATA section.
|
|
742
|
+
* Content containing the terminator is split across two CDATA
|
|
743
|
+
* sections by rewriting it as "]]]]><![CDATA[>" — the same
|
|
744
|
+
* technique libxml2 uses. Everything else in CDATA is literal. */
|
|
745
|
+
const char* p = cdata->content;
|
|
746
|
+
const char* run_start = p;
|
|
747
|
+
while (*p) {
|
|
748
|
+
if (p[0] == ']' && p[1] == ']' && p[2] == '>') {
|
|
749
|
+
buffer_append_len(buf, run_start, (size_t)(p - run_start));
|
|
750
|
+
buffer_append(buf, "]]]]><![CDATA[>");
|
|
751
|
+
p += 3;
|
|
752
|
+
run_start = p;
|
|
753
|
+
} else {
|
|
754
|
+
p++;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
buffer_append(buf, run_start);
|
|
758
|
+
buffer_append(buf, "]]>");
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
void serialize_pi_internal(LeptrisPINode* pi, SerializeBuffer* buf) {
|
|
762
|
+
if (!pi || !pi->target) return;
|
|
763
|
+
|
|
764
|
+
buffer_append(buf, "<?");
|
|
765
|
+
buffer_append(buf, pi->target);
|
|
766
|
+
|
|
767
|
+
if (pi->data && pi->data[0] != '\0') {
|
|
768
|
+
buffer_append_char(buf, ' ');
|
|
769
|
+
buffer_append(buf, pi->data);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/* §16.2: HTML PIs close with '>' — no trailing '?' (libxml2
|
|
773
|
+
* HTMLtree.c). */
|
|
774
|
+
buffer_append(buf, buf->html_method ? ">" : "?>");
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/* #1094: entity references serialize back as &name; — the name is
|
|
778
|
+
* an entity name, never escaped (escaping would corrupt the ref). */
|
|
779
|
+
void serialize_entity_ref_internal(LeptrisEntityRefNode* ref, SerializeBuffer* buf) {
|
|
780
|
+
if (!ref) return;
|
|
781
|
+
buffer_append(buf, "&");
|
|
782
|
+
if (ref->name) buffer_append(buf, ref->name);
|
|
783
|
+
buffer_append(buf, ";");
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
void serialize_doctype_internal(LeptrisDoctypeNode* doctype, SerializeBuffer* buf) {
|
|
787
|
+
if (!doctype || !doctype->name) return;
|
|
788
|
+
|
|
789
|
+
buffer_append(buf, "<!DOCTYPE ");
|
|
790
|
+
buffer_append(buf, doctype->name);
|
|
791
|
+
|
|
792
|
+
if (doctype->public_id) {
|
|
793
|
+
buffer_append(buf, " PUBLIC \"");
|
|
794
|
+
buffer_append(buf, doctype->public_id);
|
|
795
|
+
buffer_append_char(buf, '"');
|
|
796
|
+
|
|
797
|
+
if (doctype->system_id) {
|
|
798
|
+
buffer_append(buf, " \"");
|
|
799
|
+
buffer_append(buf, doctype->system_id);
|
|
800
|
+
buffer_append_char(buf, '"');
|
|
801
|
+
}
|
|
802
|
+
} else if (doctype->system_id) {
|
|
803
|
+
buffer_append(buf, " SYSTEM \"");
|
|
804
|
+
buffer_append(buf, doctype->system_id);
|
|
805
|
+
buffer_append_char(buf, '"');
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/* Output internal subset if present */
|
|
809
|
+
if (doctype->internal_subset) {
|
|
810
|
+
/* Trim the source's bracket whitespace, then lay the
|
|
811
|
+
* declarations out libxml2-style: each on its own line
|
|
812
|
+
* (issue #633). Declarations open with '<!' and close with
|
|
813
|
+
* '>', so '><' is the boundary. */
|
|
814
|
+
const char* s = doctype->internal_subset;
|
|
815
|
+
size_t sl = strlen(s);
|
|
816
|
+
while (sl && (s[0] == ' ' || s[0] == '\t' || s[0] == '\n' ||
|
|
817
|
+
s[0] == '\r')) { s++; sl--; }
|
|
818
|
+
while (sl && (s[sl-1] == ' ' || s[sl-1] == '\t' ||
|
|
819
|
+
s[sl-1] == '\n' || s[sl-1] == '\r')) sl--;
|
|
820
|
+
if (sl) {
|
|
821
|
+
buffer_append(buf, " [\n");
|
|
822
|
+
for (size_t i = 0; i < sl; i++) {
|
|
823
|
+
if (i + 1 < sl && s[i] == '>' && s[i + 1] == '<') {
|
|
824
|
+
/* Declaration boundary: line-break after '>';
|
|
825
|
+
* the next '<' prints on the following pass —
|
|
826
|
+
* skipping it dropped every later declaration's
|
|
827
|
+
* opening byte (issue #687). */
|
|
828
|
+
buffer_append_char(buf, '>');
|
|
829
|
+
buffer_append_char(buf, '\n');
|
|
830
|
+
} else {
|
|
831
|
+
buffer_append_char(buf, s[i]);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
buffer_append(buf, "\n]");
|
|
835
|
+
}
|
|
836
|
+
/* Empty subset: no brackets at all (libxml2). */
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
buffer_append_char(buf, '>');
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/* Emit a qualified element/attribute name: XML requires names in a
|
|
843
|
+
* namespace to serialize with their prefix (prefix:name). libleptris
|
|
844
|
+
* stores the prefix beside the local name, so every name-emission
|
|
845
|
+
* site routes through this helper. */
|
|
846
|
+
static void append_qualified_name(SerializeBuffer* buf, const char* prefix,
|
|
847
|
+
const char* name, size_t name_len) {
|
|
848
|
+
if (prefix && prefix[0]) {
|
|
849
|
+
buffer_append(buf, prefix);
|
|
850
|
+
buffer_append_char(buf, ':');
|
|
851
|
+
}
|
|
852
|
+
buffer_append_len(buf, name, name_len);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/* Issue #546: rootless documents may still carry document-level
|
|
856
|
+
* nodes. Emit the declaration (if the original had one) and the
|
|
857
|
+
* child chain (no root element exists in it) instead of returning
|
|
858
|
+
* an empty string. */
|
|
859
|
+
static char* serialize_rootless_pis(struct leptris_document* doc,
|
|
860
|
+
const LeptrisSerializeOptions* options) {
|
|
861
|
+
if (!doc || !doc->doc_children_head) return NULL;
|
|
862
|
+
SerializeBuffer* pibuf = buffer_create(0);
|
|
863
|
+
if (!pibuf) return NULL;
|
|
864
|
+
int xml_declaration = options ? options->xml_declaration : 1;
|
|
865
|
+
if (xml_declaration && doc->had_declaration) {
|
|
866
|
+
const char* enc = options && options->encoding
|
|
867
|
+
? options->encoding
|
|
868
|
+
: (doc->encoding ? doc->encoding : "UTF-8");
|
|
869
|
+
const char* ver = doc->xml_version ? doc->xml_version : "1.0";
|
|
870
|
+
buffer_append(pibuf, "<?xml version=\"");
|
|
871
|
+
buffer_append(pibuf, ver);
|
|
872
|
+
buffer_append(pibuf, "\"");
|
|
873
|
+
if (enc) {
|
|
874
|
+
buffer_append(pibuf, " encoding=\"");
|
|
875
|
+
buffer_append(pibuf, enc);
|
|
876
|
+
buffer_append(pibuf, "\"");
|
|
877
|
+
}
|
|
878
|
+
if (doc->standalone >= 0) {
|
|
879
|
+
buffer_append(pibuf, " standalone=\"");
|
|
880
|
+
buffer_append(pibuf, doc->standalone ? "yes" : "no");
|
|
881
|
+
buffer_append(pibuf, "\"");
|
|
882
|
+
}
|
|
883
|
+
buffer_append(pibuf, "?>");
|
|
884
|
+
}
|
|
885
|
+
/* Document children (issue #580): comment/PI nodes in document
|
|
886
|
+
* order — the interleaving the old side lists lost. */
|
|
887
|
+
for (LeptrisNode* c = (LeptrisNode*)doc->doc_children_head; c;
|
|
888
|
+
c = leptris_node_get_next_sibling(c)) {
|
|
889
|
+
if (c->type == LEPTRIS_NODE_TYPE_PI) {
|
|
890
|
+
LeptrisPINode* pi = (LeptrisPINode*)c;
|
|
891
|
+
buffer_append(pibuf, "<?");
|
|
892
|
+
if (pi->target) buffer_append(pibuf, pi->target);
|
|
893
|
+
if (pi->data && pi->data[0]) {
|
|
894
|
+
buffer_append_char(pibuf, ' ');
|
|
895
|
+
buffer_append(pibuf, pi->data);
|
|
896
|
+
}
|
|
897
|
+
buffer_append(pibuf, "?>");
|
|
898
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_COMMENT) {
|
|
899
|
+
buffer_append(pibuf, "<!--");
|
|
900
|
+
buffer_append(pibuf,
|
|
901
|
+
leptris_comment_get_content((LeptrisCommentNode*)c));
|
|
902
|
+
buffer_append(pibuf, "-->");
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
char* out = buffer_to_string(pibuf);
|
|
906
|
+
buffer_free(pibuf);
|
|
907
|
+
return out;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
#define SER_WALK_STACK_MAX 512
|
|
911
|
+
|
|
912
|
+
typedef struct { LeptrisElement e; size_t nl; int mixed; int cd_open;
|
|
913
|
+
int close_brk; char* cd_buf; size_t cd_len, cd_cap; } SerFrame;
|
|
914
|
+
|
|
915
|
+
/* Issue #534: an element whose children include TEXT (non-whitespace)
|
|
916
|
+
* or CDATA is MIXED CONTENT — indenting inside it would change the
|
|
917
|
+
* text on round-trip (inserted whitespace becomes new text nodes on
|
|
918
|
+
* reparse). libxml2 keeps such elements on one line; so do we.
|
|
919
|
+
* Whitespace-only text nodes are formatting artifacts and do NOT
|
|
920
|
+
* count (pretty documents keep indenting). */
|
|
921
|
+
/* XSLT-result variant: WHITESPACE-ONLY text children count —
|
|
922
|
+
* libxslt's serializer stops formatting below any text node
|
|
923
|
+
* (bug-98: the copied source whitespace is the visible indent). */
|
|
924
|
+
static int ser_children_have_any_text(LeptrisNode* fc) {
|
|
925
|
+
for (LeptrisNode* c = fc; c; c = leptris_node_get_next_sibling(c)) {
|
|
926
|
+
if (c->type == LEPTRIS_NODE_TYPE_CDATA) return 1;
|
|
927
|
+
if (c->type == LEPTRIS_NODE_TYPE_TEXT) return 1;
|
|
928
|
+
}
|
|
929
|
+
return 0;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
static int ser_children_have_text(LeptrisNode* fc) {
|
|
933
|
+
for (LeptrisNode* c = fc; c; c = leptris_node_get_next_sibling(c)) {
|
|
934
|
+
if (c->type == LEPTRIS_NODE_TYPE_CDATA) return 1;
|
|
935
|
+
if (c->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
936
|
+
LeptrisTextNode* tn = (LeptrisTextNode*)c;
|
|
937
|
+
const char* tc;
|
|
938
|
+
size_t tl;
|
|
939
|
+
if (tn->borrowed && tn->content_len > 0) {
|
|
940
|
+
tc = tn->content;
|
|
941
|
+
tl = tn->content_len;
|
|
942
|
+
} else {
|
|
943
|
+
tc = leptris_text_get_content(tn);
|
|
944
|
+
tl = tc ? tn->content_len : 0;
|
|
945
|
+
}
|
|
946
|
+
for (size_t i = 0; i < tl; i++) {
|
|
947
|
+
if (tc[i] != ' ' && tc[i] != '\t' &&
|
|
948
|
+
tc[i] != '\n' && tc[i] != '\r') {
|
|
949
|
+
return 1;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
return 0;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
static int ser_frame_cd_append(SerFrame* f, const char* s) {
|
|
958
|
+
if (!f || !s) return 1;
|
|
959
|
+
size_t len = strlen(s);
|
|
960
|
+
if (len == 0) return 1;
|
|
961
|
+
if (f->cd_len + len + 1 > f->cd_cap) {
|
|
962
|
+
size_t cap = f->cd_cap ? f->cd_cap * 2 : 128;
|
|
963
|
+
while (cap < f->cd_len + len + 1) cap *= 2;
|
|
964
|
+
char* grown = (char*)realloc(f->cd_buf, cap);
|
|
965
|
+
if (!grown) return 0;
|
|
966
|
+
f->cd_buf = grown;
|
|
967
|
+
f->cd_cap = cap;
|
|
968
|
+
}
|
|
969
|
+
memcpy(f->cd_buf + f->cd_len, s, len);
|
|
970
|
+
f->cd_len += len;
|
|
971
|
+
f->cd_buf[f->cd_len] = '\0';
|
|
972
|
+
f->cd_open = 1;
|
|
973
|
+
return 1;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
static void ser_frame_cd_flush(SerializeBuffer* buf, SerFrame* f) {
|
|
977
|
+
if (!f || !f->cd_open) return;
|
|
978
|
+
buffer_append(buf, "<![CDATA[");
|
|
979
|
+
if (f->cd_buf && f->cd_len)
|
|
980
|
+
emit_cdata_body(buf, f->cd_buf, f->cd_len);
|
|
981
|
+
buffer_append(buf, "]]>");
|
|
982
|
+
f->cd_open = 0;
|
|
983
|
+
f->cd_len = 0;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
static void ser_frames_free(SerFrame* st, int sp) {
|
|
987
|
+
if (!st) return;
|
|
988
|
+
for (int i = 0; i < sp; i++) free(st[i].cd_buf);
|
|
989
|
+
free(st);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
void serialize_element_internal(LeptrisElement root_elem, SerializeBuffer* buf, int is_root) {
|
|
993
|
+
if (!root_elem || !root_elem->name) return;
|
|
994
|
+
|
|
995
|
+
/* Heap-grown frames (TODO 194e follow-up): a fixed 512-deep
|
|
996
|
+
* array needed a recursive fallback walker that duplicated the
|
|
997
|
+
* whole emission path — every serializer feature landed twice.
|
|
998
|
+
* The frames grow by doubling; the duplicate walker is gone. */
|
|
999
|
+
size_t st_cap = SER_WALK_STACK_MAX;
|
|
1000
|
+
SerFrame* st = (SerFrame*)malloc(st_cap * sizeof(SerFrame));
|
|
1001
|
+
if (!st) return;
|
|
1002
|
+
int sp = 0;
|
|
1003
|
+
|
|
1004
|
+
LeptrisNode* cur = (LeptrisNode*)root_elem;
|
|
1005
|
+
int is_root_cur = is_root;
|
|
1006
|
+
|
|
1007
|
+
int trailing_text_nl = 0;
|
|
1008
|
+
for (;;) {
|
|
1009
|
+
if (cur->type != LEPTRIS_NODE_TYPE_ELEMENT) {
|
|
1010
|
+
/* #534 companion: in pretty mode the formatter owns the
|
|
1011
|
+
* whitespace between elements of a NON-mixed parent —
|
|
1012
|
+
* the source's ws-only text nodes are dropped and
|
|
1013
|
+
* replaced by the canonical newline+indent the open and
|
|
1014
|
+
* close paths already emit. (Before, both were emitted,
|
|
1015
|
+
* doubling the blank lines on every round-trip.) Text
|
|
1016
|
+
* inside a mixed parent is verbatim content: never
|
|
1017
|
+
* dropped. HTML mode prints text verbatim (libxml2 has
|
|
1018
|
+
* no formatter-owned whitespace there). */
|
|
1019
|
+
if (buf->indent_spaces > 0 && !buf->html_method &&
|
|
1020
|
+
cur->type == LEPTRIS_NODE_TYPE_TEXT &&
|
|
1021
|
+
!((sp > 0) && st[sp - 1].mixed)) {
|
|
1022
|
+
LeptrisTextNode* wsn = (LeptrisTextNode*)cur;
|
|
1023
|
+
const char* wsc;
|
|
1024
|
+
size_t wsl;
|
|
1025
|
+
if (wsn->borrowed && wsn->content_len > 0) {
|
|
1026
|
+
wsc = wsn->content;
|
|
1027
|
+
wsl = wsn->content_len;
|
|
1028
|
+
} else {
|
|
1029
|
+
wsc = leptris_text_get_content(wsn);
|
|
1030
|
+
wsl = wsc ? wsn->content_len : 0;
|
|
1031
|
+
}
|
|
1032
|
+
int ws_only = 1;
|
|
1033
|
+
for (size_t i = 0; i < wsl; i++) {
|
|
1034
|
+
if (wsc[i] != ' ' && wsc[i] != '\t' &&
|
|
1035
|
+
wsc[i] != '\n' && wsc[i] != '\r') {
|
|
1036
|
+
ws_only = 0;
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (ws_only) goto advance; /* skip, formatter owns it */
|
|
1041
|
+
}
|
|
1042
|
+
/* #129 indent_text: non-whitespace text sits on its own
|
|
1043
|
+
* indented line (display form — not round-trip). */
|
|
1044
|
+
if (buf->indent_text && buf->indent_spaces > 0 &&
|
|
1045
|
+
cur->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
1046
|
+
LeptrisTextNode* itn = (LeptrisTextNode*)cur;
|
|
1047
|
+
const char* isc;
|
|
1048
|
+
size_t isl;
|
|
1049
|
+
if (itn->borrowed && itn->content_len > 0) {
|
|
1050
|
+
isc = itn->content; isl = itn->content_len;
|
|
1051
|
+
} else {
|
|
1052
|
+
isc = leptris_text_get_content(itn);
|
|
1053
|
+
isl = isc ? itn->content_len : 0;
|
|
1054
|
+
}
|
|
1055
|
+
int ws_only = 1;
|
|
1056
|
+
for (size_t k = 0; k < isl; k++) {
|
|
1057
|
+
char c = isc[k];
|
|
1058
|
+
if (c != ' ' && c != '\t' && c != '\n' && c != '\r') {
|
|
1059
|
+
ws_only = 0; break;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
if (!ws_only) {
|
|
1063
|
+
buffer_append_newline(buf);
|
|
1064
|
+
buffer_append_indent(buf);
|
|
1065
|
+
/* text ends the line: the next child or the close
|
|
1066
|
+
* tag indents from a fresh line. */
|
|
1067
|
+
trailing_text_nl = 1;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
/* §16.1 cdata-section-elements: text children of a
|
|
1071
|
+
* listed element join ONE CDATA run per consecutive
|
|
1072
|
+
* text span (libxslt merges the section). */
|
|
1073
|
+
int cdata_parent = sp > 0 && st[sp - 1].e &&
|
|
1074
|
+
is_cdata_element(buf, st[sp - 1].e);
|
|
1075
|
+
if ((cur->type == LEPTRIS_NODE_TYPE_TEXT &&
|
|
1076
|
+
!((LeptrisTextNode*)cur)->base.raw) ||
|
|
1077
|
+
(cur->type == LEPTRIS_NODE_TYPE_CDATA)) {
|
|
1078
|
+
if (cdata_parent) {
|
|
1079
|
+
const char* tc =
|
|
1080
|
+
(cur->type == LEPTRIS_NODE_TYPE_CDATA)
|
|
1081
|
+
? leptris_cdata_get_content(
|
|
1082
|
+
(LeptrisCDATANode*)cur)
|
|
1083
|
+
: leptris_text_get_content(
|
|
1084
|
+
(LeptrisTextNode*)cur);
|
|
1085
|
+
if (tc && !ser_frame_cd_append(&st[sp - 1], tc)) {
|
|
1086
|
+
ser_frames_free(st, sp);
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1089
|
+
goto advance;
|
|
1090
|
+
}
|
|
1091
|
+
if (sp > 0 && st[sp - 1].cd_open)
|
|
1092
|
+
ser_frame_cd_flush(buf, &st[sp - 1]);
|
|
1093
|
+
/* §16.2 rawtext parent: mixed-content text inside
|
|
1094
|
+
* script/style is verbatim under method=html. */
|
|
1095
|
+
if (buf->html_method && sp > 0 && st[sp - 1].e) {
|
|
1096
|
+
const char* rn = st[sp - 1].e->name;
|
|
1097
|
+
if (rn &&
|
|
1098
|
+
(html_elem_sem_flags(st[sp - 1].e) & HTML_F_RAW)) {
|
|
1099
|
+
const char* tr = leptris_text_get_content(
|
|
1100
|
+
(LeptrisTextNode*)cur);
|
|
1101
|
+
if (tr) buffer_append(buf, tr);
|
|
1102
|
+
goto advance;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
serialize_node_internal(cur, buf);
|
|
1106
|
+
if (trailing_text_nl) {
|
|
1107
|
+
buffer_append_newline(buf);
|
|
1108
|
+
trailing_text_nl = 0;
|
|
1109
|
+
}
|
|
1110
|
+
goto advance;
|
|
1111
|
+
}
|
|
1112
|
+
if (sp > 0 && st[sp - 1].cd_open)
|
|
1113
|
+
ser_frame_cd_flush(buf, &st[sp - 1]);
|
|
1114
|
+
/* libxml2 xmlIndentTreeOutput (issue #633): comments and
|
|
1115
|
+
* PIs under a NON-mixed parent get their own indented
|
|
1116
|
+
* line, like element siblings. Mixed-content parents
|
|
1117
|
+
* keep them inline — a PI between text must not move. */
|
|
1118
|
+
if (buf->indent_spaces > 0 && sp > 0 && !st[sp - 1].mixed &&
|
|
1119
|
+
!buf->html_method &&
|
|
1120
|
+
(cur->type == LEPTRIS_NODE_TYPE_COMMENT ||
|
|
1121
|
+
cur->type == LEPTRIS_NODE_TYPE_PI)) {
|
|
1122
|
+
buffer_append_indent(buf);
|
|
1123
|
+
serialize_node_internal(cur, buf);
|
|
1124
|
+
buffer_append_newline(buf);
|
|
1125
|
+
goto advance;
|
|
1126
|
+
}
|
|
1127
|
+
serialize_node_internal(cur, buf);
|
|
1128
|
+
goto advance;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
LeptrisElement e = (LeptrisElement)cur;
|
|
1132
|
+
/* #534: children of a mixed-content parent emit inline. */
|
|
1133
|
+
int parent_mixed = (sp > 0) && st[sp - 1].mixed;
|
|
1134
|
+
const char* name = e->name;
|
|
1135
|
+
size_t nl = (e->name_len != 0xFF) ? (size_t)e->name_len
|
|
1136
|
+
: strlen(name);
|
|
1137
|
+
const char* epfx = leptris_element_get_prefix(e);
|
|
1138
|
+
size_t epl = (epfx && epfx[0]) ? strlen(epfx) + 1 : 0;
|
|
1139
|
+
|
|
1140
|
+
/* libxml2 addmeta: a head directly under the root html
|
|
1141
|
+
* element injects the Content-Type meta at serialization
|
|
1142
|
+
* time (case-sensitive head/html names, xmlStrEqual). */
|
|
1143
|
+
int addmeta = 0;
|
|
1144
|
+
if (buf->xhtml && sp == 1 && st[0].e &&
|
|
1145
|
+
nl == 4 && memcmp(name, "head", 4) == 0) {
|
|
1146
|
+
const char* rn = st[0].e->name;
|
|
1147
|
+
size_t rnl = (st[0].e->name_len != 0xFF)
|
|
1148
|
+
? (size_t)st[0].e->name_len
|
|
1149
|
+
: (rn ? strlen(rn) : 0);
|
|
1150
|
+
if (rn && rnl == 4 && memcmp(rn, "html", 4) == 0)
|
|
1151
|
+
addmeta = xhtml_head_wants_meta(e);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/* --- total-fusion fast path (TODO 194f): a compact-mode leaf
|
|
1155
|
+
* element with no attributes and no namespaces emits its ENTIRE
|
|
1156
|
+
* `<name>text</name>` from one reservation — the dominant shape
|
|
1157
|
+
* in text-heavy documents paid two reservations + finalize.
|
|
1158
|
+
* RAW parents (html script/style) escape the fusion: their
|
|
1159
|
+
* text is verbatim. */
|
|
1160
|
+
if (buf->indent_text == 0 && !addmeta &&
|
|
1161
|
+
leptris_element_get_first_attribute(e) == NULL &&
|
|
1162
|
+
leptris_elem_namespaces(e) == NULL &&
|
|
1163
|
+
!(buf->html_method &&
|
|
1164
|
+
(html_elem_sem_flags(e) & HTML_F_RAW))) {
|
|
1165
|
+
LeptrisNode* fc0 = leptris_node_first_child_internal((LeptrisNode*)e);
|
|
1166
|
+
if (fc0 && fc0->type == LEPTRIS_NODE_TYPE_TEXT &&
|
|
1167
|
+
leptris_node_get_next_sibling(fc0) == NULL) {
|
|
1168
|
+
/* §16.1 cdata-section-elements wins over the fused
|
|
1169
|
+
* escaped emission. */
|
|
1170
|
+
if (buf->cdata_count && !((LeptrisTextNode*)fc0)->base.raw &&
|
|
1171
|
+
is_cdata_element(buf, e)) {
|
|
1172
|
+
const char* tcd =
|
|
1173
|
+
leptris_text_get_content((LeptrisTextNode*)fc0);
|
|
1174
|
+
buffer_append_char(buf, '<');
|
|
1175
|
+
append_qualified_name(
|
|
1176
|
+
buf, leptris_element_get_prefix(e), name, nl);
|
|
1177
|
+
buffer_append_char(buf, '>');
|
|
1178
|
+
if (tcd)
|
|
1179
|
+
emit_cdata_checked(buf, tcd);
|
|
1180
|
+
buffer_append(buf, "</");
|
|
1181
|
+
append_qualified_name(
|
|
1182
|
+
buf, leptris_element_get_prefix(e),
|
|
1183
|
+
name, nl);
|
|
1184
|
+
buffer_append_char(buf, '>');
|
|
1185
|
+
goto advance;
|
|
1186
|
+
}
|
|
1187
|
+
LeptrisTextNode* tn0 = (LeptrisTextNode*)fc0;
|
|
1188
|
+
/* View-direct (round 18): for entity-free borrowed
|
|
1189
|
+
* text, read the view directly — get_content would
|
|
1190
|
+
* materialize a pool copy (alloc + memcpy) just to
|
|
1191
|
+
* NUL-terminate, which the escaper doesn't need
|
|
1192
|
+
* (it's length-bounded). Entity-bearing text still
|
|
1193
|
+
* materializes for correct expansion. */
|
|
1194
|
+
const char* tc0;
|
|
1195
|
+
size_t tl0;
|
|
1196
|
+
if (tn0->borrowed && tn0->content_len > 0 &&
|
|
1197
|
+
!memchr(tn0->content, '&', tn0->content_len)) {
|
|
1198
|
+
tc0 = tn0->content;
|
|
1199
|
+
tl0 = tn0->content_len;
|
|
1200
|
+
} else {
|
|
1201
|
+
tc0 = leptris_text_get_content(tn0);
|
|
1202
|
+
tl0 = tc0 ? tn0->content_len : 0;
|
|
1203
|
+
}
|
|
1204
|
+
/* Pretty mode fuses newline + indent + open + text +
|
|
1205
|
+
* close into the same single reservation — leaves
|
|
1206
|
+
* otherwise pay ~8 capacity-checked appends each
|
|
1207
|
+
* (the raw-only guard was why pretty trailed). */
|
|
1208
|
+
int pretty0 = buf->indent_spaces > 0 &&
|
|
1209
|
+
!buf->html_method && !parent_mixed;
|
|
1210
|
+
/* HTML mode: zero lead ever; trail follows the
|
|
1211
|
+
* after-close break rule (mixed is not a gate). */
|
|
1212
|
+
int htrail0 = buf->html_method && !is_root_cur &&
|
|
1213
|
+
html_break_after_elem(
|
|
1214
|
+
e, name, nl, html_elem_sem_flags(e));
|
|
1215
|
+
/* #658: honor the indent unit here too — computing
|
|
1216
|
+
* indent*indent_spaces directly lost the unit on
|
|
1217
|
+
* every fused leaf (buffer_append_indent's #633
|
|
1218
|
+
* branch never ran). */
|
|
1219
|
+
const char* iunit =
|
|
1220
|
+
(buf->indent_unit && buf->indent_unit[0])
|
|
1221
|
+
? buf->indent_unit : NULL;
|
|
1222
|
+
size_t iul = iunit ? strlen(iunit) : 0;
|
|
1223
|
+
int ilevels = (!is_root_cur && pretty0)
|
|
1224
|
+
? buf->indent : 0;
|
|
1225
|
+
int lead = ilevels
|
|
1226
|
+
? (iunit ? (int)(ilevels * iul)
|
|
1227
|
+
: buf->indent * buf->indent_spaces)
|
|
1228
|
+
: 0;
|
|
1229
|
+
int trail = htrail0 ||
|
|
1230
|
+
(pretty0 && !is_root_cur);
|
|
1231
|
+
buffer_ensure_capacity(
|
|
1232
|
+
buf, (size_t)(lead + trail) + 2 * (epl + nl) + 6 * tl0 + 6);
|
|
1233
|
+
char* q = buf->data + buf->size;
|
|
1234
|
+
if (lead) {
|
|
1235
|
+
if (iunit) {
|
|
1236
|
+
for (int i = 0; i < ilevels; i++) {
|
|
1237
|
+
memcpy(q, iunit, iul);
|
|
1238
|
+
q += iul;
|
|
1239
|
+
}
|
|
1240
|
+
} else {
|
|
1241
|
+
memset(q, ' ', (size_t)lead);
|
|
1242
|
+
q += lead;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
*q++ = '<';
|
|
1246
|
+
if (epl) {
|
|
1247
|
+
memcpy(q, epfx, epl - 1); q += epl - 1;
|
|
1248
|
+
*q++ = ':';
|
|
1249
|
+
}
|
|
1250
|
+
memcpy(q, name, nl); q += nl;
|
|
1251
|
+
*q++ = '>';
|
|
1252
|
+
if (tc0 && tl0) q = emit_escaped_inline(q, tc0, tl0, 0);
|
|
1253
|
+
*q++ = '<'; *q++ = '/';
|
|
1254
|
+
if (epl) {
|
|
1255
|
+
memcpy(q, epfx, epl - 1); q += epl - 1;
|
|
1256
|
+
*q++ = ':';
|
|
1257
|
+
}
|
|
1258
|
+
memcpy(q, name, nl); q += nl;
|
|
1259
|
+
*q++ = '>';
|
|
1260
|
+
if (trail) *q++ = '\n';
|
|
1261
|
+
buf->size = (size_t)(q - buf->data);
|
|
1262
|
+
buf->data[buf->size] = '\0';
|
|
1263
|
+
goto advance;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/* --- open tag (batched, as before) --- */
|
|
1268
|
+
if (!is_root_cur && buf->indent_spaces > 0 && !parent_mixed)
|
|
1269
|
+
buffer_append_indent(buf);
|
|
1270
|
+
buffer_ensure_capacity(buf, 1 + epl + nl + 1);
|
|
1271
|
+
char* ot = buf->data + buf->size;
|
|
1272
|
+
*ot++ = '<';
|
|
1273
|
+
if (epl) {
|
|
1274
|
+
memcpy(ot, epfx, epl - 1);
|
|
1275
|
+
ot += epl - 1;
|
|
1276
|
+
*ot++ = ':';
|
|
1277
|
+
}
|
|
1278
|
+
memcpy(ot, name, nl);
|
|
1279
|
+
ot += nl;
|
|
1280
|
+
buf->size = (size_t)(ot - buf->data);
|
|
1281
|
+
buf->data[buf->size] = '\0';
|
|
1282
|
+
|
|
1283
|
+
/* --- namespace declarations in CHAIN order (libxml2
|
|
1284
|
+
* serializes the nsDef list verbatim; parse appends in
|
|
1285
|
+
* source order — bug-104 keeps the source's declaration
|
|
1286
|
+
* order, default namespace included). */
|
|
1287
|
+
{
|
|
1288
|
+
for (struct leptris_namespace* ns = leptris_elem_namespaces(e); ns; ns = ns->next) {
|
|
1289
|
+
const char* prefix = ns->prefix ? ns->prefix : "";
|
|
1290
|
+
size_t pnl = ns->prefix ? strlen(ns->prefix) : 0;
|
|
1291
|
+
const char* uri = ns->uri ? ns->uri : "";
|
|
1292
|
+
size_t ul = ns->uri ? strlen(ns->uri) : 0;
|
|
1293
|
+
buffer_ensure_capacity(buf, 7 + pnl + 2 + 6 * ul + 2);
|
|
1294
|
+
char* nw = buf->data + buf->size;
|
|
1295
|
+
*nw++ = ' ';
|
|
1296
|
+
memcpy(nw, "xmlns", 5);
|
|
1297
|
+
nw += 5;
|
|
1298
|
+
if (pnl) { *nw++ = ':'; memcpy(nw, prefix, pnl); nw += pnl; }
|
|
1299
|
+
*nw++ = '=';
|
|
1300
|
+
*nw++ = '"';
|
|
1301
|
+
for (size_t i = 0; i < ul; i++) {
|
|
1302
|
+
switch (uri[i]) {
|
|
1303
|
+
case '<': memcpy(nw, "<", 4); nw += 4; break;
|
|
1304
|
+
case '>': memcpy(nw, ">", 4); nw += 4; break;
|
|
1305
|
+
case '&': memcpy(nw, "&", 5); nw += 5; break;
|
|
1306
|
+
case '"': memcpy(nw, """, 6); nw += 6; break;
|
|
1307
|
+
case '\'': *nw++ = '\''; break; /* raw (libxml2) */
|
|
1308
|
+
default: *nw++ = uri[i]; break;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
*nw++ = '"';
|
|
1312
|
+
buf->size = (size_t)(nw - buf->data);
|
|
1313
|
+
buf->data[buf->size] = '\0';
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/* libxml2 xmlsave: an element in NO namespace whose nearest
|
|
1318
|
+
* default-ns DECLARATION on the ancestor chain binds non-empty
|
|
1319
|
+
* must reset it with xmlns="" or the element would inherit
|
|
1320
|
+
* that namespace (bug-130's imported-module <div> under a
|
|
1321
|
+
* default-namespaced <html>). Parsed documents resolve
|
|
1322
|
+
* inherited namespaces onto the element, so only
|
|
1323
|
+
* namespace-less result elements reach this. */
|
|
1324
|
+
if (!epl) {
|
|
1325
|
+
const char* ens = leptris_element_get_namespace_uri(e);
|
|
1326
|
+
if (!ens || !ens[0]) {
|
|
1327
|
+
int own_default = 0;
|
|
1328
|
+
for (struct leptris_namespace* ns = leptris_elem_namespaces(e);
|
|
1329
|
+
ns; ns = ns->next)
|
|
1330
|
+
if (!ns->prefix || !ns->prefix[0]) { own_default = 1; break; }
|
|
1331
|
+
if (!own_default) {
|
|
1332
|
+
int reset_needed = 0;
|
|
1333
|
+
for (int f = (int)sp - 1; f >= 0; f--) {
|
|
1334
|
+
LeptrisElement ae = st[f].e;
|
|
1335
|
+
if (!ae) continue;
|
|
1336
|
+
int decided = 0;
|
|
1337
|
+
for (struct leptris_namespace* ns =
|
|
1338
|
+
leptris_elem_namespaces(ae);
|
|
1339
|
+
ns; ns = ns->next) {
|
|
1340
|
+
if (!ns->prefix || !ns->prefix[0]) {
|
|
1341
|
+
reset_needed = ns->uri && ns->uri[0];
|
|
1342
|
+
decided = 1;
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
if (decided) break;
|
|
1347
|
+
}
|
|
1348
|
+
if (reset_needed)
|
|
1349
|
+
buffer_append(buf, " xmlns=\"\"");
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
/* libxml2 3.1.1: an <html> in no namespace with no local ns
|
|
1355
|
+
* declarations gets the XHTML namespace injected. */
|
|
1356
|
+
if (buf->xhtml && !epl && leptris_elem_namespaces(e) == NULL &&
|
|
1357
|
+
leptris_element_get_namespace_uri(e) == NULL &&
|
|
1358
|
+
nl == 4 && memcmp(name, "html", 4) == 0)
|
|
1359
|
+
buffer_append(buf, " xmlns=\"" LEPTRIS_XHTML_NS "\"");
|
|
1360
|
+
|
|
1361
|
+
/* --- namespaces (identical emission) --- */
|
|
1362
|
+
for (struct leptris_attribute* attr = leptris_element_get_first_attribute(e); attr; attr = leptris_attr_next(attr)) {
|
|
1363
|
+
const char* val;
|
|
1364
|
+
if (attr_has_entities(attr)) {
|
|
1365
|
+
struct leptris_document* d = leptris_element_get_document(e);
|
|
1366
|
+
LeptrisMemoryPool* pool = d ? d->pool : NULL;
|
|
1367
|
+
LeptrisStringView av = leptris_attr_value_sv(attr);
|
|
1368
|
+
char* resolved = pool
|
|
1369
|
+
? leptris_decode_entities_view(&av, pool) : NULL;
|
|
1370
|
+
if (resolved) {
|
|
1371
|
+
leptris_attr_value_set_heap(attr, leptris_sv_from_cstr(resolved));
|
|
1372
|
+
attr_set_entities(attr, 0);
|
|
1373
|
+
}
|
|
1374
|
+
val = attr_cvalue(attr);
|
|
1375
|
+
} else {
|
|
1376
|
+
val = attr_cvalue(attr);
|
|
1377
|
+
}
|
|
1378
|
+
const char* name_c = attr_cname(attr);
|
|
1379
|
+
size_t anl = attr->name_view.length;
|
|
1380
|
+
const char* apfx = attr_get_prefix(attr);
|
|
1381
|
+
size_t apl = (apfx && apfx[0]) ? strlen(apfx) + 1 : 0;
|
|
1382
|
+
/* Issue #542: name_view carries the QUALIFIED name —
|
|
1383
|
+
* when the prefix is emitted separately, skip its bytes
|
|
1384
|
+
* so the prefix is not doubled (ns:ns:attr). */
|
|
1385
|
+
if (apl && anl > apl &&
|
|
1386
|
+
memcmp(name_c, apfx, apl - 1) == 0 && name_c[apl - 1] == ':') {
|
|
1387
|
+
name_c += apl;
|
|
1388
|
+
anl -= apl;
|
|
1389
|
+
}
|
|
1390
|
+
/* View length is authoritative (entity resolution
|
|
1391
|
+
* replaces the view) — same as the recursive path. */
|
|
1392
|
+
size_t vlen = leptris_attr_value_sv(attr).length;
|
|
1393
|
+
/* §16.2 html: href/src values percent-encode as URIs
|
|
1394
|
+
* (libxml2 htmlAttrDumpOutput, bug-83); apostrophes
|
|
1395
|
+
* stay raw (the XML serializer's ' is HTML-wrong). */
|
|
1396
|
+
int html_uri_attr = 0;
|
|
1397
|
+
if (buf->html_method && anl &&
|
|
1398
|
+
((anl == 4 && memcmp(name_c, "href", 4) == 0) ||
|
|
1399
|
+
(anl == 3 && memcmp(name_c, "src", 3) == 0) ||
|
|
1400
|
+
/* libxml2 also URI-encodes name attributes (the
|
|
1401
|
+
* .out for bug-159: name="%D1%91"). */
|
|
1402
|
+
(anl == 4 && memcmp(name_c, "name", 4) == 0)))
|
|
1403
|
+
html_uri_attr = 1;
|
|
1404
|
+
if (html_uri_attr) {
|
|
1405
|
+
buffer_ensure_capacity(
|
|
1406
|
+
buf, 1 + apl + anl + 2 + 3 * vlen + 2 + 1);
|
|
1407
|
+
char* out = buf->data + buf->size;
|
|
1408
|
+
*out++ = ' ';
|
|
1409
|
+
if (apl) {
|
|
1410
|
+
memcpy(out, apfx, apl - 1);
|
|
1411
|
+
out += apl - 1;
|
|
1412
|
+
*out++ = ':';
|
|
1413
|
+
}
|
|
1414
|
+
memcpy(out, name_c, anl);
|
|
1415
|
+
out += anl;
|
|
1416
|
+
*out++ = '=';
|
|
1417
|
+
*out++ = '"';
|
|
1418
|
+
for (size_t i = 0; i < vlen; i++) {
|
|
1419
|
+
unsigned char uc = (unsigned char)val[i];
|
|
1420
|
+
if (uc <= 0x20 || uc >= 0x7f) {
|
|
1421
|
+
/* UTF-8 bytes ≥ 0x80 and ASCII controls/spaces
|
|
1422
|
+
* percent-encode; keep XML-unsafe chars escaped
|
|
1423
|
+
* below for safety. */
|
|
1424
|
+
if (uc == '<' || uc == '>' || uc == '"' ||
|
|
1425
|
+
uc == '&' || uc == '\'') {
|
|
1426
|
+
/* fall into entity handling */
|
|
1427
|
+
} else {
|
|
1428
|
+
out += sprintf(out, "%%%02X", uc);
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
switch (val[i]) {
|
|
1433
|
+
case '<': memcpy(out, "<", 4); out += 4; break;
|
|
1434
|
+
case '>': memcpy(out, ">", 4); out += 4; break;
|
|
1435
|
+
case '&': memcpy(out, "&", 5); out += 5; break;
|
|
1436
|
+
case '"': memcpy(out, """, 6); out += 6; break;
|
|
1437
|
+
case '\'': *out++ = '\''; break;
|
|
1438
|
+
default: *out++ = val[i]; break;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
*out++ = '"';
|
|
1442
|
+
buf->size = (size_t)(out - buf->data);
|
|
1443
|
+
buf->data[buf->size] = '\0';
|
|
1444
|
+
continue;
|
|
1445
|
+
}
|
|
1446
|
+
buffer_ensure_capacity(buf, 1 + apl + anl + 2 + 6 * vlen + 2 + 1);
|
|
1447
|
+
char* out = buf->data + buf->size;
|
|
1448
|
+
*out++ = ' ';
|
|
1449
|
+
if (apl) {
|
|
1450
|
+
memcpy(out, apfx, apl - 1);
|
|
1451
|
+
out += apl - 1;
|
|
1452
|
+
*out++ = ':';
|
|
1453
|
+
}
|
|
1454
|
+
memcpy(out, name_c, anl);
|
|
1455
|
+
out += anl;
|
|
1456
|
+
*out++ = '=';
|
|
1457
|
+
*out++ = '"';
|
|
1458
|
+
for (size_t i = 0; i < vlen; i++) {
|
|
1459
|
+
switch (val[i]) {
|
|
1460
|
+
case '<': memcpy(out, "<", 4); out += 4; break;
|
|
1461
|
+
case '>': memcpy(out, ">", 4); out += 4; break;
|
|
1462
|
+
case '&': memcpy(out, "&", 5); out += 5; break;
|
|
1463
|
+
case '"': memcpy(out, """, 6); out += 6; break;
|
|
1464
|
+
case '\'':
|
|
1465
|
+
/* Apostrophes stay raw in double-quoted
|
|
1466
|
+
* attribute values (libxml2, bug-86). */
|
|
1467
|
+
*out++ = '\''; break;
|
|
1468
|
+
case '\t':
|
|
1469
|
+
case '\n':
|
|
1470
|
+
/* libxml2's HTML serializer leaves tabs and
|
|
1471
|
+
* newlines RAW in attribute values (bug-5-:
|
|
1472
|
+
* <tr class="\nPROD\n">). XML keeps the
|
|
1473
|
+
* char-ref escapes for round-trip fidelity. */
|
|
1474
|
+
if (buf->html_method) { *out++ = val[i]; break; }
|
|
1475
|
+
out += sprintf(out, val[i] == '\t' ? "	" : " ");
|
|
1476
|
+
break;
|
|
1477
|
+
case '\r': out += sprintf(out, " "); break;
|
|
1478
|
+
default: *out++ = val[i]; break;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
*out++ = '"';
|
|
1482
|
+
buf->size = (size_t)(out - buf->data);
|
|
1483
|
+
buf->data[buf->size] = '\0';
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/* --- children --- */
|
|
1487
|
+
LeptrisNode* fc = leptris_node_first_child_internal((LeptrisNode*)e);
|
|
1488
|
+
if (!fc) {
|
|
1489
|
+
/* §16.2 html method: void elements end at '>'; every
|
|
1490
|
+
* other element closes explicitly (never `<x/>`). */
|
|
1491
|
+
if (buf->xhtml) {
|
|
1492
|
+
if (addmeta) {
|
|
1493
|
+
buffer_append_char(buf, '>');
|
|
1494
|
+
if (buf->indent_spaces > 0) {
|
|
1495
|
+
buffer_append_newline(buf);
|
|
1496
|
+
buf->indent++;
|
|
1497
|
+
buffer_append_indent(buf);
|
|
1498
|
+
buf->indent--;
|
|
1499
|
+
}
|
|
1500
|
+
emit_xhtml_meta(buf);
|
|
1501
|
+
if (buf->indent_spaces > 0)
|
|
1502
|
+
buffer_append_newline(buf);
|
|
1503
|
+
buffer_append(buf, "</");
|
|
1504
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1505
|
+
buffer_append_char(buf, '>');
|
|
1506
|
+
} else if (!epl && xhtml_is_empty_elem(e, name, nl)) {
|
|
1507
|
+
buffer_append(buf, " />");
|
|
1508
|
+
} else {
|
|
1509
|
+
buffer_append(buf, "></");
|
|
1510
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1511
|
+
buffer_append_char(buf, '>');
|
|
1512
|
+
}
|
|
1513
|
+
if (!is_root_cur && buf->indent_spaces > 0 &&
|
|
1514
|
+
!parent_mixed)
|
|
1515
|
+
buffer_append_newline(buf);
|
|
1516
|
+
goto advance;
|
|
1517
|
+
}
|
|
1518
|
+
if (buf->html_method) {
|
|
1519
|
+
int hf = html_elem_sem_flags(e);
|
|
1520
|
+
if (hf & HTML_F_EMPTY) {
|
|
1521
|
+
buffer_append(buf, ">");
|
|
1522
|
+
} else {
|
|
1523
|
+
buffer_append(buf, "></");
|
|
1524
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1525
|
+
buffer_append_char(buf, '>');
|
|
1526
|
+
}
|
|
1527
|
+
} else if (buf->expand_empty) {
|
|
1528
|
+
buffer_append(buf, "></");
|
|
1529
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1530
|
+
buffer_append_char(buf, '>');
|
|
1531
|
+
} else {
|
|
1532
|
+
buffer_append(buf, "/>");
|
|
1533
|
+
}
|
|
1534
|
+
if (!is_root_cur && buf->indent_spaces > 0 &&
|
|
1535
|
+
(buf->html_method
|
|
1536
|
+
? html_break_after_elem(e, name, nl,
|
|
1537
|
+
html_elem_sem_flags(e))
|
|
1538
|
+
: !parent_mixed))
|
|
1539
|
+
buffer_append_newline(buf);
|
|
1540
|
+
goto advance;
|
|
1541
|
+
}
|
|
1542
|
+
if (buf->indent_text == 0 && !addmeta &&
|
|
1543
|
+
fc->type == LEPTRIS_NODE_TYPE_TEXT &&
|
|
1544
|
+
leptris_node_get_next_sibling(fc) == NULL) {
|
|
1545
|
+
/* text-only element */
|
|
1546
|
+
if (is_cdata_element(buf, e) &&
|
|
1547
|
+
!((LeptrisTextNode*)fc)->base.raw) {
|
|
1548
|
+
buffer_append_char(buf, '>');
|
|
1549
|
+
const char* tcd = leptris_text_get_content(
|
|
1550
|
+
(LeptrisTextNode*)fc);
|
|
1551
|
+
if (tcd)
|
|
1552
|
+
emit_cdata_checked(buf, tcd);
|
|
1553
|
+
buffer_append(buf, "</");
|
|
1554
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1555
|
+
buffer_append_char(buf, '>');
|
|
1556
|
+
goto advance;
|
|
1557
|
+
}
|
|
1558
|
+
/* §16.2 rawtext elements (script/style/…): the single
|
|
1559
|
+
* text child is VERBATIM under method=html. */
|
|
1560
|
+
if (buf->html_method &&
|
|
1561
|
+
(html_elem_sem_flags(e) & HTML_F_RAW)) {
|
|
1562
|
+
const char* tr = leptris_text_get_content(
|
|
1563
|
+
(LeptrisTextNode*)fc);
|
|
1564
|
+
buffer_append_char(buf, '>');
|
|
1565
|
+
if (tr) buffer_append(buf, tr);
|
|
1566
|
+
buffer_append(buf, "</");
|
|
1567
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1568
|
+
buffer_append_char(buf, '>');
|
|
1569
|
+
goto advance;
|
|
1570
|
+
}
|
|
1571
|
+
if (buf->indent_spaces == 0) {
|
|
1572
|
+
LeptrisTextNode* tn = (LeptrisTextNode*)fc;
|
|
1573
|
+
const char* tc;
|
|
1574
|
+
size_t tlen;
|
|
1575
|
+
if (tn->borrowed && tn->content_len > 0 &&
|
|
1576
|
+
!memchr(tn->content, '&', tn->content_len)) {
|
|
1577
|
+
tc = tn->content;
|
|
1578
|
+
tlen = tn->content_len;
|
|
1579
|
+
} else {
|
|
1580
|
+
tc = leptris_text_get_content(tn);
|
|
1581
|
+
tlen = tc ? tn->content_len : 0;
|
|
1582
|
+
}
|
|
1583
|
+
buffer_ensure_capacity(buf, 2 + epl + nl + 6 * tlen + 2 + 1);
|
|
1584
|
+
char* te = buf->data + buf->size;
|
|
1585
|
+
*te++ = '>';
|
|
1586
|
+
if (tc && tlen) te = emit_escaped_inline(te, tc, tlen, 0);
|
|
1587
|
+
*te++ = '<'; *te++ = '/';
|
|
1588
|
+
if (epl) {
|
|
1589
|
+
memcpy(te, epfx, epl - 1); te += epl - 1;
|
|
1590
|
+
*te++ = ':';
|
|
1591
|
+
}
|
|
1592
|
+
memcpy(te, name, nl); te += nl;
|
|
1593
|
+
*te++ = '>';
|
|
1594
|
+
buf->size = (size_t)(te - buf->data);
|
|
1595
|
+
buf->data[buf->size] = '\0';
|
|
1596
|
+
} else {
|
|
1597
|
+
buffer_append_char(buf, '>');
|
|
1598
|
+
if (is_cdata_element(buf, e) &&
|
|
1599
|
+
(fc->type == LEPTRIS_NODE_TYPE_TEXT ||
|
|
1600
|
+
fc->type == LEPTRIS_NODE_TYPE_CDATA) &&
|
|
1601
|
+
!((LeptrisTextNode*)fc)->base.raw) {
|
|
1602
|
+
const char* tc2 =
|
|
1603
|
+
leptris_text_get_content((LeptrisTextNode*)fc);
|
|
1604
|
+
if (tc2)
|
|
1605
|
+
emit_cdata_checked(buf, tc2);
|
|
1606
|
+
} else {
|
|
1607
|
+
serialize_node_internal(fc, buf);
|
|
1608
|
+
}
|
|
1609
|
+
buffer_append(buf, "</");
|
|
1610
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1611
|
+
buffer_append_char(buf, '>');
|
|
1612
|
+
if (buf->html_method) {
|
|
1613
|
+
if (html_break_after_elem(e, name, nl,
|
|
1614
|
+
html_elem_sem_flags(e)))
|
|
1615
|
+
buffer_append_newline(buf);
|
|
1616
|
+
} else if (!is_root_cur && !parent_mixed) {
|
|
1617
|
+
/* is_root guard (#633): the document's last line
|
|
1618
|
+
* carries no trailing newline — the fusion path
|
|
1619
|
+
* already had the guard; this open-tag path (any
|
|
1620
|
+
* element with attributes) did not. */
|
|
1621
|
+
buffer_append_newline(buf);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
goto advance;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/* complex children: descend — grow the frame stack at the
|
|
1628
|
+
* cap instead of switching walkers (unbounded depth is safe;
|
|
1629
|
+
* malloc failure truncates rather than recursing). */
|
|
1630
|
+
if ((size_t)sp == st_cap) {
|
|
1631
|
+
size_t nc = st_cap * 2;
|
|
1632
|
+
SerFrame* grown = (SerFrame*)realloc(st, nc * sizeof(SerFrame));
|
|
1633
|
+
if (!grown) {
|
|
1634
|
+
buffer_append_char(buf, '>');
|
|
1635
|
+
buffer_append(buf, "</");
|
|
1636
|
+
append_qualified_name(buf, epfx, name, nl);
|
|
1637
|
+
buffer_append_char(buf, '>');
|
|
1638
|
+
ser_frames_free(st, sp);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
st = grown;
|
|
1642
|
+
st_cap = nc;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
/* An element child interrupts any CDATA run of this parent. */
|
|
1646
|
+
if (sp > 0 && st[sp - 1].cd_open)
|
|
1647
|
+
ser_frame_cd_flush(buf, &st[sp - 1]);
|
|
1648
|
+
buffer_append_char(buf, '>');
|
|
1649
|
+
int mixed = 0;
|
|
1650
|
+
int close_brk = 0;
|
|
1651
|
+
if (buf->html_method) {
|
|
1652
|
+
/* §16.2: mixed is not a gate — the site rules own the
|
|
1653
|
+
* newlines. mixed=1 keeps ws-only text verbatim. */
|
|
1654
|
+
mixed = 1;
|
|
1655
|
+
int hf = html_elem_sem_flags(e);
|
|
1656
|
+
if (html_break_before_children(e, name, nl, hf))
|
|
1657
|
+
buffer_append_newline(buf);
|
|
1658
|
+
close_brk = html_break_before_close(e, name, nl, hf);
|
|
1659
|
+
} else {
|
|
1660
|
+
/* #129 indent_text: the formatter owns ALL whitespace —
|
|
1661
|
+
* no element is "mixed" for layout purposes. */
|
|
1662
|
+
if (buf->indent_spaces > 0 && !buf->indent_text)
|
|
1663
|
+
mixed = buf->ws_mixed
|
|
1664
|
+
? ser_children_have_any_text(fc)
|
|
1665
|
+
: ser_children_have_text(fc);
|
|
1666
|
+
/* libxslt: once an element is mixed, formatting stops
|
|
1667
|
+
* for the whole subtree below it (bug-98) — mixed
|
|
1668
|
+
* inherits down the frame stack. */
|
|
1669
|
+
if (!mixed && sp > 0 && st[sp - 1].mixed) mixed = 1;
|
|
1670
|
+
if (buf->indent_spaces > 0 && !mixed)
|
|
1671
|
+
buffer_append_newline(buf);
|
|
1672
|
+
}
|
|
1673
|
+
if (addmeta) {
|
|
1674
|
+
/* libxml2: the meta leads head's children — indented on
|
|
1675
|
+
* its own line when formatting, inline when not. */
|
|
1676
|
+
if (buf->indent_spaces > 0 && !mixed) {
|
|
1677
|
+
buf->indent++;
|
|
1678
|
+
buffer_append_indent(buf);
|
|
1679
|
+
buf->indent--;
|
|
1680
|
+
emit_xhtml_meta(buf);
|
|
1681
|
+
buffer_append_newline(buf);
|
|
1682
|
+
} else {
|
|
1683
|
+
emit_xhtml_meta(buf);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
st[sp].e = e;
|
|
1687
|
+
st[sp].nl = nl;
|
|
1688
|
+
st[sp].mixed = mixed;
|
|
1689
|
+
st[sp].cd_open = 0;
|
|
1690
|
+
st[sp].cd_buf = NULL;
|
|
1691
|
+
st[sp].cd_len = 0;
|
|
1692
|
+
st[sp].cd_cap = 0;
|
|
1693
|
+
st[sp].close_brk = close_brk;
|
|
1694
|
+
sp++;
|
|
1695
|
+
buf->indent++;
|
|
1696
|
+
cur = fc;
|
|
1697
|
+
is_root_cur = 0;
|
|
1698
|
+
continue;
|
|
1699
|
+
|
|
1700
|
+
advance:
|
|
1701
|
+
/* The walk's root completed (any completion path — close-tag,
|
|
1702
|
+
* leaf fast path, text-only, self-closing). Emit exactly the
|
|
1703
|
+
* caller's subtree: do NOT continue to the root's siblings
|
|
1704
|
+
* (issue #523 — the leak made element serialization both
|
|
1705
|
+
* wrong and O(document)). */
|
|
1706
|
+
if (sp == 0 && (LeptrisNode*)cur == (LeptrisNode*)root_elem) {
|
|
1707
|
+
free(st);
|
|
1708
|
+
return;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
/* next sibling, else ascend closing frames */
|
|
1712
|
+
for (;;) {
|
|
1713
|
+
LeptrisNode* nsib = leptris_node_get_next_sibling(cur);
|
|
1714
|
+
if (nsib) {
|
|
1715
|
+
cur = nsib;
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
if (sp == 0) { free(st); return; } /* root fully emitted */
|
|
1719
|
+
sp--;
|
|
1720
|
+
buf->indent--;
|
|
1721
|
+
LeptrisElement pe = st[sp].e;
|
|
1722
|
+
if (st[sp].cd_open) /* close this element's CDATA run */
|
|
1723
|
+
ser_frame_cd_flush(buf, &st[sp]);
|
|
1724
|
+
free(st[sp].cd_buf);
|
|
1725
|
+
st[sp].cd_buf = NULL;
|
|
1726
|
+
const char* pn = pe->name;
|
|
1727
|
+
size_t pnl2 = st[sp].nl;
|
|
1728
|
+
const char* pfx2 = leptris_element_get_prefix(pe);
|
|
1729
|
+
/* #534: no indent inside a mixed-content element. HTML
|
|
1730
|
+
* mode: site-3 newline before the close tag, no spaces. */
|
|
1731
|
+
if (buf->html_method) {
|
|
1732
|
+
if (st[sp].close_brk) buffer_append_newline(buf);
|
|
1733
|
+
} else if (buf->indent_spaces > 0 && !st[sp].mixed) {
|
|
1734
|
+
buffer_append_indent(buf);
|
|
1735
|
+
}
|
|
1736
|
+
buffer_append(buf, "</");
|
|
1737
|
+
append_qualified_name(buf, pfx2, pn, pnl2);
|
|
1738
|
+
buffer_append_char(buf, '>');
|
|
1739
|
+
if (buf->indent_spaces > 0 &&
|
|
1740
|
+
!(sp == 0 && (LeptrisNode*)pe == (LeptrisNode*)root_elem && is_root)) {
|
|
1741
|
+
if (buf->html_method) {
|
|
1742
|
+
if (html_break_after_elem(
|
|
1743
|
+
pe, pn, pnl2, html_elem_sem_flags(pe)))
|
|
1744
|
+
buffer_append_newline(buf);
|
|
1745
|
+
} else if (buf->indent_spaces > 0) {
|
|
1746
|
+
/* Formatter-owned separator between element
|
|
1747
|
+
* children — suppressed when the next sibling
|
|
1748
|
+
* is a TEXT node: under a mixed parent its
|
|
1749
|
+
* verbatim content already carries the layout
|
|
1750
|
+
* (libxslt bug-98). */
|
|
1751
|
+
LeptrisNode* nx = leptris_node_get_next_sibling(
|
|
1752
|
+
(LeptrisNode*)pe);
|
|
1753
|
+
if (!nx || nx->type != LEPTRIS_NODE_TYPE_TEXT)
|
|
1754
|
+
buffer_append_newline(buf);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
if (sp == 0 && (LeptrisNode*)pe == (LeptrisNode*)root_elem) {
|
|
1758
|
+
/* The walk's root frame closed. STOP: an element
|
|
1759
|
+
* serialize must emit exactly the caller's subtree —
|
|
1760
|
+
* continuing to the root's siblings leaked every
|
|
1761
|
+
* following element into the output (issue #523:
|
|
1762
|
+
* both the garbage results and the O(document)
|
|
1763
|
+
* per-call cost). */
|
|
1764
|
+
ser_frames_free(st, sp);
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
cur = (LeptrisNode*)pe;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
void serialize_node_internal(LeptrisNode* node, SerializeBuffer* buf) {
|
|
1773
|
+
if (!node) return;
|
|
1774
|
+
|
|
1775
|
+
/* Dispatch via the per-type vtable registry — adding a new node
|
|
1776
|
+
* type is purely additive (register a vtable in node_vtable.c). */
|
|
1777
|
+
const LeptrisNodeVTable* vt = leptris_node_vtable_for(node->type);
|
|
1778
|
+
if (vt && vt->serialize) {
|
|
1779
|
+
vt->serialize(node, buf);
|
|
1780
|
+
}
|
|
1781
|
+
/* Unknown/unregistered type — silently skip (matches old default). */
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
/* ============================================================================
|
|
1785
|
+
* Public API
|
|
1786
|
+
* ============================================================================ */
|
|
1787
|
+
|
|
1788
|
+
char* leptris_serialize_node(LeptrisNode* node) {
|
|
1789
|
+
if (!node) return NULL;
|
|
1790
|
+
|
|
1791
|
+
SerializeBuffer* buf = buffer_create(0); /* Compact mode */
|
|
1792
|
+
if (!buf) return NULL;
|
|
1793
|
+
|
|
1794
|
+
serialize_node_internal(node, buf);
|
|
1795
|
+
|
|
1796
|
+
char* result = buffer_to_string(buf);
|
|
1797
|
+
buffer_free(buf);
|
|
1798
|
+
|
|
1799
|
+
return result;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
char* leptris_serialize_element(LeptrisElement elem) {
|
|
1803
|
+
if (!elem) return NULL;
|
|
1804
|
+
|
|
1805
|
+
SerializeBuffer* buf = buffer_create(0); /* Compact mode */
|
|
1806
|
+
if (!buf) return NULL;
|
|
1807
|
+
|
|
1808
|
+
serialize_element_internal(elem, buf, 1); /* is_root=1 */
|
|
1809
|
+
|
|
1810
|
+
char* result = buffer_to_string(buf);
|
|
1811
|
+
buffer_free(buf);
|
|
1812
|
+
|
|
1813
|
+
return result;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
/* ============================================================================
|
|
1817
|
+
* Utility: Serialize with XML Declaration
|
|
1818
|
+
* ============================================================================ */
|
|
1819
|
+
|
|
1820
|
+
char* leptris_serialize_document_with_declaration(LeptrisElement root,
|
|
1821
|
+
const char* encoding,
|
|
1822
|
+
const char* version,
|
|
1823
|
+
int standalone,
|
|
1824
|
+
int has_bom,
|
|
1825
|
+
LeptrisDoctypeNode* doctype) {
|
|
1826
|
+
if (!root) return NULL;
|
|
1827
|
+
|
|
1828
|
+
SerializeBuffer* buf = buffer_create(0); /* Compact mode by default */
|
|
1829
|
+
if (!buf) return NULL;
|
|
1830
|
+
|
|
1831
|
+
/* Output UTF-8 BOM if present in original */
|
|
1832
|
+
if (has_bom) {
|
|
1833
|
+
buffer_append_char(buf, (char)(unsigned char)0xEF);
|
|
1834
|
+
buffer_append_char(buf, (char)(unsigned char)0xBB);
|
|
1835
|
+
buffer_append_char(buf, (char)(unsigned char)0xBF);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
/* Add XML declaration only if version is provided */
|
|
1839
|
+
if (version) {
|
|
1840
|
+
buffer_append(buf, "<?xml version=\"");
|
|
1841
|
+
buffer_append(buf, version);
|
|
1842
|
+
buffer_append_char(buf, '"');
|
|
1843
|
+
|
|
1844
|
+
if (encoding) {
|
|
1845
|
+
buffer_append(buf, " encoding=\"");
|
|
1846
|
+
buffer_append(buf, encoding);
|
|
1847
|
+
buffer_append_char(buf, '"');
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
if (standalone >= 0) {
|
|
1851
|
+
buffer_append(buf, " standalone=\"");
|
|
1852
|
+
buffer_append(buf, standalone ? "yes" : "no");
|
|
1853
|
+
buffer_append_char(buf, '"');
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
buffer_append(buf, "?>");
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
/* Output DOCTYPE if present */
|
|
1860
|
+
if (doctype) {
|
|
1861
|
+
if (version) {
|
|
1862
|
+
buffer_append_char(buf, '\n');
|
|
1863
|
+
}
|
|
1864
|
+
serialize_doctype_internal(doctype, buf);
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
/* Serialize root element */
|
|
1868
|
+
if (version || doctype) {
|
|
1869
|
+
buffer_append_char(buf, '\n');
|
|
1870
|
+
}
|
|
1871
|
+
serialize_element_internal(root, buf, 1); /* is_root=1 */
|
|
1872
|
+
|
|
1873
|
+
char* result = buffer_to_string(buf);
|
|
1874
|
+
buffer_free(buf);
|
|
1875
|
+
|
|
1876
|
+
return result;
|
|
1877
|
+
}
|
|
1878
|
+
/* ============================================================================
|
|
1879
|
+
* Document Serialization (matches leptris.h public API)
|
|
1880
|
+
* ============================================================================ */
|
|
1881
|
+
|
|
1882
|
+
/* Forward declarations for document structure access */
|
|
1883
|
+
struct leptris_document;
|
|
1884
|
+
|
|
1885
|
+
/* Serialize document with options */
|
|
1886
|
+
/* Full entry: public options + the internal extended settings.
|
|
1887
|
+
* extended==NULL leaves cdata/html off (the public default). */
|
|
1888
|
+
/* #129: public extended options (LeptrisSerializeExtOptions) bridge
|
|
1889
|
+
* onto the internal LeptrisSerializeExtended — one conversion site,
|
|
1890
|
+
* the walker below reads only the SerializeBuffer fields. */
|
|
1891
|
+
LEPTRIS_API char* leptris_document_serialize_ext(
|
|
1892
|
+
struct leptris_document* doc,
|
|
1893
|
+
const LeptrisSerializeOptions* options,
|
|
1894
|
+
const LeptrisSerializeExtOptions* ext) {
|
|
1895
|
+
return leptris_document_serialize_ext_sized(
|
|
1896
|
+
doc, options, ext, ext ? sizeof(*ext) : 0);
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
/* Size-aware entry (issue #644): the ext struct MAY grow, and FFI
|
|
1900
|
+
* callers allocate only the fields they know — reading past their
|
|
1901
|
+
* buffer picked up heap garbage as indent_unit (an MSVC crash in
|
|
1902
|
+
* leptris-ruby). Each field is read only when the caller's buffer
|
|
1903
|
+
* actually covers it. */
|
|
1904
|
+
LEPTRIS_API char* leptris_document_serialize_ext_sized(
|
|
1905
|
+
struct leptris_document* doc,
|
|
1906
|
+
const LeptrisSerializeOptions* options,
|
|
1907
|
+
const LeptrisSerializeExtOptions* ext,
|
|
1908
|
+
size_t ext_size) {
|
|
1909
|
+
LeptrisSerializeExtended internal;
|
|
1910
|
+
memset(&internal, 0, sizeof(internal));
|
|
1911
|
+
if (ext) {
|
|
1912
|
+
if (ext_size >= offsetof(LeptrisSerializeExtOptions, indent_text) +
|
|
1913
|
+
sizeof(int))
|
|
1914
|
+
internal.indent_text = ext->indent_text;
|
|
1915
|
+
if (ext_size >= offsetof(LeptrisSerializeExtOptions, indent_unit) +
|
|
1916
|
+
sizeof(const char*))
|
|
1917
|
+
internal.indent_unit = ext->indent_unit;
|
|
1918
|
+
if (ext_size >= offsetof(LeptrisSerializeExtOptions, expand_empty) +
|
|
1919
|
+
sizeof(int))
|
|
1920
|
+
internal.expand_empty = ext->expand_empty;
|
|
1921
|
+
}
|
|
1922
|
+
return leptris_document_serialize_ex(doc, options, &internal);
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
/* #882: element-level twins of the ext entries — the bridge logic
|
|
1926
|
+
* duplicated here is exactly the document version's (one conversion
|
|
1927
|
+
* site per entry point; the walker reads only buffer fields). */
|
|
1928
|
+
LEPTRIS_API char* leptris_element_serialize_ext(
|
|
1929
|
+
LeptrisElement elem,
|
|
1930
|
+
const LeptrisSerializeOptions* options,
|
|
1931
|
+
const LeptrisSerializeExtOptions* ext) {
|
|
1932
|
+
return leptris_element_serialize_ext_sized(
|
|
1933
|
+
elem, options, ext, ext ? sizeof(*ext) : 0);
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
LEPTRIS_API char* leptris_element_serialize_ext_sized(
|
|
1937
|
+
LeptrisElement elem,
|
|
1938
|
+
const LeptrisSerializeOptions* options,
|
|
1939
|
+
const LeptrisSerializeExtOptions* ext,
|
|
1940
|
+
size_t ext_size) {
|
|
1941
|
+
LeptrisSerializeExtended internal;
|
|
1942
|
+
memset(&internal, 0, sizeof(internal));
|
|
1943
|
+
if (ext) {
|
|
1944
|
+
if (ext_size >= offsetof(LeptrisSerializeExtOptions, indent_text) +
|
|
1945
|
+
sizeof(int))
|
|
1946
|
+
internal.indent_text = ext->indent_text;
|
|
1947
|
+
if (ext_size >= offsetof(LeptrisSerializeExtOptions, indent_unit) +
|
|
1948
|
+
sizeof(const char*))
|
|
1949
|
+
internal.indent_unit = ext->indent_unit;
|
|
1950
|
+
if (ext_size >= offsetof(LeptrisSerializeExtOptions, expand_empty) +
|
|
1951
|
+
sizeof(int))
|
|
1952
|
+
internal.expand_empty = ext->expand_empty;
|
|
1953
|
+
}
|
|
1954
|
+
return leptris_element_serialize_ex(elem, options, &internal);
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
/* Element-level twin of leptris_document_serialize_ex: the XSLT
|
|
1958
|
+
* layer serializes a result FRAGMENT's top-level elements one by
|
|
1959
|
+
* one (bug-90) — without this entry they lost cdata-section-elements,
|
|
1960
|
+
* html and xhtml semantics, which the public options struct cannot
|
|
1961
|
+
* carry (#568). */
|
|
1962
|
+
char* leptris_element_serialize_ex(LeptrisElement elem,
|
|
1963
|
+
const LeptrisSerializeOptions* options,
|
|
1964
|
+
const LeptrisSerializeExtended* extended) {
|
|
1965
|
+
if (!elem) return NULL;
|
|
1966
|
+
int indent_spaces = options ? options->indent : 0;
|
|
1967
|
+
SerializeBuffer* buf = buffer_create(indent_spaces);
|
|
1968
|
+
if (!buf) return NULL;
|
|
1969
|
+
if (extended) {
|
|
1970
|
+
buf->cdata_names = extended->cdata_elements;
|
|
1971
|
+
buf->cdata_count = extended->cdata_element_count;
|
|
1972
|
+
buf->html_method = extended->html_method != 0;
|
|
1973
|
+
buf->indent_text = extended->indent_text != 0;
|
|
1974
|
+
buf->expand_empty = extended->expand_empty != 0;
|
|
1975
|
+
buf->indent_unit = extended->indent_unit;
|
|
1976
|
+
buf->ws_mixed = extended->ws_mixed != 0;
|
|
1977
|
+
buf->xhtml = extended->xhtml != 0;
|
|
1978
|
+
buf->xhtml_encoding = options && options->encoding
|
|
1979
|
+
? options->encoding : "UTF-8";
|
|
1980
|
+
}
|
|
1981
|
+
serialize_element_internal(elem, buf, 1);
|
|
1982
|
+
char* result = buffer_to_string(buf);
|
|
1983
|
+
buffer_free(buf);
|
|
1984
|
+
return result;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
char* leptris_document_serialize_ex(struct leptris_document* doc,
|
|
1988
|
+
const LeptrisSerializeOptions* options,
|
|
1989
|
+
const LeptrisSerializeExtended* extended) {
|
|
1990
|
+
if (!doc) return NULL;
|
|
1991
|
+
|
|
1992
|
+
/* FlatDoc serialize fast path removed — direct_parse builds the
|
|
1993
|
+
* LeptrisElement tree eagerly. Serialization always walks the DOM. */
|
|
1994
|
+
|
|
1995
|
+
/* Get root element from new_dom_root field */
|
|
1996
|
+
/* TODO 139 Phase D: trigger lazy promote if the doc was produced
|
|
1997
|
+
* by the flat-parse fast path. */
|
|
1998
|
+
leptris_document_ensure_promoted(doc);
|
|
1999
|
+
LeptrisElement root = (LeptrisElement)doc->new_dom_root;
|
|
2000
|
+
if (!root) {
|
|
2001
|
+
char* rootless = serialize_rootless_pis(doc, options);
|
|
2002
|
+
if (rootless) return rootless;
|
|
2003
|
+
return NULL;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
/* Use default options if NULL */
|
|
2007
|
+
int xml_declaration = 0;
|
|
2008
|
+
int indent_spaces = 0;
|
|
2009
|
+
const char* encoding = NULL;
|
|
2010
|
+
|
|
2011
|
+
if (options) {
|
|
2012
|
+
xml_declaration = options->xml_declaration;
|
|
2013
|
+
indent_spaces = options->indent;
|
|
2014
|
+
encoding = options->encoding;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
/* Create buffer with indent support */
|
|
2018
|
+
SerializeBuffer* buf = buffer_create(indent_spaces);
|
|
2019
|
+
if (!buf) return NULL;
|
|
2020
|
+
if (extended) {
|
|
2021
|
+
buf->cdata_names = extended->cdata_elements;
|
|
2022
|
+
buf->cdata_count = extended->cdata_element_count;
|
|
2023
|
+
/* §16.2: html semantics (void elements, attr escaping, raw
|
|
2024
|
+
* text, PI form) apply whenever the method is html — also
|
|
2025
|
+
* with indent="no". The newline LAYOUT self-gates: every
|
|
2026
|
+
* html break site goes through buffer_append_newline, which
|
|
2027
|
+
* is a no-op at indent_spaces == 0. */
|
|
2028
|
+
buf->html_method = extended->html_method != 0;
|
|
2029
|
+
buf->indent_text = extended->indent_text != 0;
|
|
2030
|
+
buf->expand_empty = extended->expand_empty != 0;
|
|
2031
|
+
buf->indent_unit = extended->indent_unit;
|
|
2032
|
+
buf->ws_mixed = extended->ws_mixed != 0;
|
|
2033
|
+
buf->xhtml = extended->xhtml != 0;
|
|
2034
|
+
buf->xhtml_encoding = encoding ? encoding : "UTF-8";
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
/* Output UTF-8 BOM if present in original */
|
|
2038
|
+
if (doc->has_bom) {
|
|
2039
|
+
buffer_append_char(buf, (char)(unsigned char)0xEF);
|
|
2040
|
+
buffer_append_char(buf, (char)(unsigned char)0xBB);
|
|
2041
|
+
buffer_append_char(buf, (char)(unsigned char)0xBF);
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
/* Add XML declaration if requested or if doc had one */
|
|
2045
|
+
const char* xml_version = doc->xml_version;
|
|
2046
|
+
int standalone = doc->standalone;
|
|
2047
|
+
|
|
2048
|
+
/* If xml_declaration is explicitly requested but doc has no version,
|
|
2049
|
+
* fall back to XML 1.0 with no standalone attribute. */
|
|
2050
|
+
if (xml_declaration && !xml_version) {
|
|
2051
|
+
xml_version = "1.0";
|
|
2052
|
+
standalone = -1;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
if ((xml_declaration || (doc->had_declaration && xml_version)) && xml_version) {
|
|
2056
|
+
buffer_append(buf, "<?xml version=\"");
|
|
2057
|
+
buffer_append(buf, xml_version);
|
|
2058
|
+
buffer_append_char(buf, '"');
|
|
2059
|
+
|
|
2060
|
+
/* TODO.bindings/06: with iconv (default build) the body was
|
|
2061
|
+
* transcoded to UTF-8 at parse time — the declaration says
|
|
2062
|
+
* so, always. Without iconv, bytes pass through unchanged:
|
|
2063
|
+
* echoing the original encoding stays truthful. Either way
|
|
2064
|
+
* the declaration never lies, and serialize(serialize(x))
|
|
2065
|
+
* is byte-stable. */
|
|
2066
|
+
const char* enc = encoding ? encoding : doc->encoding;
|
|
2067
|
+
if (enc) {
|
|
2068
|
+
buffer_append(buf, " encoding=\"");
|
|
2069
|
+
if (doc->decl_encoding_verbatim ||
|
|
2070
|
+
(extended && extended->decl_encoding_verbatim &&
|
|
2071
|
+
options && options->encoding) ||
|
|
2072
|
+
(enc[0] == 'U' || enc[0] == 'u')) {
|
|
2073
|
+
/* Verbatim: a UTF-8-spelled name; an explicit
|
|
2074
|
+
* request from a caller that transcodes the body to
|
|
2075
|
+
* match (the XSLT layer, bug-140); or a document
|
|
2076
|
+
* whose encoding was DECLARED programmatically
|
|
2077
|
+
* (#1094 set_encoding — the body was never
|
|
2078
|
+
* transcoded, re-spelling would lie). The parse-
|
|
2079
|
+
* echo fallback below only applies to encodings
|
|
2080
|
+
* inherited from a parsed document. */
|
|
2081
|
+
buffer_append(buf, enc);
|
|
2082
|
+
#ifdef LEPTRIS_HAS_ICONV
|
|
2083
|
+
} else if (enc[0]) {
|
|
2084
|
+
buffer_append(buf, "UTF-8");
|
|
2085
|
+
}
|
|
2086
|
+
#else
|
|
2087
|
+
} else {
|
|
2088
|
+
/* No iconv: bytes pass through unchanged at parse —
|
|
2089
|
+
* echoing the source encoding stays truthful. */
|
|
2090
|
+
buffer_append(buf, enc);
|
|
2091
|
+
}
|
|
2092
|
+
#endif
|
|
2093
|
+
buffer_append_char(buf, '"');
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
if (standalone >= 0) {
|
|
2097
|
+
buffer_append(buf, " standalone=\"");
|
|
2098
|
+
buffer_append(buf, standalone ? "yes" : "no");
|
|
2099
|
+
buffer_append_char(buf, '"');
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
buffer_append(buf, "?>");
|
|
2103
|
+
|
|
2104
|
+
/* Add newline after declaration if indenting */
|
|
2105
|
+
if (indent_spaces > 0) {
|
|
2106
|
+
buffer_append_newline(buf);
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
/* Output DOCTYPE if present */
|
|
2111
|
+
if (doc->doctype) {
|
|
2112
|
+
serialize_doctype_internal((LeptrisDoctypeNode*)doc->doctype, buf);
|
|
2113
|
+
if (indent_spaces > 0) {
|
|
2114
|
+
buffer_append_newline(buf);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
/* Document-level nodes (issue #580): the child chain in document
|
|
2119
|
+
* order — prolog nodes before the root, the root itself
|
|
2120
|
+
* serialized below, epilog nodes after. The single chain keeps
|
|
2121
|
+
* comment/PI interleaving the old side lists lost. */
|
|
2122
|
+
LeptrisNode* doc_root_node = (LeptrisNode*)root;
|
|
2123
|
+
for (LeptrisNode* c = (LeptrisNode*)doc->doc_children_head; c;
|
|
2124
|
+
c = leptris_node_get_next_sibling(c)) {
|
|
2125
|
+
if (c == doc_root_node) break;
|
|
2126
|
+
if (c->type == LEPTRIS_NODE_TYPE_PI) {
|
|
2127
|
+
LeptrisPINode* pi = (LeptrisPINode*)c;
|
|
2128
|
+
buffer_append(buf, "<?");
|
|
2129
|
+
if (pi->target) buffer_append(buf, pi->target);
|
|
2130
|
+
if (pi->data && pi->data[0]) {
|
|
2131
|
+
buffer_append_char(buf, ' ');
|
|
2132
|
+
buffer_append(buf, pi->data);
|
|
2133
|
+
}
|
|
2134
|
+
buffer_append(buf, "?>");
|
|
2135
|
+
if (indent_spaces > 0) {
|
|
2136
|
+
buffer_append_newline(buf);
|
|
2137
|
+
}
|
|
2138
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_COMMENT) {
|
|
2139
|
+
buffer_append(buf, "<!--");
|
|
2140
|
+
buffer_append(buf,
|
|
2141
|
+
leptris_comment_get_content((LeptrisCommentNode*)c));
|
|
2142
|
+
buffer_append(buf, "-->");
|
|
2143
|
+
if (indent_spaces > 0) {
|
|
2144
|
+
buffer_append_newline(buf);
|
|
2145
|
+
}
|
|
2146
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
2147
|
+
/* Top-level text (copied source whitespace between
|
|
2148
|
+
* prolog nodes — bug-195) emits verbatim. */
|
|
2149
|
+
const char* tc =
|
|
2150
|
+
leptris_text_get_content((LeptrisTextNode*)c);
|
|
2151
|
+
if (tc) buffer_append(buf, tc);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
/* Serialize root element */
|
|
2156
|
+
serialize_element_internal(root, buf, 1); /* is_root=1 */
|
|
2157
|
+
|
|
2158
|
+
/* Epilog: the chain nodes AFTER the root element. Gated on the
|
|
2159
|
+
* #580 chain — result-fragment documents chain top-level nodes
|
|
2160
|
+
* as root siblings WITHOUT a doc_children chain, and their
|
|
2161
|
+
* serializer (xslt_public) owns that walk. */
|
|
2162
|
+
if (doc->doc_children_head) {
|
|
2163
|
+
for (LeptrisNode* c = leptris_node_get_next_sibling(doc_root_node); c;
|
|
2164
|
+
c = leptris_node_get_next_sibling(c)) {
|
|
2165
|
+
if (c->type == LEPTRIS_NODE_TYPE_PI) {
|
|
2166
|
+
LeptrisPINode* pi = (LeptrisPINode*)c;
|
|
2167
|
+
buffer_append(buf, "<?");
|
|
2168
|
+
if (pi->target) buffer_append(buf, pi->target);
|
|
2169
|
+
if (pi->data && pi->data[0]) {
|
|
2170
|
+
buffer_append_char(buf, ' ');
|
|
2171
|
+
buffer_append(buf, pi->data);
|
|
2172
|
+
}
|
|
2173
|
+
buffer_append(buf, "?>");
|
|
2174
|
+
if (indent_spaces > 0) {
|
|
2175
|
+
buffer_append_newline(buf);
|
|
2176
|
+
}
|
|
2177
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_COMMENT) {
|
|
2178
|
+
buffer_append(buf, "<!--");
|
|
2179
|
+
buffer_append(buf,
|
|
2180
|
+
leptris_comment_get_content((LeptrisCommentNode*)c));
|
|
2181
|
+
buffer_append(buf, "-->");
|
|
2182
|
+
if (indent_spaces > 0) {
|
|
2183
|
+
buffer_append_newline(buf);
|
|
2184
|
+
}
|
|
2185
|
+
} else if (c->type == LEPTRIS_NODE_TYPE_TEXT) {
|
|
2186
|
+
const char* tc =
|
|
2187
|
+
leptris_text_get_content((LeptrisTextNode*)c);
|
|
2188
|
+
if (tc) buffer_append(buf, tc);
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
char* result = buffer_to_string(buf);
|
|
2194
|
+
buffer_free(buf);
|
|
2195
|
+
|
|
2196
|
+
return result;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
/* Public entry (ABI-frozen options only — issue #568): reads
|
|
2200
|
+
* exclusively the three frozen fields; cdata/html stay off. */
|
|
2201
|
+
LEPTRIS_API char* leptris_document_serialize(struct leptris_document* doc,
|
|
2202
|
+
const LeptrisSerializeOptions* options) {
|
|
2203
|
+
return leptris_document_serialize_ex(doc, options, NULL);
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
|
|
2207
|
+
/* ============================================================================
|
|
2208
|
+
* Element Serialization (matches leptris.h public API)
|
|
2209
|
+
* ============================================================================ */
|
|
2210
|
+
|
|
2211
|
+
/* Serialize element subtree to XML string */
|
|
2212
|
+
LEPTRIS_API char* leptris_element_serialize(LeptrisElement elem,
|
|
2213
|
+
const LeptrisSerializeOptions* options) {
|
|
2214
|
+
if (!elem) return NULL;
|
|
2215
|
+
|
|
2216
|
+
int indent_spaces = 0;
|
|
2217
|
+
if (options) {
|
|
2218
|
+
indent_spaces = options->indent;
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
SerializeBuffer* buf = buffer_create(indent_spaces);
|
|
2222
|
+
if (!buf) return NULL;
|
|
2223
|
+
|
|
2224
|
+
serialize_element_internal(elem, buf, 1); /* is_root=1 */
|
|
2225
|
+
|
|
2226
|
+
char* result = buffer_to_string(buf);
|
|
2227
|
+
buffer_free(buf);
|
|
2228
|
+
|
|
2229
|
+
return result;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
/* Issue #541: mem-cache the serialized string so the size-query
|
|
2233
|
+
* + into-call pattern reuses a single serialization. */
|
|
2234
|
+
static int ser_cache_valid(const struct leptris_document* doc,
|
|
2235
|
+
const LeptrisSerializeOptions* options) {
|
|
2236
|
+
if (!doc->ser_cache) return 0;
|
|
2237
|
+
if (doc->ser_version != doc->ser_cache_version) return 0;
|
|
2238
|
+
int text = options ? !options->xml_declaration : 1;
|
|
2239
|
+
int omit = options ? !options->xml_declaration : 0;
|
|
2240
|
+
int indent = options ? !!options->indent : 0;
|
|
2241
|
+
return text == doc->ser_cache_text && omit == doc->ser_cache_omit &&
|
|
2242
|
+
indent == doc->ser_cache_indent;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
LEPTRIS_API size_t leptris_document_serialize_into(LeptrisDocument doc,
|
|
2246
|
+
char* buf,
|
|
2247
|
+
size_t capacity,
|
|
2248
|
+
size_t* out_len,
|
|
2249
|
+
const LeptrisSerializeOptions* options) {
|
|
2250
|
+
if (!doc) return 0;
|
|
2251
|
+
if (ser_cache_valid(doc, options)) {
|
|
2252
|
+
size_t need = doc->ser_cache_len + 1;
|
|
2253
|
+
if (buf && capacity >= need) {
|
|
2254
|
+
memcpy(buf, doc->ser_cache, need);
|
|
2255
|
+
}
|
|
2256
|
+
/* #550: the sizing pass (buf NULL / too small) reports the
|
|
2257
|
+
* needed length through out_len too — callers allocate from
|
|
2258
|
+
* it. The cached path previously left it untouched. */
|
|
2259
|
+
if (out_len) *out_len = doc->ser_cache_len;
|
|
2260
|
+
return need;
|
|
2261
|
+
}
|
|
2262
|
+
char* tmp = leptris_document_serialize(doc, options);
|
|
2263
|
+
if (!tmp) return 0;
|
|
2264
|
+
size_t need = strlen(tmp) + 1;
|
|
2265
|
+
if (buf && capacity >= need) {
|
|
2266
|
+
memcpy(buf, tmp, need);
|
|
2267
|
+
}
|
|
2268
|
+
if (out_len) *out_len = need - 1;
|
|
2269
|
+
/* Cache for the no-options (defaults) path; option permutations
|
|
2270
|
+
* stay one-shot to keep the cache key simple. */
|
|
2271
|
+
if (!options) {
|
|
2272
|
+
free(doc->ser_cache);
|
|
2273
|
+
doc->ser_cache = tmp; /* ownership transferred */
|
|
2274
|
+
doc->ser_cache_len = need - 1;
|
|
2275
|
+
doc->ser_cache_version = doc->ser_version;
|
|
2276
|
+
doc->ser_cache_text = 0;
|
|
2277
|
+
doc->ser_cache_omit = 0;
|
|
2278
|
+
doc->ser_cache_indent = 0;
|
|
2279
|
+
} else {
|
|
2280
|
+
leptris_free_string(tmp);
|
|
2281
|
+
}
|
|
2282
|
+
return need;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
LEPTRIS_API size_t leptris_element_serialize_into(LeptrisElement elem,
|
|
2286
|
+
char* buf,
|
|
2287
|
+
size_t capacity,
|
|
2288
|
+
size_t* out_len,
|
|
2289
|
+
const LeptrisSerializeOptions* options) {
|
|
2290
|
+
char* tmp = leptris_element_serialize(elem, options);
|
|
2291
|
+
if (!tmp) return 0;
|
|
2292
|
+
size_t need = strlen(tmp) + 1;
|
|
2293
|
+
if (buf && capacity >= need) {
|
|
2294
|
+
memcpy(buf, tmp, need);
|
|
2295
|
+
}
|
|
2296
|
+
if (out_len) *out_len = need - 1; /* sizing pass too (#550) */
|
|
2297
|
+
leptris_free_string(tmp);
|
|
2298
|
+
return need;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
/* Save document to file */
|
|
2302
|
+
LEPTRIS_API int leptris_document_save_file(struct leptris_document* doc,
|
|
2303
|
+
const char* filepath,
|
|
2304
|
+
const LeptrisSerializeOptions* options) {
|
|
2305
|
+
if (!doc) return -4; /* LEPTRIS_ERROR_NULL_ARG */
|
|
2306
|
+
if (!filepath) return -4; /* LEPTRIS_ERROR_NULL_ARG */
|
|
2307
|
+
|
|
2308
|
+
/* Serialize document to XML string */
|
|
2309
|
+
char* xml = leptris_document_serialize(doc, options);
|
|
2310
|
+
if (!xml) return -1; /* LEPTRIS_ERROR_MEMORY */
|
|
2311
|
+
|
|
2312
|
+
/* Open file for writing */
|
|
2313
|
+
FILE* file = fopen(filepath, "wb");
|
|
2314
|
+
if (!file) {
|
|
2315
|
+
LEPTRIS_FREE(xml);
|
|
2316
|
+
return -7; /* LEPTRIS_ERROR_IO */
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
/* Write XML content to file */
|
|
2320
|
+
size_t len = strlen(xml);
|
|
2321
|
+
size_t written = fwrite(xml, 1, len, file);
|
|
2322
|
+
fclose(file);
|
|
2323
|
+
|
|
2324
|
+
/* Free the XML string */
|
|
2325
|
+
LEPTRIS_FREE(xml);
|
|
2326
|
+
|
|
2327
|
+
/* Check if all bytes were written */
|
|
2328
|
+
if (written != len) {
|
|
2329
|
+
return -7; /* LEPTRIS_ERROR_IO */
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
return 0; /* LEPTRIS_OK */
|
|
2333
|
+
}
|