diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-03-12 08:34:35 -0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-03-14 09:51:48 +0100 |
commit | 770c0c1746b5c0b94dc07d5f1d6c2c04802c8540 (patch) | |
tree | 3634144a257a554182a331a72d66c47ee3a2344b /help3xsl/get_tree.xsl | |
parent | 05d4e9fb471224b6adbc174ecb7968ffa29d4a56 (diff) |
tdf#116296 remove produt version from help path
Part two.
Part 1 is in sfx2 module
Remove product version from offline help path but keep
in online help.
Product version is kept for online because a help server can have more
than one helponline version.
Change-Id: I1d4ba12a7d6472defd4210c79349e35ccaf32d8d
Reviewed-on: https://gerrit.libreoffice.org/51126
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'help3xsl/get_tree.xsl')
-rw-r--r-- | help3xsl/get_tree.xsl | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/help3xsl/get_tree.xsl b/help3xsl/get_tree.xsl index 4f959ad5a0..e20774dd0c 100644 --- a/help3xsl/get_tree.xsl +++ b/help3xsl/get_tree.xsl @@ -13,10 +13,10 @@ Usage: xsltproc get_tree.xsl <file.tree> --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -<xsl:param name="app"/> <xsl:param name="lang"/> -<xsl:param name="productname" select="'LibreOffice'"/> +<xsl:param name="local"/> <xsl:param name="productversion"/> +<xsl:param name="productname" select="'LibreOffice'"/> <xsl:output indent="no" method="text"/> <!-- ############################ @@ -28,6 +28,15 @@ xsltproc get_tree.xsl <file.tree> <xsl:variable name="brand2" select="'$[officeversion]'"/> <xsl:variable name="brand3" select="'%PRODUCTNAME'"/> <xsl:variable name="brand4" select="'%PRODUCTVERSION'"/> + +<xsl:variable name="online" select="$local!='yes'"/> +<xsl:variable name="target"> + <xsl:choose> + <xsl:when test="$online"><xsl:value-of select="concat($productversion,'/')"/></xsl:when> + <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise> + </xsl:choose> +</xsl:variable> + <!-- ############# # Templates # @@ -38,22 +47,18 @@ xsltproc get_tree.xsl <file.tree> <xsl:apply-templates/> </xsl:template> <xsl:template match="help_section"> -<![CDATA[<ul><li><input type="checkbox" id="]]><xsl:value-of select="@id"/><![CDATA["><label for="]]><xsl:value-of select="@id"/><![CDATA[">]]><xsl:call-template name="replace"><xsl:with-param name="text"><xsl:value-of select="@title"/></xsl:with-param></xsl:call-template><![CDATA[</label><ul>\]]> -<xsl:apply-templates/><![CDATA[</ul></li></ul>\]]> + <![CDATA[<ul><li><input type="checkbox" id="]]><xsl:value-of select="@id"/><![CDATA["><label for="]]><xsl:value-of select="@id"/><![CDATA[">]]><xsl:call-template name="replace"><xsl:with-param name="text"><xsl:value-of select="@title"/></xsl:with-param></xsl:call-template><![CDATA[</label><ul>\]]><xsl:apply-templates/><![CDATA[</ul></li></ul>\]]> </xsl:template> <xsl:template match="node"> -<![CDATA[<li><input type="checkbox" id="]]><xsl:value-of select="@id"/><![CDATA["><label for="]]><xsl:value-of select="@id"/><![CDATA[">]]><xsl:call-template name="replace"><xsl:with-param name="text"><xsl:value-of select="@title"/></xsl:with-param></xsl:call-template><![CDATA[</label><ul>\]]> -<xsl:apply-templates/><![CDATA[</ul></li>\]]> + <![CDATA[<li><input type="checkbox" id="]]><xsl:value-of select="@id"/><![CDATA["><label for="]]><xsl:value-of select="@id"/><![CDATA[">]]><xsl:call-template name="replace"><xsl:with-param name="text"><xsl:value-of select="@title"/></xsl:with-param></xsl:call-template><![CDATA[</label><ul>\]]><xsl:apply-templates/><![CDATA[</ul></li>\]]> </xsl:template> <xsl:template match="topic"> <xsl:variable name="htmlpage"> - <xsl:call-template name="filehtml"> - <xsl:with-param name="file" select="concat('/',$productversion,'/',$lang,'/',substring-after(@id,'/'))"/> - </xsl:call-template> + <xsl:value-of select="concat($target,$lang,'/',substring-before(substring-after(@id,'/'),'.xhp'),'.html')" /> </xsl:variable> -<![CDATA[<li><a target="_top" href="]]><xsl:value-of select="$htmlpage"/><![CDATA[">]]><xsl:call-template name="replace"><xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param></xsl:call-template><![CDATA[</a></li>\]]> + <![CDATA[<li><a target="_top" href="]]><xsl:value-of select="$htmlpage"/><![CDATA[">]]><xsl:call-template name="replace"><xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param></xsl:call-template><![CDATA[</a></li>\]]> </xsl:template> <xsl:template name="replace"> @@ -68,6 +73,7 @@ xsltproc get_tree.xsl <file.tree> </xsl:with-param> </xsl:call-template> </xsl:template> + <!-- weird characters inside bookmarks, replace by HTML entities--> <xsl:template name="apostrophe"> <xsl:param name="string"/> @@ -88,9 +94,9 @@ xsltproc get_tree.xsl <file.tree> </xsl:otherwise> </xsl:choose> </xsl:template> + <xsl:template name="brand" > <xsl:param name="string"/> - <xsl:choose> <xsl:when test="contains($string,$brand1)"> @@ -142,9 +148,4 @@ xsltproc get_tree.xsl <file.tree> </xsl:otherwise> </xsl:choose> </xsl:template> - -<xsl:template name="filehtml"> - <xsl:param name="file"/> - <xsl:value-of select="substring-after(concat(substring-before($file,'.xhp'),'.html'),'/')"/> -</xsl:template> </xsl:stylesheet> |