/[gentoo]/xml/htdocs/xsl/guidexml2wiki.xsl
Gentoo

Diff of /xml/htdocs/xsl/guidexml2wiki.xsl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
11 exclude-result-prefixes="opensearch feed" 11 exclude-result-prefixes="opensearch feed"
12 12
13 extension-element-prefixes="exslt func dyn str" > 13 extension-element-prefixes="exslt func dyn str" >
14 14
15<xsl:output encoding="UTF-8" method="text" indent="no" /> 15<xsl:output encoding="UTF-8" method="text" indent="no" />
16<xsl:preserve-space elements="li p pre" /> 16<xsl:preserve-space elements="pre" />
17<!-- <xsl:preserve-space elements="li p pre" /> -->
17 18
18<xsl:template match="guide"><xsl:apply-templates /> 19<xsl:template match="guide"><xsl:apply-templates />
20<xsl:if test="//guide/author[not(@title='script generated')]">
19== Acknowledgements == 21== Acknowledgements ==
20 22
21We would like to thank the following authors and editors for their contributions to this guide: 23We would like to thank the following authors and editors for their contributions to this guide:
22<xsl:for-each select="//guide/author"> 24<xsl:for-each select="//guide/author">
23* <xsl:value-of select="mail" /> 25* <xsl:value-of select="mail" />
24</xsl:for-each> 26</xsl:for-each>
27</xsl:if>
25 28
26[[Category:Server and Security]] 29[[Category:Server and Security]]
27</xsl:template> 30</xsl:template>
28 31
29<xsl:template match="author" /> 32<xsl:template match="author" />
30 33
31<xsl:template match="abstract" /> 34<xsl:template match="abstract" />
32 35
33<xsl:template match="chapter"> 36<xsl:template match="chapter">
34 37
35== <xsl:value-of select="title" /> == 38== <xsl:value-of select="title" /> ==<xsl:text>
39
40</xsl:text>
36<xsl:apply-templates /> 41<xsl:apply-templates />
37</xsl:template> 42</xsl:template>
38 43
39<xsl:template match="section"> 44<xsl:template match="section">
40<xsl:if test="preceding-sibling::section"><xsl:text> 45<xsl:if test="preceding-sibling::section"><xsl:text>
41</xsl:text> 46</xsl:text>
42</xsl:if> 47</xsl:if>
48<xsl:if test="title">
43=== <xsl:value-of select="title" /> === 49=== <xsl:value-of select="title" /> ===
50</xsl:if>
44 51
45<xsl:apply-templates /> 52<xsl:apply-templates />
46</xsl:template> 53</xsl:template>
47 54
55<xsl:template match="body"><xsl:apply-templates /></xsl:template>
56
57<!--
58 i is for in-pre commands, we cannot support that easily as we have no
59 knowledge of what needs to be RootCmd, UserCmd, what is output, etc.
60-->
61<xsl:template match="i"><xsl:apply-templates /></xsl:template>
62
63<xsl:template match="mail"><xsl:choose><xsl:when test="link">{{Mail|<xsl:value-of select="@link" />|<xsl:value-of select="text()" />}}</xsl:when><xsl:otherwise>{{Mail|<xsl:value-of select="text()" />}}</xsl:otherwise></xsl:choose></xsl:template>
64
65<xsl:template match="p"><xsl:apply-templates /><xsl:text>
66
67</xsl:text>
68</xsl:template>
69
48<xsl:template match="p"> 70<xsl:template match="br" />
49<xsl:apply-templates /><xsl:text> 71<xsl:template match="license" />
50 72
51</xsl:text> 73<!--
52</xsl:template> 74 var is formatting in pre, difficult to handle this
75-->
76<xsl:template match="var"><xsl:apply-templates /></xsl:template>
53 77
54<xsl:template match="uri"><xsl:choose><xsl:when test="starts-with(@link, 'http')">[<xsl:value-of select="@link" /><xsl:text> </xsl:text><xsl:value-of select="text()" />]</xsl:when><xsl:otherwise> [[INTERNAL <xsl:value-of select="@link" />]] </xsl:otherwise></xsl:choose></xsl:template> 78<!--
79 stmt is formatting in pre, difficult to handle this
80-->
81<xsl:template match="stmt"><xsl:apply-templates /></xsl:template>
82
83<!--
84 const is formatting in pre, difficult to handle this
85-->
86<xsl:template match="const"><xsl:apply-templates /></xsl:template>
87
88<xsl:template match="uri"><xsl:text> </xsl:text><xsl:choose><xsl:when test="starts-with(@link, 'http')">[<xsl:value-of select="@link" /><xsl:text> </xsl:text><xsl:value-of select="normalize-space(text())" />]</xsl:when><xsl:when test="not(starts-with(@link, '#'))">[http://www.gentoo.org/<xsl:value-of select="@link"/><xsl:text> </xsl:text><xsl:value-of select="normalize-space(text())" />]</xsl:when></xsl:choose><xsl:text> </xsl:text></xsl:template>
55 89
56<xsl:template match="e"> ''<xsl:apply-templates />'' </xsl:template> 90<xsl:template match="e"> ''<xsl:apply-templates />'' </xsl:template>
57 91
58<xsl:template match="ul"> 92<xsl:template match="ul">
59<xsl:apply-templates /><xsl:text> 93<xsl:apply-templates /><xsl:text>
157</xsl:template> 191</xsl:template>
158 192
159<xsl:template match="text()"> 193<xsl:template match="text()">
160<xsl:choose> 194<xsl:choose>
161<xsl:when test="ancestor::pre"><xsl:value-of select="." /></xsl:when> 195<xsl:when test="ancestor::pre"><xsl:value-of select="." /></xsl:when>
162<xsl:otherwise> 196<xsl:otherwise><xsl:value-of select="normalize-space()" /></xsl:otherwise>
163<xsl:value-of select="normalize-space()" />
164</xsl:otherwise>
165</xsl:choose> 197</xsl:choose>
166</xsl:template> 198</xsl:template>
167 199
168</xsl:stylesheet> 200</xsl:stylesheet>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20