diff --git a/build.gradle b/build.gradle
index b45f6e5d2..d93f75f87 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1586,6 +1586,9 @@ fileTree(
}
testGenerator.createTasks()
+testSummary.dependsOn project.tasks.named("all_mo_tests")
+report.dependsOn project.tasks.named("all_mo_tests")
+
// These are the xspec files authored by hand for whatever reason
fileTree(dir: "${projectDir}/src/test/xspec", include: "*.xspec").each { xspec ->
String fn = xspec.toString().replace('\\', '/').split('/')[-1]
diff --git a/buildSrc/src/main/groovy/org/docbook/xsltng/gradle/TestGenerator.groovy b/buildSrc/src/main/groovy/org/docbook/xsltng/gradle/TestGenerator.groovy
index 0d80cac41..d5cd3fd7f 100644
--- a/buildSrc/src/main/groovy/org/docbook/xsltng/gradle/TestGenerator.groovy
+++ b/buildSrc/src/main/groovy/org/docbook/xsltng/gradle/TestGenerator.groovy
@@ -155,6 +155,7 @@ class TestGenerator {
configureCalloutTests()
configureNumberedFromTests()
configureInheritedFromTests()
+ configureMediaObjectTests()
}
void configure(File xml) {
@@ -338,6 +339,1207 @@ class TestGenerator {
}
}
+ void configureMediaObjectTests() {
+ def all_mo_tests = project.tasks.register("all_mo_tests") {
+ // Just somewhere to hang dependencies
+ }
+
+ ["1", "2"].each { mo ->
+ project.tasks.register("mo_${mo}_test_1", SaxonXsltTask) {
+ // Single output HTML file, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-1"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 1"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-1"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "**/*"
+ exclude "**/*.xml"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-1/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-1"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_1")
+ }
+
+ project.tasks.register("mo_${mo}_test_2", SaxonXsltTask) {
+ // Single output HTML file, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-2"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 2"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-2"
+ }
+
+ doFirst {
+ // N.B. These copy commands are a bit redundant because they
+ // have to work for all of the input layouts
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/body"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/front"
+ include "*.mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-2/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "false"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-2"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_2")
+ }
+
+ project.tasks.register("mo_${mo}_test_3", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-3"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 3"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-3"
+ }
+
+ doFirst {
+ // N.B. These copy commands are a bit redundant because they
+ // have to work for all of the input layouts
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "**/*"
+ exclude "**/*.xml"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-3/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-3"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_3")
+ }
+
+ project.tasks.register("mo_${mo}_test_4", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ // but segregated by type
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ inputs.file "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-2
+ outputs.dir "${buildDir}/actual/mo-${mo}-4"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 4"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-4"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/body/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/body"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/media/video"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/front/video"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/front"
+ include "*.mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/media/audio"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.mp3"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/media/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.png"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book.xml"
+ stylesheet "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-2
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-4/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-4"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_4")
+ }
+
+ project.tasks.register("mo_${mo}_test_5", SaxonXsltTask) {
+ // Chunked output HTML, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-5"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 5"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-5"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/body"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/front"
+ include "*.mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-5/",
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "false"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-5"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_5")
+ }
+ }
+
+ // Test 3 is different because, although the media are relative to the
+ // source locations, they escape out above the "book" as might occur
+ // if you had several books with some common media.
+ ["3"].each { mo ->
+ project.tasks.register("mo_${mo}_test_1", SaxonXsltTask) {
+ // Single output HTML file, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-1"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 1"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-1/book"
+ project.mkdir "${buildDir}/actual/mo-${mo}-1/media"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "**/*"
+ exclude "**/*.xml"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1/book"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-1/book/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-1"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_1")
+ }
+
+ project.tasks.register("mo_${mo}_test_2", SaxonXsltTask) {
+ // Single output HTML file, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-2"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 2"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-2/book"
+ }
+
+ doFirst {
+ // N.B. These copy commands are a bit redundant because they
+ // have to work for all of the input layouts
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/book/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/book/body"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/book/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/book"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-2/book/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "false"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-2"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_2")
+ }
+
+ project.tasks.register("mo_${mo}_test_3", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-3"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 3"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-3/book"
+ project.mkdir "${buildDir}/actual/mo-${mo}-3/media"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}"
+ include "**/*"
+ exclude "**/*.xml"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3/book"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-3/book/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-3"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_3")
+ }
+
+ project.tasks.register("mo_${mo}_test_4", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ // but segregated by type
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ inputs.file "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-2
+ outputs.dir "${buildDir}/actual/mo-${mo}-4"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 4"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-4/book"
+ project.mkdir "${buildDir}/actual/mo-${mo}-4/media"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/book/body/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/book/body"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/media/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/media/audio"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.mp3"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/media/video"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/front/video"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/front"
+ include "*.mp4"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/book"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-2
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-4/book/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-4"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_4")
+ }
+
+ project.tasks.register("mo_${mo}_test_5", SaxonXsltTask) {
+ // Chunked output HTML, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-5"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 5"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-5"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/book/body"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.png"
+ include "*.mp4"
+ include "*.mp3"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-5/",
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "false"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-5"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_5")
+ }
+ }
+
+ // Test 4 stores the media in a separate hierarchy
+ ["4"].each { mo ->
+ project.tasks.register("mo_${mo}_test_1", SaxonXsltTask) {
+ // Single output HTML file, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-1"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 1"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-1"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "**/*"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-1/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-1"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_1")
+ }
+
+ project.tasks.register("mo_${mo}_test_2", SaxonXsltTask) {
+ // Single output HTML file, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-2"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 2"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-2"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-2/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "true"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-2"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_2")
+ }
+
+ project.tasks.register("mo_${mo}_test_3", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-3"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 3"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-3"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "**/*"
+ exclude "**/*.xml"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-3/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-3"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_3")
+ }
+
+ project.tasks.register("mo_${mo}_test_4", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ // but segregated by type
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ inputs.file "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-2
+ outputs.dir "${buildDir}/actual/mo-${mo}-4"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 4"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-4"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/left/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media/left"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/right/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media/right"
+ include "*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/video"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/audio"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "*.mp3"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-4
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-4/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-4"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_4")
+ }
+
+ project.tasks.register("mo_${mo}_test_5", SaxonXsltTask) {
+ // Chunked output HTML, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-5"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 5"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-5"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-5/",
+ "mediaobject-input-base-uri": "../media/",
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "true"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-5"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_5")
+ }
+ }
+
+ // Test 5 stores the media grouped by type
+ ["5"].each { mo ->
+ project.tasks.register("mo_${mo}_test_1", SaxonXsltTask) {
+ // Single output HTML file, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-1"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 1"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-1"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "**/*"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-1"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-1/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "mediaobject-grouped-by-type": "true"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-1"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_2")
+ }
+
+ project.tasks.register("mo_${mo}_test_2", SaxonXsltTask) {
+ // Single output HTML file, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-2"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 2"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-2"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-2"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ output "${buildDir}/actual/mo-${mo}-2/index.html"
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "true",
+ "mediaobject-grouped-by-type": "true"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-2"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_2")
+ }
+
+ project.tasks.register("mo_${mo}_test_3", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-3"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 3"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-3"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ include "**/*"
+ exclude "**/*.xml"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-3"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-3/",
+ "mediaobject-grouped-by-type": "true"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-3"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_3")
+ }
+
+ project.tasks.register("mo_${mo}_test_4", SaxonXsltTask) {
+ // Chunked output HTML, media all in the same relative locations
+ // but segregated by type
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ inputs.file "${projectDir}/src/test/resources/mo_1_test_4.xsl" // even for mo-2
+ outputs.dir "${buildDir}/actual/mo-${mo}-4"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 4"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-4"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/left/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media/left"
+ include "**/*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/right/image"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media/right"
+ include "**/*.png"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/video/mp4"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media/mp4"
+ }
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4/audio/mp3"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media/mp3"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-4"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${projectDir}/src/test/resources/mo_5_test_4.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "mediaobject-input-base-uri": "../media/",
+ "mediaobject-grouped-by-type": "true",
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-4/"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-4"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_4")
+ }
+
+ project.tasks.register("mo_${mo}_test_5", SaxonXsltTask) {
+ // Chunked output HTML, media all in a common directory
+ inputs.dir "${projectDir}/src/test/resources/xml/mo-${mo}"
+ inputs.dir "${buildDir}/xslt"
+ outputs.dir "${buildDir}/actual/mo-${mo}-5"
+ dependsOn project.tasks.named('makeXslt')
+ dependsOn project.tasks.named('copyResources')
+
+ group: "mediaobject-test"
+ description: "Test source mo-${mo}, output version 5"
+
+ doFirst {
+ project.mkdir "${buildDir}/actual/mo-${mo}-5"
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5/media"
+ from "${projectDir}/src/test/resources/xml/mo-${mo}/media"
+ }
+ }
+
+ doFirst {
+ project.copy {
+ into "${buildDir}/actual/mo-${mo}-5"
+ from "${buildDir}/actual"
+ include "js/**"
+ include "css/**"
+ }
+ }
+
+ input "${projectDir}/src/test/resources/xml/mo-${mo}/book/book.xml"
+ stylesheet "${buildDir}/xslt/docbook.xsl"
+ // no output
+ args(['-init:org.docbook.xsltng.extensions.Register'])
+ parameters([
+ "chunk": "index.html",
+ "chunk-output-base-uri": "${buildDir}/actual/mo-${mo}-5/",
+ "mediaobject-input-base-uri": "../media/",
+ "mediaobject-output-base-uri": "media/",
+ "mediaobject-output-paths": "true",
+ "mediaobject-grouped-by-type": "true"
+ ])
+
+ doLast {
+ project.exec {
+ commandLine "python", "src/bin/linkcheck.py",
+ "${buildDir}/actual/mo-${mo}-5"
+ }
+ }
+ }
+ all_mo_tests.configure {
+ dependsOn project.tasks.named("mo_${mo}_test_5")
+ }
+ }
+ }
+
void createTasks() {
testCases.createTasks()
testConfigurations.createTasks()
diff --git a/properties.gradle b/properties.gradle
index 8000b1bbe..182be6a04 100644
--- a/properties.gradle
+++ b/properties.gradle
@@ -2,9 +2,9 @@
ext {
xslTNGtitle = 'DocBook xslTNG'
xslTNGbaseName = 'docbook-xslTNG'
- xslTNGversion = '2.0.17'
- guideVersion = '2.0.17'
- guidePrerelease = true
+ xslTNGversion = '2.1.0'
+ guideVersion = '2.1.0'
+ guidePrerelease = false
docbookVersion = '5.2CR5'
publishersVersion = '5.2CR5'
diff --git a/src/bin/linkcheck.py b/src/bin/linkcheck.py
index 935fa7cd4..4af9816a9 100644
--- a/src/bin/linkcheck.py
+++ b/src/bin/linkcheck.py
@@ -14,10 +14,10 @@
import click
from saxonche import PySaxonProcessor
-def linkcheck(root, debug):
+def linkcheck(root, server_root, debug):
if debug:
print("Checking links in", root)
-
+
globpatn = root + '/**/*'
if root.endswith('/'): # can this happen?
globpatn = root + '**/*'
@@ -32,11 +32,19 @@ def linkcheck(root, debug):
+
+
+
+
@@ -48,19 +56,47 @@ def linkcheck(root, debug):
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
"""
seen = []
fail = {}
-
+
for htmlfile in files:
with open(htmlfile, "r", encoding="utf-8") as html:
doc = html5_parser.parse(html.read())
@@ -69,13 +105,17 @@ def linkcheck(root, debug):
with PySaxonProcessor(license=False) as saxon:
xslt = saxon.new_xslt30_processor()
+ if server_root:
+ xslt.set_parameter("{}server-root", saxon.make_string_value(root))
xexec = xslt.compile_stylesheet(stylesheet_text=extract)
builder = saxon.new_document_builder()
builder.set_base_uri('file:' + htmlfile)
node = builder.parse_xml(xml_text=text)
- uris = json.loads(xexec.apply_templates_returning_string(xdm_value=node))
+ xexec.set_global_context_item(xdm_item=node)
+ result = xexec.apply_templates_returning_string(xdm_value=node)
+ uris = json.loads(result)
for uri in uris:
if uri.startswith('file:'):
@@ -84,8 +124,14 @@ def linkcheck(root, debug):
# FIXME: check fragment identifiers...
if "#" in fn:
fn = fn[0:fn.index("#")]
-
+
+ # FIXME?: check queries
+ if "?" in fn:
+ fn = fn[0:fn.index("?")]
+
if fn not in seen:
+ if debug:
+ print(f"\tCheck {uri}")
seen.append(fn)
if not os.path.exists(fn):
if not htmlfile in fail:
@@ -102,10 +148,11 @@ def linkcheck(root, debug):
@click.command()
@click.option("--debug", help="Debug", is_flag=True)
+@click.option("--server-root", "-s", help="Server root", is_flag=True)
@click.argument("root", type=click.Path(exists=True))
-def main(debug, root):
+def main(debug, server_root, root):
""" The main entry point."""
- linkcheck(os.path.abspath(root), debug)
+ linkcheck(os.path.abspath(root), server_root, debug)
if __name__ == "__main__":
main()
diff --git a/src/guide/xml/changelog.xml b/src/guide/xml/changelog.xml
index 4165f9c82..d5abb8a75 100644
--- a/src/guide/xml/changelog.xml
+++ b/src/guide/xml/changelog.xml
@@ -2,787 +2,19 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
-
-2.0.17
-2023-04-07
-
-This is still a pre-release; see 2.0.16.
-
-
-Changed mediaobject-accessibility and
-table-accessibility parameters into space-separated lists of strings.
-
-
-Reworked how metadata is formatted for media objects so that more accessibility metadata
-can be added.
-
-
-
-
-
-
-2.0.16
-2023-04-05
-
-This is still a pre-release; see 2.0.15.
-
-
-Completely reworked the way the on-page ToC is implemented. The previous
-implementation used a CSS “sticky” property and flex to manage the
-ToC. That was nice and all, but it was impossible to scroll the ToC.
-There’s a lot more JavaScript in the new implementation, but since
-there was already JavaScript in the implementation, I think that’s justified.
-
-
-
-
-
-
-2.0.15
-2023-04-04
-
-This is still a pre-release; see 2.0.14.
-
-
-Improved error messages when the persistent ToC is unavailable. Updated documentation.
-
-
-Improved some dependencies in the build.
-
-
-Hopefully, this
-is the last pre-release of the 2.x stylesheets.
-
-
-
-
-2.0.14
-2023-04-03
-
-This is still a pre-release; see 2.0.13.
-
-
-Mostly, this update is a complete rewrite of how tests are managed. There are new
-classes to move a bunch of complexity out of build.gradle and manage
-XSpec tests and configurations automatically.
-
-
-That said, there were a few bugs fixed along the way.
-The persistent ToC was not being handled correctly
-when chunking was not being used.
-
-
-Added message-level to allow some
-informational messages to be suppressed.
-
-
-Updated the build to use Pygments 2.14.0. (That just changes a bunch of test results in
-some insignificant ways.)
-
-
-
-
-
-
-2.0.13
-2023-03-25
-
-This is still a pre-release; see 2.0.12.
-
-
-Reworked audio and video fallback. Placing an HTML prose description
-in the video tag is apparently not supported. Apparently, it has to be
-handled by JavaScript. There’s now a fallback-js
-parameter.
-
-
-Removed db-footnote attributes from HTML output.
-
-
-Placement of table titles, before or after the table, can now be
-set with formal-object-title-placement. For backwards
-compatibility, it defaults to ‘before’ for tables. Within a
-formalgroup, title placement is controlled by
-formalgroup-nested-object-title-placement. Finally,
-the placement of media
-object details can be set with mediaobject-details-placement.
-
-
-
-Added a unwrap-paragraphs parameter.
-
-
-
-Completely reworked how numbering of elements is performed. See
-. It’s a bit more complicated now, but it’s also
-more flexible and better tested. The default numeration should be the same
-as before, although a few small changes may appear in places where (I think)
-the previous numeration was wrong.
-
-
-
-I tinkered a bit with the
-on-page table of contents feature.
-It’s a bit easier to configure and there’s a JavaScript API for it.
-
-
-
-
-
-
-2.0.12
-2023-03-12
-
-This is still a pre-release; see 2.0.10.
-(Note that version 2.0.11 was not adequately documented in the change log.)
-
-
-Fixed a bug
-where chapter and appendix numbering was wrong.
-
-
-
-Implemented an
-on-page table of contents feature.
-
-
-
-Switched to
-section elements for
-sections inside a refentry instead of
-div elements.
-This supports the new
-on-page table of contents feature and
-should have been done when the rest of the sectioning elements
-were converted.
-
-
-
-Moved the
-footer element from
-just after
-main to just inside it.
-This simplifies and improves CSS rendering and is arguably more correct.
-
-
-
-Made including the docbook-print.css file conditional
-on producing print output. Modern browsers attempt to parse the file, even when
-the link specifies that it’s for print media, and produce a large number of
-spurious error messages.
-
-
-Fixed a bug where the catalog.xml file in the
-jar file was not at a location where the XML Resolver would find it.
-
-
-
-
-
-2.0.10
-2023-02-21
-
-This is still a pre-release; see 2.0.9.
-
-
-Reworked ToC handling. Added auto-toc parameter.
-The placement of generated lists-of-titles can now be controlled with an
-empty toc element (or db-toc processing
-instruction).
-
-
-Support creation of ToCs generated by hand. (Former handling for
-tocdiv and tocentry was just broken.)
-
-
-
-Updated the XML Resolver to version 5.1.0.
-
-
-Deprecated the m:html-body-script mode.
-
-
-Fixed incorrect URIs for SVG draft overlay in print CSS.
-
-
-Hopefully, this
-is the last pre-release of the 2.x stylesheets.
-
-
-
-
-2.0.9
-2023-02-13
-
-This is still a pre-release; see 2.0.8.
-
-
-There are no changes to the stylesheets in this release. It
-simply updates the XML Resolver to version 5.0.0 and the XInclude
-extension function to version 5.0.0.
-Hopefully, this is the last pre-release of the 2.x stylesheets.
-
-
-
-
-
-
-2.0.8
-2023-02-11
-
-This is still a pre-release; see 2.0.6.
-
-
-Fixed a bug in localization support (a missing localization file accidentally
-caused the transformation to terminate). Fixed a bug the initializer for
-v:chunk-output-base-uri. Added
-mediaobject-grouped-by-type to group media objects by
-type.
-
-
-
-
-
-
-2.0.6
-2023-02-01
-
-This is still a pre-release; see 2.0.5.
-
-
-Completely refactored the way that media objects are located
-during the transformation and how the URIs for them are generated in
-the output. It is now possible to store the media objects in a location
-independent of the source files. Four separate source arrangements are represented
-in the test suite and each can be processed to produce several different outputs;
-see the mediaobject-test group of tasks. (Run
-./gradlew tasks in the source repository.)
-
-
-
-
-
-
-2.0.5
-2023-01-25
-
-This is still a pre-release; see 2.0.4.
-
-
-Fixed the bug where attributes on image, video, audio, and text objects
-in mediaobject and inlinemediaobject were not being preserved
-in the output. In particular, this meant that role
-attributes on those objects were not reflected in the HTML
-class attribute.
-
-
-
-
-
-
-2.0.4
-2023-01-22
-
-This is still a pre-release; see 2.0.3.
-
-
-Changed ext:cwd() so that it always returns an absolute URI.
-This fixes a bug in chunk output base URI handling. Tidied up some code.
-
-
-
-
-
-
-2.0.3
-2023-01-21
-
-This is still a pre-release; see 2.0.2.
-
-
-Removed ↑ from chunk-nav.
-
-
-Support media objects that have no media (e.g., a media object that contains
-only inline text objects).
-
-
-Process unexected elements in titlepage templates in the normal way; removed
-the warning message associated with them. Added it back by putting
-templates in debug.
-
-
-Improved presentation of multiple keycap elements in a
-keycombo.
-
-
-Added table-of-contents to the linear flow of EPUBs. This fixes an
-epubcheck 3.3 error. Fixed the CSS for the ToC.
-
-
-
-
-
-
-2.0.2
-2023-01-05
-
-This is still a pre-release; see 2.0.1.
-
-
-Reworked the way the persistent ToC
-is generated.
-
-
-Documented some subtleties with respect to the
-chunk-output-base-uri parameter.
-
-
-Documentation improvements.
-
-
-Cleaned up the build scripts a bit.
-
-
-
-
-
-
-2.0.1
-2023-01-03
-
-This is still a pre-release; see 2.0.0.
-
-
-Added support for ISO 690 bibliographies via a
-bibliography-style parameter.
-
-
-
-Fixed bug where authorgroup wasn’t being processed in
-biblioentry.
-
-
-
-Another few (but hopefully nearly the last) refactorings in the area of
-localization. Properties have been removed and all template lookups are now
-done with XPath expressions instead ad hoc string matching.
-
-
-A number of smaller changes have also been made to improve localization.
-(I discovered a small number of tests that weren’t being run in automation;
-those revealed new errors, mostly in generated text for cross references.)
-
-
-The way lists-of-titles and the persistent table of contents
-are generated has been changed. This happened in the 2.0.0 release, but was lost
-behind all the localization changes.
-
-
-
-
-
-
-2.0.0
-2022-12-30
+2.1.0
+2023-04-07
-This is a pre-release; existing customization layers will very
-likely require work. Some generated text may be rendered
-differently.
-
-
-The system for dealing with generated text has been completely rewritten.
-We’re back to using templates as described in .
-Most of the parameters, variables, and functions associated with gentext have
-been removed.
-
-It’s likely that there are small changes to the way lists-of-titles
-and cross references are formatted by default in some cases.
-
-
-Labels for formal objects may be different, but I think the previous
-formatting was actually in error.
-
-
-
-In some contexts, for example callouts, labels are now used for the
-links instead of titles.
-
-
-The parameters for the t:top-nav and
-t:bottom-nav templates have changed. They are now always
-called, even when chunking is not being performed. The new
-$chunk parameter indicates whether or not a chunk is being formatted.
-
-
-
-Fixed a bug where orderedlist numeration was not handled
-correctly in cross-references to list items.
-
-
-Made another attempt at sorting out how
-media object URIs are resolved in the source (for reading their properties)
-and formatted in the output. If the
-mediaobject-input-base-uri is specified, it is always
-used.
-
-
-It’s possible that there are other changes as well, fixing localization
-was a pretty substantial change.
+This is the first official release of the “2.x” versions of the
+stylesheets. Version 2.1.0 introduces a number of new features and
+corrects major issues with localization and media object rendering,
+but is not entirely backwards compatible with the 1.x versions. The
+incompatibilities should mostly effect customization layers, not
+formatted documents, though the HTML output will be a little different
+in most cases. For a summary of the changes, see .
-
- 1.11.1
- 2022-11-08
-
-
-
- Fixed a CSS problem and removed some debugging cruft.
-
-
-
-
-
- 1.11.0
- 2022-11-07
-
-
-
- Added support for EPUB3 output.
-
-
- Reworked how media objects are processed
-
-
- Reworked how contentwidth,
- contentdepth, width,
- depth, scalefit, and
- scale are handled. Width and height (depth)
- are now processed independently. The results are
- supposed to be the same as
- before.
-
-
- It now makes sense to have both multiple imageobject elements
- and multiple imagedata elements with an imageobject. (And, analogously,
- multiple videoobject elements with multiple videodata, and
- multiple audioobject elements with multiple audiodata inside.)
-
-
- The stylesheets select the first object for which none of
- the data elements are excluded by mediaobject-exclude-extensions
- and then process all of the data elements inside.
-
-
- For images, all of the alternatives are placed in a picture element using
- source and img.
-
-
- For videos, all of the alternatives are placed in a video element using
- source unless the mediaobject-video-element is iframe.
-
-
- For audio, all of the alternatives are placed in an audio elemnt using
- source.
-
-
-
-
-
- The fallback for audio and video elements is a paragraph that offers download
- links. This can be configured by overriding the t:audio-fallback and
- t:video-fallback templates, respectively.
-
-
-
- Use multimediaparams to specify the controls for audio and vidoe objects.
- If no parameters are specified, controls will be added automatically.
- (If you specify any parameters, you are responsible for specifying the controls
- parameter.)
-
-
-
- If you have multiple data elements in an object, only the
- attributes associated with the last alternative are considered
- when calculating the viewport, alignment, etc. This is (a)
- consistent with HTML, and (b) at least partly justifiable by the
- observation that for scalable formats like SVG, it doesn’t make
- sense to say that the image has a particular height or width.
- Specify that on the raster fallback image where it makes sense.
-
-
-
-
-
- The actual nesting of divs and spans and some of the class values
- have changed. Check your CSS.
-
-
- Fixed a bug where the summary accesibility attribute was not always output.
-
-
-
- Reworked image maps.
-
-
- Simpified the code for computing how calspair coordinates are calculated.
-
-
-
- Added support for html-rect, html-circle, and html-poly
- styles. Use units="other" and place the new styles in
- otherunits. See the calloutlist.005.xml unit test for
- examples.
-
-
-
-
- Changed the mediaobject-exclude-extensions parameter into
- space-delimited string so that it’s easier to pass as a
- parameter. The variable v:mediaobject-exclude-extensions is a
- list constructed from the string.
-
-
-
- Added mediaobject-video-element parameter.
-
-
-
- Changed f:parse-length so that it accepts xs:string? and returns
- an empty sequence if it’s passed one.
-
-
- Added support for db:textdata. If a text data element is present, the first
- one encountered is used (unless it contains only a single db:phrase as those
- where historically used for alt text).
-
-
-
-
- The icons used for admonitions have been changed. One or two of them
- didn’t show up in EPUB readers.
-
-
- Updated the extension functions that attempt to extract metadata
- from images so that they accept filenames that aren’t URIs. Also
- added support for a second “image” parameter, so that you can
- prevent them from attempting to parse, for example, a video as an
- image.
-
-
- Added convenience variables
- v:as-xml and v:as-json for
- convenience in calls to fn:serialize(). Mostly
- this is for debugging.
-
-
- Reworked how the preprocessing pipeline is evaluated.
-
-
- Switched to using Sass to generate CSS.
-
-
- Fixed a bug in link processing that sometimes resulted in nested anchors.
-
-
- Fixed bug where unnumbered verbatim listings still had room for line numbers.
-
-
-
-
-
-
diff --git a/src/guide/xml/ver2.xml b/src/guide/xml/ver2.xml
index a1ee462e5..c974436ac 100644
--- a/src/guide/xml/ver2.xml
+++ b/src/guide/xml/ver2.xml
@@ -2,7 +2,7 @@
version="5.0" xml:id="version2">
- Changes in version 2.0
+ Changes in version 2.1.0Version 2.x of the DocBook xslTNG
@@ -30,21 +30,67 @@ system should produce “the same results” as the old system for an
equivalent localization, but there may be small changes in the way
lists of titles and cross references are formatted.
-
-This chapter is still being revised. This is (mostly) a placeholder.
-
+The major changes are:
+Completely reworked how localization is handled. See
+. The
+localization file format has changed. Localization files are no longer
+simply transformed from the XSLT 1.0 stylesheet format.
+
+
+Completely reworked how numbering of elements is performed. See
+. It’s a bit more complicated now, but it’s also
+more flexible and better tested. The default numeration should be the same
+as before, although a few small changes may appear in places where (I think)
+the previous numeration was wrong.
+
+
+
+Completely refactored the way that media objects are located
+during the transformation and how the URIs for them are generated in
+the output. It is now possible to store the media objects in a location
+independent of the source files. Four separate source arrangements are represented
+in the test suite and each can be processed to produce several different outputs;
+see the all_mo_tests build target and its dependencies.
+
+
+Refactored the templates for processing media objects to improve support for
+accessibility metadata and formatting copyright statements, legal notices, etc.
+See m:mediaobject-start and m:mediaobject-end.
+
+
+
+Fixed the bug where attributes on image, video, audio, and text objects
+in mediaobject and inlinemediaobject were not being preserved
+in the output. In particular, this meant that role
+attributes on those objects were not reflected in the HTML
+class attribute.
+
+
+Reworked audio and video fallback. Placing an HTML prose description
+in the video tag is not the correct approach in modern browsers. That prose is only
+rendered by browsers that don’t understand the
+video tag at all.
+Apparently, it has to be
+handled by JavaScript. There’s now a fallback-js
+parameter.
+
+
+Support media objects that have no media (e.g., a media object that contains
+only inline text objects).
+
+Implemented an
on-page table of contents feature.
Switched to
-section elements for
-sections inside a refentry instead of
-div elements.
+section elements
+(instead of div elements)
+for sections inside of refentry and a number of other places.
This supports the new
on-page table of contents feature and
should have been done when the rest of the sectioning elements
@@ -52,6 +98,43 @@ were converted.
+Reworked ToC handling. Added auto-toc parameter.
+The placement of generated lists-of-titles can now be controlled with an
+empty toc element (or db-toc processing
+instruction).
+
+
+Added support for creating ToCs by hand. (Former handling for
+tocdiv and tocentry was just broken.)
+
+
+
+Placement of table titles, before or after the table, is now
+set with formal-object-title-placement. For backwards
+compatibility, it defaults to ‘before’ for tables. Within a
+formalgroup, title placement is controlled by
+formalgroup-nested-object-title-placement. In a related way,
+the placement of media
+object details can be set with mediaobject-details-placement.
+
+
+
+Labels for formal objects may be different, but I think the previous
+formatting was actually in error.
+
+
+
+Changed mediaobject-accessibility and
+table-accessibility parameters into space-separated lists of strings.
+
+
+The parameters for the t:top-nav and
+t:bottom-nav templates have changed. They are now always
+called, even when chunking is not being performed. The new
+$chunk parameter indicates whether or not a chunk is being formatted.
+
+
+Moved the
footer element from
just after
@@ -60,27 +143,18 @@ This simplifies and improves CSS rendering and is arguably more correct.
+Added an unwrap-paragraphs parameter. If this
+parameter is true, a single DocBook paragraph that contains
+block elements (for example, tables or figures) will be rendered as several HTML paragraphs
+with blocks between them. HTML doesn’t allow blocks inside paragraphs.
+
+Made including the docbook-print.css file conditional
on producing print output. Modern browsers attempt to parse the file, even when
the link specifies that it’s for print media, and produce a large number of
spurious error messages.
-Fixed a bug where the catalog.xml file in the
-jar file was not at a location where the XML Resolver would find it.
-
-
-Reworked ToC handling. Added auto-toc parameter.
-The placement of generated lists-of-titles can now be controlled with an
-empty toc element (or db-toc processing
-instruction).
-
-
-Support creation of ToCs generated by hand. (Former handling for
-tocdiv and tocentry was just broken.)
-
-
-Deprecated the m:html-body-script mode.
Changed the way the standard scripts are included; instead of putting them
at the end of the
@@ -91,36 +165,25 @@ deferred.
-Fixed incorrect URIs for SVG draft overlay in print CSS.
-
+In some contexts, for example callouts, labels are now used for the
+links instead of titles.
+
-Completely refactored the way that media objects are located
-during the transformation and how the URIs for them are generated in
-the output. It is now possible to store the media objects in a location
-independent of the source files. Four separate source arrangements are represented
-in the test suite and each can be processed to produce several different outputs;
-see the mediaobject-test group of tasks. (Run
-./gradlew tasks in the source repository.)
+Removed up-arrow from the keys that chunk-nav responds
+to. The up-arrow key is used by browser to move up the page and chunk navigation was
+interfering with that behavior. The U key will still go “up” in
+chunk navigation.
-Fixed the bug where attributes on image, video, audio, and text objects
-in mediaobject and inlinemediaobject were not being preserved
-in the output. In particular, this meant that role
-attributes on those objects were not reflected in the HTML
-class attribute.
+Reworked the persistent
+ToC. It can now store the ToC in a separate file. Improved the
+error messages when the persistent ToC is unavailable.Changed ext:cwd() so that it always returns an absolute URI.
This fixes a bug in chunk output base URI handling. Tidied up some code.
-Removed ↑ from chunk-nav.
-
-
-Support media objects that have no media (e.g., a media object that contains
-only inline text objects).
-
-Process unexected elements in titlepage templates in the normal way; removed
the warning message associated with them. Add it back by putting
templates in debug.
@@ -134,24 +197,23 @@ the warning message associated with them. Add it back by putting
epubcheck 3.3 error. Fixed the CSS for the ToC.
-Reworked the way the persistent ToC
-is generated.
-
-Added support for ISO 690 bibliographies via a
bibliography-style parameter.
-Fixed bug where authorgroup wasn’t being processed in
-biblioentry.
-
+Added a message-level parameter to support suppressing
+some informational messages.
-The parameters for the t:top-nav and
-t:bottom-nav templates have changed. They are now always
-called, even when chunking is not being performed. The new
-$chunk parameter indicates whether or not a chunk is being formatted.
+Removed db-footnote attributes from the output. Technically, attribute
+names that contain a hyphen are HTML5 extension attributes, but sometimes they make validation
+more difficult. Some extension attributes remain, because they’re used by JavaScript in
+the presentation for example, but db-footnote isn’t used that way.
+
+
+Fixed bug where authorgroup wasn’t being processed in
+biblioentry.
@@ -159,13 +221,20 @@ called, even when chunking is not being performed. The new
correctly in cross-references to list items.
-Labels for formal objects may be different, but I think the previous
-formatting was actually in error.
-
+Fixed incorrect URIs for SVG draft overlay in print CSS.
+
+
+Fixed a bug where the catalog.xml file in the
+jar file was not at a location where the XML Resolver would find it.
-In some contexts, for example callouts, labels are now used for the
-links instead of titles.
+Updated the build system to use Pygments version 2.14.0. This effects the markup
+produced in some syntax highlighted listings. (You’re free to use any version of Pygments
+that’s convenient; this is just about conformance with the expected test results.)
+
+
+The way unit tests are managed has been completely rewritten.
+See .
diff --git a/src/guide/xsl/common.xsl b/src/guide/xsl/common.xsl
index bef5f05fe..cbc832678 100644
--- a/src/guide/xsl/common.xsl
+++ b/src/guide/xsl/common.xsl
@@ -48,7 +48,7 @@
'self::*[ancestor::db:partintro]',
'self::db:section')"/>
-
+
diff --git a/src/main/xslt/main.xsl b/src/main/xslt/main.xsl
index dd17885a8..550d68857 100644
--- a/src/main/xslt/main.xsl
+++ b/src/main/xslt/main.xsl
@@ -141,6 +141,10 @@
+
+
+
+