Skip to content

Commit

Permalink
Merge pull request #94 from ndw/master
Browse files Browse the repository at this point in the history
Use properly typed atomic values for parameters
  • Loading branch information
ndw authored Feb 19, 2018
2 parents 0368a3c + eea1e93 commit 084f3b9
Show file tree
Hide file tree
Showing 300 changed files with 880 additions and 611 deletions.
30 changes: 9 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ language: java
script: gradle dist
sudo: false
install:
- echo sonatypeUsername=none >> gradle.properties
- echo sonatypePassword=none >> gradle.properties
- ".travis/setup-diff.sh"
env:
global:
- secure: EEcwLo3rIHqaV46h/AOMGafxqaZcy4i9WA8RlFO53wj23QJGmeUdYa2ka4IC2c+J+iNFYu1+dRkR52G6S6tY3LnsDmZGHj9xT9n7tPr/h/OmMXhdtNy3Nl5AWQORMZhqGCXwMxRZUyhWp6CjtY1LeGaVenwf1A3PiLEQmEJw9nY=
- secure: ZxjZEeu4LhPI/e3MWpvngp34/POm2LLz3bpHn0+tgr7rfo8FLet2iVX0AfYPXKcPVTCeYjUn+Do2NQcWVgIhBxZAKDl/wzDzLiCdaxVepmYrf5hKuhbPJDKT6Pb3IfHnXOJAZRqMTr762x6lkJUUNIpuKLiKyA5lpDNK3HkFnug=
- secure: iQrTUqRtq/49XDY4c8S9AKG0ObO3Dy55NuwC7/iP9+KJw9DUz5tZtKKH08Kswfk0GZ9z1bkLbJ8hBf1Kr99hPAY4l+1b6zcshazZKRYdmFndrpnFSkOVXzy7erhR9bw4AFtGuK94jR4h9Bz1JYnpg+vMOmPNxMTixneiukCZHgM=
- secure: wANXSFrYfizk6WXC/niyZ+7aZT8YalRy7WNYcmcIfCLR02hzc6krbFGCs3VAAqgk1qTU6yriEMtSyr/lHEWeVYYTNg9yO55i4cVHI//qUvsBRmDkOBWAwaqq0GjOWG7zlUC3TUHXNnZRxe8B5yQE3Zj6xXfsF9agKIAMq7manGA=
- secure: fPB4s8zVRnYNSSqk0UjHovlWO2/b87he2LREHSev35ns8n1Hjoh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uGnkVYL2ChelbQ9qlEb6TGuaZo4OOaoagiT5QGJN+5tucQwpYe39iTs9wcqtnBTyMxElxCEzY9lmHgldzccnU41oxHEAybS4=
- secure: X8TFKaiN2DfMvvtnIK+/1zpu9uvc40VwL4sCHduQHpRW5owjG9HX35oRa7Ot69/VFM4cO/DP+6fA0dei0OujEWqtCRn7vwMnEl7cviujs+6vYsG5RLkt6nupvUwPZNPmwZHKAChu7i9mmOnmfcRDLP3Zc6Kwijs0GwDGTEXAqsk=
- secure: T2nXGt7DPUomi2j6ctC51O8use8dXZXYrGq6yaNopSgGZOg1Qgm93oKkbKhgTzq/1/DH6tY3eOlYjx/0G+F9h1dG1i9ufjZC3dmi0xVQ5t441lqFzhBP2qOdCQ0U/BQGux10/TIPLiJ5rhARoqUUNCYxIFQ2F9EDM2bod65KA78=
- secure: L8BgolosqoP2Sp7oSaOh17MRtNo3s4WN2IV8000Ofk3BRX/fp1WFDtoxX3/2A2YKxq59rdD1OPQub01QzltR3vA/DP4s/9ITNJB/iSbDGPloVJz7EwuVRkm3nlgX8KroEIPepZc55AMfq0e61+JFu7hriyLS0IuO3fVe2j50eGo=
after_success:
- ".travis/publish-results.sh"
- echo sonatypeUsername=none >> gradle.properties
- echo sonatypePassword=none >> gradle.properties

#after_success:
#- ".travis/publish-results.sh"

