source: trunk/lib/docbook/custom-styles/docbook/plain/xsl/customized.chunked.xsl @ 3198

Last change on this file since 3198 was 3198, checked in by Martin Svensson, 15 years ago

Added an ant task and a xsl stylesheet for helptext-import-file generation.

File size: 3.6 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                version='1.0'>
5
6<xsl:import href="@ant.docbook.styler.fileuri@/docbook/xsl/html/chunk.xsl" />
7
8<!-- (MM20040315) xsl parameters moved from ant-build-docbook.xml to here -->
9<xsl:param name="table.borders.with.css" select="1"/>
10<xsl:param name="html.stylesheet">css/docbook.css</xsl:param>
11<xsl:param name="html.stylesheet.type">text/css</xsl:param>       
12<xsl:param name="section.label.includes.component.label" select="1" />         
13<xsl:param name="section.autolabel" select="1" />
14<xsl:param name="section.autolabel.max.depth" select="2" />
15<xsl:param name="chunk.first.sections" select="1" />
16<xsl:param name="toc.max.depth" select="2"/>
17<xsl:param name="make.graphic.viewport" select="0"/>
18<xsl:param name="callout.graphics" select="1" />
19<xsl:param name="callout.graphics.path">gfx/admonitions/callouts/</xsl:param>
20<xsl:param name="callout.graphics.extension">.gif</xsl:param>
21<xsl:param name="admon.graphics" select="1"/>
22<xsl:param name="admon.graphics.path">gfx/admonitions/</xsl:param>
23<xsl:param name="admon.graphics.extension">.gif</xsl:param>
24<xsl:param name="admonition.title.properties">text-align: left</xsl:param>
25
26<xsl:param name="use.id.as.filename" select="1"/>
27
28<xsl:param name="chunker.output.encoding">utf-8</xsl:param>
29<xsl:param name="chunker.output.indent">yes</xsl:param>
30
31<!-- (MM20040315) base.dir and root.filename are coming from the ant-build-docbook.xml -->
32<xsl:param name="base.dir">@base.dir@/</xsl:param>
33<xsl:param name="root.filename">@root.filename@</xsl:param>
34
35
36<!-- convert url-only references to a format that is wrappable -->
37
38<xsl:template match="ulink" name="ulink">
39  <xsl:choose>
40  <xsl:when test="count(child::node())=0">
41  <a>
42      <xsl:if test="@id">
43        <xsl:attribute name="name">
44          <xsl:value-of select="@id"/>
45        </xsl:attribute>
46      </xsl:if>
47      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
48      <xsl:if test="$ulink.target != ''">
49        <xsl:attribute name="target">
50          <xsl:value-of select="$ulink.target"/>
51        </xsl:attribute>
52      </xsl:if> 
53    <xsl:if test="count(child::node())=0">
54        <xsl:call-template name="insertInvisibleBreaks">
55            <xsl:with-param name="url" select="@url" />
56            <xsl:with-param name="breakat" select="translate(@url, '/-_:', '____')" />
57        </xsl:call-template>
58    </xsl:if>
59  </a>
60  </xsl:when>
61  <xsl:otherwise>
62  <xsl:apply-imports/>
63  </xsl:otherwise>
64  </xsl:choose>
65</xsl:template> 
66
67<xsl:template name="insertInvisibleBreaks">
68    <xsl:param name="url" />
69    <xsl:param name="breakat" />
70    <!-- <xsl:message><xsl:value-of select="concat('param:', $url, $breakat)" /></xsl:message> -->
71    <xsl:choose>
72        <xsl:when test="contains($breakat, '_')">
73            <xsl:value-of select="substring($url, 1, string-length(substring-before($breakat, '_'))+1)" /><wbr/>
74            <xsl:call-template name="insertInvisibleBreaks">
75                <xsl:with-param name="url" select="substring($url, string-length(substring-before($breakat, '_'))+2)"/>
76                <xsl:with-param name="breakat" select="substring($breakat, string-length(substring-before($breakat, '_'))+2)"/>
77            </xsl:call-template>
78        </xsl:when>
79        <xsl:otherwise>
80            <xsl:value-of select="$url" />
81        </xsl:otherwise>
82    </xsl:choose>
83</xsl:template>
84
85<xsl:template match="helptext">
86  <xsl:apply-templates />
87</xsl:template>
88
89</xsl:stylesheet>
90
91
Note: See TracBrowser for help on using the repository browser.