├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.org ├── app ├── .gitignore ├── Module.md ├── build.gradle.kts └── src │ ├── main │ ├── docs │ │ ├── README.md │ │ ├── extra │ │ │ └── README.md │ │ └── helloWorld.xpl │ ├── kotlin │ │ └── com │ │ │ └── xmlcalabash │ │ │ └── app │ │ │ ├── CommandLine.kt │ │ │ ├── FileOutputReceiver.kt │ │ │ ├── Main.kt │ │ │ ├── Moon.kt │ │ │ ├── OutputFilename.kt │ │ │ └── XmlCalabashCli.kt │ ├── resources │ │ └── com │ │ │ └── xmlcalabash │ │ │ └── help.txt │ └── scripts │ │ ├── xmlcalabash.ps1 │ │ └── xmlcalabash.sh │ └── test │ └── kotlin │ └── com │ └── xmlcalabash │ └── app │ └── test │ └── OutputFilenameTest.kt ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts ├── gradle.properties ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── ExternalDependencies.kt │ ├── Html5Parser.kt │ ├── buildlogic.kotlin-application-conventions.gradle.kts │ ├── buildlogic.kotlin-common-conventions.gradle.kts │ ├── buildlogic.kotlin-library-conventions.gradle.kts │ ├── extensions.kt │ ├── xmlcal.gradle.kts │ └── xmlcalabash-build-plugin.kt ├── containers ├── apache2 │ ├── Dockerfile │ ├── README │ └── build.sh ├── sendria │ ├── Dockerfile │ └── build.sh └── testing │ ├── .gitignore │ ├── Dockerfile │ ├── build.sh │ ├── compose.yml │ └── scripts │ ├── build-and-test.sh │ ├── build.sh │ └── test-report.sh ├── documentation ├── build.gradle.kts ├── src │ ├── dokka │ │ └── resources │ │ │ └── css │ │ │ └── xmlcalabash.css │ ├── examples │ │ ├── html │ │ │ └── rdfa.html │ │ ├── rdf │ │ │ ├── address-book.rdf │ │ │ └── query.rq │ │ ├── xml │ │ │ ├── default-ch2.xml │ │ │ ├── default-input.xml │ │ │ ├── det-a.xml │ │ │ ├── exgraph-description-styled.xml │ │ │ ├── exgraph-description.xml │ │ │ ├── logback.xml │ │ │ ├── multithreading.xml │ │ │ └── threading.xml │ │ ├── xpl │ │ │ ├── add-attribute-001.xpl │ │ │ ├── add-status.xpl │ │ │ ├── add-xml-base-001.xpl │ │ │ ├── assertions-1.xpl │ │ │ ├── assertions-2.xpl │ │ │ ├── assertions-3.xpl │ │ │ ├── debugger.xpl │ │ │ ├── delete-001.xpl │ │ │ ├── delete-002.xpl │ │ │ ├── graph-pipeline.xpl │ │ │ ├── messages.xpl │ │ │ ├── rdfa.xpl │ │ │ ├── simple.xpl │ │ │ └── sparql.xpl │ │ └── xsl │ │ │ └── custom-graph-style.xsl │ ├── reference │ │ ├── bibliography.xml │ │ ├── depends.xml │ │ ├── extension-steps │ │ │ ├── cx-asciidoctor.xml │ │ │ ├── cx-cache-add.xml │ │ │ ├── cx-cache-delete.xml │ │ │ ├── cx-collection-manager.xml │ │ │ ├── cx-ditaa.xml │ │ │ ├── cx-ebnf-convert.xml │ │ │ ├── cx-epubcheck.xml │ │ │ ├── cx-find.xml │ │ │ ├── cx-javascript.xml │ │ │ ├── cx-json-diff.xml │ │ │ ├── cx-json-patch.xml │ │ │ ├── cx-jsonpath.xml │ │ │ ├── cx-markup-blitz.xml │ │ │ ├── cx-mathml-to-svg.xml │ │ │ ├── cx-metadata-extractor.xml │ │ │ ├── cx-pipeline-messages.xml │ │ │ ├── cx-plantuml.xml │ │ │ ├── cx-polyglot.xml │ │ │ ├── cx-python.xml │ │ │ ├── cx-railroad.xml │ │ │ ├── cx-selenium.xml │ │ │ ├── cx-trang-files.xml │ │ │ ├── cx-trang.xml │ │ │ ├── cx-unique-id.xml │ │ │ ├── cx-until.xml │ │ │ ├── cx-wait-for-update.xml │ │ │ ├── cx-while.xml │ │ │ ├── cx-xmlunit.xml │ │ │ ├── cx-xpath.xml │ │ │ └── reference.xml │ │ ├── functions.xml │ │ ├── glossary.xml │ │ ├── preface.xml │ │ ├── rdf-steps │ │ │ ├── cx-rdf-graph.xml │ │ │ ├── cx-rdf-merge.xml │ │ │ ├── cx-rdfa.xml │ │ │ ├── cx-sparql.xml │ │ │ ├── general.xml │ │ │ └── reference.xml │ │ ├── reference.xml │ │ ├── running.xml │ │ └── standard-steps │ │ │ ├── p-add-attribute.xml │ │ │ ├── p-add-xml-base.xml │ │ │ ├── p-archive-manifest.xml │ │ │ ├── p-archive.xml │ │ │ ├── p-cast-content-type.xml │ │ │ ├── p-compare.xml │ │ │ ├── p-compress.xml │ │ │ ├── p-count.xml │ │ │ ├── p-css-formatter.xml │ │ │ ├── p-delete.xml │ │ │ ├── p-directory-list.xml │ │ │ ├── p-encode.xml │ │ │ ├── p-error.xml │ │ │ ├── p-file-copy.xml │ │ │ ├── p-file-create-tempfile.xml │ │ │ ├── p-file-delete.xml │ │ │ ├── p-file-info.xml │ │ │ ├── p-file-mkdir.xml │ │ │ ├── p-file-move.xml │ │ │ ├── p-file-touch.xml │ │ │ ├── p-filter.xml │ │ │ ├── p-hash.xml │ │ │ ├── p-http-request.xml │ │ │ ├── p-identity.xml │ │ │ ├── p-insert.xml │ │ │ ├── p-invisible-xml.xml │ │ │ ├── p-json-join.xml │ │ │ ├── p-json-merge.xml │ │ │ ├── p-label-elements.xml │ │ │ ├── p-load.xml │ │ │ ├── p-make-absolute-uris.xml │ │ │ ├── p-markdown-to-html.xml │ │ │ ├── p-message.xml │ │ │ ├── p-namespace-delete.xml │ │ │ ├── p-namespace-rename.xml │ │ │ ├── p-os-exec.xml │ │ │ ├── p-os-info.xml │ │ │ ├── p-pack.xml │ │ │ ├── p-rename.xml │ │ │ ├── p-replace.xml │ │ │ ├── p-run.xml │ │ │ ├── p-send-mail.xml │ │ │ ├── p-set-attributes.xml │ │ │ ├── p-set-properties.xml │ │ │ ├── p-sink.xml │ │ │ ├── p-sleep.xml │ │ │ ├── p-split-sequence.xml │ │ │ ├── p-store.xml │ │ │ ├── p-string-replace.xml │ │ │ ├── p-text-count.xml │ │ │ ├── p-text-head.xml │ │ │ ├── p-text-join.xml │ │ │ ├── p-text-replace.xml │ │ │ ├── p-text-sort.xml │ │ │ ├── p-text-tail.xml │ │ │ ├── p-unarchive.xml │ │ │ ├── p-uncompress.xml │ │ │ ├── p-unwrap.xml │ │ │ ├── p-uuid.xml │ │ │ ├── p-validate-with-dtd.xml │ │ │ ├── p-validate-with-json-schema.xml │ │ │ ├── p-validate-with-nvdl.xml │ │ │ ├── p-validate-with-relax-ng.xml │ │ │ ├── p-validate-with-schematron.xml │ │ │ ├── p-validate-with-xml-schema.xml │ │ │ ├── p-wrap-sequence.xml │ │ │ ├── p-wrap.xml │ │ │ ├── p-www-form-urldecode.xml │ │ │ ├── p-www-form-urlencode.xml │ │ │ ├── p-xinclude.xml │ │ │ ├── p-xquery.xml │ │ │ ├── p-xsl-formatter.xml │ │ │ ├── p-xslt.xml │ │ │ └── reference.xml │ ├── resources │ │ ├── css │ │ │ ├── xmlcalabash.css │ │ │ └── xproc.css │ │ └── img │ │ │ ├── ItDepends.png │ │ │ ├── amaryllis.jpg │ │ │ ├── debugger-exident-custom.svg │ │ │ ├── debugger-exident.svg │ │ │ ├── debugger-graph-exident.svg │ │ │ ├── debugger-graph-pipeline.svg │ │ │ ├── debugger-graph.svg │ │ │ ├── debugger-pipeline.svg │ │ │ ├── det-a.svg │ │ │ ├── ditaa.png │ │ │ ├── icon.png │ │ │ ├── multithreading.svg │ │ │ ├── plantuml-001.png │ │ │ ├── plantuml-002.png │ │ │ ├── plantuml-003.png │ │ │ ├── railroad-1.svg │ │ │ ├── railroad-2.svg │ │ │ ├── railroad-3.svg │ │ │ ├── threading-fixed.svg │ │ │ ├── threading-graph.svg │ │ │ └── xmlcalabash.png │ ├── rng │ │ └── docbook.rnc │ ├── txt │ │ ├── ditaa.txt │ │ ├── expression.ebnf │ │ ├── plantuml-001.txt │ │ ├── plantuml-002.txt │ │ └── plantuml-003.txt │ ├── userguide │ │ ├── assertions.xml │ │ ├── changelog.xml │ │ ├── colophon.xml │ │ ├── config.xml │ │ ├── debugger.xml │ │ ├── errors.xml │ │ ├── graphs.xml │ │ ├── install.xml │ │ ├── logging.xml │ │ ├── mediatypes.xml │ │ ├── preface.xml │ │ ├── run.xml │ │ ├── threading.xml │ │ ├── tracing.xml │ │ ├── userguide.xml │ │ └── validation.xml │ ├── xpl │ │ ├── ditaa.xpl │ │ ├── mathml.xpl │ │ ├── plantuml-001.xpl │ │ ├── plantuml-002.xpl │ │ ├── plantuml-003.xpl │ │ ├── process.xpl │ │ ├── railroad-001.xpl │ │ └── railroad-002.xpl │ └── xsl │ │ ├── common.xsl │ │ ├── integrate.xsl │ │ ├── markdown-extensions.xsl │ │ ├── merge-standard-prose.xsl │ │ ├── ref-custom.xsl │ │ ├── reference.xsl │ │ ├── rngsyntax.xsl │ │ ├── user-custom.xsl │ │ ├── userguide.xsl │ │ ├── xinclude.xsl │ │ └── xproc.xsl └── tools │ ├── changelog.xsl │ ├── dx-output.xsl │ ├── extract-steps.xsl │ ├── html2txt.xsl │ └── xmlcalabash3.xml ├── ext └── polyglot │ ├── README.md │ ├── build.gradle.kts │ └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── xmlcalabash │ │ │ └── ext │ │ │ └── polyglot │ │ │ ├── PolyglotDocumentResolverProvider.kt │ │ │ ├── PolyglotStep.kt │ │ │ └── PolyglotStepProvider.kt │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ ├── com.xmlcalabash.spi.AtomicStepProvider │ │ │ └── com.xmlcalabash.spi.DocumentResolverProvider │ │ └── com │ │ └── xmlcalabash │ │ └── ext │ │ └── polyglot.xpl │ └── test │ ├── kotlin │ └── SmokeTestPolyglot.kt │ └── resources │ ├── js.xpl │ ├── polyglot.xpl │ ├── python.xpl │ ├── r.xpl │ └── ruby.xpl ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── query.sparql ├── settings.gradle.kts ├── template ├── java │ ├── README.md │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── xmlcalabash │ │ │ │ └── ext │ │ │ │ └── templatejava │ │ │ │ ├── TemplateJava.java │ │ │ │ ├── TemplateStepManager.java │ │ │ │ └── TemplateStepProvider.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── com.xmlcalabash.spi.AtomicStepProvider │ │ └── test │ │ ├── java │ │ └── SmokeTest.java │ │ └── resources │ │ ├── doc.json │ │ ├── pipe.xpl │ │ └── scalar.json └── kotlin │ ├── README.md │ ├── build.gradle.kts │ └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── xmlcalabash │ │ │ └── ext │ │ │ └── templatekotlin │ │ │ ├── TemplateKotlin.kt │ │ │ └── TemplateKotlinStepProvider.kt │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.xmlcalabash.spi.AtomicStepProvider │ └── test │ ├── kotlin │ └── SmokeTestTemplate.kt │ └── resources │ ├── doc.json │ ├── pipe.xpl │ └── scalar.json ├── test-driver ├── build.gradle.kts └── src │ ├── css │ └── test-report.css │ ├── js │ └── filter.js │ ├── main │ └── kotlin │ │ └── com │ │ └── xmlcalabash │ │ └── testdriver │ │ ├── Main.kt │ │ ├── NsReport.kt │ │ ├── NsT.kt │ │ ├── TestCase.kt │ │ ├── TestDriver.kt │ │ ├── TestOptions.kt │ │ └── TestStatus.kt │ ├── test │ └── resources │ │ └── exclusions.txt │ └── xsl │ └── test-report.xsl ├── tests ├── extra-suite │ └── test-suite │ │ ├── documents │ │ ├── address-book.rdf │ │ ├── assertions.xml │ │ ├── catalog-sample.xml │ │ ├── construct.sparql │ │ ├── data1.ttl │ │ ├── data2.ttl │ │ ├── docbook-invalid.xml │ │ ├── document.html │ │ ├── document.md │ │ ├── document.png │ │ ├── document.txt │ │ ├── document.xml │ │ ├── document.xml.Z │ │ ├── document.xml.br │ │ ├── document.xml.bz2 │ │ ├── document.xml.deflate │ │ ├── document.xml.gz │ │ ├── document.xml.lzma │ │ ├── document.xml.xz │ │ ├── document.xsd │ │ ├── documents.7z │ │ ├── documents.a │ │ ├── documents.arj │ │ ├── documents.cpio │ │ ├── documents.jar │ │ ├── documents.pack.gz │ │ ├── documents.tar │ │ ├── documents.tar.gz │ │ ├── documents.zip │ │ ├── dtd │ │ │ ├── core.dtd │ │ │ ├── sample.dtd │ │ │ ├── schema.dtd │ │ │ └── sub │ │ │ │ └── b.dtd │ │ ├── find │ │ │ ├── alt │ │ │ │ ├── config.alts │ │ │ │ └── mobydick.altx │ │ │ ├── bookstore.json │ │ │ ├── bookstore.xml │ │ │ ├── config.json │ │ │ ├── mobydick.json │ │ │ └── mobydick.xml │ │ ├── identity.xsl │ │ ├── query1.rq │ │ ├── query1.sch │ │ ├── query2.rq │ │ ├── rdf.json │ │ ├── rdf.jsonld │ │ ├── rdf.nquads │ │ ├── rdf.ntriples │ │ ├── rdf.shaclc │ │ ├── rdf.trig │ │ ├── rdf.turtle │ │ ├── rdf.xml │ │ ├── rdfa.html │ │ ├── results1.srj │ │ ├── results1.srx │ │ ├── rnc │ │ │ ├── core.rnc │ │ │ ├── schema.rnc │ │ │ └── sub │ │ │ │ └── b.rnc │ │ ├── rng │ │ │ ├── core.rng │ │ │ ├── schema.rng │ │ │ └── sub │ │ │ │ └── b.rng │ │ ├── sample-catalog.xml │ │ ├── sample1.jsonld │ │ ├── sample1.n3 │ │ ├── sample1.nq │ │ ├── sample1.nt │ │ ├── sample1.rdf │ │ ├── sample1.rj │ │ ├── sample1.shaclc │ │ ├── sample1.thrift │ │ ├── sample1.trig │ │ ├── sample1.trix │ │ ├── sample1.ttl │ │ ├── simple-catalog.xml │ │ ├── simple.xml │ │ ├── simple.xsd │ │ ├── subdir │ │ │ ├── second-level.xml │ │ │ └── subdir │ │ │ │ ├── fourth-level.xml │ │ │ │ └── third-level.xml │ │ └── xinclude-321.xml │ │ ├── epubcheck │ │ ├── README.md │ │ └── epub-001.epub │ │ ├── pipelines │ │ ├── assertions1.xpl │ │ ├── assertions2.xpl │ │ ├── assertions3.xpl │ │ ├── show.xsl │ │ ├── step.xpl │ │ └── test │ │ │ └── test.xpl │ │ └── tests │ │ ├── asciidoctor-001.xml │ │ ├── asciidoctor-002.xml │ │ ├── asciidoctor-003.xml │ │ ├── asciidoctor-004.xml │ │ ├── asciidoctor-005.xml │ │ ├── asciidoctor-006.xml │ │ ├── assertions-001.xml │ │ ├── assertions-002.xml │ │ ├── assertions-003.xml │ │ ├── assertions-004.xml │ │ ├── assertions-005.xml │ │ ├── assertions-006.xml │ │ ├── assertions-007.xml │ │ ├── assertions-008.xml │ │ ├── assertions-009.xml │ │ ├── assertions-010.xml │ │ ├── assertions-011.xml │ │ ├── cache-001.xml │ │ ├── cache-002.xml │ │ ├── cache-003.xml │ │ ├── cache-004.xml │ │ ├── cache-005.xml │ │ ├── cache-006.xml │ │ ├── cache-007.xml │ │ ├── catalog-001.xml │ │ ├── catalog-002.xml │ │ ├── collmgr-001.xml │ │ ├── collmgr-002.xml │ │ ├── collmgr-003.xml │ │ ├── collmgr-004.xml │ │ ├── collmgr-005.xml │ │ ├── collmgr-006.xml │ │ ├── cx-until-001.xml │ │ ├── cx-until-002.xml │ │ ├── cx-while-001.xml │ │ ├── ebnf-convert-001.xml │ │ ├── ebnf-convert-002.xml │ │ ├── ebnf-convert-003.xml │ │ ├── ebnf-convert-004.xml │ │ ├── ebnf-convert-005.xml │ │ ├── ebnf-convert-006.xml │ │ ├── epubcheck-001.xml │ │ ├── find-001.xml │ │ ├── find-002.xml │ │ ├── find-003.xml │ │ ├── find-004.xml │ │ ├── find-005.xml │ │ ├── find-006.xml │ │ ├── find-007.xml │ │ ├── find-008.xml │ │ ├── find-009.xml │ │ ├── find-010.xml │ │ ├── issue-160-001.xml │ │ ├── java-properties-001.xml │ │ ├── java-properties-002.xml │ │ ├── java-properties-003.xml │ │ ├── java-properties-004.xml │ │ ├── java-properties-005.xml │ │ ├── java-properties-006.xml │ │ ├── java-properties-007.xml │ │ ├── java-properties-008.xml │ │ ├── java-properties-009.xml │ │ ├── java-properties-010.xml │ │ ├── java-properties-011.xml │ │ ├── java-properties-012.xml │ │ ├── java-properties-013.xml │ │ ├── java-properties-014.xml │ │ ├── java-properties-015.xml │ │ ├── json-patch-001.xml │ │ ├── json-patch-002.xml │ │ ├── json-patch-merge-001.xml │ │ ├── json-patch-merge-002.xml │ │ ├── jsonpath-001.xml │ │ ├── jsonpath-002.xml │ │ ├── jsonpath-003.xml │ │ ├── jsonpath-004.xml │ │ ├── jsonpath-005.xml │ │ ├── lookup-uri-001.xml │ │ ├── lookup-uri-002.xml │ │ ├── markup-blitz-001.xml │ │ ├── markup-blitz-002.xml │ │ ├── message-001.xml │ │ ├── message-002.xml │ │ ├── metadata-extractor-001.xml │ │ ├── polyglot-001.xml │ │ ├── polyglot-002.xml │ │ ├── polyglot-003.xml │ │ ├── polyglot-004.xml │ │ ├── polyglot-005.xml │ │ ├── polyglot-006.xml │ │ ├── polyglot-007.xml │ │ ├── polyglot-008.xml │ │ ├── polyglot-009.xml │ │ ├── polyglot-010.xml │ │ ├── polyglot-011.xml │ │ ├── rdf-jsonld-001.xml │ │ ├── rdf-jsonld-002.xml │ │ ├── rdf-jsonld-003.xml │ │ ├── rdf-n3-001.xml │ │ ├── rdf-n3-002.xml │ │ ├── rdf-n3-003.xml │ │ ├── rdf-nq-001.xml │ │ ├── rdf-nq-002.xml │ │ ├── rdf-nq-003.xml │ │ ├── rdf-nt-001.xml │ │ ├── rdf-nt-002.xml │ │ ├── rdf-nt-003.xml │ │ ├── rdf-rdf-001.xml │ │ ├── rdf-rdf-002.xml │ │ ├── rdf-rdf-003.xml │ │ ├── rdf-rj-001.xml │ │ ├── rdf-rj-002.xml │ │ ├── rdf-rj-003.xml │ │ ├── rdf-rq-001.xml │ │ ├── rdf-srj-001.xml │ │ ├── rdf-srj-002.xml │ │ ├── rdf-srj-003.xml │ │ ├── rdf-srx-001.xml │ │ ├── rdf-srx-002.xml │ │ ├── rdf-srx-003.xml │ │ ├── rdf-thrift-001.xml │ │ ├── rdf-thrift-002.xml │ │ ├── rdf-thrift-003.xml │ │ ├── rdf-trig-001.xml │ │ ├── rdf-trig-002.xml │ │ ├── rdf-trig-003.xml │ │ ├── rdf-trix-001.xml │ │ ├── rdf-trix-002.xml │ │ ├── rdf-trix-003.xml │ │ ├── rdf-ttl-001.xml │ │ ├── rdf-ttl-002.xml │ │ ├── rdf-ttl-003.xml │ │ ├── rr-001.xml │ │ ├── rr-002.xml │ │ ├── rr-003.xml │ │ ├── rr-004.xml │ │ ├── rr-005.xml │ │ ├── rr-006.xml │ │ ├── rr-007.xml │ │ ├── static-expr-context-001.xml │ │ ├── trang-001.xml │ │ ├── trang-002.xml │ │ ├── trang-003.xml │ │ ├── trang-004.xml │ │ ├── trang-005.xml │ │ ├── trang-006.xml │ │ ├── trang-007.xml │ │ ├── trang-008.xml │ │ ├── trang-009.xml │ │ ├── trang-010.xml │ │ ├── trang-011.xml │ │ ├── trang-012.xml │ │ ├── trang-013.xml │ │ ├── trang-014.xml │ │ ├── trang-015.xml │ │ ├── trang-016.xml │ │ ├── unique-id-001.xml │ │ ├── unique-id-002.xml │ │ ├── unique-id-003.xml │ │ ├── unique-id-004.xml │ │ ├── unique-id-005.xml │ │ ├── unique-id-006.xml │ │ ├── unique-id-007.xml │ │ ├── unique-id-008.xml │ │ ├── unique-id-009.xml │ │ ├── unique-id-010.xml │ │ ├── validate-json-schema-001.xml │ │ ├── validate-nvdl-001.xml │ │ ├── validate-rng-001.xml │ │ ├── validate-sch-001.xml │ │ ├── validate-xsd-001.xml │ │ ├── wait-for-update-001.xml │ │ ├── xinclude-321.xml │ │ ├── xmlunit-001.xml │ │ ├── xmlunit-002.xml │ │ ├── xmlunit-003.xml │ │ ├── xmlunit-004.xml │ │ ├── xpath-001.xml │ │ ├── xpath-002.xml │ │ ├── yaml-001.xml │ │ └── yaml-002.xml └── selenium │ └── test-suite │ └── tests │ ├── selenium-001.xml │ ├── selenium-002.xml │ ├── selenium-003.xml │ ├── selenium-004.xml │ ├── selenium-005.xml │ ├── selenium-006.xml │ ├── selenium-007.xml │ ├── selenium-008.xml │ ├── selenium-009.xml │ ├── selenium-010.xml │ ├── selenium-011.xml │ ├── selenium-012.xml │ ├── selenium-013.xml │ ├── selenium-014.xml │ ├── selenium-015.xml │ ├── selenium-016.xml │ ├── selenium-017-xml.xml │ ├── selenium-017.xml │ ├── selenium-018.xml │ ├── selenium-019.xml │ ├── selenium-020.xml │ ├── selenium-021.xml │ ├── selenium-022.xml │ ├── selenium-023.xml │ ├── selenium-024.xml │ ├── selenium-025.xml │ ├── selenium-026.xml │ ├── selenium-027.xml │ ├── selenium-028.xml │ ├── selenium-029.xml │ └── selenium-030.xml ├── tools ├── dsl-gen.xsl ├── graphsvg.js ├── library2builder.xsl ├── markdown-extensions.xml ├── markdown-to-kotlin.xsl ├── resources │ ├── XPath31.ebnf │ ├── schema-for-xslt30.rng │ └── xslt30-dsl.xml └── rng-to-xml.xsl └── xmlcalabash ├── Module.md ├── build.gradle.kts ├── lib └── Alternate_XfoJavaCtl.jar └── src ├── main ├── java │ └── com │ │ └── xmlcalabash │ │ ├── parsers │ │ └── XPath31.java │ │ └── util │ │ └── BuilderLocation.java ├── kotlin │ └── com │ │ └── xmlcalabash │ │ ├── XmlCalabash.kt │ │ ├── XmlCalabashBuilder.kt │ │ ├── XmlCalabashConfiguration.kt │ │ ├── api │ │ ├── CssProcessor.kt │ │ ├── FoProcessor.kt │ │ ├── MessageReporter.kt │ │ ├── Monitor.kt │ │ ├── RegisterSaxonFunctions.kt │ │ └── XProcStep.kt │ │ ├── config │ │ ├── ConfigurationLoader.kt │ │ ├── ExecutionContextImpl.kt │ │ ├── ExecutionContextManager.kt │ │ ├── PipelineConfiguration.kt │ │ ├── SaxonConfiguration.kt │ │ ├── StepConfiguration.kt │ │ └── XProcEnvironment.kt │ │ ├── datamodel │ │ ├── AtomicDocumentStepInstruction.kt │ │ ├── AtomicEmptyStepInstruction.kt │ │ ├── AtomicExpressionStepInstruction.kt │ │ ├── AtomicInlineStepInstruction.kt │ │ ├── AtomicSelectStepInstruction.kt │ │ ├── AtomicStepInstruction.kt │ │ ├── BindingContainer.kt │ │ ├── CatchInstruction.kt │ │ ├── ChooseInstruction.kt │ │ ├── CompileEnvironment.kt │ │ ├── CompoundLoopDeclaration.kt │ │ ├── CompoundStepDeclaration.kt │ │ ├── ConnectionInstruction.kt │ │ ├── DeclareStepInstruction.kt │ │ ├── DocumentContext.kt │ │ ├── DocumentContextImpl.kt │ │ ├── DocumentInstruction.kt │ │ ├── EmptyInstruction.kt │ │ ├── FinallyInstruction.kt │ │ ├── ForEachInstruction.kt │ │ ├── GroupInstruction.kt │ │ ├── GuardExpressionStepInstruction.kt │ │ ├── IfInstruction.kt │ │ ├── ImportFunctionsInstruction.kt │ │ ├── ImportResolver.kt │ │ ├── InlineInstruction.kt │ │ ├── InputBindingInstruction.kt │ │ ├── InputInstruction.kt │ │ ├── InstructionConfiguration.kt │ │ ├── LibraryInstruction.kt │ │ ├── Location.kt │ │ ├── OptionInstruction.kt │ │ ├── OtherwiseInstruction.kt │ │ ├── OutputInstruction.kt │ │ ├── PipeInstruction.kt │ │ ├── PipelineBuilder.kt │ │ ├── PipelineVisualization.kt │ │ ├── PortBindingContainer.kt │ │ ├── RunInputInstruction.kt │ │ ├── RunInstruction.kt │ │ ├── RunOptionInstruction.kt │ │ ├── SpecialType.kt │ │ ├── StandardLibrary.kt │ │ ├── StandardLibraryInstruction.kt │ │ ├── StaticOptionDetails.kt │ │ ├── StaticOptionsManager.kt │ │ ├── StepContainerInterface.kt │ │ ├── StepDeclaration.kt │ │ ├── TryInstruction.kt │ │ ├── UntilInstruction.kt │ │ ├── VariableBindingContainer.kt │ │ ├── VariableInstruction.kt │ │ ├── ViewportInstruction.kt │ │ ├── Visibility.kt │ │ ├── WhenInstruction.kt │ │ ├── WhileInstruction.kt │ │ ├── WithInputInstruction.kt │ │ ├── WithOptionInstruction.kt │ │ ├── WithOutputInstruction.kt │ │ ├── XProcAvtExpression.kt │ │ ├── XProcConstantExpression.kt │ │ ├── XProcErrorExpression.kt │ │ ├── XProcExpression.kt │ │ ├── XProcFunctionLibrary.kt │ │ ├── XProcInstruction.kt │ │ ├── XProcMatchExpression.kt │ │ ├── XProcSelectExpression.kt │ │ └── XProcShortcutExpression.kt │ │ ├── debugger │ │ ├── CliDebugger.kt │ │ ├── Debugger.kt │ │ └── NopDebugger.kt │ │ ├── documents │ │ ├── DocumentProperties.kt │ │ ├── LazyDocumentValue.kt │ │ ├── XProcBinaryDocument.kt │ │ └── XProcDocument.kt │ │ ├── exceptions │ │ ├── DefaultErrorExplanation.kt │ │ ├── ErrorExplanation.kt │ │ ├── ErrorStackFrame.kt │ │ ├── XProcError.kt │ │ ├── XProcException.kt │ │ └── XProcUserError.kt │ │ ├── functions │ │ ├── DocumentPropertiesFunction.kt │ │ ├── DocumentPropertyFunction.kt │ │ ├── ErrorFunction.kt │ │ ├── FunctionLibraryImportableFunction.kt │ │ ├── IterationPositionFunction.kt │ │ ├── IterationSizeFunction.kt │ │ ├── LookupUriFunction.kt │ │ ├── PipelineFunction.kt │ │ ├── StepAvailableFunction.kt │ │ ├── SystemPropertyFunction.kt │ │ └── UrifyFunction.kt │ │ ├── graph │ │ ├── AtomicModel.kt │ │ ├── CompoundModel.kt │ │ ├── Connection.kt │ │ ├── DefaultInput.kt │ │ ├── Edge.kt │ │ ├── Foot.kt │ │ ├── Graph.kt │ │ ├── GraphEnvironment.kt │ │ ├── GraphVisualization.kt │ │ ├── Head.kt │ │ ├── Joiner.kt │ │ ├── Model.kt │ │ ├── ModelInputPort.kt │ │ ├── ModelOption.kt │ │ ├── ModelPort.kt │ │ ├── PipelineModel.kt │ │ ├── Sink.kt │ │ ├── Splitter.kt │ │ └── SubpipelineModel.kt │ │ ├── io │ │ ├── DocumentConverter.kt │ │ ├── DocumentLoader.kt │ │ ├── DocumentManager.kt │ │ ├── DocumentWriter.kt │ │ ├── InternetProtocolRequest.kt │ │ ├── InternetProtocolResponse.kt │ │ ├── Marshaller.kt │ │ ├── MediaType.kt │ │ ├── MediaTypeParameter.kt │ │ ├── MessagePrinter.kt │ │ ├── MimeReader.kt │ │ ├── RdfConverter.kt │ │ └── RdfLoader.kt │ │ ├── namespace │ │ ├── Ns.kt │ │ ├── NsC.kt │ │ ├── NsCx.kt │ │ ├── NsDescription.kt │ │ ├── NsErr.kt │ │ ├── NsFn.kt │ │ ├── NsHtml.kt │ │ ├── NsP.kt │ │ ├── NsRdf.kt │ │ ├── NsRng.kt │ │ ├── NsS.kt │ │ ├── NsSaxon.kt │ │ ├── NsSparqlResults.kt │ │ ├── NsSvg.kt │ │ ├── NsSvrl.kt │ │ ├── NsXlink.kt │ │ ├── NsXml.kt │ │ ├── NsXmlns.kt │ │ ├── NsXs.kt │ │ ├── NsXsi.kt │ │ ├── NsXslt.kt │ │ └── NsXvrl.kt │ │ ├── parsers │ │ ├── XPathExpressionDetails.kt │ │ ├── xpath31 │ │ │ └── XPathExpressionParser.kt │ │ └── xpl │ │ │ ├── XplParser.kt │ │ │ └── elements │ │ │ ├── AnyNode.kt │ │ │ ├── ConditionalExecutionContext.kt │ │ │ ├── ConditionalStepException.kt │ │ │ ├── DeclareStepNode.kt │ │ │ ├── ElementNode.kt │ │ │ ├── ImportFunctionsNode.kt │ │ │ ├── ImportNode.kt │ │ │ ├── LibraryNode.kt │ │ │ ├── OptionNode.kt │ │ │ ├── RootNode.kt │ │ │ ├── StepImplementation.kt │ │ │ ├── TextNode.kt │ │ │ ├── UseWhenContext.kt │ │ │ ├── XplDocument.kt │ │ │ └── XplDocumentManager.kt │ │ ├── runtime │ │ ├── ExpressionEvaluator.kt │ │ ├── LazyValue.kt │ │ ├── PipelineReceiverProxy.kt │ │ ├── ProcessMatch.kt │ │ ├── ProcessMatchingNodes.kt │ │ ├── RuntimeEnvironment.kt │ │ ├── XProcDescription.kt │ │ ├── XProcExecutionContext.kt │ │ ├── XProcPipeline.kt │ │ ├── XProcRuntime.kt │ │ ├── XProcStepConfiguration.kt │ │ ├── api │ │ │ ├── Receiver.kt │ │ │ ├── RuntimeOption.kt │ │ │ ├── RuntimePort.kt │ │ │ └── StepSignature.kt │ │ ├── model │ │ │ ├── AtomicBuiltinOptionModel.kt │ │ │ ├── AtomicBuiltinStepModel.kt │ │ │ ├── AtomicCompoundStepModel.kt │ │ │ ├── AtomicStepModel.kt │ │ │ ├── AtomicUserStepModel.kt │ │ │ ├── CompoundStepModel.kt │ │ │ ├── FootModel.kt │ │ │ ├── HeadModel.kt │ │ │ ├── ModelEdge.kt │ │ │ └── StepModel.kt │ │ ├── parameters │ │ │ ├── DocumentStepParameters.kt │ │ │ ├── EmptyStepParameters.kt │ │ │ ├── ExpressionStepParameters.kt │ │ │ ├── InlineStepParameters.kt │ │ │ ├── OptionStepParameters.kt │ │ │ ├── RunStepStepParameters.kt │ │ │ ├── RuntimeStepParameters.kt │ │ │ ├── SelectStepParameters.kt │ │ │ ├── StepParameters.kt │ │ │ ├── TryCatchStepParameters.kt │ │ │ ├── UnimplementedStepParameters.kt │ │ │ └── ViewportStepParameters.kt │ │ └── steps │ │ │ ├── AbstractStep.kt │ │ │ ├── AtomicOptionStep.kt │ │ │ ├── AtomicStep.kt │ │ │ ├── ChooseOtherwiseStep.kt │ │ │ ├── ChooseStep.kt │ │ │ ├── ChooseWhenStep.kt │ │ │ ├── CompoundStep.kt │ │ │ ├── CompoundStepFoot.kt │ │ │ ├── CompoundStepHead.kt │ │ │ ├── Consumer.kt │ │ │ ├── ForEachStep.kt │ │ │ ├── GroupStep.kt │ │ │ ├── PipelineStep.kt │ │ │ ├── RunStep.kt │ │ │ ├── TryCatchStep.kt │ │ │ ├── TryFinallyStep.kt │ │ │ ├── TryStep.kt │ │ │ ├── UntilStep.kt │ │ │ ├── ViewportStep.kt │ │ │ └── WhileStep.kt │ │ ├── spi │ │ ├── AtomicStepManager.kt │ │ ├── AtomicStepProvider.kt │ │ ├── AtomicStepServiceProvider.kt │ │ ├── Configurer.kt │ │ ├── ConfigurerProvider.kt │ │ ├── ConfigurerServiceProvider.kt │ │ ├── ContentTypeConverter.kt │ │ ├── ContentTypeConverterProvider.kt │ │ ├── ContentTypeConverterServiceProvider.kt │ │ ├── ContentTypeLoader.kt │ │ ├── ContentTypeLoaderProvider.kt │ │ ├── ContentTypeLoaderServiceProvider.kt │ │ ├── DocumentResolver.kt │ │ ├── DocumentResolverProvider.kt │ │ ├── DocumentResolverServiceProvider.kt │ │ ├── PagedMediaManager.kt │ │ ├── PagedMediaProvider.kt │ │ └── PagedMediaServiceProvider.kt │ │ ├── steps │ │ ├── AbstractArchiveStep.kt │ │ ├── AbstractAtomicStep.kt │ │ ├── AbstractTextStep.kt │ │ ├── AddAttributeStep.kt │ │ ├── AddXmlBaseStep.kt │ │ ├── ArchiveManifestStep.kt │ │ ├── ArchiveStep.kt │ │ ├── CastContentTypeStep.kt │ │ ├── CompareStep.kt │ │ ├── CompressStep.kt │ │ ├── CountStep.kt │ │ ├── CssFormatterStep.kt │ │ ├── DeleteStep.kt │ │ ├── EncodeStep.kt │ │ ├── ErrorStep.kt │ │ ├── FilterStep.kt │ │ ├── HashStep.kt │ │ ├── HttpRequestStep.kt │ │ ├── IdentityStep.kt │ │ ├── InsertStep.kt │ │ ├── InvisibleXmlStep.kt │ │ ├── JsonJoinStep.kt │ │ ├── JsonMergeStep.kt │ │ ├── LabelElementsStep.kt │ │ ├── LoadStep.kt │ │ ├── MakeAbsoluteUrisStep.kt │ │ ├── MarkdownToHtml.kt │ │ ├── MessageStep.kt │ │ ├── NamespaceDeleteStep.kt │ │ ├── NamespaceRenameStep.kt │ │ ├── PackStep.kt │ │ ├── RenameStep.kt │ │ ├── ReplaceStep.kt │ │ ├── SendMailStep.kt │ │ ├── SetAttributesStep.kt │ │ ├── SetPropertiesStep.kt │ │ ├── SinkStep.kt │ │ ├── SleepStep.kt │ │ ├── SplitSequenceStep.kt │ │ ├── StoreStep.kt │ │ ├── StringReplaceStep.kt │ │ ├── TextCountStep.kt │ │ ├── TextHeadStep.kt │ │ ├── TextJoinStep.kt │ │ ├── TextReplaceStep.kt │ │ ├── TextSortStep.kt │ │ ├── TextTailStep.kt │ │ ├── UnarchiveStep.kt │ │ ├── UncompressStep.kt │ │ ├── UnwrapStep.kt │ │ ├── UuidStep.kt │ │ ├── WrapSequenceStep.kt │ │ ├── WrapStep.kt │ │ ├── WwwFormUrlDecodeStep.kt │ │ ├── WwwFormUrlEncodeStep.kt │ │ ├── XIncludeStep.kt │ │ ├── XQueryStep.kt │ │ ├── XslFormatterStep.kt │ │ ├── XsltStep.kt │ │ ├── archives │ │ │ ├── AbstractArchiveFile.kt │ │ │ ├── ArInputArchive.kt │ │ │ ├── ArOutputArchive.kt │ │ │ ├── ArchiveType.kt │ │ │ ├── ArjInputArchive.kt │ │ │ ├── CpioInputArchive.kt │ │ │ ├── CpioOutputArchive.kt │ │ │ ├── InputArchive.kt │ │ │ ├── JarInputArchive.kt │ │ │ ├── JarOutputArchive.kt │ │ │ ├── OutputArchive.kt │ │ │ ├── SevenZInputArchive.kt │ │ │ ├── SevenZOutputArchive.kt │ │ │ ├── TarInputArchive.kt │ │ │ ├── TarOutputArchive.kt │ │ │ ├── XArchiveEntry.kt │ │ │ ├── ZipInputArchive.kt │ │ │ └── ZipOutputArchive.kt │ │ ├── extension │ │ │ ├── AbstractJsonPatch.kt │ │ │ ├── AbstractRdfStep.kt │ │ │ ├── AbstractTrangStep.kt │ │ │ ├── AsciidoctorStep.kt │ │ │ ├── CacheAddStep.kt │ │ │ ├── CacheDeleteStep.kt │ │ │ ├── CollectionManagerStep.kt │ │ │ ├── DitaaStep.kt │ │ │ ├── EPubCheckConfigurer.kt │ │ │ ├── EPubCheckStep.kt │ │ │ ├── EbnfConvertStep.kt │ │ │ ├── FindStep.kt │ │ │ ├── JsonPatchDiffStep.kt │ │ │ ├── JsonPatchStep.kt │ │ │ ├── JsonPath.kt │ │ │ ├── JsonPathStep.kt │ │ │ ├── MarkupBlitzStep.kt │ │ │ ├── MathMLtoSvgStep.kt │ │ │ ├── MetadataExtractorImpl.kt │ │ │ ├── MetadataExtractorStep.kt │ │ │ ├── PipelineMessagesStep.kt │ │ │ ├── PlantumlStep.kt │ │ │ ├── RailroadStep.kt │ │ │ ├── RdfGraphStep.kt │ │ │ ├── RdfMergeStep.kt │ │ │ ├── RdfaStep.kt │ │ │ ├── SeleniumStep.kt │ │ │ ├── SparqlStep.kt │ │ │ ├── TrangFilesStep.kt │ │ │ ├── TrangStep.kt │ │ │ ├── ULID.kt │ │ │ ├── UniqueIdStep.kt │ │ │ ├── WaitForUpdateStep.kt │ │ │ ├── XPathStep.kt │ │ │ └── XmlUnitStep.kt │ │ ├── file │ │ │ ├── CreateTempfileStep.kt │ │ │ ├── DirectoryDir.kt │ │ │ ├── DirectoryEntry.kt │ │ │ ├── DirectoryFile.kt │ │ │ ├── DirectoryListStep.kt │ │ │ ├── FileCopyOrMove.kt │ │ │ ├── FileCopyStep.kt │ │ │ ├── FileDeleteStep.kt │ │ │ ├── FileInfoStep.kt │ │ │ ├── FileMkdirStep.kt │ │ │ ├── FileMoveStep.kt │ │ │ ├── FileStep.kt │ │ │ └── FileTouchStep.kt │ │ ├── internal │ │ │ ├── DocumentStep.kt │ │ │ ├── EmptyStep.kt │ │ │ ├── ExpressionStep.kt │ │ │ ├── GuardStep.kt │ │ │ ├── InlineStep.kt │ │ │ ├── JoinerStep.kt │ │ │ ├── NullStep.kt │ │ │ ├── OptionExpressionStep.kt │ │ │ ├── SelectStep.kt │ │ │ ├── SplitterStep.kt │ │ │ └── UnimplementedStep.kt │ │ ├── os │ │ │ ├── OsExec.kt │ │ │ └── OsInfo.kt │ │ ├── pagedmedia │ │ │ ├── antennahouse │ │ │ │ ├── AbstractAH.kt │ │ │ │ ├── AhManager.kt │ │ │ │ ├── CssAH.kt │ │ │ │ └── FoAH.kt │ │ │ ├── fop │ │ │ │ ├── FoFop.kt │ │ │ │ └── FopManager.kt │ │ │ ├── prince │ │ │ │ ├── CssPrince.kt │ │ │ │ └── PrinceManager.kt │ │ │ └── weasyprint │ │ │ │ ├── CssWeasyprint.kt │ │ │ │ └── WeasyprintManager.kt │ │ └── validation │ │ │ ├── CachingErrorListener.kt │ │ │ ├── Errors.kt │ │ │ ├── ValidateWithDTD.kt │ │ │ ├── ValidateWithJsonSchema.kt │ │ │ ├── ValidateWithNVDL.kt │ │ │ ├── ValidateWithRelaxNG.kt │ │ │ ├── ValidateWithSchematron.kt │ │ │ └── ValidateWithXmlSchema.kt │ │ ├── tracing │ │ ├── DetailTraceListener.kt │ │ ├── DocumentDetail.kt │ │ ├── GetResourceDetail.kt │ │ ├── NsTrace.kt │ │ ├── StandardTraceListener.kt │ │ ├── StepStartDetail.kt │ │ ├── StepStopDetail.kt │ │ ├── TraceDetail.kt │ │ └── TraceListener.kt │ │ ├── util │ │ ├── AssertionsLevel.kt │ │ ├── AssertionsMonitor.kt │ │ ├── BufferingMessageReporter.kt │ │ ├── BufferingReceiver.kt │ │ ├── DefaultLocation.kt │ │ ├── DefaultMarkdownConfigurer.kt │ │ ├── DefaultMessagePrinter.kt │ │ ├── DefaultMessageReporter.kt │ │ ├── DefaultOutputReceiver.kt │ │ ├── DiscardingReceiver.kt │ │ ├── DurationUtils.kt │ │ ├── FileUtils.kt │ │ ├── HashUtils.kt │ │ ├── InternalDocumentResolver.kt │ │ ├── InvisibleXmlImpl.kt │ │ ├── InvisibleXmlMarkupBlitz.kt │ │ ├── InvisibleXmlNineML.kt │ │ ├── LoggingMessageReporter.kt │ │ ├── MarkdownConfigurer.kt │ │ ├── MarkdownExtensions.kt │ │ ├── MediaClassification.kt │ │ ├── MemoMimetypesFileTypeMap.kt │ │ ├── NodeLocation.kt │ │ ├── NopMessageReporter.kt │ │ ├── Report.kt │ │ ├── S9Api.kt │ │ ├── SaxonErrorReporter.kt │ │ ├── SaxonTreeBuilder.kt │ │ ├── SaxonXsdValidator.kt │ │ ├── SchematronImpl.kt │ │ ├── SimpleDocumentResolverProvider.kt │ │ ├── SimpleStepProvider.kt │ │ ├── SysIdLocation.kt │ │ ├── TransformationNamespaces.kt │ │ ├── TypeUtils.kt │ │ ├── UriUtils.kt │ │ ├── Urify.kt │ │ ├── ValueTemplate.kt │ │ ├── ValueTemplateFilter.kt │ │ ├── ValueTemplateFilterNone.kt │ │ ├── ValueTemplateFilterXml.kt │ │ ├── ValueTemplateParser.kt │ │ ├── ValueUtils.kt │ │ ├── Verbosity.kt │ │ ├── VisualizerOutput.kt │ │ ├── VoidLocation.kt │ │ ├── XAttributeMap.kt │ │ ├── XProcCollectionFinder.kt │ │ ├── XmlViewportComposer.kt │ │ ├── XmlViewportItem.kt │ │ ├── XsdResolver.kt │ │ └── spi │ │ │ ├── StandardConfigurer.kt │ │ │ ├── StandardContentTypeConverter.kt │ │ │ ├── StandardContentTypeLoader.kt │ │ │ ├── StandardDocumentResolver.kt │ │ │ ├── StandardPagedMediaProvider.kt │ │ │ └── StandardStepProvider.kt │ │ ├── visualizers │ │ ├── AbstractVisualizer.kt │ │ ├── Detail.kt │ │ ├── Plain.kt │ │ └── Silent.kt │ │ ├── xslt │ │ └── xslt.kt │ │ └── xvrl │ │ ├── XvrlCategory.kt │ │ ├── XvrlContainer.kt │ │ ├── XvrlContext.kt │ │ ├── XvrlCreator.kt │ │ ├── XvrlDetection.kt │ │ ├── XvrlDigest.kt │ │ ├── XvrlDocument.kt │ │ ├── XvrlElement.kt │ │ ├── XvrlLet.kt │ │ ├── XvrlLocation.kt │ │ ├── XvrlMessage.kt │ │ ├── XvrlMessageElement.kt │ │ ├── XvrlProvenance.kt │ │ ├── XvrlReport.kt │ │ ├── XvrlReportMetadata.kt │ │ ├── XvrlReports.kt │ │ ├── XvrlSchema.kt │ │ ├── XvrlSummary.kt │ │ ├── XvrlSupplemental.kt │ │ ├── XvrlText.kt │ │ ├── XvrlTimestamp.kt │ │ ├── XvrlTitle.kt │ │ ├── XvrlValidator.kt │ │ └── XvrlValueOf.kt └── resources │ ├── META-INF │ └── services │ │ ├── com.xmlcalabash.spi.AtomicStepProvider │ │ ├── com.xmlcalabash.spi.DocumentResolverProvider │ │ └── com.xmlcalabash.spi.PagedMediaProvider │ ├── com │ └── xmlcalabash │ │ ├── archive-manifest.rnc │ │ ├── debugger.ixml │ │ ├── debugger.txt │ │ ├── description.rnc │ │ ├── dot2text.xsl │ │ ├── explain-errors.txt │ │ ├── ext │ │ ├── asciidoctor.xpl │ │ ├── cache.xpl │ │ ├── collection-manager.xpl │ │ ├── diagramming.xpl │ │ ├── ebnf-convert.xpl │ │ ├── epubcheck.xpl │ │ ├── find.xpl │ │ ├── json-patch.xpl │ │ ├── jsonpath.xpl │ │ ├── markup-blitz.xpl │ │ ├── metadata-extractor.xpl │ │ ├── pipeline-messages.xpl │ │ ├── railroad.xpl │ │ ├── rdf.xpl │ │ ├── selenium-grammar.ixml │ │ ├── selenium-grammar.rnc │ │ ├── selenium.xpl │ │ ├── trang.xpl │ │ ├── unique-id.xpl │ │ ├── wait-for-update.xpl │ │ ├── xmlunit.xpl │ │ └── xpath.xpl │ │ ├── format-xvrl.xsl │ │ ├── graph2dot.xsl │ │ ├── graphstyle.xsl │ │ ├── graphsvg.xsl │ │ ├── graphviz.xsl │ │ ├── library.xpl │ │ ├── mb-ixml.ixml │ │ ├── pipeline-messages.rnc │ │ ├── properties.rnc │ │ ├── schxslt2-1.3.1 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── VERSION │ │ └── transpile.xsl │ │ ├── sparql2text.xsl │ │ ├── static.xsl │ │ ├── trace.rnc │ │ ├── xml-calabash.rnc │ │ └── xpath.xsl │ └── logback.xml └── test ├── Java └── com │ └── xmlcalabash │ └── test │ └── JavaApiTest.java ├── kotlin └── com │ └── xmlcalabash │ └── test │ ├── AntennaHouseTest.kt │ ├── ApiTest.kt │ ├── ArchiveTest.kt │ ├── BuilderApiTest.kt │ ├── CxMetadataExtractorTest.kt │ ├── CxPipelineMessages.kt │ ├── CxRailroadTest.kt │ ├── CxSendMail.kt │ ├── ExpressionAvtTest.kt │ ├── ExpressionSelectTest.kt │ ├── FopTest.kt │ ├── MarshallTest.kt │ ├── MediaTypeTest.kt │ ├── PagedMediaTest.kt │ ├── ParserTest.kt │ ├── PrinceTest.kt │ ├── SConfigTest.kt │ ├── UriTestNonWindows.kt │ ├── UriTestWindows.kt │ ├── UrifyNonWindowsTest.kt │ ├── UrifyWindowsTest.kt │ ├── UseWhenTest.kt │ ├── ValueTemplateParserTest.kt │ ├── WeasyprintTest.kt │ ├── XAttributeMapTest.kt │ ├── XPathParserTest.kt │ ├── XmlCalabashTestClass.kt │ ├── XsltDslTest.kt │ └── XvrlReportTest.kt └── resources ├── 001-pipeline-messages.xpl ├── 001-railroad.xpl ├── configfile.xml ├── css-formatter.css ├── css-formatter.html ├── css.xpl ├── cx-metadata-extractor ├── amaryllis.bmp ├── amaryllis.eps ├── amaryllis.gif ├── amaryllis.jpg ├── amaryllis.pdf ├── amaryllis.png ├── document.pdf ├── envelope.pdf ├── pipe-encrypted-pdf.xpl └── pipe.xpl ├── doc.css ├── doc.html ├── envelope.fo ├── extension.xpl ├── fo.xpl ├── fop.xpl ├── identity.xpl ├── marshall ├── input-base64.xml ├── input-broken.html ├── input-broken.xhtml ├── input-broken.xml ├── input-json-array.json ├── input-json-map-dup-keys.json ├── input-json-map.json ├── input-json-number.json ├── input-json-string.json ├── input.html ├── input.jpg ├── input.toml ├── input.txt ├── input.xhtml ├── input.xml ├── input.yaml └── input.zip ├── names.xpl ├── parser ├── functions.xqy ├── functions.xsl ├── importfunctions.xpl └── library1.xpl ├── prince.xpl ├── schematron ├── doc-001.xml └── schema-001.xml ├── send-mail ├── pipe-html.xpl ├── pipe-mp.xpl └── pipe.xpl ├── static-error.xpl ├── usewhen ├── A.xpl ├── B.xpl ├── declexcluded.xpl ├── declimport1.xpl ├── declimport2.xpl ├── declimport3.xpl ├── declloop.xpl ├── decloption1.xpl ├── decloption2.xpl ├── decloption3.xpl ├── decltrue.xpl ├── excluded.xpl ├── none.xpl ├── pusewhen.xpl └── simple.xpl ├── weasyprint.xpl └── xslt.xpl /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle/ 2 | .kotlin/ 3 | build/ 4 | /lib/ 5 | /documentation/lib/ 6 | /paged-media/**/lib/ 7 | /test-driver/lib/ 8 | saxon-license.lic 9 | .#* 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/3.0-test-suite"] 2 | path = tests/3.0-test-suite 3 | url = https://github.com/xproc/3.0-test-suite.git 4 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: 301 Moved Permanently 2 | 3 | XML Calabash development has [[https://codeberg.org/xmlcalabash/xmlcalabash3][moved to Codeberg]]. 4 | 5 | Apologies for any inconvenience. 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /*.xpl 2 | /*.svg 3 | /*.xml 4 | /*.dot 5 | /*.xsl 6 | /*.xqy 7 | /*.json 8 | /*.yaml 9 | -------------------------------------------------------------------------------- /app/Module.md: -------------------------------------------------------------------------------- 1 | # Module XML Calabash Application 2 | 3 | This is the command line application that runs pipelines 4 | 5 | # Package com.xmlcalabash.app 6 | 7 | This package provides the command line application that runs XProc pipelines. 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/docs/README.md: -------------------------------------------------------------------------------- 1 | # XML Calabash version @@VERSION@@ 2 | 3 | This is an alpha release. A lot of things work. Some things don’t. 4 | YMMV. Please report any problems as issues: 5 | https://github.com/xmlcalabash/xmlcalabash3/issues 6 | 7 | Do not put this in production. 8 | 9 | Example: 10 | 11 | ``` 12 | java -jar xmlcalabash-app-@@VERSION@@.jar helloWorld.xpl 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/docs/extra/README.md: -------------------------------------------------------------------------------- 1 | # XML Calabash “extra” jars 2 | 3 | Any jar files added to this directory will automatically be placed 4 | on the classpath by the “xmlcalabash” script(s) in the release 5 | directory. 6 | 7 | This can be used to install a different version of a dependency or to 8 | add more jars to the release, for example for extension steps 9 | published separately. 10 | -------------------------------------------------------------------------------- /app/src/main/docs/helloWorld.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | This is {p:system-property('p:product-name') 9 | } version {p:system-property('p:product-version')}. 10 | Share and enjoy! 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/xmlcalabash/app/Main.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.app 2 | 3 | /** 4 | * Run the XML Calabash application with the specified arguments. 5 | * 6 | * This function simply passes the command line arguments to [XmlCalabashCli]. 7 | */ 8 | class Main { 9 | companion object { 10 | @JvmStatic 11 | fun main(vararg args: String) { 12 | XmlCalabashCli.run(args) 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/scripts/xmlcalabash.ps1: -------------------------------------------------------------------------------- 1 | # This is a fairly naive Powershell script that constructs a classpath for 2 | # running XML Calabash. The idea is that it puts jar files from the "extra" 3 | # directory ahead of jar files from the "lib" directory. This should support 4 | # overriding jars. And supports running steps that require extra libraries. 5 | 6 | $cp = "$PSScriptRoot\xmlcalabash-app-@@VERSION@@.jar" 7 | 8 | if (![System.IO.File]::Exists("$cp")) { 9 | Write-Host "XML Calabash script did not find the @@VERSION@@ distribution jar" 10 | Exit 1 11 | } 12 | 13 | Get-ChildItem "$PSScriptRoot\extra" -Filter *.jar | 14 | ForEach-Object { 15 | $cp = "$cp;$PSScriptroot\lib\$_" 16 | } 17 | 18 | Get-ChildItem "$PSScriptRoot\lib" -Filter *.jar | 19 | ForEach-Object { 20 | $cp = "$cp;$PSScriptroot\lib\$_" 21 | } 22 | 23 | # FIXME: should there be some attempt to look for $Env:JAVA_HOME here? 24 | 25 | java -cp "$cp" com.xmlcalabash.app.Main $args 26 | -------------------------------------------------------------------------------- /buildSrc/gradle.properties: -------------------------------------------------------------------------------- 1 | saxonVersion=12.6 2 | docbookVersion=5.2 3 | xslTNGversion=2.5.0 4 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | versionCatalogs { 3 | create("libs", { from(files("../gradle/libs.versions.toml")) }) 4 | } 5 | } 6 | 7 | rootProject.name = "buildSrc" 8 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/buildlogic.kotlin-application-conventions.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.xmlcalabash.build.ExternalDependencies 2 | 3 | plugins { 4 | id("buildlogic.kotlin-common-conventions") 5 | } 6 | 7 | dependencies { 8 | ExternalDependencies.of(listOf("xmlcalabash", "asciidoctor", "diagramming", "ebnf-convert", 9 | "epubcheck", "find", "json-patch", "jsonpath", 10 | "markup-blitz", "metadata-extractor", 11 | "paged-media-fop", "paged-media-prince", 12 | "railroad", "rdf", 13 | "selenium", "send-mail", "trang", "unique-id", "xmlunit")).forEach { 14 | implementation(it) { 15 | exclude(group="net.sf.saxon", module="Saxon-HE") 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/extensions.kt: -------------------------------------------------------------------------------- 1 | interface XmlCalExtension { 2 | } 3 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/xmlcal.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java-library") 3 | } 4 | 5 | repositories { 6 | mavenLocal() 7 | mavenCentral() 8 | maven { url = uri("https://maven.saxonica.com/maven") } 9 | } 10 | 11 | val extension = project.extensions.create("xmlcal") 12 | -------------------------------------------------------------------------------- /containers/apache2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Created by Norm Walsh for running the XProc test suite http tests. 2 | # Note: if you change the version of httpd in this container, you 3 | # may also need to change the configuration and other setup files 4 | # mounted in the container (see ../docker-compose.yml) 5 | FROM httpd:2.4 AS build 6 | 7 | RUN apt-get update -y 8 | RUN apt-get install -y apt-utils locales curl procps 9 | RUN apt-get install -y libcgi-pm-perl 10 | 11 | RUN mkdir /src 12 | 13 | CMD ["httpd-foreground"] 14 | -------------------------------------------------------------------------------- /containers/apache2/README: -------------------------------------------------------------------------------- 1 | This is a copy of the setup used by the XProc test suite. (I copied it because 2 | the XProc test suite container on Dockerhub is X86 and I don't feel like working 3 | out how to publish an ARM version right now.) 4 | 5 | You'll need the XProc test suite for the directories to mount... -------------------------------------------------------------------------------- /containers/apache2/build.sh: -------------------------------------------------------------------------------- 1 | # If you have trouble with an update, run the build with --no-cache 2 | 3 | if [ `uname -p` = 'arm' ]; then 4 | ARCH=aarch64 5 | else 6 | ARCH=x86_64 7 | fi 8 | 9 | docker build . --platform=linux/$ARCH --file Dockerfile --tag xmlcalabash-apache 10 | -------------------------------------------------------------------------------- /containers/sendria/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-alpine AS build 2 | 3 | # Copied for local install inorder to get the right architecture 4 | 5 | ARG VERSION=2.2.2 6 | 7 | RUN addgroup -S sendria && adduser -S sendria -G sendria 8 | WORKDIR /home/sendria 9 | USER sendria 10 | RUN python3 -m pip install --user sendria==$VERSION 11 | ENV PATH="/home/sendria/.local/bin:$PATH" 12 | 13 | EXPOSE 1025 1080 14 | 15 | ENTRYPOINT [ "sendria", "--foreground", "--db=./mails.sqlite", "--smtp-ip=0.0.0.0", "--http-ip=0.0.0.0" ] 16 | -------------------------------------------------------------------------------- /containers/sendria/build.sh: -------------------------------------------------------------------------------- 1 | # If you have trouble with an update, run the build with --no-cache 2 | 3 | if [ `uname -p` = 'arm' ]; then 4 | ARCH=aarch64 5 | else 6 | ARCH=x86_64 7 | fi 8 | 9 | docker build . --platform=linux/$ARCH --file Dockerfile --tag xmlcalabash-sendria 10 | -------------------------------------------------------------------------------- /containers/testing/.gitignore: -------------------------------------------------------------------------------- 1 | output/ -------------------------------------------------------------------------------- /containers/testing/build.sh: -------------------------------------------------------------------------------- 1 | # If you have trouble with an update, run the build with --no-cache 2 | 3 | if [ `uname -p` = 'arm' ]; then 4 | ARCH=aarch64 5 | GARCH=aarch64 6 | else 7 | ARCH=x86_64 8 | GARCH=x64 9 | fi 10 | 11 | docker build . --platform=linux/$ARCH --file Dockerfile --tag xmlcalabash-testing \ 12 | --build-arg="targetarch=$ARCH" --build-arg="graalvmarch=$GARCH" 13 | -------------------------------------------------------------------------------- /containers/testing/scripts/build-and-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export WEBSERVER=http://webserver 4 | export SMTPSERVER=sendriasmtp 5 | 6 | rsync -ar --delete --exclude build --exclude .gradle /sources/ /xmlcalabash/src/ 7 | cd /xmlcalabash/src 8 | if [ "$1" = "clean" ]; then 9 | ./gradlew --console=plain clean 10 | fi 11 | 12 | rm -rf /output/reports/xmlcalabash 13 | 14 | ./gradlew --console=plain xmlcalabash:test 15 | 16 | mkdir -p /output/reports/xmlcalabash 17 | 18 | rsync -ar --delete xmlcalabash/build/reports/ /output/reports/xmlcalabash/ 19 | -------------------------------------------------------------------------------- /containers/testing/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /xmlcalabash/src && rsync -ar --delete --exclude build --exclude .gradle /sources/ ./ 4 | pwd 5 | ./gradlew --console=plain clean 6 | ./gradlew --console=plain stage 7 | -------------------------------------------------------------------------------- /containers/testing/scripts/test-report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | shopt -s nullglob 4 | 5 | export WEBSERVER=http://webserver 6 | export SMTPSERVER=sendriasmtp 7 | 8 | rsync -ar --delete --exclude build --exclude .gradle /sources/ /xmlcalabash/src/ 9 | cd /xmlcalabash/src 10 | if [ "$1" = "clean" ]; then 11 | ./gradlew --console=plain clean 12 | shift 13 | fi 14 | 15 | compgen -W test-driver/build/*.xml > /dev/null 2>&1 16 | if [ $? -lt 2 ]; then 17 | rm -f test-driver/build/*.xml 18 | fi 19 | 20 | ./gradlew --console=plain -PWHOST=$WEBSERVER -PSHOST=$SMTPSERVER ${1:-test-report} 21 | 22 | compgen -W test-driver/build/*.xml > /dev/null 2>&1 23 | if [ $? -lt 2 ]; then 24 | cp test-driver/build/*.xml /output/ 25 | fi 26 | -------------------------------------------------------------------------------- /documentation/src/dokka/resources/css/xmlcalabash.css: -------------------------------------------------------------------------------- 1 | /* Stylesheet customizations */ 2 | 3 | html { 4 | font-size: 16pt; 5 | } 6 | -------------------------------------------------------------------------------- /documentation/src/examples/rdf/query.rq: -------------------------------------------------------------------------------- 1 | PREFIX rdf: 2 | PREFIX rdfs: 3 | PREFIX c: 4 | PREFIX v: 5 | PREFIX p: 6 | 7 | SELECT ?category ?name ?region ?locality 8 | WHERE 9 | { 10 | ?x c:associatedName ?name . 11 | ?x p:category ?category . 12 | ?x p:category "Restaurants" . 13 | ?x v:workAdr ?addr . 14 | ?addr v:country-name "GB" . 15 | ?addr v:region ?region . 16 | ?addr v:locality ?locality . 17 | } 18 | -------------------------------------------------------------------------------- /documentation/src/examples/xml/default-ch2.xml: -------------------------------------------------------------------------------- 1 | 2 | Second Chapter 3 |

4 |
5 | -------------------------------------------------------------------------------- /documentation/src/examples/xml/default-input.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | First Chapter 6 |

7 |
8 | 9 | Third Chapter 10 |

11 |
12 | Appendix 13 |

14 |
15 |
16 | -------------------------------------------------------------------------------- /documentation/src/examples/xml/multithreading.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /documentation/src/examples/xml/threading.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | One Two Three 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/add-attribute-001.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 10 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/add-status.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/delete-001.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/delete-002.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/graph-pipeline.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {$today} 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/rdfa.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/simple.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /documentation/src/examples/xpl/sparql.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /documentation/src/reference/preface.xml: -------------------------------------------------------------------------------- 1 | 5 | Preface 6 | 7 | This whole things is pretty rough. There are some experiments with new 8 | step documentation. And ultimately there needs to be reference documentation about the APIs 9 | and things. Maybe when they’re a little a little more baked and a little less runny batter. 10 | 11 | 12 | All of the standard and extension steps are included in the reference. 13 | The steps that have descriptions providing additional, implementation-specific detail 14 | are indicated in the table of contents with a bold font and a “✵” icon. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /documentation/src/reference/rdf-steps/reference.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | RDF extension steps 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /documentation/src/reference/running.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | Running example 8 | 9 | 10 | Most of the examples in this reference use the same input document: 11 | default-input.xml. 12 | To avoid repeating it in every example, it is summarized here. 13 | 14 | 16 | 17 | Where the content of default-ch2.xml is: 18 | 19 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /documentation/src/resources/img/ItDepends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/ItDepends.png -------------------------------------------------------------------------------- /documentation/src/resources/img/amaryllis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/amaryllis.jpg -------------------------------------------------------------------------------- /documentation/src/resources/img/ditaa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/ditaa.png -------------------------------------------------------------------------------- /documentation/src/resources/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/icon.png -------------------------------------------------------------------------------- /documentation/src/resources/img/plantuml-001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/plantuml-001.png -------------------------------------------------------------------------------- /documentation/src/resources/img/plantuml-002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/plantuml-002.png -------------------------------------------------------------------------------- /documentation/src/resources/img/plantuml-003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/plantuml-003.png -------------------------------------------------------------------------------- /documentation/src/resources/img/xmlcalabash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/documentation/src/resources/img/xmlcalabash.png -------------------------------------------------------------------------------- /documentation/src/txt/ditaa.txt: -------------------------------------------------------------------------------- 1 | +--------+ +-------+ +-------+ 2 | | | --+ ditaa +--> | | 3 | | Text | +-------+ |diagram| 4 | |Document| |!magic!| | | 5 | | {d}| | | | | 6 | +---+----+ +-------+ +-------+ 7 | : ^ 8 | | Lots of work | 9 | +-------------------------+ 10 | -------------------------------------------------------------------------------- /documentation/src/txt/expression.ebnf: -------------------------------------------------------------------------------- 1 | Expression ::= Number op Number | "(" Expression ")" 2 | Number ::= [0-9]+ 3 | op ::= "+" | "-" | "×" | "÷" 4 | -------------------------------------------------------------------------------- /documentation/src/txt/plantuml-001.txt: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam backgroundColor #FFFFF8 3 | 4 | class BaseClass 5 | 6 | namespace net.dummy #DDDDDD { 7 | .BaseClass <|-- Person 8 | Meeting o-- Person 9 | 10 | .BaseClass <|- Meeting 11 | } 12 | 13 | namespace net.foo { 14 | net.dummy.Person <|- Person 15 | .BaseClass <|-- Person 16 | 17 | net.dummy.Meeting o-- Person 18 | } 19 | 20 | BaseClass <|-- net.unused.Person 21 | 22 | @enduml 23 | -------------------------------------------------------------------------------- /documentation/src/txt/plantuml-002.txt: -------------------------------------------------------------------------------- 1 | @startjson 2 | skinparam backgroundColor #FFFFF8 3 | 4 | #highlight "lastName" 5 | #highlight "address" / "city" 6 | #highlight "phoneNumbers" / "0" / "number" 7 | { 8 | "firstName": "John", 9 | "lastName": "Smith", 10 | "isAlive": true, 11 | "age": 28, 12 | "address": { 13 | "streetAddress": "21 2nd Street", 14 | "city": "New York", 15 | "state": "NY", 16 | "postalCode": "10021-3100" 17 | }, 18 | "phoneNumbers": [ 19 | { 20 | "type": "home", 21 | "number": "212 555-1234" 22 | }, 23 | { 24 | "type": "office", 25 | "number": "646 555-4567" 26 | } 27 | ], 28 | "children": [], 29 | "spouse": null 30 | } 31 | @endjson 32 | -------------------------------------------------------------------------------- /documentation/src/userguide/colophon.xml: -------------------------------------------------------------------------------- 1 | 5 | Colophon 6 | 7 | This document was authored in 8 | DocBook version , 9 | edited in Emacs, and transformed to HTML, PDF, and EPUB with the 10 | DocBook xslTNG stylesheets 11 | version . 12 | 13 | Dr. Bethan Tovey-Walsh designed the cover art and 14 | the sticker at the end of the threading chapter. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /documentation/src/userguide/preface.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | Preface 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation/src/xpl/ditaa.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation/src/xpl/mathml.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation/src/xpl/plantuml-001.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation/src/xpl/plantuml-002.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation/src/xpl/plantuml-003.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation/src/xpl/railroad-001.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Expression ::= Number op Number | "(" Expression ")" 11 | Number ::= [0-9]+ 12 | op ::= "+" | "-" | "×" | "÷" 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /documentation/src/xpl/railroad-002.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Expression ::= Number op Number | "(" Expression ")" 11 | Number ::= [0-9]+ 12 | op ::= "+" | "-" | "×" | "÷" 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /documentation/src/xsl/xinclude.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ext/polyglot/src/main/kotlin/com/xmlcalabash/ext/polyglot/PolyglotDocumentResolverProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.ext.polyglot 2 | 3 | import com.xmlcalabash.util.SimpleDocumentResolverProvider 4 | import java.net.URI 5 | 6 | class PolyglotDocumentResolverProvider: SimpleDocumentResolverProvider( 7 | URI("https://xmlcalabash.com/ext/library/polyglot.xpl"), 8 | "/com/xmlcalabash/ext/polyglot.xpl") -------------------------------------------------------------------------------- /ext/polyglot/src/main/resources/META-INF/services/com.xmlcalabash.spi.AtomicStepProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.ext.polyglot.PolyglotStepProvider 2 | -------------------------------------------------------------------------------- /ext/polyglot/src/main/resources/META-INF/services/com.xmlcalabash.spi.DocumentResolverProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.ext.polyglot.PolyglotDocumentResolverProvider -------------------------------------------------------------------------------- /ext/polyglot/src/test/resources/js.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | function f(x) { 15 | let date1 = new Date(1999, 7, 5) 16 | let date2 = new Date(2012, 1, 3, 12, 11, 14) 17 | return 12.3 18 | } 19 | f(x) 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ext/polyglot/src/test/resources/r.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

