Skip to content

Commit

Permalink
Merge branch 'hotfix/4.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jelovirt committed Jul 20, 2023
2 parents 00b35f0 + d709d5b commit 4d0817e
Show file tree
Hide file tree
Showing 18 changed files with 134 additions and 62 deletions.
22 changes: 16 additions & 6 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ For information on additional DITA and DITA-OT resources, see [SUPPORT]. To repo
- [Prerequisites: Java 17](#prerequisites-java-17)
- [Installing](#installing)
- [Building output](#building-output)
- [For developers](#for-developers)
- [Development](#development)
- [Running tests](#running-tests)
- [Formatting code](#formatting-code)
- [Distribution builds](#distribution-builds)
- [License](#license)

## Prerequisites: Java 17
Expand Down Expand Up @@ -65,10 +68,9 @@ You can generate output using the `dita` command-line tool included with DITA Op

See the [documentation][docs] for arguments and [options].

## For developers
## Development

<details>
<summary>Building the toolkit from source code and compiling the distribution package</summary>
Building the toolkit from source code and compiling the distribution package

1. Clone the DITA-OT Git repository:
```shell
Expand All @@ -87,6 +89,15 @@ See the [documentation][docs] for arguments and [options].
./gradlew
```

### Running tests

```shell
./gradlew check
```

All tests are run by GitHub Actions [test workflow] on each push and
for every pull request.

### Formatting code

Requirements:
Expand Down Expand Up @@ -118,8 +129,6 @@ Prettier is used retain consistent Java formatting.

For more information on the `-Xmx` option, see the [Java SE Documentation][javadoc].

</details>

## License

DITA Open Toolkit is licensed for use under the [Apache License 2.0][apache].
Expand All @@ -136,3 +145,4 @@ DITA Open Toolkit is licensed for use under the [Apache License 2.0][apache].
[apache]: http://www.apache.org/licenses/LICENSE-2.0
[issue]: https://github.com/dita-ot/dita-ot/issues/new/choose
[contributing]: https://github.com/dita-ot/.github/blob/master/CONTRIBUTING.md
[test workflow]: https://github.com/dita-ot/dita-ot/actions/workflows/test.yml
33 changes: 21 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply plugin: 'signing'
group = 'org.dita-ot'
archivesBaseName = 'dost'
/** Semver version number */
version = '4.1.0'
version = '4.1.1'

description = """DITA Open Toolkit"""

Expand All @@ -33,28 +33,29 @@ dependencies {
implementation group: 'xerces', name: 'xercesImpl', version:'2.12.2'
implementation group: 'xml-apis', name: 'xml-apis', version:'1.4.01'
implementation group: 'xml-resolver', name: 'xml-resolver', version:'1.2'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '12.2'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '12.3'
implementation group: 'com.ibm.icu', name: 'icu4j', version:'70.1'
implementation group: 'org.apache.ant', name: 'ant', version:'1.10.13'
implementation group: 'org.apache.ant', name: 'ant-launcher', version:'1.10.13'
implementation(group: 'com.google.guava', name: 'guava', version: '25.1-jre') {
implementation(group: 'com.google.guava', name: 'guava', version: '32.1.1-jre') {
exclude group: 'org.checkerframework', module: 'checker-qual'
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
exclude group: 'com.google.guava', module: 'failureaccess'
exclude group: 'com.google.guava', module: 'listenablefuture'
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
exclude group: 'com.google.j2objc', module: 'j2objc-annotations'
}
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.32'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.8'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.13.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.14.0'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.13.4'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.8'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.15.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.2'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.2'
implementation group: 'org.relaxng', name: 'jing', version: '20181222'
implementation group: 'org.apache.ant', name: 'ant-apache-resolver', version:'1.10.13'
testImplementation group: 'nu.validator.htmlparser', name: 'htmlparser', version:'1.4'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.8.2'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.6.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.3'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.9.3'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.9.1'
}

jar {
Expand Down Expand Up @@ -84,6 +85,7 @@ artifacts {
}

test {
useJUnitPlatform()
exclude '**/IntegrationTest*.class'
exclude '**/EndToEndTest*.class'
}
Expand All @@ -110,6 +112,10 @@ task integrationTest(type: Test, dependsOn: 'buildLocal') {
systemProperties = integrationTestSystemProperties
include '**/IntegrationTest*.class'
}
tasks.named('check') {
dependsOn('integrationTest')
}


// End to end test

Expand All @@ -135,6 +141,9 @@ task e2eTest(type: Test, dependsOn: 'buildLocal') {
systemProperties = e2eTestSystemProperties
include '**/EndToEndTest*.class'
}
tasks.named('check') {
dependsOn('e2eTest')
}

// Install

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ public DITAOTXMLErrorHandler(final String file, final DITAOTLogger logger, final
*/
@Override
public void error(final SAXParseException saxException) throws SAXException {
final SAXExceptionWrapper ex = new SAXExceptionWrapper(filePath, saxException);
if (mode == Configuration.Mode.STRICT) {
throw new SAXExceptionWrapper(filePath, saxException);
throw ex;
} else {
logger.error(saxException.getMessage(), saxException);
logger.error(ex.getMessage(), ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ protected void insertRelaxDefaultsComponent() {
public void setFeature(String featureId, boolean state) throws XMLConfigurationException {
if (XERCES_SCHEMA_VALIDATION.equals(featureId)) {
relaxNGValidation = state;
} else {
super.setFeature(featureId, state);
}
super.setFeature(featureId, state);
}

@Override
Expand Down
38 changes: 18 additions & 20 deletions src/main/plugins/org.dita.base/xsl/preprocess/topicpullImpl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,14 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
</xsl:choose>
</xsl:template>

<!-- Insert a <?ditaot usershortdesc?> processing instruction to indicate preexisting <desc> elements in the input document
* This behavior applies only to <desc> elements contained in <xref> and <link> elements
* The "topicpull:add-usershortdesc-PI" mode does not add a *shortdesc PI if one already exists -->
<xsl:template match="*[contains(@class,' topic/xref ') or contains(@class,' topic/link ')]/*[contains(@class,' topic/desc ')]">
<xsl:apply-templates select=".." mode="topicpull:add-usershortdesc-PI"/>
<xsl:next-match/> <!-- process the element as usual -->
</xsl:template>

<!-- 2007.03.13: Update inheritance to check specific elements and attributes.
Similar to the inheritance template in mappull, except that it stops at related links. -->
<xsl:template name="topicpull:inherit">
Expand Down Expand Up @@ -698,7 +706,6 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
<xsl:when test="$inDescContent"/>
<!--if there's already a desc, copy it-->
<xsl:when test="*[contains(@class, ' topic/desc ')]">
<xsl:apply-templates select="." mode="topicpull:add-usershortdesc-PI"/>
<xsl:apply-templates select="*[contains(@class, ' topic/desc ')]"/>
</xsl:when>
<!--if the target is inaccessible, don't do anything - shortdesc is optional -->
Expand All @@ -714,7 +721,7 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
<xsl:apply-templates select="." mode="topicpull:add-genshortdesc-PI"/>
<desc class="- topic/desc ">
<xsl:apply-templates select="$shortdesc">
<xsl:with-param name="baseContextElement" select="." tunnel="yes"/>
<xsl:with-param name="baseContextElement" select="$targetElement" tunnel="yes"/>
<xsl:with-param name="inDescContent" as="xs:boolean" select="true()" tunnel="yes"/>
</xsl:apply-templates>
</desc>
Expand Down Expand Up @@ -1416,25 +1423,16 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
</xsl:template>

<!-- Added for RFE 3001750. -->
<xsl:template match="*" mode="topicpull:add-genshortdesc-PI">
<xsl:choose>
<xsl:when test="processing-instruction()[name()='ditaot'][.='usershortdesc' or .='genshortdesc']">
<xsl:copy-of select="processing-instruction()[name()='ditaot'][.='usershortdesc' or .='genshortdesc']"/>
</xsl:when>
<xsl:otherwise>
<xsl:processing-instruction name="ditaot">genshortdesc</xsl:processing-instruction>
</xsl:otherwise>
</xsl:choose>
<!-- Returns a <?ditaot dita-ot:genshortdesc?> if context element does not already have a *shortdesc PI -->
<xsl:template match="*" mode="topicpull:add-genshortdesc-PI"/>
<xsl:template match="*[not(processing-instruction('ditaot')[. = ('usershortdesc' ,'genshortdesc')])]" mode="topicpull:add-genshortdesc-PI" priority="10">
<xsl:processing-instruction name="ditaot">genshortdesc</xsl:processing-instruction>
</xsl:template>
<xsl:template match="*" mode="topicpull:add-usershortdesc-PI">
<xsl:choose>
<xsl:when test="processing-instruction()[name()='ditaot'][.='usershortdesc' or .='genshortdesc']">
<xsl:copy-of select="processing-instruction()[name()='ditaot'][.='usershortdesc' or .='genshortdesc']"/>
</xsl:when>
<xsl:otherwise>
<xsl:processing-instruction name="ditaot">usershortdesc</xsl:processing-instruction>
</xsl:otherwise>
</xsl:choose>

<!-- Returns a <?ditaot dita-ot:usershortdesc?> if context element does not already have a *shortdesc PI -->
<xsl:template match="*" mode="topicpull:add-usershortdesc-PI"/>
<xsl:template match="*[not(processing-instruction('ditaot')[. = ('usershortdesc' ,'genshortdesc')])]" mode="topicpull:add-usershortdesc-PI" priority="10">
<xsl:processing-instruction name="ditaot">usershortdesc</xsl:processing-instruction>
</xsl:template>

</xsl:stylesheet>
9 changes: 6 additions & 3 deletions src/main/plugins/org.dita.html5/build_dita2html5_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ See the accompanying LICENSE file for applicable license.
</condition>
<param name="1" value="${args.ftr}"/>
</dita-ot-fail>
<makeurl file="${args.ftr}" property="args.ftr.url" if:set="args.ftr"/>
<dita-ot-fail id="DOTA008E">
<condition>
<and>
Expand All @@ -46,6 +47,7 @@ See the accompanying LICENSE file for applicable license.
</condition>
<param name="1" value="${args.hdr}"/>
</dita-ot-fail>
<makeurl file="${args.hdr}" property="args.hdr.url" if:set="args.hdr"/>
<dita-ot-fail id="DOTA009E">
<condition>
<and>
Expand All @@ -57,6 +59,7 @@ See the accompanying LICENSE file for applicable license.
</condition>
<param name="1" value="${args.hdf}"/>
</dita-ot-fail>
<makeurl file="${args.hdf}" property="args.hdf.url" if:set="args.hdf"/>

<!-- begin to check and init css relevant properties -->

Expand Down Expand Up @@ -178,9 +181,9 @@ See the accompanying LICENSE file for applicable license.
<param name="FILTERFILE" expression="${dita.input.valfile.url}" if:set="dita.input.valfile"/>
<param name="CSS" expression="${args.css.file}" if:set="args.css.file"/>
<param name="CSSPATH" expression="${user.csspath}" if:set="user.csspath"/>
<param name="HDF" expression="${args.hdf}" if:set="args.hdf"/>
<param name="HDR" expression="${args.hdr}" if:set="args.hdr"/>
<param name="FTR" expression="${args.ftr}" if:set="args.ftr"/>
<param name="HDF" expression="${args.hdf.url}" if:set="args.hdf.url"/>
<param name="HDR" expression="${args.hdr.url}" if:set="args.hdr.url"/>
<param name="FTR" expression="${args.ftr.url}" if:set="args.ftr.url"/>
<param name="DRAFT" expression="${args.draft}" if:set="args.draft"/>
<param name="ARTLBL" expression="${args.artlbl}" if:set="args.artlbl"/>
<param name="GENERATE-TASK-LABELS" expression="${args.gen.task.lbl}" if:set="args.gen.task.lbl"/>
Expand Down
16 changes: 10 additions & 6 deletions src/main/plugins/org.dita.htmlhelp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ repositories {
dependencies {
implementation rootProject
implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '12.2'
implementation group: 'org.apache.ant', name: 'ant', version:'1.10.12'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '12.3'
implementation group: 'org.apache.ant', name: 'ant', version:'1.10.13'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7'
testImplementation rootProject
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.8.2'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.3.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.3'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.9.3'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.9.1'
testImplementation group: 'nu.validator.htmlparser', name: 'htmlparser', version:'1.4'
testImplementation rootProject.sourceSets.test.output
}

test {
useJUnitPlatform()
}

jar.archiveFileName = "${project.name}.jar"

task copyInstall(type: Copy) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/plugins/org.dita.pdf2.fop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ dependencies {
exclude group: 'xalan'
}
runtimeOnly group: 'xml-apis', name: 'xml-apis-ext', version: '1.3.04'
runtimeOnly group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.30'
runtimeOnly group: 'org.slf4j', name: 'jcl-over-slf4j', version: '2.0.7'
runtimeOnly(group: 'org.apache.xmlgraphics', name: 'fop-pdf-images', version: '2.8') {
exclude group: 'xalan'
}
runtimeOnly group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.28'
}

test {
useJUnitPlatform()
}

task copyInstall(type: Copy) {
from (jar)
from(sourceSets.main.runtimeClasspath) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/plugins/org.dita.pdf2.fop/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ See the accompanying LICENSE file for applicable license.
<feature extension="dita.conductor.lib.import" file="lib/fontbox-2.0.28.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/fop-2.8.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/fop-pdf-images-2.8.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/jcl-over-slf4j-1.7.30.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/jcl-over-slf4j-2.0.7.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/xml-apis-ext-1.3.04.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/pdfbox-2.0.28.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/slf4j-api-1.7.30.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/slf4j-api-2.0.7.jar"/>
<feature extension="dita.conductor.lib.import" file="lib/xmlgraphics-commons-2.8.jar"/>
<transtype name="pdf" desc="PDF">
<param name="pdf.formatter" desc="Specifies the XSL processor." type="enum">
Expand Down
9 changes: 6 additions & 3 deletions src/main/plugins/org.dita.pdf2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ dependencies {
implementation rootProject
implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
implementation group: 'com.ibm.icu', name: 'icu4j', version:'70.1'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '10.6'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '12.3'
implementation group: 'org.apache.ant', name: 'ant', version:'1.10.13'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7'
implementation group: 'xml-resolver', name: 'xml-resolver', version:'1.2'
implementation group: 'net.sf.saxon', name: 'Saxon-HE', version: '12.2'
}
sourceSets {
main {
Expand All @@ -33,6 +32,10 @@ sourceSets {
}
}

test {
useJUnitPlatform()
}

jar.archiveFileName = "${project.name}.jar"
jar.include "com/idiominc/**"
jar.include "com/suite/**"
Expand Down
9 changes: 6 additions & 3 deletions src/main/plugins/org.dita.xhtml/build_general_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ See the accompanying LICENSE file for applicable license.
</condition>
<param name="1" value="${args.ftr}"/>
</dita-ot-fail>
<makeurl file="${args.ftr}" property="args.ftr.url" if:set="args.ftr"/>
<dita-ot-fail id="DOTA008E">
<condition>
<and>
Expand All @@ -34,6 +35,7 @@ See the accompanying LICENSE file for applicable license.
</condition>
<param name="1" value="${args.hdr}"/>
</dita-ot-fail>
<makeurl file="${args.hdr}" property="args.hdr.url" if:set="args.hdr"/>
<dita-ot-fail id="DOTA009E">
<condition>
<and>
Expand All @@ -45,6 +47,7 @@ See the accompanying LICENSE file for applicable license.
</condition>
<param name="1" value="${args.hdf}"/>
</dita-ot-fail>
<makeurl file="${args.hdf}" property="args.hdf.url" if:set="args.hdf"/>
<!-- begin to check and init css relevant properties -->
<condition property="user.csspath.url">
<or>
Expand Down Expand Up @@ -133,9 +136,9 @@ See the accompanying LICENSE file for applicable license.
if:set="args.css.file" />
<param name="CSSPATH" expression="${user.csspath}"
if:set="user.csspath" />
<param name="HDF" expression="${args.hdf}" if:set="args.hdf" />
<param name="HDR" expression="${args.hdr}" if:set="args.hdr" />
<param name="FTR" expression="${args.ftr}" if:set="args.ftr" />
<param name="HDF" expression="${args.hdf.url}" if:set="args.hdf.url" />
<param name="HDR" expression="${args.hdr.url}" if:set="args.hdr.url" />
<param name="FTR" expression="${args.ftr.url}" if:set="args.ftr.url" />
<param name="DRAFT" expression="${args.draft}" if:set="args.draft" />
<param name="ARTLBL" expression="${args.artlbl}" if:set="args.artlbl" />
<param name="GENERATE-TASK-LABELS" expression="${args.gen.task.lbl}" if:set="args.gen.task.lbl" />
Expand Down

0 comments on commit 4d0817e

Please sign in to comment.