VirtualBox

source: vbox/trunk/src/libs/dita-ot-1.8.5/plugins/com.sophos.tocjs/xsl/gethref.xsl@ 99507

最後變更 在這個檔案從99507是 98584,由 vboxsync 提交於 2 年 前

Docs: bugref:10302. Setting svn properties of DITA-OT library.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.5 KB
 
1<!--
2 This file is part of the DITA Open Toolkit project hosted on
3 Sourceforge.net. See the accompanying license.txt file for
4 applicable licenses.
5
6 (C) Copyright Shawn McKenzie, 2007. All Rights Reserved.
7 *-->
8<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
9
10 <xsl:template name="gethref">
11 <xsl:param name="ditahref"/>
12
13 <xsl:if test="@scope='external' and @format='html'">
14 <xsl:value-of select="@href"/>
15 </xsl:if>
16
17
18 <xsl:if test="not(@scope='external')">
19 <xsl:if test="contains($ditahref, '#')">
20 <xsl:call-template name="swapext">
21 <xsl:with-param name="newhref" select="substring-before($ditahref, '#')"/>
22 </xsl:call-template>
23 </xsl:if>
24
25 <xsl:if test="not(contains($ditahref, '#'))">
26 <xsl:call-template name="swapext">
27 <xsl:with-param name="newhref" select="$ditahref"/>
28 </xsl:call-template>
29 </xsl:if>
30 </xsl:if>
31
32 </xsl:template>
33
34
35 <xsl:template name="swapext">
36 <xsl:param name="newhref"/>
37
38 <xsl:if test="substring($newhref, string-length($newhref) - string-length('.xml') +1) = '.xml'">
39 <xsl:value-of select="concat(substring-before($newhref, '.xml'), '.html')"/>
40 </xsl:if>
41 <xsl:if
42 test="substring($newhref, string-length($newhref) - string-length('.dita') +1) =
43 '.dita'">
44 <xsl:value-of select="concat(substring-before($newhref, '.dita'), '.html')"/>
45 </xsl:if>
46
47 </xsl:template>
48
49
50</xsl:stylesheet>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette