[477] | 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="taskId"><xsl:value-of select="@taskId"/></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:if test="stageInOut"> |
---|
| 82 | <xsl:element name="execution"> |
---|
| 83 | <xsl:apply-templates select="stageInOut" mode="COPY_OF_MODE"/> |
---|
| 84 | </xsl:element> |
---|
| 85 | </xsl:if> |
---|
| 86 | </xsl:template> |
---|
| 87 | <!-- =====================================================================================================================--> |
---|
| 88 | <xsl:template match="stageInOut" mode="COPY_OF_MODE"> |
---|
| 89 | <xsl:element name="stageInOut"> |
---|
| 90 | <xsl:apply-templates select="*" mode="COPY_OF_MODE"/> |
---|
| 91 | </xsl:element> |
---|
| 92 | </xsl:template> |
---|
| 93 | <!-- =====================================================================================================================--> |
---|
| 94 | <xsl:template match="file | directory" mode="COPY_OF_MODE"> |
---|
| 95 | <xsl:element name="{name()}"> |
---|
| 96 | <xsl:attribute name="name"> |
---|
| 97 | <xsl:value-of select="@name"/> |
---|
| 98 | </xsl:attribute> |
---|
| 99 | <xsl:attribute name="type"> |
---|
| 100 | <xsl:value-of select="@type"/> |
---|
| 101 | </xsl:attribute> |
---|
| 102 | <xsl:if test="@size"> |
---|
| 103 | <xsl:attribute name="size"> |
---|
| 104 | <xsl:value-of select="@size"/> |
---|
| 105 | </xsl:attribute> |
---|
| 106 | </xsl:if> |
---|
| 107 | <xsl:if test="@required"> |
---|
| 108 | <xsl:attribute name="required"> |
---|
| 109 | <xsl:value-of select="@required"/> |
---|
| 110 | </xsl:attribute> |
---|
| 111 | </xsl:if> |
---|
| 112 | <xsl:apply-templates select="*" mode="COPY_OF_MODE"/> |
---|
| 113 | </xsl:element> |
---|
| 114 | </xsl:template> |
---|
| 115 | <!-- =====================================================================================================================--> |
---|
| 116 | <xsl:template match="*" mode="COPY_OF_MODE"> |
---|
| 117 | <xsl:choose> |
---|
| 118 | <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> |
---|
| 119 | <xsl:otherwise><xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element></xsl:otherwise> |
---|
| 120 | </xsl:choose> |
---|
| 121 | </xsl:template> |
---|
| 122 | <!-- =====================================================================================================================--> |
---|
| 123 | <xsl:template match="*"> |
---|
| 124 | !!! BRAK OBSLUGI DLA <xsl:value-of select="name()"/> !!! |
---|
| 125 | </xsl:template> |
---|
| 126 | <!-- =====================================================================================================================--> |
---|
| 127 | </xsl:transform> |
---|