chelnak
12/9/2014 - 12:35 PM

vRA LeaseAboutToExpire.xslt date

vRA LeaseAboutToExpire.xslt date

<!-- This bit goes after <xsl:template match="/"> -->

<xsl:variable name="dd">
	<xsl:value-of select="substring(//VirtualMachineEx/Expires, 9,2)" />
</xsl:variable>

<xsl:variable name="mm">
	<xsl:value-of select="substring(//VirtualMachineEx/Expires, 6,2)" />
</xsl:variable>
	
<xsl:variable name="yyyy">
	<xsl:value-of select="substring(//VirtualMachineEx/Expires, 1,4)" />
</xsl:variable>

<xsl:variable name="time">
	<xsl:value-of select="substring(//VirtualMachineEx/Expires, 12,5)" />
</xsl:variable>

<!-- 
As I was only interested in changing notification for single machine 
deployments at this time I put the following after <xsl:otherwise>
-->

The lease for Virtual Machine <xsl:value-of select="//VirtualMachineEx/Name"/> will expire on 
		
<xsl:value-of select="$dd" />/<xsl:value-of select="$mm" />/<xsl:value-of select="$yyyy" />
		
at <xsl:value-of select="$time" />.

<!-- 
You will get the following output:
The lease for Virtual Machine VM-01 will expire on 09/12/2014 at 12:00
-->