Skip to content

Commit

Permalink
Merge pull request #104 from ndw/master
Browse files Browse the repository at this point in the history
Fix bugs in $rootid
  • Loading branch information
ndw authored Mar 6, 2018
2 parents fd13d35 + 49e2cfe commit 34856b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version=2.2.1
version=2.2.2
saxonVersion=9.8.0-8
xmlCalabashVersion=1.1.18-98
xmlCalabashVersion=1.1.19-98

snapshot=
builtBy=Norman Walsh
Expand Down
6 changes: 3 additions & 3 deletions xslt/base/common/control.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<xsl:param name="document"/>
<xsl:param name="rootid"/>

<xsl:if test="$rootid != '' and not(key('id', $rootid, $document))">
<xsl:if test="exists($rootid) and ($rootid != '') and not(key('id', $rootid, $document))">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
Expand All @@ -27,7 +27,7 @@

<xsl:variable name="root" as="element()">
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:when test="exists($rootid) and ($rootid != '')">
<xsl:sequence select="key('id', $rootid, $document)"/>
</xsl:when>
<xsl:otherwise>
Expand Down Expand Up @@ -82,7 +82,7 @@ element (or the element selected for processing with
<xsl:message terminate="yes">
<xsl:text>Error: document root element (</xsl:text>
<xsl:value-of select="name($root/*[1])"/>
<xsl:if test="$rootid">
<xsl:if test="exists($rootid) and ($rootid != '')">
<xsl:text>, $rootid=</xsl:text>
<xsl:value-of select="$rootid"/>
</xsl:if>
Expand Down
2 changes: 1 addition & 1 deletion xslt/base/html/chunkfunc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<xsl:when test="string($pibn) != ''">
<xsl:value-of select="concat($pibn, $html.ext)"/>
</xsl:when>
<xsl:when test="$chunk/@xml:id and $use.id.as.filename != '0'">
<xsl:when test="$chunk/@xml:id and $use.id.as.filename">
<xsl:value-of select="concat($chunk/@xml:id,$html.ext)"/>
</xsl:when>
<xsl:otherwise>
Expand Down
2 changes: 1 addition & 1 deletion xslt/base/html/chunktemp.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

<xsl:template match="/">
<xsl:choose>
<xsl:when test="$rootid = ''">
<xsl:when test="empty($rootid) or ($rootid = '')">
<xsl:apply-templates select="$chunks" mode="m:chunk"/>
</xsl:when>
<xsl:when test="$chunks[@xml:id = $rootid]">
Expand Down

0 comments on commit 34856b6

Please sign in to comment.