VirtualBox

source: vbox/trunk/doc/manual/xhtml-qhelp.xsl@ 88787

Last change on this file since 88787 was 86633, checked in by vboxsync, 4 years ago

FE/Qt: bugref:9831. Adding 'preface' item to toc.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1<?xml version="1.0"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:xhtml="http://www.w3.org/1999/xhtml">
5 <xsl:output method="xml" omit-xml-declaration="no"/>
6 <!-- Don't include non matching elements in output -->
7 <xsl:template match="text()"/>
8 <xsl:strip-space elements="*"/>
9
10 <!-- maybe a bit nicer way of adding a new line to the output -->
11 <xsl:variable name="newline"><xsl:text>
12 </xsl:text></xsl:variable>
13
14 <xsl:variable name="inputFileName">
15 <xsl:text>UserManual.xhtml</xsl:text>
16 </xsl:variable>
17
18 <xsl:template match="/">
19 <xsl:element name="QtHelpProject">
20 <xsl:attribute name="version">
21 <xsl:value-of select="format-number(1, '.0')" />
22 </xsl:attribute>
23 <xsl:value-of select="$newline" />
24 <xsl:element name="namespace">org.virtualbox</xsl:element>
25 <xsl:value-of select="$newline" />
26 <xsl:element name="virtualFolder">manual</xsl:element>
27 <xsl:value-of select="$newline" />
28 <xsl:element name="filterSection">
29 <xsl:value-of select="$newline" />
30 <xsl:element name="toc">
31 <xsl:apply-templates select="//xhtml:div[@class='toc']//xhtml:span[@class='chapter'] | //xhtml:div[@class='toc']//xhtml:span[@class='preface']"/>
32 </xsl:element><!-- toc -->
33 <xsl:value-of select="$newline" />
34 <!-- <xsl:element name="keywords"></xsl:element> -->
35 <xsl:value-of select="$newline" />
36 <xsl:element name="files">
37 <!-- ======================input html file(s)============================= -->
38 <xsl:value-of select="$newline" />
39 <!-- ====================chunked html input files========================== -->
40 <!-- Process div tag with class='toc'. For each space with class='chapter' -->
41 <!-- add a <file>ch(position()).html</file> assuming our docbook chunked html -->
42 <!-- files are named in this fashion. -->
43 <!-- <xsl:apply-templates select="//xhtml:div[@class='toc']//xhtml:span[@class='chapter']"/> -->
44 <!-- ====================single html input file========================== -->
45 <xsl:element name="file">
46 <xsl:value-of select="$inputFileName" />
47 </xsl:element>
48 <xsl:value-of select="$newline" />
49 <!-- ===================================================================== -->
50 <!-- ===================image files======================================= -->
51 <xsl:apply-templates select="//xhtml:img"/>
52 <!-- ===================================================================== -->
53
54 </xsl:element>
55 <xsl:value-of select="$newline" />
56 </xsl:element>
57 <xsl:value-of select="$newline" />
58 </xsl:element>
59 </xsl:template>
60
61 <!-- ===================toc related template(s)====================== -->
62 <xsl:template match="xhtml:span[@class='chapter'] | xhtml:span[@class='preface']">
63 <xsl:element name="section">
64 <xsl:attribute name="title">
65 <xsl:value-of select="*" />
66 </xsl:attribute>
67 <xsl:attribute name="ref">
68 <xsl:value-of select="$inputFileName" /><xsl:value-of select="xhtml:a/@href" />
69 </xsl:attribute>
70 </xsl:element>
71 <xsl:value-of select="$newline" />
72 </xsl:template>
73 <!-- ============================================================== -->
74
75 <xsl:template match="//xhtml:img">
76 <xsl:element name="file">
77 <xsl:value-of select="@src"/>
78 </xsl:element>
79 <xsl:value-of select="$newline" />
80 </xsl:template>
81
82
83</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

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