text

13 |
14 |
15 | 16 | 17 | 18 | 19 | 20 | print("Hello World!", quote = FALSE) 21 | 22 | 23 | 24 | 25 |
26 | -------------------------------------------------------------------------------- /ext/polyglot/src/test/resources/ruby.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | x + 4 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | kotlin.daemon.jvmargs=-Xmx6g 3 | org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx6g -Dfile.encoding=UTF-8 4 | 5 | # Also fix buildSrc/gradle.properties! 6 | saxonVersion=12.7 7 | docbookVersion=5.2 8 | xslTNGversion=2.5.0 9 | 10 | # This one is used in the processor, not just the documentation 11 | schxslt2=1.3.1 12 | 13 | xmlcalabashGroup=com.xmlcalabash 14 | xmlcalabashVersion=3.0.0-beta8-SNAPSHOT 15 | // name is defined in settings.gradle.kts 16 | 17 | builtBy=Norm Tovey-Walsh 18 | 19 | // Versions of third party libraries 20 | fop=2.10 21 | -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | # This file was generated by the Gradle 'init' task. 2 | # https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format 3 | 4 | [versions] 5 | kotlin-gradle-plugin = "1.9.22" 6 | 7 | [libraries] 8 | kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-gradle-plugin" } 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /query.sparql: -------------------------------------------------------------------------------- 1 | PREFIX dc: 2 | 3 | SELECT ?x ?title 4 | WHERE 5 | { 6 | ?x dc:title ?title . 7 | } 8 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | // Apply the foojay-resolver plugin to allow automatic download of JDKs 3 | id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" 4 | } 5 | 6 | rootProject.name = "xmlcalabash" 7 | 8 | include("xmlcalabash") 9 | include("app") 10 | include("test-driver") 11 | include("documentation") 12 | include("template:java") 13 | include("template:kotlin") 14 | include("ext:polyglot") 15 | -------------------------------------------------------------------------------- /template/java/README.md: -------------------------------------------------------------------------------- 1 | # Java step template 2 | 3 | This is a template for writing an XML Calabash 3.x extension step in Java. 4 | 5 | ``` 6 | 7 | 8 | 9 | 10 | 11 | ``` 12 | 13 | It simply reports the number of XML, text, JSON, and non-XML documents 14 | passed to it. 15 | -------------------------------------------------------------------------------- /template/java/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.xmlcalabash.build.XmlCalabashBuildExtension 2 | 3 | plugins { 4 | id("buildlogic.kotlin-library-conventions") 5 | id("com.xmlcalabash.build.xmlcalabash-build") 6 | } 7 | 8 | dependencies { 9 | implementation(project(":xmlcalabash")) 10 | } 11 | 12 | val xmlbuild = the() 13 | 14 | tasks.jar { 15 | archiveFileName.set(xmlbuild.jarArchiveFilename()) 16 | } 17 | -------------------------------------------------------------------------------- /template/java/src/main/java/com/xmlcalabash/ext/templatejava/TemplateStepProvider.java: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.ext.templatejava; 2 | 3 | import com.xmlcalabash.config.SaxonConfiguration; 4 | import com.xmlcalabash.spi.AtomicStepManager; 5 | import com.xmlcalabash.spi.AtomicStepProvider; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class TemplateStepProvider implements AtomicStepProvider { 9 | @NotNull 10 | @Override 11 | public AtomicStepManager create() { 12 | return new TemplateStepManager(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /template/java/src/main/resources/META-INF/services/com.xmlcalabash.spi.AtomicStepProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.ext.templatejava.TemplateStepProvider 2 | -------------------------------------------------------------------------------- /template/java/src/test/resources/doc.json: -------------------------------------------------------------------------------- 1 | {"test": 1} 2 | -------------------------------------------------------------------------------- /template/java/src/test/resources/pipe.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /template/java/src/test/resources/scalar.json: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /template/kotlin/README.md: -------------------------------------------------------------------------------- 1 | # Java step template 2 | 3 | This is a template for writing an XML Calabash 3.x extension step in Kotlin. 4 | 5 | ``` 6 | 7 | 8 | 9 | 10 | 11 | ``` 12 | 13 | It simply reports the number of XML, text, JSON, and non-XML documents 14 | passed to it. 15 | -------------------------------------------------------------------------------- /template/kotlin/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.xmlcalabash.build.XmlCalabashBuildExtension 2 | 3 | plugins { 4 | id("buildlogic.kotlin-library-conventions") 5 | id("com.xmlcalabash.build.xmlcalabash-build") 6 | } 7 | 8 | dependencies { 9 | implementation(project(":xmlcalabash")) 10 | } 11 | 12 | val xmlbuild = the() 13 | 14 | tasks.jar { 15 | archiveFileName.set(xmlbuild.jarArchiveFilename()) 16 | } 17 | -------------------------------------------------------------------------------- /template/kotlin/src/main/kotlin/com/xmlcalabash/ext/templatekotlin/TemplateKotlinStepProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.ext.templatekotlin 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | import com.xmlcalabash.util.SimpleStepProvider 5 | import net.sf.saxon.s9api.QName 6 | 7 | class TemplateKotlinStepProvider: SimpleStepProvider( 8 | QName(NsCx.namespace, "cx:template-kotlin"), 9 | { -> TemplateKotlin() }) -------------------------------------------------------------------------------- /template/kotlin/src/main/resources/META-INF/services/com.xmlcalabash.spi.AtomicStepProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.ext.templatekotlin.TemplateKotlinStepProvider 2 | -------------------------------------------------------------------------------- /template/kotlin/src/test/kotlin/SmokeTestTemplate.kt: -------------------------------------------------------------------------------- 1 | import com.xmlcalabash.XmlCalabash 2 | import com.xmlcalabash.util.BufferingReceiver 3 | import org.junit.jupiter.api.Assertions.fail 4 | import org.junit.jupiter.api.Test 5 | 6 | class SmokeTestTemplate { 7 | @Test 8 | fun testTemplate() { 9 | val calabash = XmlCalabash.newInstance() 10 | val parser = calabash.newXProcParser() 11 | val decl = parser.parse("src/test/resources/pipe.xpl") 12 | 13 | val exec = decl.getExecutable() 14 | val receiver = BufferingReceiver() 15 | exec.receiver = receiver 16 | 17 | try { 18 | exec.run() 19 | } catch (ex: Exception) { 20 | fail() 21 | } 22 | 23 | val result = receiver.outputs["result"]!!.first() 24 | System.out.println(result.value) 25 | } 26 | } -------------------------------------------------------------------------------- /template/kotlin/src/test/resources/doc.json: -------------------------------------------------------------------------------- 1 | {"test": 1} 2 | -------------------------------------------------------------------------------- /template/kotlin/src/test/resources/pipe.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /template/kotlin/src/test/resources/scalar.json: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /test-driver/src/main/kotlin/com/xmlcalabash/testdriver/TestOptions.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.testdriver 2 | 3 | import net.sf.saxon.s9api.QName 4 | import net.sf.saxon.s9api.XdmValue 5 | 6 | class TestOptions() { 7 | var debug = false 8 | var title: String? = null 9 | var requirePass = false 10 | var outputGraph: String? = null 11 | var testRegex = "." 12 | var stopOnFirstFailed = false 13 | var report: String? = null 14 | var testDirectoryList = mutableListOf() 15 | var consoleOutput = false 16 | val options = mutableMapOf() 17 | } -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/catalog-sample.xml: -------------------------------------------------------------------------------- 1 | 2 | Hello, world. 3 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/construct.sparql: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX org: 3 | 4 | CONSTRUCT { ?x foaf:name ?name } 5 | WHERE { ?x org:employeeName ?name } 6 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/data1.ttl: -------------------------------------------------------------------------------- 1 | @prefix org: . 2 | 3 | _:a org:employeeName "Alice" . 4 | _:a org:employeeId 12345 . 5 | 6 | _:b org:employeeName "Bob" . 7 | _:b org:employeeId 67890 . 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/data2.ttl: -------------------------------------------------------------------------------- 1 | @prefix dc: . 2 | @prefix : . 3 | @prefix ns: . 4 | 5 | :book1 dc:title "SPARQL Tutorial" . 6 | :book1 ns:price 42 . 7 | :book2 dc:title "The Semantic Web" . 8 | :book2 ns:price 23 . 9 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sample HTML document 5 | 6 | 7 |

