File: moin2test.xsl

package info (click to toggle)
debian-reference 2.24
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 20,088 kB
  • ctags: 35
  • sloc: xml: 70,510; sh: 616; makefile: 352; perl: 221; sed: 3
file content (52 lines) | stat: -rw-r--r-- 1,412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="utf-8" ?>
<!-- vim: set sts=2 ai expandtab:

TEST Convert wiki page generated raw.xml to chapter
URL links cleaned as "&url-*;".
Table are not touched.

General:
 Drop <article>
 Drop <section> except second one
 Use second <section> and if requested change it to <chapter>

Add tags:
 * warning:	added for para with /!\
 * caution:	added for para with <!>
 * important:	added for para with {*}
 * tip:		added for para with {i}
 * note:	added for para with (!)
 * note:	added for para with (./)
 * note:	added for para with {OK}

-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:variable name="uletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 !#$%()=-~^|\/+*,.?;:@`&quot;&apos;&amp;&gt;&lt;</xsl:variable>
<xsl:variable name="lletters">abcdefghijklmnopqrstuvwxyzabcdefghij</xsl:variable>

<xsl:output method="xml" indent="yes"/>

<!-- xsl:strip-space elements="*"/ -->

<xsl:template match="para">
  <xsl:copy>
    <!-- xsl:value-of select="concat(substring(translate(.,$uletters,$lletters),1,8),substring(translate(.,$uletters,$lletters), string-length(translate(.,$uletters,$lletters))-7,8))"/ -->
    <xsl:value-of select="(translate(.,$uletters,$lletters))"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>


</xsl:stylesheet>