1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <xsl:stylesheet version="2.0" |
---|
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
4 | |
---|
5 | <!-- Specification of the output document --> |
---|
6 | <xsl:output method="xml" version="1.0" encoding="UTF-8" |
---|
7 | indent="yes" /> |
---|
8 | |
---|
9 | <xsl:template match="/"> |
---|
10 | <xsl:apply-templates select="environment"/> |
---|
11 | </xsl:template> |
---|
12 | |
---|
13 | <xsl:template match="environment"> |
---|
14 | <xsl:copy > |
---|
15 | <xsl:copy-of select="@*" /> |
---|
16 | <xsl:apply-templates select="resources"/> |
---|
17 | </xsl:copy> |
---|
18 | </xsl:template> |
---|
19 | |
---|
20 | <xsl:template match="resources"> |
---|
21 | <xsl:copy copy-namespaces="no"> |
---|
22 | <xsl:apply-templates select="//resources/computingResource" /> |
---|
23 | <xsl:copy-of select="scheduler"/> |
---|
24 | </xsl:copy> |
---|
25 | </xsl:template> |
---|
26 | |
---|
27 | <xsl:template match="computingResource"> |
---|
28 | <xsl:copy copy-namespaces="no"> |
---|
29 | <xsl:copy-of select="@*" /> |
---|
30 | <!-- Find nested elements in appropriate order and copy them --> |
---|
31 | <!-- resourceUnit --> |
---|
32 | <xsl:apply-templates select="resourceUnit" /> |
---|
33 | <!-- parameter --> |
---|
34 | <xsl:apply-templates select="parameter" /> |
---|
35 | <!-- profile --> |
---|
36 | <xsl:apply-templates select="profile" /> |
---|
37 | <!-- location --> |
---|
38 | <xsl:apply-templates select="location" /> |
---|
39 | <!-- computingResource --> |
---|
40 | <xsl:apply-templates select="computingResource" /> |
---|
41 | </xsl:copy> |
---|
42 | </xsl:template> |
---|
43 | |
---|
44 | <xsl:template match="resourceUnit | parameter | profile | location"> |
---|
45 | <xsl:copy-of select="." copy-namespaces="no" /> |
---|
46 | </xsl:template> |
---|
47 | <!-- <xsl:template match="parameter">--> |
---|
48 | <!-- <xsl:copy-of select="." copy-namespaces="no" />--> |
---|
49 | <!-- </xsl:template>--> |
---|
50 | <!-- <xsl:template match="profile">--> |
---|
51 | <!-- <xsl:copy-of select="." copy-namespaces="no" />--> |
---|
52 | <!-- </xsl:template>--> |
---|
53 | <!-- <xsl:template match="location">--> |
---|
54 | <!-- <xsl:copy-of select="." copy-namespaces="no" />--> |
---|
55 | <!-- </xsl:template>--> |
---|
56 | |
---|
57 | </xsl:stylesheet> |
---|