import torrus 1.0.9
[freeside.git] / torrus / scripts / xml / extract-skeleton.xsl
1 <?xml version="1.0"?>
2 <!--
3    Copyright (C) 2002  Stanislav Sinyagin
4  
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9  
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14  
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18
19   $Id: extract-skeleton.xsl,v 1.1 2010-12-27 00:04:04 ivan Exp $
20   Stanislav Sinyagin <ssinyagin@yahoo.com>
21
22   XSLT Template to transform Torrus configuration into a skeleton of
23   subtrees and leaves only.
24
25 -->
26
27 <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
28
29 <xsl:output method="xml" encoding="UTF-8" indent="yes" />
30 <xsl:strip-space elements="*" />
31
32 <xsl:template match="/configuration">
33   <configuration>
34     <creator-info>
35       This file is a result of extract-skeleton.xsl template
36     </creator-info>
37     <xsl:text>
38     </xsl:text>
39     <xsl:apply-templates />
40   </configuration>
41 </xsl:template>
42
43
44 <xsl:template match="creator-info">
45   <creator-info>
46     <xsl:value-of select="." />
47   </creator-info>
48   <xsl:text>
49   </xsl:text>
50 </xsl:template>
51
52
53 <xsl:template match="datasources">
54   <datasources>
55     <xsl:apply-templates />
56   </datasources>
57     <xsl:text>
58     </xsl:text>
59 </xsl:template>
60
61
62 <xsl:template match="subtree">
63   <xsl:text>
64   </xsl:text>
65   <subtree name="{@name}">
66     <xsl:text> </xsl:text>
67     <xsl:apply-templates />
68   </subtree>
69   <xsl:text>
70   </xsl:text>
71 </xsl:template>
72
73
74 <xsl:template match="leaf">
75   <xsl:text>
76   </xsl:text>
77   <leaf name="{@name}">
78     <xsl:text> </xsl:text>
79     <xsl:apply-templates />
80   </leaf>
81   <xsl:text>
82   </xsl:text>
83 </xsl:template>
84
85
86 </xsl:transform>
87