Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Choosing right element

From: anitawa <anitawa@-----.--->
To: 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>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent