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

Last change on this file since 3153 was 3153, checked in by Nicklas Nordborg, 16 years ago

Added docbook DTD:s and stylesheets

File size: 3.3 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="generate.toc">book toc,title</xsl:param>         
15<xsl:param name="make.graphic.viewport" select="0"/>
16<xsl:param name="callout.graphics" select="1" />
17<xsl:param name="callout.graphics.path">gfx/admonitions/callouts/</xsl:param>
18<xsl:param name="callout.graphics.extension">.gif</xsl:param>
19<xsl:param name="admon.graphics" select="1"/>
20<xsl:param name="admon.graphics.path">gfx/admonitions/</xsl:param>
21<xsl:param name="admon.graphics.extension">.gif</xsl:param>
22<xsl:param name="admonition.title.properties">text-align: left</xsl:param>
23
24<xsl:param name="chunker.output.encoding">utf-8</xsl:param>
25
26<!-- (MM20040315) base.dir and root.filename are coming from the ant-build-docbook.xml -->
27<xsl:param name="base.dir">@base.dir@/</xsl:param>
28<xsl:param name="root.filename">@root.filename@</xsl:param>
29
30
31<!-- convert url-only references to a format that is wrappable -->
32
33<xsl:template match="ulink" name="ulink">
34  <xsl:choose>
35  <xsl:when test="count(child::node())=0">
36  <a>
37      <xsl:if test="@id">
38        <xsl:attribute name="name">
39          <xsl:value-of select="@id"/>
40        </xsl:attribute>
41      </xsl:if>
42      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
43      <xsl:if test="$ulink.target != ''">
44        <xsl:attribute name="target">
45          <xsl:value-of select="$ulink.target"/>
46        </xsl:attribute>
47      </xsl:if> 
48    <xsl:if test="count(child::node())=0">
49        <xsl:call-template name="insertInvisibleBreaks">
50            <xsl:with-param name="url" select="@url" />
51            <xsl:with-param name="breakat" select="translate(@url, '/-_:', '____')" />
52        </xsl:call-template>
53    </xsl:if>
54  </a>
55  </xsl:when>
56  <xsl:otherwise>
57  <xsl:apply-imports/>
58  </xsl:otherwise>
59  </xsl:choose>
60</xsl:template> 
61
62<xsl:template name="insertInvisibleBreaks">
63    <xsl:param name="url" />
64    <xsl:param name="breakat" />
65    <!-- <xsl:message><xsl:value-of select="concat('param:', $url, $breakat)" /></xsl:message> -->
66    <xsl:choose>
67        <xsl:when test="contains($breakat, '_')">
68            <xsl:value-of select="substring($url, 1, string-length(substring-before($breakat, '_'))+1)" /><wbr/>
69            <xsl:call-template name="insertInvisibleBreaks">
70                <xsl:with-param name="url" select="substring($url, string-length(substring-before($breakat, '_'))+2)"/>
71                <xsl:with-param name="breakat" select="substring($breakat, string-length(substring-before($breakat, '_'))+2)"/>
72            </xsl:call-template>
73        </xsl:when>
74        <xsl:otherwise>
75            <xsl:value-of select="$url" />
76        </xsl:otherwise>
77    </xsl:choose>
78</xsl:template>
79
80</xsl:stylesheet>
81
82
Note: See TracBrowser for help on using the repository browser.