File: moin2chpt.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 (39 lines) | stat: -rw-r--r-- 736 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
<?xml version="1.0" encoding="utf-8" ?>
<!-- vim: set sts=2 ai expandtab:

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

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

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

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

<xsl:template match="/">
    <xsl:apply-templates select="/article/section[2]"/>
</xsl:template>

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

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


</xsl:stylesheet>