summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-11-15 20:24:30 -0200
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-11-16 14:02:55 +0100
commit121bc8154cd8b1d515a11b02e0ed88b528602acb (patch)
tree07e97838de49cff04250f2b91521383a8ea80c81
parent87079b854b6e4eb6ea08e567710286fd4c529be4 (diff)
Honor asc/desc in XHP sorting
Change-Id: I11cc206e3f8771fc19387cd2a9c02697982251dc Reviewed-on: https://gerrit.libreoffice.org/63445 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r--help3xsl/online_transform.xsl16
1 files changed, 14 insertions, 2 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index c1755937cd..ee6a5fbf27 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -622,10 +622,22 @@
<!-- SORT -->
<xsl:template match="sort" >
- <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+ <xsl:variable name="order1">
+ <xsl:choose>
+ <xsl:when test="string-length(@order) = 0"><xsl:value-of select="'ascending'"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="concat(@order,'ending')"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:apply-templates><xsl:sort order="{$order1}" select="descendant::paragraph"/></xsl:apply-templates>
</xsl:template>
<xsl:template match="sort" mode="embedded">
- <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+ <xsl:variable name="order1">
+ <xsl:choose>
+ <xsl:when test="string-length(@order) = 0"><xsl:value-of select="'ascending'"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="concat(@order,'ending')"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:apply-templates><xsl:sort order="{$order1}" select="descendant::paragraph"/></xsl:apply-templates>
</xsl:template>
<!-- SWITCH -->