Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Choosing right element Choosing right elementTo: NULL Date: 5/7/2007 1:42:00 PM
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>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
