Do not add 00:00:00-05:00 when time element is blank
I have xml code with 2 elements one for timeServed and the other for dateServed. When timeServed element is empty, my xslt is showing <ServiceTime>00:00:00-05:00</ServiceTime>. Instead I want this <ServiceTime></ServiceTime> displayed.
I think I can add an If statement to the xslt code below to check if the timeserved is blank and if it is do not display anything. i.e do not display the 00:00:00-05:00.
How do I do this?
Desired output
<ServiceDate>2014-10-08</ServiceDate>
<ServiceTime></ServiceTime>
Current output which is wrong
<ServiceDate>2014-10-08</ServiceDate>
<ServiceTime>00:00:00-05:00</ServiceTime>
My XML code
dateServed="10/08/2014"
timeServed=""
My XSLT code. I have concatenated time dateserved and timeserved together using a function mscef:formatTime
<ServiceTime>
<xsl:value-of select="mscef:formatTime(concat(@dateServed,' ',@timeServed))"/>
</ServiceTime>
|