aboutsummaryrefslogtreecommitdiff
path: root/make.xsl
blob: f0739101120eb7a37b2f5923aba7336a4e295f1c (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xalan="http://xml.apache.org/xalan"
	xmlns:InputXSLT="function.inputxslt.application"
	exclude-result-prefixes="xalan InputXSLT"
>

<xsl:output
	method="xml"
	omit-xml-declaration="yes"
	encoding="UTF-8"
	indent="no"
/>

<xsl:template name="generate">
	<xsl:param name="input"/>
	<xsl:param name="transformation"/>

	<xsl:copy-of select="InputXSLT:generate(
		$input,
		string($transformation)
	)/self::generation/node()"/>
</xsl:template>

<xsl:template match="/">
	<xsl:variable name="source">source</xsl:variable>
	<xsl:variable name="target">target</xsl:variable>

	<xsl:variable name="list_source">
		<datasource>
			<xsl:value-of select="$source"/>
		</datasource>
	</xsl:variable>

	<xsl:variable name="plan_source">
		<datasource>
			<xsl:call-template name="generate">
				<xsl:with-param name="input" select="$list_source"/>
				<xsl:with-param name="transformation">list.xsl</xsl:with-param>
			</xsl:call-template>
			<meta>
				<source><xsl:value-of select="$source"/></source>
				<target><xsl:value-of select="$target"/></target>
			</meta>
		</datasource>
	</xsl:variable>

	<xsl:variable name="process_source">
		<xsl:call-template name="generate">
			<xsl:with-param name="input" select="$plan_source"/>
			<xsl:with-param name="transformation">plan.xsl</xsl:with-param>
		</xsl:call-template>
	</xsl:variable>

	<xsl:variable name="summarize_source">
		<xsl:call-template name="generate">
			<xsl:with-param name="input" select="$process_source"/>
			<xsl:with-param name="transformation">process.xsl</xsl:with-param>
		</xsl:call-template>
	</xsl:variable>

	<xsl:call-template name="generate">
		<xsl:with-param name="input" select="$summarize_source"/>
		<xsl:with-param name="transformation">summarize.xsl</xsl:with-param>
	</xsl:call-template>
</xsl:template>

</xsl:stylesheet>