1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | This file is part of the DITA Open Toolkit project hosted on
|
---|
4 | Sourceforge.net. See the accompanying license.txt file for
|
---|
5 | applicable licenses.
|
---|
6 |
|
---|
7 | Copyright Shawn McKenzie, 2007. All Rights Reserved.
|
---|
8 |
|
---|
9 | Created by Robert Anderson August 2011, based on the sample
|
---|
10 | frameset distributed with the original samples. Minor udpates:
|
---|
11 | - Grab title of the map as the title
|
---|
12 | - Update contentwin to use the first topic
|
---|
13 |
|
---|
14 | This is intended to create an initial, sample frameset when
|
---|
15 | one is not already provided. Long term, users may wish to create
|
---|
16 | a stable frameset using local styles and organization.
|
---|
17 | -->
|
---|
18 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
19 |
|
---|
20 | <xsl:import href="plugin:org.dita.base:xsl/common/dita-utilities.xsl"/>
|
---|
21 | <xsl:import href="plugin:org.dita.base:xsl/common/output-message.xsl"/>
|
---|
22 | <xsl:variable name="msgprefix">DOTX</xsl:variable>
|
---|
23 |
|
---|
24 | <xsl:output encoding="UTF-8"/>
|
---|
25 |
|
---|
26 | <xsl:param name="CSSPATH"/>
|
---|
27 | <xsl:param name="OUTEXT" select="'.html'"/>
|
---|
28 | <xsl:param name="DITAEXT" select="'.xml'"/>
|
---|
29 |
|
---|
30 | <xsl:variable name="firsttopic">
|
---|
31 | <xsl:variable name="f" select="/*/*[contains(@class, ' map/topicref ')][1]/descendant-or-self::*[@href][not(@processing-role='resource-only')]"/>
|
---|
32 | <xsl:choose>
|
---|
33 | <xsl:when test="$f">
|
---|
34 | <xsl:choose>
|
---|
35 | <xsl:when test="not($f[1]/@format) or $f[1]/@format = 'dita'">
|
---|
36 | <xsl:call-template name="replace-extension">
|
---|
37 | <xsl:with-param name="filename" select="$f[1]/@href"/>
|
---|
38 | <xsl:with-param name="extension" select="$OUTEXT"/>
|
---|
39 | </xsl:call-template>
|
---|
40 | </xsl:when>
|
---|
41 | <xsl:otherwise>
|
---|
42 | <xsl:value-of select="$f[1]/@href"/>
|
---|
43 | </xsl:otherwise>
|
---|
44 | </xsl:choose>
|
---|
45 | </xsl:when>
|
---|
46 | <xsl:otherwise>
|
---|
47 | <xsl:variable name="f" select="/*/descendant-or-self::*[@href][not(@processing-role='resource-only')]"/>
|
---|
48 | <xsl:choose>
|
---|
49 | <xsl:when test="not($f[1]/@format) or $f[1]/@format = 'dita'">
|
---|
50 | <xsl:call-template name="replace-extension">
|
---|
51 | <xsl:with-param name="filename" select="$f[1]/@href"/>
|
---|
52 | <xsl:with-param name="extension" select="$OUTEXT"/>
|
---|
53 | </xsl:call-template>
|
---|
54 | </xsl:when>
|
---|
55 | <xsl:otherwise>
|
---|
56 | <xsl:value-of select="$f[1]/@href"/>
|
---|
57 | </xsl:otherwise>
|
---|
58 | </xsl:choose>
|
---|
59 | </xsl:otherwise>
|
---|
60 | </xsl:choose>
|
---|
61 | </xsl:variable>
|
---|
62 | <xsl:variable name="firsttopicAsHtml" select="$firsttopic"/>
|
---|
63 |
|
---|
64 |
|
---|
65 | <xsl:template match="/">
|
---|
66 | <html>
|
---|
67 | <head>
|
---|
68 | <title>
|
---|
69 | <xsl:choose>
|
---|
70 | <xsl:when test="/*/*[contains(@class,' topic/title ')]">
|
---|
71 | <xsl:value-of select="normalize-space(/*/*[contains(@class,' topic/title ')])"/>
|
---|
72 | </xsl:when>
|
---|
73 | <xsl:when test="/*/@title">
|
---|
74 | <xsl:value-of select="normalize-space(/*/@title)"/>
|
---|
75 | </xsl:when>
|
---|
76 | </xsl:choose>
|
---|
77 | </title>
|
---|
78 | <xsl:choose>
|
---|
79 | <xsl:when test="$CSSPATH!=''">
|
---|
80 | <link rel="stylesheet" type="text/css" href="concat($CSSPATH,'commonltr.css')"/>
|
---|
81 | </xsl:when>
|
---|
82 | <xsl:otherwise>
|
---|
83 | <link rel="stylesheet" type="text/css" href="commonltr.css"/>
|
---|
84 | </xsl:otherwise>
|
---|
85 | </xsl:choose>
|
---|
86 | </head>
|
---|
87 | <frameset cols="30%,*">
|
---|
88 | <frame name="tocwin" src="tocnav.html"/>
|
---|
89 | <frame name="contentwin" src="{$firsttopicAsHtml}"/>
|
---|
90 | </frameset>
|
---|
91 | </html>
|
---|
92 | </xsl:template>
|
---|
93 |
|
---|
94 | </xsl:stylesheet>
|
---|