root/trunk/gsdl3/dist-resources/convert-build-xml-source.xsl @ 10908

Revision 10908, 2.0 KB (checked in by kjdon, 15 years ago)

another xsl file for modifying the build.xml - this time for a source distribution

  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <!-- we basically want to copy everything except for a few targets that no longer apply -->
6  <xsl:output method="xml"/>
7
8  <!-- for some reason, the default copy-of doesn't copy empty attributes, so have this to get the empty arg1 in equals-->
9  <xsl:template match="project|condition|and|isset|equals|not|or">
10    <xsl:copy>
11      <xsl:copy-of select="@*"/>
12      <!--<xsl:for-each select="@*">
13    <xsl:attribute name="name()"><xsl:value-of select="."/></xsl:attribute>
14      </xsl:for-each>-->
15      <xsl:apply-templates/>
16    </xsl:copy>
17  </xsl:template>
18 
19  <!-- delete the install-for-dist target-->
20  <xsl:template match="target[@name='install-for-dist']">
21  </xsl:template>
22   
23  <!-- delete the unnecessary targets -->
24  <xsl:template match="target[starts-with(@name, 'prepare')]">
25  </xsl:template>
26  <xsl:template match="target[starts-with(@name, 'cvsupdate')]">
27  </xsl:template>
28  <xsl:template match="target[starts-with(@name, 'update')]">
29  </xsl:template>
30 
31  <!-- save the prepare-tomcat and prepare-mysql targets -->
32  <xsl:template match="target[@name='prepare-tomcat']">
33    <xsl:copy-of select="."/>
34  </xsl:template>
35  <xsl:template match="target[@name='prepare-tomcat-compat']">
36    <xsl:copy-of select="."/>
37  </xsl:template>
38  <xsl:template match="target[@name='prepare-mysql']">
39    <xsl:copy-of select="."/>
40  </xsl:template>
41  <xsl:template match="target[@name='prepare-web']">
42    <xsl:copy-of select="."/>
43  </xsl:template>
44  <!-- rename the 'prepare-for-source' target 'prepare' -->
45  <xsl:template match="target[@name='prepare-for-source']">
46    <target name="prepare">
47      <xsl:copy-of select="@depends|@description|@if|@unless|node()"/>
48    </target>
49  </xsl:template>
50
51
52  <xsl:template match="*">
53    <xsl:copy-of select="."/>
54  </xsl:template>
55
56  <xsl:template match="comment()">
57    <xsl:copy-of select="."/>
58    <xsl:text>
59</xsl:text>
60  </xsl:template>
61   
62</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.