Hello, world.

8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.md: -------------------------------------------------------------------------------- 1 | # Sample Markdown document 2 | 3 | Hello, world. 4 | 5 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.png -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.txt: -------------------------------------------------------------------------------- 1 | Hello, world. 2 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml: -------------------------------------------------------------------------------- 1 | 2 | Sample XML document 3 |

Hello, world.

4 |
5 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.Z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.Z -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.br: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.br -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.bz2 -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.deflate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.deflate -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.gz -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.lzma -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/document.xml.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/document.xml.xz -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.7z -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.a -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.arj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.arj -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.cpio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.cpio -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.jar -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.pack.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.pack.gz -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.tar -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.tar.gz -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/documents.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/documents/documents.zip -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/dtd/core.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | %b; 9 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/dtd/sample.dtd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/dtd/schema.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | %core; 9 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/dtd/sub/b.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/find/alt/config.alts: -------------------------------------------------------------------------------- 1 | { 2 | "category": "alternate", 3 | "number": 4, 4 | "string": "test", 5 | "null": null 6 | } 7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/find/alt/mobydick.altx: -------------------------------------------------------------------------------- 1 | 2 | Herman Melville 3 | Moby Dick 4 | 0-553-21311-3 5 | 8.99 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/find/bookstore.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nigel Rees 5 | Sayings of the Century 6 | 8.95 7 | 8 | 9 | Evelyn Waugh 10 | Sword of Honour 11 | 12.99 12 | 13 | 14 | Herman Melville 15 | Moby Dick 16 | 0-553-21311-3 17 | 8.99 18 | 19 | 20 | J. R. R. Tolkien 21 | The Lord of the Rings 22 | 0-395-19395-8 23 | 22.99 24 | 25 | 26 | 27 | 28 | 19.95 29 | 30 | 10 31 | 32 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/find/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "category": "configuration", 3 | "number": 4, 4 | "string": "test", 5 | "null": null 6 | } 7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/find/mobydick.json: -------------------------------------------------------------------------------- 1 | { 2 | "category": "fiction", 3 | "author": "Herman Melville", 4 | "title": "Moby Dick", 5 | "isbn": "0-553-21311-3" 6 | } 7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/find/mobydick.xml: -------------------------------------------------------------------------------- 1 | 2 | Herman Melville 3 | Moby Dick 4 | 0-553-21311-3 5 | 8.99 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/identity.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/query1.rq: -------------------------------------------------------------------------------- 1 | PREFIX dc: 2 | 3 | SELECT ?document ?title 4 | WHERE 5 | { 6 | ?document dc:title ?title . 7 | } 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/query1.sch: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | The root is wrong. 7 | 8 | 9 | There’s no head 10 | There are no results 11 | 12 | 13 | Wrong number of headers 14 | 15 | 16 | Wrong number of results 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/query2.rq: -------------------------------------------------------------------------------- 1 | PREFIX c: 2 | PREFIX v: 3 | PREFIX p: 4 | 5 | SELECT ?category ?name ?locality 6 | WHERE 7 | { 8 | ?x c:associatedName ?name . 9 | ?x p:category ?category . 10 | ?x p:category "Restaurants" . 11 | ?x v:workAdr ?addr . 12 | ?addr v:country-name "US" . 13 | ?addr v:region "CA" . 14 | ?addr v:locality ?locality . 15 | } 16 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.json: -------------------------------------------------------------------------------- 1 | { 2 | "http://example.org/about" : { 3 | "http://purl.org/dc/terms/title" : [ { "value" : "Anna's Homepage", 4 | "type" : "literal", 5 | "lang" : "en" } ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.jsonld: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://json-ld.org/contexts/person.jsonld", 3 | "@id": "http://dbpedia.org/resource/John_Lennon", 4 | "name": "John Lennon", 5 | "born": "1940-10-09", 6 | "spouse": "http://dbpedia.org/resource/Cynthia_Lennon" 7 | } 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.nquads: -------------------------------------------------------------------------------- 1 | . # comments here 2 | # or on a line by themselves 3 | _:subject1 "object1" . 4 | _:subject2 "object2" . 5 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.ntriples: -------------------------------------------------------------------------------- 1 | . # comments here 2 | # or on a line by themselves 3 | _:subject1 "object1" . 4 | _:subject2 "object2" . 5 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.shaclc: -------------------------------------------------------------------------------- 1 | BASE 2 | 3 | IMPORTS 4 | 5 | PREFIX ex: 6 | 7 | shape ex:PersonShape -> ex:Person { 8 | closed=true ignoredProperties=[rdf:type] . 9 | 10 | ex:ssn xsd:string [0..1] pattern="^\\d{3}-\\d{2}-\\d{4}$" . 11 | ex:worksFor IRI ex:Company [0..*] . 12 | ex:address BlankNode [0..1] { 13 | ex:city xsd:string [1..1] . 14 | ex:postalCode xsd:integer|xsd:string [1..1] maxLength=5 . 15 | } . 16 | } -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.trig: -------------------------------------------------------------------------------- 1 | # This document encodes one graph. 2 | @prefix ex: . 3 | @prefix : . 4 | 5 | :G1 { :Monica a ex:Person ; 6 | ex:name "Monica Murphy" ; 7 | ex:homepage ; 8 | ex:email ; 9 | ex:hasSkill ex:Management , 10 | ex:Programming . } 11 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.turtle: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix foaf: . 5 | @prefix rel: . 6 | 7 | <#green-goblin> 8 | rel:enemyOf <#spiderman> ; 9 | a foaf:Person ; # in the context of the Marvel universe 10 | foaf:name "Green Goblin" . 11 | 12 | <#spiderman> 13 | rel:enemyOf <#green-goblin> ; 14 | a foaf:Person ; 15 | foaf:name "Spiderman", "Человек-паук"@ru . 16 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rdf.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rnc/core.rnc: -------------------------------------------------------------------------------- 1 | namespace rng = "http://relaxng.org/ns/structure/1.0" 2 | namespace s = "http://purl.oclc.org/dsdl/schematron" 3 | namespace ex = "http://example.com/ns" 4 | default namespace = "http://example.com/ns" 5 | 6 | a = 7 | element ex:a { 8 | empty 9 | } 10 | 11 | include "sub/b.rnc" 12 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rnc/schema.rnc: -------------------------------------------------------------------------------- 1 | namespace rng = "http://relaxng.org/ns/structure/1.0" 2 | namespace s = "http://purl.oclc.org/dsdl/schematron" 3 | namespace ex = "http://example.com/ns" 4 | default namespace = "http://example.com/ns" 5 | 6 | start = ex.first 7 | 8 | ex.first = 9 | element ex:first { 10 | a, b 11 | } 12 | 13 | include "core.rnc" 14 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rnc/sub/b.rnc: -------------------------------------------------------------------------------- 1 | namespace rng = "http://relaxng.org/ns/structure/1.0" 2 | namespace s = "http://purl.oclc.org/dsdl/schematron" 3 | namespace ex = "http://example.com/ns" 4 | default namespace = "http://example.com/ns" 5 | 6 | b = 7 | element ex:b { 8 | empty 9 | } 10 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rng/core.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rng/schema.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/rng/sub/b.rng: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/sample-catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/sample1.shaclc: -------------------------------------------------------------------------------- 1 | BASE 2 | 3 | IMPORTS 4 | 5 | PREFIX ex: 6 | 7 | shape ex:PersonShape -> ex:Person { 8 | closed=true ignoredProperties=[rdf:type] . 9 | 10 | ex:ssn xsd:string [0..1] pattern="^\\d{3}-\\d{2}-\\d{4}$" . 11 | ex:worksFor IRI ex:Company [0..*] . 12 | ex:address BlankNode [0..1] { 13 | ex:city xsd:string [1..1] . 14 | ex:postalCode xsd:integer|xsd:string [1..1] maxLength=5 . 15 | } . 16 | } 17 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/simple-catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/simple.xml: -------------------------------------------------------------------------------- 1 | 4 | Document title 5 |

Some text.

6 |
7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/subdir/second-level.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/subdir/subdir/fourth-level.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/subdir/subdir/third-level.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/documents/xinclude-321.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/epubcheck/README.md: -------------------------------------------------------------------------------- 1 | # EPUBCheck test files 2 | 3 | The files in this directory are from, or possibly derived from, the 4 | files in the W3C epubcheck test suite, https://github.com/w3c/epubcheck 5 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/epubcheck/epub-001.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/tests/extra-suite/test-suite/epubcheck/epub-001.epub -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/pipelines/assertions3.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/pipelines/show.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | {$test} 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/pipelines/step.xpl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/pipelines/test/test.xpl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/extra-suite/test-suite/tests/assertions-003.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | assertions-003 6 | 7 | 8 | 2024-12-27 9 | 10 | Norm Tovey-Walsh 11 | 12 | 13 |

Created test.

14 |
15 |
16 |
17 |
18 | 19 |

Tests a Schematron assertion.

20 |
21 | 22 | 23 | 24 | 25 |
26 | -------------------------------------------------------------------------------- /xmlcalabash/Module.md: -------------------------------------------------------------------------------- 1 | # Module XMLCalabash 2 | 3 | This is XML Calabash, an implementation of [XProc 3.1](https://xproc.org/). 4 | 5 | # Package com.xmlcalabash.api 6 | 7 | Interfaces for writing steps and paged-media processors. 8 | 9 | # Package com.xmlcalabash.config 10 | 11 | The configuration classes. 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/lib/Alternate_XfoJavaCtl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/lib/Alternate_XfoJavaCtl.jar -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/api/CssProcessor.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.api 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.io.MediaType 5 | import com.xmlcalabash.runtime.XProcStepConfiguration 6 | import net.sf.saxon.s9api.QName 7 | import net.sf.saxon.s9api.XdmValue 8 | import java.io.OutputStream 9 | import java.net.URI 10 | 11 | interface CssProcessor { 12 | fun name(): String 13 | fun initialize(stepConfig: XProcStepConfiguration, baseURI: URI, options: Map) 14 | fun format(document: XProcDocument, contentType: MediaType, out: OutputStream) 15 | fun addStylesheet(document: XProcDocument) 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/api/FoProcessor.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.api 2 | 3 | import com.xmlcalabash.io.MediaType 4 | import com.xmlcalabash.documents.XProcDocument 5 | import com.xmlcalabash.runtime.XProcStepConfiguration 6 | import net.sf.saxon.s9api.QName 7 | import net.sf.saxon.s9api.XdmValue 8 | import java.io.OutputStream 9 | import java.net.URI 10 | 11 | interface FoProcessor { 12 | fun name(): String 13 | fun initialize(context: XProcStepConfiguration, baseURI: URI, options: Map) 14 | fun format(document: XProcDocument, contentType: MediaType, out: OutputStream) 15 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/api/MessageReporter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.api 2 | 3 | import com.xmlcalabash.io.MessagePrinter 4 | import com.xmlcalabash.util.Report 5 | import com.xmlcalabash.util.Verbosity 6 | import net.sf.saxon.s9api.QName 7 | 8 | interface MessageReporter { 9 | val messagePrinter: MessagePrinter 10 | var threshold: Verbosity 11 | fun setMessagePrinter(messagePrinter: MessagePrinter) 12 | fun error(report: () -> Report) 13 | fun warn(report: () -> Report) 14 | fun info(report: () -> Report) 15 | fun debug(report: () -> Report) 16 | fun trace(report: () -> Report) 17 | 18 | fun report(severity: Verbosity, report: () -> Report) 19 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/api/Monitor.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.api 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.runtime.steps.AbstractStep 5 | import com.xmlcalabash.runtime.steps.Consumer 6 | 7 | interface Monitor { 8 | fun startStep(step: AbstractStep) 9 | fun endStep(step: AbstractStep) 10 | fun abortStep(step: AbstractStep, ex: Exception) 11 | fun sendDocument(from: Pair, to: Pair, document: XProcDocument): XProcDocument 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/api/XProcStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.api 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.runtime.LazyValue 5 | import com.xmlcalabash.runtime.XProcStepConfiguration 6 | import com.xmlcalabash.runtime.api.Receiver 7 | import com.xmlcalabash.runtime.parameters.RuntimeStepParameters 8 | import net.sf.saxon.s9api.QName 9 | 10 | interface XProcStep { 11 | fun setup(stepConfig: XProcStepConfiguration, receiver: Receiver, stepParams: RuntimeStepParameters) 12 | fun extensionAttributes(attributes: Map) 13 | 14 | fun option(name: QName, binding: LazyValue) 15 | fun input(port: String, doc: XProcDocument) 16 | fun run() 17 | fun abort() 18 | 19 | fun reset() 20 | fun teardown() 21 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/config/ExecutionContextManager.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.config 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.runtime.XProcExecutionContext 5 | import com.xmlcalabash.runtime.steps.AbstractStep 6 | import net.sf.saxon.s9api.XdmValue 7 | import java.util.* 8 | 9 | interface ExecutionContextManager { 10 | fun newExecutionContext(stepConfig: StepConfiguration): XProcExecutionContext 11 | fun newExecutionContext(step: AbstractStep): XProcExecutionContext 12 | fun getExecutionContext(): XProcExecutionContext 13 | fun setExecutionContext(dynamicContext: XProcExecutionContext) 14 | fun releaseExecutionContext() 15 | fun preserveExecutionContext(): Stack 16 | fun restoreExecutionContext(contextStack: Stack) 17 | fun addProperties(doc: XProcDocument?) 18 | fun removeProperties(doc: XProcDocument?) 19 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/config/PipelineConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.config 2 | 3 | import com.xmlcalabash.io.MessagePrinter 4 | import com.xmlcalabash.util.AssertionsLevel 5 | import javax.activation.MimetypesFileTypeMap 6 | 7 | interface PipelineConfiguration { 8 | val messagePrinter: MessagePrinter 9 | //val monitors: List 10 | //val documentManager: DocumentManager 11 | val mimeTypes: MimetypesFileTypeMap 12 | //val errorExplanation: ErrorExplanation 13 | //val messageReporter: MessageReporter 14 | val proxies: Map 15 | val assertions: AssertionsLevel 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/AtomicDocumentStepInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.io.MediaType 4 | import com.xmlcalabash.namespace.NsCx 5 | 6 | class AtomicDocumentStepInstruction(parent: XProcInstruction): AtomicStepInstruction(parent, NsCx.document) { 7 | var contentType: MediaType? = null 8 | lateinit var documentProperties: XProcExpression 9 | lateinit var parameters: XProcExpression 10 | 11 | init { 12 | name = stepConfig.uniqueName("!${instructionType.localName}") 13 | } 14 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/AtomicEmptyStepInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | 5 | class AtomicEmptyStepInstruction(parent: XProcInstruction): AtomicStepInstruction(parent, NsCx.empty) { 6 | init { 7 | name = "!${instructionType.localName}_${stepConfig.nextId}" 8 | } 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/AtomicExpressionStepInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | import net.sf.saxon.s9api.QName 5 | 6 | class AtomicExpressionStepInstruction(parent: XProcInstruction, val bindingName: QName, val expression: XProcExpression): AtomicStepInstruction(parent, NsCx.expression) { 7 | private var _externalName: QName? = null 8 | 9 | internal var externalName: QName? 10 | get() = _externalName 11 | set(value) { 12 | _externalName = value 13 | } 14 | 15 | init { 16 | name = "!${instructionType.localName}_${stepConfig.nextId}" 17 | } 18 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/AtomicInlineStepInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | import com.xmlcalabash.util.ValueTemplateFilter 5 | 6 | class AtomicInlineStepInstruction(parent: InlineInstruction, val filter: ValueTemplateFilter): AtomicStepInstruction(parent, NsCx.inline) { 7 | var contentType = parent.contentType 8 | var encoding = parent.encoding 9 | var documentProperties = parent.documentProperties 10 | 11 | init { 12 | name = stepConfig.uniqueName("!${instructionType.localName}") 13 | } 14 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/AtomicSelectStepInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | 5 | class AtomicSelectStepInstruction(parent: XProcInstruction, val select: XProcExpression): AtomicStepInstruction(parent, NsCx.select) { 6 | init { 7 | name = "!${instructionType.localName}_${stepConfig.nextId}" 8 | } 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/ConnectionInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import net.sf.saxon.s9api.QName 4 | 5 | abstract class ConnectionInstruction(parent: XProcInstruction, instructionType: QName): XProcInstruction(parent, parent.stepConfig.copy(), instructionType) { 6 | internal abstract fun promoteToStep(parent: StepDeclaration, step: StepDeclaration): List 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/EmptyInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.io.MediaType 4 | import com.xmlcalabash.namespace.NsCx 5 | import com.xmlcalabash.namespace.NsP 6 | 7 | class EmptyInstruction(parent: XProcInstruction) : ConnectionInstruction(parent, NsP.empty) { 8 | 9 | override fun promoteToStep(parent: StepDeclaration, step: StepDeclaration): List { 10 | val emptyStep = AtomicStepInstruction(parent, NsCx.empty) 11 | emptyStep.depends.addAll(step.depends) 12 | 13 | emptyStep.elaborateInstructions() 14 | 15 | val output = emptyStep.withOutput() 16 | output.port = "result" 17 | output.primary = true 18 | output.sequence = true 19 | output.contentTypes = MediaType.MATCH_ANY 20 | 21 | return listOf(emptyStep) 22 | } 23 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/ForEachInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsP 4 | 5 | class ForEachInstruction(parent: XProcInstruction): CompoundLoopDeclaration(parent, NsP.forEach) { 6 | override val contentModel = anySteps + mapOf(NsP.withInput to '1', NsP.output to '*') 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/GroupInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsP 4 | 5 | class GroupInstruction internal constructor(parent: XProcInstruction): CompoundStepDeclaration(parent, parent.stepConfig.copy(), NsP.group) { 6 | override val contentModel = anySteps + mapOf(NsP.withInput to '0', NsP.output to '*') 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/GuardExpressionStepInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | 5 | class GuardExpressionStepInstruction(parent: XProcInstruction): AtomicStepInstruction(parent, NsCx.guard) { 6 | init { 7 | name = "!${instructionType.localName}_${stepConfig.nextId}" 8 | } 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/InputBindingInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import net.sf.saxon.s9api.QName 4 | 5 | open class InputBindingInstruction(parent: XProcInstruction, stepConfig: InstructionConfiguration, instructionType: QName): PortBindingContainer(parent, stepConfig, instructionType) { 6 | internal val defaultBindings = mutableListOf() 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/OtherwiseInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.exceptions.XProcError 4 | import com.xmlcalabash.namespace.Ns 5 | import com.xmlcalabash.namespace.NsP 6 | 7 | class OtherwiseInstruction(parent: ChooseInstruction): CompoundStepDeclaration(parent, parent.stepConfig.copy(), NsP.otherwise) { 8 | override val contentModel = anySteps + mapOf(NsP.withInput to '0', NsP.output to '*') 9 | 10 | override fun elaborateInstructions() { 11 | if (depends.isNotEmpty()) { 12 | throw stepConfig.exception(XProcError.xsAttributeForbidden(Ns.depends)) 13 | } 14 | super.elaborateInstructions() 15 | } 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/RunInputInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.exceptions.XProcError 4 | import com.xmlcalabash.namespace.Ns 5 | 6 | class RunInputInstruction(parent: XProcInstruction, stepConfig: InstructionConfiguration): WithInputInstruction(parent, stepConfig) { 7 | override fun elaborateInstructions() { 8 | super.elaborateInstructions() 9 | 10 | if (!portDefined) { 11 | throw stepConfig.exception(XProcError.xsMissingRequiredAttribute(Ns.port)) 12 | } 13 | 14 | _sequence = true 15 | } 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/RunOptionInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import net.sf.saxon.s9api.QName 4 | 5 | class RunOptionInstruction(parent: XProcInstruction, name: QName, stepConfig: InstructionConfiguration): WithOptionInstruction(parent, name, stepConfig) { 6 | internal var _static: Boolean? = null 7 | var static: Boolean? 8 | get() = _static 9 | set(value) { 10 | checkOpen() 11 | _static = value 12 | } 13 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/SpecialType.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | enum class SpecialType { 4 | EQNAME_LIST, XPATH_EXPRESSION, XSLT_SELECTION_PATTERN, REGULAR_EXPRESSION 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/StandardLibraryInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | // The standard step library. There should only be one instance in any given pipeline configuration 4 | 5 | class StandardLibraryInstruction(builder: PipelineBuilder, stepConfig: InstructionConfiguration): LibraryInstruction(stepConfig) { 6 | init { 7 | this.builder = builder 8 | } 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/StepContainerInterface.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.io.MediaType 4 | import net.sf.saxon.s9api.QName 5 | import java.net.URI 6 | 7 | interface StepContainerInterface { 8 | var psviRequired: Boolean? 9 | var xpathVersion: Double? 10 | var version: Double? 11 | fun option(name: QName): OptionInstruction 12 | fun option(name: QName, staticValue: XProcExpression): OptionInstruction 13 | fun declareStep(): DeclareStepInstruction 14 | fun importFunctions(href: URI, contentType: MediaType?, namespace: String?): ImportFunctionsInstruction 15 | fun import(import: StepContainerInterface) 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/Visibility.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | enum class Visibility { 4 | PUBLIC, PRIVATE 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/datamodel/WithOutputInstruction.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.datamodel 2 | 3 | import com.xmlcalabash.namespace.NsP 4 | 5 | class WithOutputInstruction(parent: XProcInstruction, stepConfig: InstructionConfiguration): PortBindingContainer(parent, stepConfig, NsP.withOutput) { 6 | constructor(parent: XProcInstruction, stepConfig: InstructionConfiguration, port: String, primary: Boolean?, sequence: Boolean?) : this(parent, stepConfig) { 7 | this.port = port 8 | this.primary = primary 9 | this.sequence = sequence 10 | } 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/debugger/Debugger.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.debugger 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.runtime.steps.AbstractStep 5 | 6 | interface Debugger { 7 | fun startStep(step: AbstractStep) 8 | fun endStep(step: AbstractStep) 9 | fun sendDocument(from: Pair, to: Pair, document: XProcDocument): XProcDocument 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/debugger/NopDebugger.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.debugger 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.api.Monitor 5 | import com.xmlcalabash.runtime.steps.AbstractStep 6 | import com.xmlcalabash.runtime.steps.Consumer 7 | 8 | class NopDebugger: Monitor { 9 | override fun startStep(step: AbstractStep) { 10 | // nop 11 | } 12 | override fun endStep(step: AbstractStep) { 13 | // nop 14 | } 15 | 16 | override fun abortStep(step: AbstractStep, ex: Exception) { 17 | // nop 18 | } 19 | 20 | override fun sendDocument(from: Pair, to: Pair, document: XProcDocument): XProcDocument { 21 | return document 22 | } 23 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/documents/LazyDocumentValue.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.documents 2 | 3 | import net.sf.saxon.s9api.XdmValue 4 | 5 | data class LazyDocumentValue(val value: XdmValue, val properties: DocumentProperties) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/exceptions/ErrorExplanation.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.exceptions 2 | 3 | interface ErrorExplanation { 4 | var showStacktrace: Boolean 5 | fun report(error: XProcError) 6 | fun reportExplanation(error: XProcError) 7 | fun message(error: XProcError, includeDetails: Boolean): String 8 | fun explanation(error: XProcError): String 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/exceptions/ErrorStackFrame.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.exceptions 2 | 3 | import net.sf.saxon.s9api.QName 4 | 5 | class ErrorStackFrame(val stepType: QName, val stepName: String) { 6 | override fun toString() = "${stepType} / ${stepName}" 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/exceptions/XProcException.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.exceptions 2 | 3 | 4 | class XProcException(val error: XProcError, cause: Throwable? = null): RuntimeException(error.toString(), cause) { 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/exceptions/XProcUserError.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.exceptions 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.documents.XProcDocument 5 | import net.sf.saxon.s9api.QName 6 | 7 | class XProcUserError(code: QName, location: Location, inputLocation: Location, vararg documents: XProcDocument) 8 | : XProcError(code, 1, location, inputLocation, *documents) 9 | { 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Connection.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | class Connection(var from: ModelPort, var to: ModelPort) { 4 | override fun toString(): String { 5 | return "${from} -> ${to}" 6 | } 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/DefaultInput.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.ConnectionInstruction 4 | import com.xmlcalabash.datamodel.XProcExpression 5 | 6 | class DefaultInput(val inputs: List, val select: XProcExpression?) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Edge.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | class Edge(val number: Long, val from: Model, val outputPort: String, val to: Model, val inputPort: String, val implicit: Boolean) { 4 | override fun toString(): String { 5 | return "${from}.${outputPort} -> ${to}.${inputPort}" 6 | } 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Foot.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | class Foot(graph: Graph, parent: CompoundModel, id: String): Model(graph, parent, parent.step, id) { 4 | override fun init() { 5 | // nop 6 | } 7 | 8 | override fun toString(): String { 9 | return "Foot(${parent})" 10 | } 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/GraphEnvironment.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.config.XProcEnvironment 4 | import com.xmlcalabash.datamodel.CompileEnvironment 5 | 6 | class GraphEnvironment(val environment: CompileEnvironment): XProcEnvironment by environment { 7 | override fun uniqueName(base: String): String { 8 | val key = if (base.startsWith("!")) { 9 | base.substring(1) 10 | } else { 11 | base 12 | } 13 | 14 | if (key in environment.nameCounts) { 15 | val suffix = environment.nameCounts[key]!! + 1 16 | environment.nameCounts[key] = suffix 17 | return "${key}_${suffix}" 18 | } 19 | environment.nameCounts[key] = 1 20 | return key 21 | } 22 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Head.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.InputInstruction 4 | 5 | class Head(graph: Graph, parent: CompoundModel, id: String): Model(graph, parent, parent.step, id) { 6 | val defaultInputs = mutableMapOf() 7 | 8 | override fun init() { 9 | for (input in step.inputs().filterIsInstance()) { 10 | if (input.defaultBindings.isNotEmpty()) { 11 | val default = DefaultInput(input.defaultBindings, input.select) 12 | defaultInputs[input.port] = default 13 | } 14 | } 15 | } 16 | 17 | override fun toString(): String { 18 | return "Head(${parent})" 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Joiner.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.AtomicStepInstruction 4 | import com.xmlcalabash.datamodel.XProcInstruction 5 | import com.xmlcalabash.namespace.NsCx 6 | 7 | class Joiner(parent: XProcInstruction): AtomicStepInstruction(parent, NsCx.joiner) { 8 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Model.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.StepDeclaration 4 | import net.sf.saxon.s9api.QName 5 | 6 | abstract class Model(val graph: Graph, val parent: Model?, val step: StepDeclaration, val id: String) { 7 | // Issue #160, don't create a new Saxon configuration here 8 | internal val saxonConfig = step.stepConfig.saxonConfig 9 | internal val inputs = mutableMapOf() 10 | internal val outputs = mutableMapOf() 11 | internal val options = mutableMapOf() 12 | internal var _threadGroup = 0 13 | val threadGroup: Int 14 | get() = _threadGroup 15 | 16 | internal abstract fun init() 17 | } 18 | 19 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/ModelInputPort.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.ConnectionInstruction 4 | import com.xmlcalabash.datamodel.InputBindingInstruction 5 | 6 | class ModelInputPort(parent: Model, input: InputBindingInstruction): ModelPort(parent, input) { 7 | val defaultBindings: List = input.defaultBindings 8 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/PipelineModel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.CompoundStepDeclaration 4 | 5 | class PipelineModel internal constructor(graph: Graph, parent: Model?, step: CompoundStepDeclaration, id: String): CompoundModel(graph, parent, step, id) { 6 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Sink.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.AtomicStepInstruction 4 | import com.xmlcalabash.datamodel.XProcInstruction 5 | import com.xmlcalabash.namespace.NsCx 6 | 7 | class Sink(parent: XProcInstruction): AtomicStepInstruction(parent, NsCx.sink) { 8 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/Splitter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | import com.xmlcalabash.datamodel.AtomicStepInstruction 4 | import com.xmlcalabash.datamodel.XProcInstruction 5 | import com.xmlcalabash.namespace.NsCx 6 | 7 | class Splitter(parent: XProcInstruction): AtomicStepInstruction(parent, NsCx.splitter) { 8 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/graph/SubpipelineModel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.graph 2 | 3 | class SubpipelineModel(val model: CompoundModel, id: String): Model(model.graph, model, model.step, id) { 4 | override fun init() { 5 | graph.models.add(this) 6 | graph.instructionMap[step] = this 7 | } 8 | 9 | override fun toString(): String { 10 | return "S(${model})" 11 | } 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/io/MediaTypeParameter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.io 2 | 3 | import org.apache.hc.core5.http.NameValuePair 4 | 5 | class MediaTypeParameter(val parameter: String): NameValuePair { 6 | constructor (name: String, value: String) : this("${name}=${value}") 7 | 8 | val pos = parameter.indexOf("=") 9 | 10 | override fun getName(): String { 11 | if (pos > 0) { 12 | return parameter.substring(0, pos) 13 | } 14 | return "" 15 | } 16 | 17 | override fun getValue(): String { 18 | if (pos >= 0) { 19 | return parameter.substring(pos + 1) 20 | } 21 | return parameter 22 | } 23 | 24 | override fun toString(): String { 25 | return parameter 26 | } 27 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/io/MessagePrinter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.io 2 | 3 | import java.io.PrintStream 4 | 5 | interface MessagePrinter { 6 | val encoding: String 7 | fun setEncoding(encoding: String) 8 | fun setPrintStream(stream: PrintStream) 9 | fun print(message: String) 10 | fun println(message: String) 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsDescription.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsDescription { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://xmlcalabash.com/ns/description") 8 | 9 | // These are dynamic because the prefix isn't fixed. 10 | fun g(localName: String, prefix: String = "g"): QName { 11 | return QName(namespace, "${prefix}:${localName}") 12 | } 13 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsHtml.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsHtml { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/1999/xhtml") 8 | 9 | val html = QName(namespace, "html") 10 | val body = QName(namespace, "body") 11 | val img = QName(namespace, "img") 12 | } 13 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsRdf.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsRdf { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/1999/02/22-rdf-syntax-ns#") 8 | 9 | val RDF = QName(namespace, "rdf:RDF") 10 | 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsRng.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | 5 | object NsRng { 6 | val namespace: NamespaceUri = NamespaceUri.of("http://relaxng.org/ns/structure/1.0") 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsS.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsS { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://purl.oclc.org/dsdl/schematron") 8 | 9 | val schema = QName(namespace, "s:schema") 10 | 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsSparqlResults.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsSparqlResults { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/2005/sparql-results#") 8 | 9 | val sparql = QName(namespace, "sparql") 10 | val head = QName(namespace, "head") 11 | val variable = QName(namespace, "variable") 12 | val link = QName(namespace, "link") 13 | val results = QName(namespace, "results") 14 | val result = QName(namespace, "result") 15 | val binding = QName(namespace, "binding") 16 | val bnode = QName(namespace, "bnode") 17 | val uri = QName(namespace, "uri") 18 | val literal = QName(namespace, "literal") 19 | val boolean = QName(namespace, "boolean") 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsSvg.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsSvg { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/2000/svg") 8 | 9 | val svg = QName(namespace, "svg") 10 | val def = QName(namespace, "def") 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsSvrl.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsSvrl { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://purl.oclc.org/dsdl/svrl") 8 | 9 | val activePattern = QName(namespace, "svrl:active-pattern") 10 | val diagnosticReference = QName(namespace, "svrl:diagnostic-reference") 11 | val failedAssert = QName(namespace, "svrl:failed-assert") 12 | val firedRule = QName(namespace, "svrl:fired-rule") 13 | val schematronOutput = QName(namespace, "svrl:schematron-output") 14 | val successfulReport = QName(namespace, "svrl:successful-report") 15 | val text = QName(namespace, "svrl:text") 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsXlink.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsXlink { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/1999/xlink") 8 | 9 | val href = QName(namespace, "href") 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsXml.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsXml { 7 | val namespace = NamespaceUri.of("http://www.w3.org/XML/1998/namespace") 8 | 9 | val base = QName(namespace, "xml:base") 10 | val lang = QName(namespace, "xml:lang") 11 | val id = QName(namespace, "xml:id") 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsXmlns.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | 5 | object NsXmlns { 6 | val namespace = NamespaceUri.of("http://www.w3.org/2000/xmlns/") 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsXsi.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsXsi { 7 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/2001/XMLSchema-instance") 8 | 9 | val noNamespaceSchemaLocation = QName(namespace, "xsi:noNamespaceSchemaLocation") 10 | val schemaLocation = QName(namespace, "xsi:schemaLocation") 11 | val type = QName(namespace, "xsi:type") 12 | 13 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/namespace/NsXslt.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.namespace 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | 5 | object NsXslt { 6 | val namespace: NamespaceUri = NamespaceUri.of("http://www.w3.org/1999/XSL/Transform") 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/XPathExpressionDetails.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers 2 | 3 | import net.sf.saxon.s9api.QName 4 | 5 | data class XPathExpressionDetails( 6 | val error: Exception?, 7 | val variableRefs: Set, 8 | val functionRefs: Set>, 9 | val contextRef: Boolean, 10 | val alwaysDynamic: Boolean 11 | ) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/xpl/elements/ConditionalStepException.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers.xpl.elements 2 | 3 | class ConditionalStepException(message: String): RuntimeException(message) { 4 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/xpl/elements/ImportFunctionsNode.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers.xpl.elements 2 | 3 | import com.xmlcalabash.datamodel.ImportFunctionsInstruction 4 | import com.xmlcalabash.io.MediaType 5 | import com.xmlcalabash.namespace.Ns 6 | import com.xmlcalabash.util.UriUtils 7 | import net.sf.saxon.s9api.XdmNode 8 | 9 | class ImportFunctionsNode(parent: AnyNode, node: XdmNode): ElementNode(parent, node) { 10 | val href = UriUtils.resolve(node.baseURI, node.getAttributeValue(Ns.href))!! 11 | val contentType = node.getAttributeValue(Ns.contentType) 12 | val namespace = node.getAttributeValue(Ns.namespace) 13 | 14 | init { 15 | val import = ImportFunctionsInstruction(null, parent.stepConfig, href) 16 | contentType?.let { import.contentType = MediaType.parse(it) } 17 | namespace?.let { import.namespace = it } 18 | import.prefetch() 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/xpl/elements/ImportNode.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers.xpl.elements 2 | 3 | import com.xmlcalabash.namespace.Ns 4 | import com.xmlcalabash.util.UriUtils 5 | import net.sf.saxon.s9api.XdmNode 6 | 7 | class ImportNode(parent: AnyNode, node: XdmNode): ElementNode(parent, node) { 8 | val href = UriUtils.resolve(node.baseURI, node.getAttributeValue(Ns.href))!! 9 | var firstPass = true 10 | 11 | override fun computeUseWhenOnThisElement(context: UseWhenContext) { 12 | super.computeUseWhenOnThisElement(context) 13 | if (firstPass) { 14 | firstPass = false 15 | } else { 16 | if (useWhen == null) { 17 | useWhen = false 18 | context.useWhen.remove(this) 19 | context.resolvedCount++ 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/xpl/elements/LibraryNode.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers.xpl.elements 2 | 3 | import net.sf.saxon.s9api.XdmNode 4 | 5 | class LibraryNode(parent: AnyNode, node: XdmNode): RootNode(parent, parent.stepConfig, node) { 6 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/xpl/elements/StepImplementation.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers.xpl.elements 2 | 3 | data class StepImplementation(var resolved: Boolean, val isImplemented: () -> Boolean) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/parsers/xpl/elements/TextNode.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.parsers.xpl.elements 2 | 3 | import net.sf.saxon.s9api.XdmNode 4 | 5 | open class TextNode(parent: AnyNode, node: XdmNode): AnyNode(parent, node) { 6 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/ProcessMatchingNodes.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime 2 | 3 | import net.sf.saxon.om.AttributeMap 4 | import net.sf.saxon.s9api.XdmNode 5 | 6 | interface ProcessMatchingNodes { 7 | fun startDocument(node: XdmNode): Boolean 8 | fun endDocument(node: XdmNode) 9 | 10 | fun startElement(node: XdmNode, attributes: AttributeMap): Boolean 11 | fun attributes(node: XdmNode, matchingAttributes: AttributeMap, nonMatchingAttributes: AttributeMap): AttributeMap? 12 | fun endElement(node: XdmNode) 13 | 14 | fun text(node: XdmNode) 15 | fun comment(node: XdmNode) 16 | fun pi(node: XdmNode) 17 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/RuntimeEnvironment.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime 2 | 3 | import com.xmlcalabash.api.Monitor 4 | import com.xmlcalabash.config.XProcEnvironment 5 | import com.xmlcalabash.datamodel.CompileEnvironment 6 | import java.util.* 7 | 8 | class RuntimeEnvironment(override val episode: String, environment: CompileEnvironment): XProcEnvironment by environment { 9 | override val monitors = mutableListOf() 10 | internal var threadsAvailable = environment.xmlCalabashConfig.maxThreadCount 11 | 12 | companion object { 13 | fun newInstance(environment: CompileEnvironment): RuntimeEnvironment { 14 | val episode = "E-${UUID.randomUUID()}" 15 | return RuntimeEnvironment(episode, environment) 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/api/Receiver.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.api 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | 5 | interface Receiver { 6 | fun output(port: String, document: XProcDocument) 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/api/RuntimeOption.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.api 2 | 3 | import com.xmlcalabash.datamodel.XProcExpression 4 | import com.xmlcalabash.documents.XProcDocument 5 | import net.sf.saxon.s9api.QName 6 | import net.sf.saxon.s9api.SequenceType 7 | import net.sf.saxon.s9api.XdmAtomicValue 8 | 9 | class RuntimeOption(val name: QName, val required: Boolean, val asType: SequenceType, val values: List, val static: Boolean, val staticValue: XProcExpression? = null) { 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/api/StepSignature.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.api 2 | 3 | import com.xmlcalabash.XmlCalabashConfiguration 4 | import net.sf.saxon.s9api.QName 5 | 6 | class StepSignature( 7 | val xmlCalabashConfiguration: XmlCalabashConfiguration, 8 | val inputs: Map, 9 | val outputs: Map, 10 | val options: Map) 11 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/model/AtomicBuiltinOptionModel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.model 2 | 3 | import com.xmlcalabash.datamodel.AtomicExpressionStepInstruction 4 | import com.xmlcalabash.graph.AtomicModel 5 | import com.xmlcalabash.runtime.XProcRuntime 6 | import com.xmlcalabash.runtime.XProcStepConfiguration 7 | import com.xmlcalabash.runtime.steps.AbstractStep 8 | import com.xmlcalabash.runtime.steps.AtomicOptionStep 9 | 10 | class AtomicBuiltinOptionModel(runtime: XProcRuntime, model: AtomicModel): AtomicBuiltinStepModel(runtime, model) { 11 | override fun runnable(config: XProcStepConfiguration): () -> AbstractStep { 12 | val externalName = (model.step as AtomicExpressionStepInstruction).externalName!! 13 | return { AtomicOptionStep(config.copy(), this, externalName) } 14 | } 15 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/model/AtomicStepModel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.model 2 | 3 | import com.xmlcalabash.graph.Model 4 | import com.xmlcalabash.runtime.XProcRuntime 5 | 6 | abstract class AtomicStepModel(runtime: XProcRuntime, model: Model): StepModel(runtime, model) { 7 | override fun initialize(model: Model) { 8 | // nop 9 | } 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/model/FootModel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.model 2 | 3 | import com.xmlcalabash.graph.Model 4 | import com.xmlcalabash.runtime.XProcRuntime 5 | import com.xmlcalabash.runtime.XProcStepConfiguration 6 | import com.xmlcalabash.runtime.steps.AbstractStep 7 | 8 | class FootModel(runtime: XProcRuntime, model: Model): StepModel(runtime, model) { 9 | override fun initialize(model: Model) { 10 | // nop 11 | } 12 | 13 | override fun runnable(config: XProcStepConfiguration): () -> AbstractStep { 14 | throw UnsupportedOperationException("You can't make a runnable from a foot") 15 | } 16 | 17 | override fun toString(): String { 18 | return "(foot)" 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/model/HeadModel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.model 2 | 3 | import com.xmlcalabash.graph.Head 4 | import com.xmlcalabash.graph.Model 5 | import com.xmlcalabash.runtime.XProcRuntime 6 | import com.xmlcalabash.runtime.XProcStepConfiguration 7 | import com.xmlcalabash.runtime.steps.AbstractStep 8 | 9 | class HeadModel(runtime: XProcRuntime, model: Model): StepModel(runtime, model) { 10 | val defaultInputs = (model as Head).defaultInputs 11 | 12 | override fun initialize(model: Model) { 13 | // nop 14 | } 15 | 16 | override fun runnable(yconfig: XProcStepConfiguration): () -> AbstractStep { 17 | throw UnsupportedOperationException("You can't make a runnable from a head") 18 | } 19 | 20 | override fun toString(): String { 21 | return "(head)" 22 | } 23 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/model/ModelEdge.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.model 2 | 3 | class ModelEdge(val fromStep: StepModel, val fromPort: String, val toStep: StepModel, val toPort: String) { 4 | override fun toString(): String { 5 | return "${fromStep}.${fromPort} → ${toStep}.${toPort}" 6 | } 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/DocumentStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.io.MediaType 5 | import com.xmlcalabash.namespace.NsCx 6 | import com.xmlcalabash.runtime.api.RuntimeOption 7 | import com.xmlcalabash.runtime.api.RuntimePort 8 | import net.sf.saxon.s9api.QName 9 | 10 | class DocumentStepParameters(stepName: String, 11 | location: Location, 12 | inputs: Map, 13 | outputs: Map, 14 | options: Map, 15 | val contentType: MediaType? 16 | ): RuntimeStepParameters(NsCx.document, stepName, location, inputs, outputs, options) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/EmptyStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.namespace.NsCx 5 | import com.xmlcalabash.runtime.api.RuntimeOption 6 | import com.xmlcalabash.runtime.api.RuntimePort 7 | import net.sf.saxon.s9api.QName 8 | 9 | class EmptyStepParameters(stepName: String, 10 | location: Location, 11 | inputs: Map, 12 | outputs: Map, 13 | options: Map 14 | ): RuntimeStepParameters(NsCx.empty, stepName, location, inputs, outputs, options) 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/OptionStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.AtomicExpressionStepInstruction 4 | import com.xmlcalabash.datamodel.Location 5 | import com.xmlcalabash.namespace.NsCx 6 | import com.xmlcalabash.runtime.api.RuntimeOption 7 | import com.xmlcalabash.runtime.api.RuntimePort 8 | import net.sf.saxon.s9api.QName 9 | 10 | class OptionStepParameters( 11 | stepName: String, 12 | location: Location, 13 | inputs: Map, 14 | outputs: Map, 15 | options: Map, 16 | val step: AtomicExpressionStepInstruction 17 | ): ExpressionStepParameters(stepName, location, inputs, outputs, options, step, NsCx.option) { 18 | val name = step.externalName 19 | } 20 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/RunStepStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.runtime.api.RuntimeOption 5 | import com.xmlcalabash.runtime.api.RuntimePort 6 | import net.sf.saxon.s9api.QName 7 | 8 | open class RunStepStepParameters( 9 | stepType: QName, 10 | stepName: String, 11 | location: Location, 12 | inputs: Map, 13 | outputs: Map, 14 | options: Map, 15 | val primaryInput: String?, 16 | val primaryOutput: String? 17 | ): RuntimeStepParameters(stepType, stepName, location, inputs, outputs, options) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/RuntimeStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.runtime.api.RuntimeOption 5 | import com.xmlcalabash.runtime.api.RuntimePort 6 | import net.sf.saxon.s9api.QName 7 | 8 | open class RuntimeStepParameters( 9 | stepType: QName, 10 | stepName: String, 11 | location: Location, 12 | val inputs: Map, 13 | val outputs: Map, 14 | val options: Map 15 | ): StepParameters(stepType, stepName, location) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/SelectStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.datamodel.XProcExpression 5 | import com.xmlcalabash.namespace.NsCx 6 | import com.xmlcalabash.runtime.api.RuntimeOption 7 | import com.xmlcalabash.runtime.api.RuntimePort 8 | import net.sf.saxon.s9api.QName 9 | 10 | class SelectStepParameters(stepName: String, 11 | location: Location, 12 | inputs: Map, 13 | outputs: Map, 14 | options: Map, 15 | val select: XProcExpression 16 | ): RuntimeStepParameters(NsCx.select, stepName, location, inputs, outputs, options) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/StepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import net.sf.saxon.s9api.QName 5 | 6 | open class StepParameters(val stepType: QName, val stepName: String = "", val location: Location = Location.NULL) { 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/TryCatchStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.runtime.api.RuntimeOption 5 | import com.xmlcalabash.runtime.api.RuntimePort 6 | import net.sf.saxon.s9api.QName 7 | 8 | open class TryCatchStepParameters( 9 | stepType: QName, 10 | stepName: String, 11 | location: Location, 12 | inputManifold: Map, 13 | outputManifold: Map, 14 | optionManifold: Map, 15 | val codes: List 16 | ): RuntimeStepParameters(stepType, stepName, location, inputManifold, outputManifold, optionManifold) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/UnimplementedStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.namespace.NsCx 4 | import net.sf.saxon.s9api.QName 5 | 6 | class UnimplementedStepParameters(val unimplemented: QName): StepParameters(NsCx.unimplemented) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/parameters/ViewportStepParameters.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.parameters 2 | 3 | import com.xmlcalabash.datamodel.Location 4 | import com.xmlcalabash.runtime.api.RuntimeOption 5 | import com.xmlcalabash.runtime.api.RuntimePort 6 | import net.sf.saxon.s9api.QName 7 | 8 | open class ViewportStepParameters( 9 | stepType: QName, 10 | stepName: String, 11 | location: Location, 12 | inputManifold: Map, 13 | outputManifold: Map, 14 | optionManifold: Map 15 | ): RuntimeStepParameters(stepType, stepName, location, inputManifold, outputManifold, optionManifold) -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/steps/ChooseOtherwiseStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.steps 2 | 3 | import com.xmlcalabash.runtime.XProcStepConfiguration 4 | import com.xmlcalabash.runtime.model.CompoundStepModel 5 | 6 | open class ChooseOtherwiseStep(yconfig: XProcStepConfiguration, compound: CompoundStepModel): ChooseWhenStep(yconfig, compound) { 7 | override fun evaluateGuardExpression(parent: CompoundStep): Boolean { 8 | if (runnables.isEmpty()) { 9 | instantiate() 10 | } 11 | 12 | localStepsToRun.clear() 13 | localStepsToRun.addAll(runnables) 14 | 15 | runtimeParent = parent 16 | head.runStep(this) 17 | 18 | return true 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/steps/Consumer.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.steps 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | 5 | interface Consumer { 6 | val id: String 7 | fun input(port: String, doc: XProcDocument) 8 | fun close(port: String) 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/steps/GroupStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.steps 2 | 3 | import com.xmlcalabash.runtime.XProcStepConfiguration 4 | import com.xmlcalabash.runtime.model.CompoundStepModel 5 | 6 | open class GroupStep(config: XProcStepConfiguration, compound: CompoundStepModel): CompoundStep(config, compound) { 7 | override fun run() { 8 | stepsToRun.clear() 9 | stepsToRun.addAll(runnables) 10 | 11 | try { 12 | stepConfig.saxonConfig.newExecutionContext(stepConfig) 13 | 14 | head.runStep(this) 15 | runSubpipeline() 16 | foot.runStep(this) 17 | } finally { 18 | stepConfig.saxonConfig.releaseExecutionContext() 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/steps/TryCatchStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.steps 2 | 3 | import com.xmlcalabash.runtime.XProcStepConfiguration 4 | import com.xmlcalabash.runtime.model.CompoundStepModel 5 | import com.xmlcalabash.runtime.parameters.TryCatchStepParameters 6 | 7 | open class TryCatchStep(yconfig: XProcStepConfiguration, compound: CompoundStepModel): GroupStep(yconfig, compound) { 8 | internal val codes = (params as TryCatchStepParameters).codes 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/runtime/steps/TryFinallyStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.runtime.steps 2 | 3 | import com.xmlcalabash.runtime.XProcStepConfiguration 4 | import com.xmlcalabash.runtime.model.CompoundStepModel 5 | 6 | open class TryFinallyStep(config: XProcStepConfiguration, compound: CompoundStepModel): TryCatchStep(config, compound) { 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/AtomicStepManager.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | import com.xmlcalabash.api.XProcStep 4 | import com.xmlcalabash.runtime.parameters.StepParameters 5 | import net.sf.saxon.s9api.QName 6 | 7 | interface AtomicStepManager { 8 | fun stepTypes(): Set 9 | fun stepAvailable(stepType: QName): Boolean 10 | fun createStep(params: StepParameters): () -> XProcStep 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/AtomicStepProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | interface AtomicStepProvider { 4 | fun create(): AtomicStepManager 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/Configurer.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | import com.xmlcalabash.XmlCalabashBuilder 4 | import net.sf.saxon.Configuration 5 | 6 | interface Configurer { 7 | fun configure(builder: XmlCalabashBuilder) 8 | fun configureSaxon(config: Configuration) 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/ConfigurerProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | interface ConfigurerProvider { 4 | fun create(): Configurer 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/ContentTypeConverter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | import com.xmlcalabash.config.StepConfiguration 4 | import com.xmlcalabash.documents.XProcDocument 5 | import com.xmlcalabash.io.MediaType 6 | import net.sf.saxon.s9api.QName 7 | import net.sf.saxon.s9api.XdmValue 8 | 9 | interface ContentTypeConverter { 10 | fun canConvert(from: MediaType, to: MediaType): Boolean 11 | fun convert(stepConfig: StepConfiguration, doc: XProcDocument, convertTo: MediaType, serialization: Map): XProcDocument 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/ContentTypeConverterProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | interface ContentTypeConverterProvider { 4 | fun create(): ContentTypeConverter 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/ContentTypeLoader.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | import com.xmlcalabash.config.StepConfiguration 4 | import com.xmlcalabash.documents.XProcDocument 5 | import com.xmlcalabash.io.MediaType 6 | import java.io.InputStream 7 | import java.net.URI 8 | import java.nio.charset.Charset 9 | 10 | interface ContentTypeLoader { 11 | fun contentTypes(): List 12 | fun load(context: StepConfiguration, uri: URI?, stream: InputStream, contentType: MediaType, charset: Charset?): XProcDocument 13 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/ContentTypeLoaderProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | interface ContentTypeLoaderProvider { 4 | fun create(): ContentTypeLoader 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/DocumentResolver.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | import com.xmlcalabash.config.StepConfiguration 4 | import com.xmlcalabash.documents.XProcDocument 5 | import com.xmlcalabash.io.DocumentManager 6 | import com.xmlcalabash.runtime.XProcStepConfiguration 7 | import java.net.URI 8 | 9 | interface DocumentResolver { 10 | fun resolvableUris(): List 11 | fun resolvableLibraryUris(): List 12 | fun configure(manager: DocumentManager) 13 | fun resolve(context: StepConfiguration, uri: URI, current: XProcDocument?): XProcDocument? 14 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/DocumentResolverProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | interface DocumentResolverProvider { 4 | fun create(): DocumentResolver 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/PagedMediaManager.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | import com.xmlcalabash.api.CssProcessor 4 | import com.xmlcalabash.api.FoProcessor 5 | import net.sf.saxon.s9api.QName 6 | import java.net.URI 7 | 8 | interface PagedMediaManager { 9 | fun formatters(): List 10 | fun formatterSupported(formatter: URI): Boolean 11 | fun configure(formatter: URI, properties: Map) 12 | fun formatterAvailable(formatter: URI): Boolean 13 | fun getCssProcessor(formatter: URI): CssProcessor 14 | fun getFoProcessor(formatter: URI): FoProcessor 15 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/spi/PagedMediaProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.spi 2 | 3 | interface PagedMediaProvider { 4 | fun create(): PagedMediaManager 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/IdentityStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps 2 | 3 | open class IdentityStep(): AbstractAtomicStep() { 4 | override fun run() { 5 | super.run() 6 | for (doc in queues["source"]!!) { 7 | receiver.output("result", doc) 8 | } 9 | } 10 | 11 | override fun toString(): String = "p:identity" 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/MessageStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps 2 | 3 | import com.xmlcalabash.namespace.Ns 4 | 5 | open class MessageStep(): AbstractAtomicStep() { 6 | override fun run() { 7 | super.run() 8 | 9 | val test = booleanBinding(Ns.test)!! 10 | if (test) { 11 | val value = options[Ns.select]!!.value 12 | for (item in value.iterator()) { 13 | stepConfig.info { item.toString() } 14 | } 15 | } 16 | 17 | for (doc in queues["source"]!!) { 18 | receiver.output("result", doc) 19 | } 20 | } 21 | 22 | override fun reset() { 23 | super.reset() 24 | } 25 | 26 | override fun toString(): String = "p:message" 27 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/SinkStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps 2 | 3 | open class SinkStep(): AbstractAtomicStep() { 4 | override fun toString(): String = "p:sink" 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/SleepStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps 2 | 3 | import com.xmlcalabash.namespace.Ns 4 | import com.xmlcalabash.util.DurationUtils 5 | 6 | open class SleepStep(): AbstractAtomicStep() { 7 | override fun run() { 8 | super.run() 9 | 10 | val duration = DurationUtils.parseDuration(stepConfig, stringBinding(Ns.duration)!!) 11 | val ms = duration.toMillis() 12 | 13 | stepConfig.debug { "Sleeping for ${DurationUtils.prettyPrint(duration)} ... "} 14 | Thread.sleep(ms) 15 | 16 | for (doc in queues["source"]!!) { 17 | receiver.output("result", doc) 18 | } 19 | } 20 | 21 | 22 | override fun toString(): String = "p:sleep" 23 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/archives/ArchiveType.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.archives 2 | 3 | enum class ArchiveType { SEVENZ, AR, ARJ, CPIO, JAR, TAR, ZIP } 4 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/archives/JarInputArchive.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.archives 2 | 3 | import com.xmlcalabash.documents.XProcBinaryDocument 4 | import com.xmlcalabash.namespace.Ns 5 | import com.xmlcalabash.runtime.XProcStepConfiguration 6 | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry 7 | import java.io.InputStream 8 | 9 | class JarInputArchive(stepConfig: XProcStepConfiguration, doc: XProcBinaryDocument): ZipInputArchive(stepConfig, doc) { 10 | override val archiveFormat = Ns.jar 11 | override val baseUri = doc.baseURI 12 | override fun open() { 13 | openZip(".jar") 14 | } 15 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/archives/JarOutputArchive.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.archives 2 | 3 | import com.xmlcalabash.namespace.Ns 4 | import com.xmlcalabash.runtime.XProcStepConfiguration 5 | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream 6 | import java.io.File 7 | 8 | class JarOutputArchive(stepConfig: XProcStepConfiguration): ZipOutputArchive(stepConfig) { 9 | override val archiveFormat = Ns.jar 10 | 11 | override fun create(file: File?) { 12 | if (file == null) { 13 | archiveFile = createArchive(".jar") 14 | } else { 15 | archiveFile = file.toPath() 16 | } 17 | 18 | zipStream = ZipArchiveOutputStream(archiveFile) 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/extension/AbstractRdfStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.extension 2 | 3 | import com.xmlcalabash.steps.AbstractAtomicStep 4 | import net.sf.saxon.s9api.QName 5 | 6 | abstract class AbstractRdfStep(): AbstractAtomicStep() { 7 | companion object { 8 | val _graph = QName("graph") 9 | val _language = QName("language") 10 | } 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/extension/EPubCheckConfigurer.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.extension 2 | 3 | import com.xmlcalabash.XmlCalabashBuilder 4 | import com.xmlcalabash.spi.Configurer 5 | import com.xmlcalabash.spi.ConfigurerProvider 6 | import net.sf.saxon.Configuration 7 | 8 | class EPubCheckConfigurer(): Configurer, ConfigurerProvider { 9 | override fun configure(builder: XmlCalabashBuilder) { 10 | builder.addMimeType("application/epub+zip", listOf("epub")) 11 | } 12 | 13 | override fun configureSaxon(config: Configuration) { 14 | // nop 15 | } 16 | 17 | override fun create(): Configurer { 18 | return this 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/file/DirectoryDir.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.file 2 | 3 | import java.io.File 4 | 5 | class DirectoryDir(file: File, include: Boolean): DirectoryEntry(file, include) { 6 | val entries = mutableListOf() 7 | override fun toString(): String { 8 | return "${file} (${entries.size})" 9 | } 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/file/DirectoryEntry.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.file 2 | 3 | import java.io.File 4 | 5 | abstract class DirectoryEntry(val file: File, var include: Boolean = false) { 6 | override fun toString(): String { 7 | return file.toString() 8 | } 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/file/DirectoryFile.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.file 2 | 3 | import com.xmlcalabash.io.MediaType 4 | import java.io.File 5 | 6 | class DirectoryFile(file: File, include: Boolean, val contentType: MediaType): DirectoryEntry(file, include) { 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/file/FileCopyStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.file 2 | 3 | import com.xmlcalabash.namespace.NsP 4 | 5 | class FileCopyStep(): FileCopyOrMove(NsP.fileCopy) { 6 | override fun run() { 7 | super.run() 8 | copyOrMove() 9 | } 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/file/FileMoveStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.file 2 | 3 | import com.xmlcalabash.namespace.NsP 4 | 5 | class FileMoveStep(): FileCopyOrMove(NsP.fileMove) { 6 | override fun run() { 7 | super.run() 8 | copyOrMove() 9 | } 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/internal/EmptyStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.internal 2 | 3 | import com.xmlcalabash.runtime.parameters.EmptyStepParameters 4 | import com.xmlcalabash.steps.AbstractAtomicStep 5 | 6 | class EmptyStep(val params: EmptyStepParameters): AbstractAtomicStep() { 7 | override fun run() { 8 | super.run() 9 | // nop 10 | } 11 | 12 | override fun toString(): String = "cx:empty" 13 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/internal/GuardStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.internal 2 | 3 | import com.xmlcalabash.steps.AbstractAtomicStep 4 | 5 | class GuardStep(): AbstractAtomicStep() { 6 | fun effectiveBooleanValue(): Boolean { 7 | val value = queues["source"]!!.first() 8 | return value.value.underlyingValue.effectiveBooleanValue() 9 | } 10 | 11 | override fun toString(): String = "cx:guard" 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/internal/OptionExpressionStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.internal 2 | 3 | import com.xmlcalabash.runtime.parameters.OptionStepParameters 4 | 5 | class OptionExpressionStep(params: OptionStepParameters): ExpressionStep(params) { 6 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/steps/internal/UnimplementedStep.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.steps.internal 2 | 3 | import com.xmlcalabash.exceptions.XProcError 4 | import com.xmlcalabash.runtime.parameters.UnimplementedStepParameters 5 | import com.xmlcalabash.steps.AbstractAtomicStep 6 | 7 | open class UnimplementedStep(val params: UnimplementedStepParameters): AbstractAtomicStep() { 8 | override fun run() { 9 | super.run() 10 | throw stepConfig.exception(XProcError.xsMissingStepDeclaration(params.unimplemented)) 11 | } 12 | 13 | override fun toString(): String = params.unimplemented.toString() 14 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/DocumentDetail.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | 5 | class DocumentDetail(threadId: Long, val from: Pair, val to: Pair, document: XProcDocument): TraceDetail(threadId) { 6 | val id = document.id 7 | val contentType = document.contentType 8 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/GetResourceDetail.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | import java.net.URI 4 | 5 | class GetResourceDetail(val startTime: Long, val duration: Long, val uri: URI, val href: URI?, val resolved: Boolean, val cached: Boolean): TraceDetail(Thread.currentThread().id) { 6 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/NsTrace.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | import net.sf.saxon.om.NamespaceUri 4 | import net.sf.saxon.s9api.QName 5 | 6 | object NsTrace { 7 | val namespace: NamespaceUri = NamespaceUri.of("https://xmlcalabash.com/ns/trace") 8 | 9 | val trace = QName(namespace, "trace") 10 | val thread = QName(namespace, "thread") 11 | val step = QName(namespace, "step") 12 | val document = QName(namespace, "document") 13 | val resource = QName(namespace, "resource") 14 | val from = QName(namespace, "from") 15 | val to = QName(namespace, "to") 16 | val location = QName(namespace, "location") 17 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/StepStartDetail.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | import com.xmlcalabash.runtime.steps.AbstractStep 4 | 5 | class StepStartDetail(step: AbstractStep, threadId: Long, val startTime: Long): TraceDetail(threadId) { 6 | val name = step.name 7 | val id = step.id 8 | val type = step.type 9 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/StepStopDetail.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | import com.xmlcalabash.runtime.steps.AbstractStep 4 | 5 | class StepStopDetail(step: AbstractStep, threadId: Long, val aborted: Exception? = null): TraceDetail(threadId) { 6 | val id = step.id 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/TraceDetail.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | abstract class TraceDetail(val threadId: Long) { 4 | val nanoSeconds = System.nanoTime() 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/tracing/TraceListener.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.tracing 2 | 3 | import com.xmlcalabash.api.Monitor 4 | import com.xmlcalabash.runtime.XProcStepConfiguration 5 | import com.xmlcalabash.util.SaxonTreeBuilder 6 | import net.sf.saxon.s9api.XdmNode 7 | import java.net.URI 8 | 9 | interface TraceListener: Monitor { 10 | val trace: List 11 | fun getResource(ms: Long, uri: URI, href: URI? = null, resolved: Boolean, cached: Boolean) 12 | fun summary(config: XProcStepConfiguration): XdmNode 13 | fun documentSummary(config: XProcStepConfiguration, builder: SaxonTreeBuilder, detail: DocumentDetail) 14 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/AssertionsLevel.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | enum class AssertionsLevel { IGNORE, WARNING, ERROR} -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/BufferingReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.runtime.api.Receiver 5 | 6 | class BufferingReceiver(): Receiver { 7 | val outputs = mutableMapOf>() 8 | 9 | override fun output(port: String, document: XProcDocument) { 10 | outputs.getOrPut(port) { mutableListOf() }.add(document) 11 | } 12 | 13 | internal fun close() { 14 | // nop 15 | } 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/DefaultLocation.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import net.sf.saxon.s9api.Location 4 | 5 | class DefaultLocation (val href: String? = null, val lineNumber: Int? = null, val columnNumber: Int? = null): Location { 6 | override fun getPublicId(): String? = null 7 | override fun getSystemId(): String? = href 8 | override fun getLineNumber(): Int = lineNumber ?: -1 9 | override fun getColumnNumber(): Int = columnNumber ?: -1 10 | override fun saveLocation(): Location = this 11 | override fun toString(): String = "${href?:""}:${lineNumber?:""}:${columnNumber?:""}" 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/DefaultMarkdownConfigurer.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.vladsch.flexmark.util.data.MutableDataSet 4 | 5 | class DefaultMarkdownConfigurer: MarkdownConfigurer { 6 | override fun configure(options: MutableDataSet, param: String) { 7 | // This doesn't do anything, it's just for testing 8 | // println("Called default configurer: ${param}") 9 | } 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/DiscardingReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.runtime.api.Receiver 5 | 6 | class DiscardingReceiver(): Receiver { 7 | override fun output(port: String, document: XProcDocument) { 8 | // Circular file, incoming! 9 | } 10 | 11 | internal fun close() { 12 | // nop 13 | } 14 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/LoggingMessageReporter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.xmlcalabash.api.MessageReporter 4 | import com.xmlcalabash.util.NopMessageReporter 5 | import net.sf.saxon.s9api.QName 6 | import org.apache.logging.log4j.kotlin.logger 7 | 8 | class LoggingMessageReporter(nextReporter: MessageReporter? = null): NopMessageReporter(nextReporter) { 9 | override fun report(severity: Verbosity, report: () -> Report) { 10 | when (severity) { 11 | Verbosity.ERROR -> logger.error(report().message) 12 | Verbosity.WARN -> logger.warn(report().message) 13 | Verbosity.INFO -> logger.info(report().message) 14 | Verbosity.DEBUG -> logger.debug(report().message) 15 | Verbosity.TRACE -> logger.trace(report().message) 16 | } 17 | nextReporter?.report(severity, report) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/MarkdownConfigurer.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.vladsch.flexmark.util.data.MutableDataSet 4 | 5 | interface MarkdownConfigurer { 6 | fun configure(options: MutableDataSet, param: String) 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/MediaClassification.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | enum class MediaClassification { 4 | XML, XHTML, HTML, JSON, YAML, TOML, TEXT, BINARY 5 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/NodeLocation.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import net.sf.saxon.s9api.Location 4 | import net.sf.saxon.s9api.XdmNode 5 | 6 | class NodeLocation(val node: XdmNode): Location { 7 | override fun getPublicId(): String? = null 8 | override fun getSystemId(): String? = node.baseURI?.toString() 9 | override fun getLineNumber(): Int = node.lineNumber 10 | override fun getColumnNumber(): Int = node.columnNumber 11 | override fun saveLocation(): Location = this 12 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/SysIdLocation.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import net.sf.saxon.s9api.Location 4 | 5 | class SysIdLocation (val sysId: String): Location { 6 | override fun getPublicId(): String? = null 7 | override fun getSystemId(): String? = sysId 8 | override fun getLineNumber(): Int = -1 9 | override fun getColumnNumber(): Int = -1 10 | override fun saveLocation(): Location = this 11 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/ValueTemplate.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | data class ValueTemplate(val value: List) { 4 | fun expressions(): List { 5 | val expr = mutableListOf() 6 | for (index in value.indices) { 7 | if (index % 2 == 1) { 8 | expr.add(value[index]) 9 | } 10 | } 11 | return expr 12 | } 13 | 14 | override fun toString(): String { 15 | val sb = StringBuilder() 16 | for (index in value.indices) { 17 | if (index % 2 == 0) { 18 | sb.append(value[index]) 19 | } else { 20 | sb.append("{").append(value[index]).append("}") 21 | } 22 | } 23 | return sb.toString() 24 | } 25 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/ValueTemplateFilter.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.xmlcalabash.config.StepConfiguration 4 | import com.xmlcalabash.datamodel.XProcExpression 5 | import com.xmlcalabash.documents.XProcDocument 6 | import com.xmlcalabash.runtime.LazyValue 7 | import net.sf.saxon.s9api.QName 8 | import net.sf.saxon.s9api.XdmNode 9 | 10 | interface ValueTemplateFilter { 11 | fun expandStaticValueTemplates(config: StepConfiguration, initialExpand: Boolean, staticBindings: Map): XdmNode 12 | fun expandValueTemplates(config: StepConfiguration, contextItem: XProcDocument?, bindings: Map): XdmNode 13 | fun containsMarkup(config: StepConfiguration): Boolean 14 | fun getNode(): XdmNode 15 | fun isStatic(): Boolean 16 | fun usesContext(): Boolean 17 | fun usesVariables(): Set 18 | fun usesFunctions(): Set> 19 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/Verbosity.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | /** 4 | * How verbose should the processor be? 5 | * 6 | * - `ERROR`: Only display error messages 7 | * - `WARN`: Display error and warning messages 8 | */ 9 | enum class Verbosity { TRACE, DEBUG, INFO, WARN, ERROR } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/VoidLocation.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import net.sf.saxon.s9api.Location 4 | 5 | class VoidLocation private constructor(): Location { 6 | companion object { 7 | val instance = VoidLocation() 8 | } 9 | 10 | override fun getPublicId(): String? = null 11 | override fun getSystemId(): String? = null 12 | override fun getLineNumber(): Int = -1 13 | override fun getColumnNumber(): Int = -1 14 | override fun saveLocation(): Location = this 15 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/XsdResolver.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util 2 | 3 | import com.xmlcalabash.runtime.XProcStepConfiguration 4 | import net.sf.saxon.Configuration 5 | import net.sf.saxon.lib.SchemaURIResolver 6 | import javax.xml.transform.stream.StreamSource 7 | 8 | class XsdResolver(val stepConfig: XProcStepConfiguration): SchemaURIResolver { 9 | override fun setConfiguration(p0: Configuration?) { 10 | // I don't care??? 11 | } 12 | 13 | override fun resolve(moduleURI: String?, baseURI: String?, locations: Array?): Array? { 14 | return stepConfig.environment.documentManager.resolve(moduleURI, baseURI, locations) 15 | } 16 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/spi/StandardConfigurer.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util.spi 2 | 3 | import com.xmlcalabash.XmlCalabashBuilder 4 | import com.xmlcalabash.spi.Configurer 5 | import net.sf.saxon.Configuration 6 | 7 | class StandardConfigurer(): Configurer { 8 | override fun configure(builder: XmlCalabashBuilder) { 9 | // nop 10 | } 11 | 12 | override fun configureSaxon(config: Configuration) { 13 | // nop 14 | } 15 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/util/spi/StandardContentTypeLoader.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.util.spi 2 | 3 | import com.xmlcalabash.config.StepConfiguration 4 | import com.xmlcalabash.documents.XProcDocument 5 | import com.xmlcalabash.io.MediaType 6 | import com.xmlcalabash.runtime.XProcStepConfiguration 7 | import com.xmlcalabash.spi.ContentTypeLoader 8 | import java.io.InputStream 9 | import java.net.URI 10 | import java.nio.charset.Charset 11 | 12 | class StandardContentTypeLoader(): ContentTypeLoader { 13 | override fun contentTypes(): List { 14 | return emptyList() 15 | } 16 | 17 | override fun load(context: StepConfiguration, uri: URI?, stream: InputStream, contentType: MediaType, charset: Charset?): XProcDocument { 18 | throw IllegalArgumentException("The StandardContentTypeLoader doesn't support any content types") 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/visualizers/Silent.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.visualizers 2 | 3 | import com.xmlcalabash.documents.XProcDocument 4 | import com.xmlcalabash.api.Monitor 5 | import com.xmlcalabash.runtime.steps.AbstractStep 6 | import com.xmlcalabash.runtime.steps.Consumer 7 | import org.apache.logging.log4j.kotlin.logger 8 | import java.util.Stack 9 | 10 | open class Silent(options: Map): AbstractVisualizer(emptyMap()) { 11 | init { 12 | if (options.isNotEmpty()) { 13 | logger.warn("The silent visualizer accepts no options") 14 | } 15 | } 16 | override fun showStart(step: AbstractStep, depth: Int) { 17 | // nop 18 | } 19 | 20 | override fun showEnd(step: AbstractStep, depth: Int) { 21 | // nop 22 | } 23 | 24 | override fun showDocument(step: AbstractStep, port: String, depth: Int, document: XProcDocument) { 25 | // nop 26 | } 27 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/xvrl/XvrlText.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.xvrl 2 | 3 | import com.xmlcalabash.config.StepConfiguration 4 | import com.xmlcalabash.util.SaxonTreeBuilder 5 | 6 | class XvrlText(stepConfiguration: StepConfiguration, val text: String): XvrlElement(stepConfiguration) { 7 | override fun serialize(builder: SaxonTreeBuilder) { 8 | builder.addText(text) 9 | } 10 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/kotlin/com/xmlcalabash/xvrl/XvrlValueOf.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.xvrl 2 | 3 | import com.xmlcalabash.runtime.XProcStepConfiguration 4 | import net.sf.saxon.s9api.QName 5 | 6 | class XvrlValueOf private constructor(stepConfiguration: XProcStepConfiguration, val name: QName): XvrlElement(stepConfiguration) { 7 | } -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/META-INF/services/com.xmlcalabash.spi.AtomicStepProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.util.spi.StandardStepProvider 2 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/META-INF/services/com.xmlcalabash.spi.DocumentResolverProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.util.spi.StandardDocumentResolver 2 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/META-INF/services/com.xmlcalabash.spi.PagedMediaProvider: -------------------------------------------------------------------------------- 1 | com.xmlcalabash.util.spi.StandardPagedMediaProvider 2 | com.xmlcalabash.steps.pagedmedia.antennahouse.AhManager 3 | com.xmlcalabash.steps.pagedmedia.fop.FopManager 4 | com.xmlcalabash.steps.pagedmedia.prince.PrinceManager 5 | com.xmlcalabash.steps.pagedmedia.weasyprint.WeasyprintManager 6 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/asciidoctor.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/cache.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/collection-manager.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/epubcheck.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/json-patch.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/jsonpath.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/markup-blitz.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/metadata-extractor.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/pipeline-messages.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/selenium.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/unique-id.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/wait-for-update.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/ext/xpath.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/properties.rnc: -------------------------------------------------------------------------------- 1 | # https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html 2 | # 3 | # Defines a DTD for properties files: 4 | # 5 | # 6 | # 7 | # 8 | # 9 | # 10 | # 11 | # 12 | # 13 | 14 | start = properties 15 | 16 | properties = 17 | element properties { 18 | attribute version { "1.0" }?, 19 | comment?, 20 | entry* 21 | } 22 | 23 | comment = 24 | element comment { text } 25 | 26 | entry = 27 | element entry { 28 | attribute key { text }, 29 | text 30 | } 31 | -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/com/xmlcalabash/schxslt2-1.3.1/VERSION: -------------------------------------------------------------------------------- 1 | 1.3.1 -------------------------------------------------------------------------------- /xmlcalabash/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | System.err 4 | 5 | %-5level %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/kotlin/com/xmlcalabash/test/PagedMediaTest.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.test 2 | 3 | import com.xmlcalabash.spi.PagedMediaManager 4 | import com.xmlcalabash.spi.PagedMediaServiceProvider 5 | import org.junit.jupiter.api.Assertions 6 | import org.junit.jupiter.api.Test 7 | 8 | class PagedMediaTest { 9 | @Test 10 | fun nopXslFormatter() { 11 | val providers = mutableListOf() 12 | for (provider in PagedMediaServiceProvider.providers()) { 13 | providers.add(provider.create()) 14 | } 15 | Assertions.assertTrue(providers.isNotEmpty()) 16 | } 17 | } -------------------------------------------------------------------------------- /xmlcalabash/src/test/kotlin/com/xmlcalabash/test/XsltDslTest.kt: -------------------------------------------------------------------------------- 1 | package com.xmlcalabash.test 2 | 3 | import com.xmlcalabash.util.SaxonTreeBuilder 4 | import net.sf.saxon.s9api.Processor 5 | import org.junit.jupiter.api.Test 6 | 7 | class XsltDslTest { 8 | @Test 9 | fun smokeTest() { 10 | val builder = SaxonTreeBuilder(Processor(false)) 11 | val x = builder.xslt(ns = mapOf("xs" to "http://www.w3.org/2001/XMLSchema")) { 12 | mode(onNoMatch = "shallow-copy") {} 13 | template(match="/") { 14 | applyTemplates() {} 15 | text() { +"Something here" } 16 | } 17 | } 18 | println(x) 19 | } 20 | } -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/001-pipeline-messages.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/configfile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/css-formatter.css: -------------------------------------------------------------------------------- 1 | strong { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/css-formatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple HTML document 4 | 5 | 6 |

Simple HTML document

7 |

Nothing to see here.

8 |

Prince test.

9 | 10 | 11 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/css.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.bmp -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.gif -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.jpg -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.pdf -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/amaryllis.png -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/document.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/document.pdf -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/envelope.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/cx-metadata-extractor/envelope.pdf -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/pipe-encrypted-pdf.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/cx-metadata-extractor/pipe.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/doc.css: -------------------------------------------------------------------------------- 1 | strong { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple HTML document 4 | 5 | 6 |

Simple HTML document

7 |

Nothing to see here.

8 | 9 | 10 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/extension.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/fo.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/fop.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/identity.xpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-base64.xml: -------------------------------------------------------------------------------- 1 | UEsDBBQAAAAIAPk8JFoFAeO4ZAAAAIgAAAAJABwAaW5wdXQudHh0VVQJAAPF5XhnxuV4Z3V4CwABBPUBAAAEFAAAAD2M0Q2DQAxD/5nCA1TM0QFYIBBTTjoSKRxFt30PipD8Y/vZw5I2NAkKt9JjuL1brk/4FkU5i5G0lgYlgyvjQ5vqCwdx+J61W+RLzJmKZG0b4QExRfX9T8C84KKuq2Szx0rtux9QSwECHgMUAAAACAD5PCRaBQHjuGQAAACIAAAACQAYAAAAAAABAAAApIEAAAAAaW5wdXQudHh0VVQFAAPF5XhndXgLAAEE9QEAAAQUAAAAUEsFBgAAAAABAAEATwAAAKcAAAAAAA== 2 | 3 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-broken.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is the title 5 | <body> 6 | <p>Not well formed, but HTML doesn’t have to be.</p> 7 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-broken.xhtml: -------------------------------------------------------------------------------- 1 | <html xmlns="http://www.w3.org/1999/xhtml"> 2 | <head> 3 | <title>XHTML 4 | 5 | 6 |

Not well formed 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-broken.xml: -------------------------------------------------------------------------------- 1 | 2 |

This is not XML. 3 | 4 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-json-array.json: -------------------------------------------------------------------------------- 1 | [ 2 | 42, 3 | { 4 | "text": "This is a test", 5 | "boolean": true, 6 | "number": 17, 7 | "array": [1,2,3] 8 | } 9 | ] 10 | 11 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-json-map-dup-keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": "This is a test", 3 | "boolean": true, 4 | "number": 17, 5 | "array": [1,2,3], 6 | "text": "This is different text" 7 | } 8 | 9 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-json-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": "This is a test", 3 | "boolean": true, 4 | "number": 17, 5 | "array": [1,2,3] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-json-number.json: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input-json-string.json: -------------------------------------------------------------------------------- 1 | "This is json" 2 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is the title 5 | 6 | 7 |

Well formed HTML.

8 | 9 | 10 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/marshall/input.jpg -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML document 2 | 3 | title = "TOML Example" 4 | 5 | [owner] 6 | name = "Tom Preston-Werner" 7 | dob = 1979-05-27T07:32:00-08:00 8 | 9 | [database] 10 | enabled = true 11 | ports = [ 8000, 8001, 8002 ] 12 | data = [ ["delta", "phi"], [3.14] ] 13 | temp_targets = { cpu = 79.5, case = 72.0 } 14 | 15 | [servers] 16 | 17 | [servers.alpha] 18 | ip = "10.0.0.1" 19 | role = "frontend" 20 | 21 | [servers.beta] 22 | ip = "10.0.0.2" 23 | role = "backend" 24 | 25 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.txt: -------------------------------------------------------------------------------- 1 | This is a test. This is only a test. Had this been a real emergency, we would 2 | have fled in terror and you would not have been informed. 3 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | XHTML 4 | 5 | 6 |

Well formed XHTML.

7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.xml: -------------------------------------------------------------------------------- 1 | 2 |

This is “XML”.

3 |
4 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/marshall/input.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmlcalabash/xmlcalabash3/bf6510a3c024795b92ca3e44fb72b057b2e562d3/xmlcalabash/src/test/resources/marshall/input.zip -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/names.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/parser/functions.xqy: -------------------------------------------------------------------------------- 1 | xquery version "1.0"; 2 | 3 | module namespace f="https://xmlcalabash.com/ns/functions/xqy"; 4 | 5 | declare default function namespace "http://www.w3.org/2005/xpath-functions"; 6 | 7 | declare function f:hello( 8 | ) as xs:string 9 | { 10 | "Hello, world." 11 | }; 12 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/parser/functions.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/parser/importfunctions.xpl: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/parser/library1.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/prince.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/schematron/doc-001.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/schematron/schema-001.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | The source document has a root id. 9 | The source document does not have a root id. 10 | The source is not a book. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/static-error.xpl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/A.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | this is i:private in A 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/B.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/declexcluded.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/declimport1.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/declimport2.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/declimport3.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/declloop.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/decloption1.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/decloption2.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/decloption3.xpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/decltrue.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/excluded.xpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/none.xpl: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/pusewhen.xpl: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/usewhen/simple.xpl: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /xmlcalabash/src/test/resources/weasyprint.xpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | --------------------------------------------------------------------------------