1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
3 | xmlns:xalan="http://xml.apache.org/xalan" |
---|
4 | extension-element-prefixes="xalan"> |
---|
5 | <xsl:strip-space elements="*"/> |
---|
6 | <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/> |
---|
7 | |
---|
8 | <xsl:param name="JOB_ID"/> |
---|
9 | <xsl:param name="USER_DN"/> |
---|
10 | <xsl:param name="SUBMISSION_TIME"/> |
---|
11 | <!-- <xsl:param name="DOMAIN"/> --> |
---|
12 | <!-- =====================================================================================================================--> |
---|
13 | <xsl:variable name="DEFAULT_FAULT_TOLERANCE" select="/task/faultTolerance"/> |
---|
14 | <xsl:variable name="COMP_RES_TEMPLATE" select="/task/requirements/resourceTemplates/computingResourceTemplate"/> |
---|
15 | <xsl:variable name="NET_RES_TEMPLATE" select="/task/requirements/resourceTemplates/networkResourceTemplate"/> |
---|
16 | <!-- =====================================================================================================================--> |
---|
17 | <xsl:template match="/"> |
---|
18 | |
---|
19 | <xsl:apply-templates select="task"/> |
---|
20 | |
---|
21 | </xsl:template> |
---|
22 | <!-- =====================================================================================================================--> |
---|
23 | <xsl:template match="task"> |
---|
24 | <xsl:element name="task"> |
---|
25 | |
---|
26 | <xsl:attribute name="jobId"><xsl:value-of select="$JOB_ID"/></xsl:attribute> |
---|
27 | <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> |
---|
28 | <xsl:attribute name="userDN"><xsl:value-of select="$USER_DN"/></xsl:attribute> |
---|
29 | <xsl:attribute name="submissionTime"><xsl:value-of select="$SUBMISSION_TIME"/></xsl:attribute> |
---|
30 | <!-- <xsl:attribute name="domain"><xsl:value-of select="$DOMAIN"/></xsl:attribute> --> |
---|
31 | <xsl:if test="@extension"> |
---|
32 | <xsl:attribute name="extension"><xsl:value-of select="@extension"/></xsl:attribute> |
---|
33 | </xsl:if> |
---|
34 | <xsl:if test="@priority"> |
---|
35 | <xsl:attribute name="priority"><xsl:value-of select="@priority"/></xsl:attribute> |
---|
36 | </xsl:if> |
---|
37 | |
---|
38 | <xsl:apply-templates select="description" mode="COPY_OF_MODE"/> |
---|
39 | <xsl:apply-templates select="proxyInfo" mode="COPY_OF_MODE"/> |
---|
40 | <xsl:apply-templates select="candidateHosts" mode="COPY_OF_MODE"/> |
---|
41 | |
---|
42 | <xsl:apply-templates select="requirements" mode="COPY_OF_MODE"/> |
---|
43 | |
---|
44 | <xsl:apply-templates select="execution" mode="COPY_OF_MODE"/> |
---|
45 | |
---|
46 | <xsl:apply-templates select="executionTime" mode="COPY_OF_MODE"/> |
---|
47 | <xsl:apply-templates select="workflow" mode="COPY_OF_MODE"/> |
---|
48 | </xsl:element> |
---|
49 | </xsl:template> |
---|
50 | <!-- =====================================================================================================================--> |
---|
51 | <xsl:template match="requirements" mode="COPY_OF_MODE"> |
---|
52 | <xsl:element name="requirements"> |
---|
53 | <xsl:apply-templates select="resourceRequirements" mode="COPY_OF_MODE"/> |
---|
54 | <xsl:apply-templates select="topology" mode="COPY_OF_MODE"/> |
---|
55 | </xsl:element> |
---|
56 | </xsl:template> |
---|
57 | <!-- =====================================================================================================================--> |
---|
58 | <xsl:template match="computingResource" mode="COPY_OF_MODE"> |
---|
59 | <xsl:element name="computingResource"> |
---|
60 | <xsl:attribute name="resourceId"><xsl:value-of select="@resourceId"/></xsl:attribute> |
---|
61 | <xsl:apply-templates mode="COPY_OF_MODE"/> |
---|
62 | <xsl:if test="not(faultTolerance)"> |
---|
63 | <xsl:apply-templates select="$DEFAULT_FAULT_TOLERANCE" mode="COPY_OF_MODE"/> |
---|
64 | </xsl:if> |
---|
65 | </xsl:element> |
---|
66 | </xsl:template> |
---|
67 | <!-- =====================================================================================================================--> |
---|
68 | <xsl:template match="templateIdReference" mode="COPY_OF_MODE"> |
---|
69 | <xsl:variable name="TEMPLATE_ID" select="."/> |
---|
70 | <xsl:choose> |
---|
71 | <xsl:when test="name(..) = 'computingResource'"> |
---|
72 | <xsl:apply-templates select="$COMP_RES_TEMPLATE[@templateId = $TEMPLATE_ID]/*" mode="COPY_OF_MODE"/> |
---|
73 | </xsl:when> |
---|
74 | <xsl:when test="name(..) = 'networkResource'"> |
---|
75 | <xsl:apply-templates select="$NET_RES_TEMPLATE[@templateId = $TEMPLATE_ID]/*" mode="COPY_OF_MODE"/> |
---|
76 | </xsl:when> |
---|
77 | </xsl:choose> |
---|
78 | </xsl:template> |
---|
79 | <!-- =====================================================================================================================--> |
---|
80 | <xsl:template match="execution" mode="COPY_OF_MODE"> |
---|
81 | <xsl:element name="execution"> |
---|
82 | <xsl:apply-templates select="executable" mode="COPY_OF_MODE"/> |
---|
83 | <xsl:apply-templates select="resourceConsumptionProfile" mode="COPY_OF_MODE"/> |
---|
84 | <xsl:apply-templates select="stdin" mode="COPY_OF_MODE"/> |
---|
85 | <xsl:apply-templates select="stdout" mode="COPY_OF_MODE"/> |
---|
86 | </xsl:element> |
---|
87 | </xsl:template> |
---|
88 | <!-- =====================================================================================================================--> |
---|
89 | <xsl:template match="stageInOut" mode="COPY_OF_MODE"> |
---|
90 | <xsl:element name="stageInOut"> |
---|
91 | <xsl:apply-templates select="*" mode="COPY_OF_MODE"/> |
---|
92 | </xsl:element> |
---|
93 | </xsl:template> |
---|
94 | <!-- =====================================================================================================================--> |
---|
95 | <xsl:template match="file | directory" mode="COPY_OF_MODE"> |
---|
96 | <xsl:element name="{name()}"> |
---|
97 | <xsl:attribute name="name"> |
---|
98 | <xsl:value-of select="@name"/> |
---|
99 | </xsl:attribute> |
---|
100 | <xsl:attribute name="type"> |
---|
101 | <xsl:value-of select="@type"/> |
---|
102 | </xsl:attribute> |
---|
103 | <xsl:if test="@size"> |
---|
104 | <xsl:attribute name="size"> |
---|
105 | <xsl:value-of select="@size"/> |
---|
106 | </xsl:attribute> |
---|
107 | </xsl:if> |
---|
108 | <xsl:if test="@required"> |
---|
109 | <xsl:attribute name="required"> |
---|
110 | <xsl:value-of select="@required"/> |
---|
111 | </xsl:attribute> |
---|
112 | </xsl:if> |
---|
113 | <xsl:apply-templates select="*" mode="COPY_OF_MODE"/> |
---|
114 | </xsl:element> |
---|
115 | </xsl:template> |
---|
116 | <!-- =====================================================================================================================--> |
---|
117 | <xsl:template match="*" mode="COPY_OF_MODE"> |
---|
118 | <xsl:choose> |
---|
119 | <xsl:when test="node()"><xsl:element name="{name()}"><xsl:copy-of select="@*"/><xsl:apply-templates select="node()" mode="COPY_OF_MODE"/></xsl:element></xsl:when> |
---|
120 | <xsl:otherwise><xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element></xsl:otherwise> |
---|
121 | </xsl:choose> |
---|
122 | </xsl:template> |
---|
123 | <!-- =====================================================================================================================--> |
---|
124 | <xsl:template match="*"> |
---|
125 | !!! BRAK OBSLUGI DLA <xsl:value-of select="name()"/> !!! |
---|
126 | </xsl:template> |
---|
127 | <!-- =====================================================================================================================--> |
---|
128 | </xsl:transform> |
---|