A
anitawa
Hi. I have a dilemma. Here is my xml.
<time>
<hour>1</hour>
<minute>0</minute>
</time>
<time timezone="PST">
<hour>1</hour>
<minute>15</hour>
</time>
<time timezone="EST">
<hour>2</hour>
<minute>20</minute>
</time>
<time timezone="TOK">
<hour>15</hour>
<minute>45</minute>
</time>
I want to choose only one of these <time> depending on system timezone
(variable $tz). If there is no system time defined, then it would
choose the first element with no timezone. Here is my xslt, but its
not working correctly.
<xsl:choose>
<xsl:when test="@timezone=$tz">
<xsl:value-of select="."/>
</xsl:when>
<xsltherwise>
<xsl:value-of select="."/>
</xsltherwise>
</xsl:choose>
<time>
<hour>1</hour>
<minute>0</minute>
</time>
<time timezone="PST">
<hour>1</hour>
<minute>15</hour>
</time>
<time timezone="EST">
<hour>2</hour>
<minute>20</minute>
</time>
<time timezone="TOK">
<hour>15</hour>
<minute>45</minute>
</time>
I want to choose only one of these <time> depending on system timezone
(variable $tz). If there is no system time defined, then it would
choose the first element with no timezone. Here is my xslt, but its
not working correctly.
<xsl:choose>
<xsl:when test="@timezone=$tz">
<xsl:value-of select="."/>
</xsl:when>
<xsltherwise>
<xsl:value-of select="."/>
</xsltherwise>
</xsl:choose>