#deploy:
# api_key:
# secure: CJWhv76T55re6sEhYblukVcOKhr1nP9zZ6bAdvp3nbcjRNcBh5shMj/fq/JaqKos90cTDpTwBn3rnbAtrX24TLU0KX//CzRkzjmYsl3e71Rb5v9MDiOFdw/iZTNZXBRED7fZy6eGqTboWHN0BGAPHBrsypRo8zVdFTuYDMRgsi0=
49 changes: 21 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,16 @@ repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'saxon' && details.requested.version == '8.7') {
details.useTarget "net.sf.saxon:Saxon-HE:" + saxonVersion
}
}
}

configurations {
pluginApi
}

dependencies {
compile fileTree(dir: 'delta').include("*.jar")
compile fileTree(dir: 'lib').include("*.jar")
compile (
[group: 'net.sf.saxon', name: 'Saxon-HE', version: saxonVersion],
[group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.8-96'],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-deltaxml', version: '1.1.4'],
//[group: 'com.xmlcalabash', name: 'xmlcalabash1-deltaxml', version: '1.1.4'],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.4'],
[group: 'com.thaiopensource', name: 'jing', version: '20091111', transitive: false],
[group: 'org.docbook', name: 'docbook-xsl-java-saxon', version: '1.2.1-95'],
Expand Down Expand Up @@ -122,8 +114,7 @@ task runtests(type: JavaExec) {
FileCollection source = fileTree(dir: testsRoot + "/src/")
FileCollection style = fileTree(dir: "xslt/")

inputs.file style + source
//outputs.file result
inputs.files style + source

main = 'com.xmlcalabash.drivers.Main'
maxHeapSize = '1024m'
Expand Down Expand Up @@ -230,9 +221,9 @@ gentext.onlyIf {
task makeFoParams(type: JavaExec) {
classpath = configurations.runtime

inputs.file fileTree(dir: "tools/").include("mkparam.xsl")
inputs.file fileTree(dir: "xslt/params/")
inputs.file fileTree(dir: "xslt/base/fo/").include("param.xml")
inputs.file "tools/mkparam.xsl"
inputs.files fileTree(dir: "xslt/params/")
inputs.files fileTree(dir: "xslt/base/fo/").include("param.xml")
outputs.file "xslt/base/fo/param.xsl"

main = 'net.sf.saxon.Transform'
Expand All @@ -244,9 +235,9 @@ task makeFoParams(type: JavaExec) {
task makeHtmlParams(type: JavaExec) {
classpath = configurations.runtime

inputs.file fileTree(dir: "tools/").include("mkparam.xsl")
inputs.file fileTree(dir: "xslt/params/")
inputs.file fileTree(dir: "xslt/base/html/").include("param.xml")
inputs.file "tools/mkparam.xsl"
inputs.files fileTree(dir: "xslt/params/")
inputs.files fileTree(dir: "xslt/base/html/").include("param.xml")
outputs.file "xslt/base/html/param.xsl"

main = 'net.sf.saxon.Transform'
Expand Down Expand Up @@ -405,16 +396,18 @@ task dist(dependsOn: [updateDist, zipJar], type: JavaExec) {
)
}

task clean.doFirst {
delete "gentext/build/"
delete "src/main/resources/xslt"
delete "xslt/base/common/locales/"
delete "xslt/base/fo/param.xsl"
delete "xslt/base/html/param.xsl"
delete "build/"
delete "test/diff"
delete "test/actual"
delete "test/result"
clean {
doFirst {
delete "gentext/build/"
delete "src/main/resources/xslt"
delete "xslt/base/common/locales/"
delete "xslt/base/fo/param.xsl"
delete "xslt/base/html/param.xsl"
delete "build/"
delete "test/diff"
delete "test/actual"
delete "test/result"
}
}

/*
Expand Down
1 change: 1 addition & 0 deletions gentext/src/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@
<template name="procedure"><Procedure/>&#160;%n, <startquote/>%t<endquote/></template>
<template name="productionset"><ProductionSet/>&#160;%n, <startquote/>%t<endquote/></template>
<template name="qandadiv"><Qandadiv/>&#160;%n, <startquote/>%t<endquote/></template>
<template name="question"><Question/>&#160;%n</template>
<template name="refsect1"><sectioncalled/> <startquote/>%t<endquote/></template>
<template name="refsect2"><sectioncalled/> <startquote/>%t<endquote/></template>
<template name="refsect3"><sectioncalled/> <startquote/>%t<endquote/></template>
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.0.22
version=2.1.0
snapshot=
builtBy=Norman Walsh
baseline=0
Expand Down
2 changes: 2 additions & 0 deletions tools/mkparam.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<xsl:namespace name="xsl" select="'http://www.w3.org/1999/XSL/Transform'"/>
<xsl:namespace name="db" select="'http://docbook.org/ns/docbook'"/>
<xsl:namespace name="f" select="'http://docbook.org/xslt/ns/extension'"/>
<xsl:namespace name="xs" select="'http://www.w3.org/2001/XMLSchema'"/>
<xsl:attribute name="exclude-result-prefixes" select="'db f xs'"/>
<xsl:apply-templates select="//db:refentry">
<xsl:sort select="@xml:id"/>
</xsl:apply-templates>
Expand Down
6 changes: 3 additions & 3 deletions xslt/base/common/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ template.</para>
<xsl:apply-templates select="($node/db:firstname|$node/db:givenname)[1]"/>
</xsl:if>

<xsl:if test="$node/db:othername and $author.othername.in.middle != 0">
<xsl:if test="$node/db:othername and $author.othername.in.middle">
<xsl:if test="$node/db:honorific or $node/db:firstname or $node/db:givenname">
<xsl:text> </xsl:text>
</xsl:if>
Expand All @@ -302,7 +302,7 @@ template.</para>

<xsl:if test="$node/db:surname">
<xsl:if test="$node/db:honorific or $node/db:firstname or $node/db:givenname
or ($node/db:othername and $author.othername.in.middle != 0)">
or ($node/db:othername and $author.othername.in.middle)">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates select="$node/db:surname[1]"/>
Expand Down Expand Up @@ -542,7 +542,7 @@ year range is <quote>1991-1992</quote> but discretely it's
-->

<xsl:choose>
<xsl:when test="$print.ranges = 0 and exists($years)">
<xsl:when test="not($print.ranges) and exists($years)">
<xsl:choose>
<xsl:when test="count($years) = 1">
<xsl:apply-templates select="$years[1]" mode="titlepage.mode"/>
Expand Down
4 changes: 2 additions & 2 deletions xslt/base/common/dbfunctions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ context node.</para>
<xsl:param name="node"/>

<xsl:choose>
<xsl:when test="$bibliography.numbered != 0">
<xsl:when test="$bibliography.numbered">
<xsl:apply-templates select="$node" mode="mp:biblioentry-label-count"/>
</xsl:when>
<xsl:when test="node-name($node/child::*[1]) = xs:QName('db:abbrev')">
Expand Down Expand Up @@ -1078,7 +1078,7 @@ node does not have an ID, the XSLT
<xsl:when test="$node/@id">
<xsl:value-of select="$node/@id"/>
</xsl:when>
<xsl:when test="$persistent.generated.ids != 0">
<xsl:when test="$persistent.generated.ids">
<xsl:variable name="xpid" select="f:xptr-id($node)"/>
<xsl:choose>
<!-- FIXME: what if $node/key('id', $xpid)? I can't test that because
Expand Down
16 changes: 8 additions & 8 deletions xslt/base/common/gentext.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ that should be used to generate its title.</para>

<xsl:template match="db:procedure" mode="m:object-title-template">
<xsl:choose>
<xsl:when test="$formal.procedures != 0 and title">
<xsl:when test="$formal.procedures and title">
<xsl:call-template name="gentext-template">
<xsl:with-param name="context" select="'title'"/>
<xsl:with-param name="name"
Expand Down Expand Up @@ -176,13 +176,13 @@ that should be used to generate a cross-reference to it.</para>

<xsl:variable name="context">
<xsl:choose>
<xsl:when test="$autonumber != 0
and $number-and-title-template != 0
and $xref.with.number.and.title != 0">
<xsl:when test="$autonumber
and $number-and-title-template
and $xref.with.number.and.title">
<xsl:value-of select="'xref-number-and-title'"/>
</xsl:when>
<xsl:when test="$autonumber != 0
and $number-template != 0">
<xsl:when test="$autonumber
and $number-template">
<xsl:value-of select="'xref-number'"/>
</xsl:when>
<xsl:otherwise>
Expand Down Expand Up @@ -837,7 +837,7 @@ defaults to the language of the context node.</para>

<xsl:variable name="pagetype">
<xsl:choose>
<xsl:when test="$olink.insert.page.number = 0
<xsl:when test="not($olink.insert.page.number)
and local-name($referrer) = 'olink'">
<!-- suppress page numbers -->
</xsl:when>
Expand Down Expand Up @@ -865,7 +865,7 @@ defaults to the language of the context node.</para>

<xsl:variable name="docnametype">
<xsl:choose>
<xsl:when test="$olink.doctitle = 0
<xsl:when test="not($olink.doctitle)
and local-name($referrer) = 'olink'">
<!-- suppress docname -->
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion xslt/base/common/l10n.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ target.</para>
<xsl:value-of select="$l10n.gentext.language"/>
</xsl:when>

<xsl:when test="$xref-context or $l10n.gentext.use.xref.language != 0">
<xsl:when test="$xref-context or $l10n.gentext.use.xref.language">
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$target/ancestor-or-self::*
Expand Down
16 changes: 8 additions & 8 deletions xslt/base/common/label-content.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ processed in this mode should generate their label.</para>
</xsl:when>

<xsl:when test="$label">
<xsl:if test="$component.label.includes.part.label != 0 and
<xsl:if test="$component.label.includes.part.label and
ancestor::db:part">
<xsl:variable name="part.label">
<xsl:apply-templates select="ancestor::db:part"
Expand All @@ -136,7 +136,7 @@ processed in this mode should generate their label.</para>
</xsl:if>

<xsl:choose>
<xsl:when test="$label.from.part != 0 and ancestor::db:part">
<xsl:when test="$label.from.part and ancestor::db:part">
<xsl:number from="db:part" format="{$format}" level="any"/>
</xsl:when>
<xsl:when test="ancestor::db:article">
Expand Down Expand Up @@ -210,7 +210,7 @@ processed in this mode should generate their label.</para>
<xsl:apply-templates select=".." mode="m:intralabel-punctuation"/>
</xsl:if>

<xsl:if test="$section.label.includes.component.label != 0
<xsl:if test="$section.label.includes.component.label
and parent::* instance of element()
and f:is-component(..)">
<xsl:variable name="parent.label">
Expand Down Expand Up @@ -247,7 +247,7 @@ processed in this mode should generate their label.</para>

<xsl:if test="@label or f:label-this-section(.)">
<!-- if the parent is a component, maybe label that too -->
<xsl:if test="$section.label.includes.component.label != 0
<xsl:if test="$section.label.includes.component.label
and f:is-component(..)">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="m:label-content"/>
Expand Down Expand Up @@ -408,7 +408,7 @@ processed in this mode should generate their label.</para>
</xsl:if>
</xsl:if>

<xsl:if test="$section.label.includes.component.label != 0
<xsl:if test="$section.label.includes.component.label
and f:is-component(..)">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="m:label-content"/>
Expand Down Expand Up @@ -457,7 +457,7 @@ processed in this mode should generate their label.</para>
</xsl:variable>

<xsl:variable name="prefix">
<xsl:if test="$qanda.inherit.numeration != 0">
<xsl:if test="$qanda.inherit.numeration">
<xsl:if test="$lparent.prefix != ''">
<xsl:copy-of select="$lparent.prefix"/>
<xsl:apply-templates select="$lparent"
Expand Down Expand Up @@ -500,7 +500,7 @@ processed in this mode should generate their label.</para>
</xsl:variable>

<xsl:variable name="prefix">
<xsl:if test="$qanda.inherit.numeration != 0">
<xsl:if test="$qanda.inherit.numeration">
<xsl:if test="$lparent.prefix != ''">
<xsl:copy-of select="$lparent.prefix"/>
<xsl:apply-templates select="$lparent" mode="m:intralabel-punctuation"/>
Expand Down Expand Up @@ -640,7 +640,7 @@ processed in this mode should generate their label.</para>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="self::db:procedure and $formal.procedures = 0">
<xsl:when test="self::db:procedure and not($formal.procedures)">
<!-- No label -->
</xsl:when>
<xsl:otherwise>
Expand Down
Loading

0 comments on commit 084f3b9

Please sign in to comment.