VirtualBox

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

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

bugref:9831. Using UserManual.xhtml rather than UserManual.html for qHelp collection file creation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 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:template match="/">
15 <xsl:element name="QtHelpProject">
16 <xsl:attribute name="version">
17 <xsl:value-of select="format-number(1, '.0')" />
18 </xsl:attribute>
19 <xsl:value-of select="$newline" />
20 <xsl:element name="namespace">org.virtualbox</xsl:element>
21 <xsl:value-of select="$newline" />
22 <xsl:element name="virtualFolder">manual</xsl:element>
23 <xsl:value-of select="$newline" />
24 <xsl:element name="filterSection">
25 <!-- No keywords and toc for now -->
26 <!-- <xsl:value-of select="$newline" /> -->
27 <!-- <xsl:element name="toc"></xsl:element> -->
28 <!-- <xsl:value-of select="$newline" /> -->
29 <!-- <xsl:element name="keywords"></xsl:element> -->
30 <xsl:value-of select="$newline" />
31 <xsl:element name="files">
32 <!-- ======================input html file(s)============================= -->
33 <xsl:value-of select="$newline" />
34 <!-- ====================chunked html input files========================== -->
35 <!-- Process div tag with class='toc'. For each space with class='chapter' -->
36 <!-- add a <file>ch(position()).html</file> assuming our docbook chunked html -->
37 <!-- files are named in this fashion. -->
38 <!-- <xsl:apply-templates select="//xhtml:div[@class='toc']//xhtml:span[@class='chapter']"/> -->
39 <!-- ====================single html input file========================== -->
40 <xsl:element name="file">
41 <xsl:text>UserManual.xhtml</xsl:text>
42 </xsl:element>
43 <xsl:value-of select="$newline" />
44 <!-- ===================================================================== -->
45 <!-- ===================image files======================================= -->
46 <xsl:apply-templates select="//xhtml:img"/>
47 <!-- ===================================================================== -->
48
49 </xsl:element>
50 <xsl:value-of select="$newline" />
51 </xsl:element>
52 <xsl:value-of select="$newline" />
53 </xsl:element>
54 </xsl:template>
55
56 <xsl:template match="xhtml:span[@class='chapter']">
57 <xsl:element name="file">
58 <xsl:text>ch</xsl:text>
59 <xsl:value-of select="format-number(position(), '00')"/>
60 <xsl:text>.html</xsl:text>
61 </xsl:element>
62 <xsl:value-of select="$newline" />
63 </xsl:template>
64
65
66 <xsl:template match="//xhtml:img">
67 <xsl:element name="file">
68 <xsl:value-of select="@src"/>
69 </xsl:element>
70 <xsl:value-of select="$newline" />
71 </xsl:template>
72
73
74</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