Subject: XSLT - test the value is true or false
Posted By: haixia Post Date: 8/21/2006 12:59:52 PM
Hi,

I am trying to test if the value of Time=Open Date, if yes, then print out Title and price. Can some one tell me how to compare the value? This is what I did, but it did not work.
<xsl:if test="Category/Book/Time='Open Date'"/>

Ex:
<Category>
 <Book>
  <Title>XSLT</Title>
  <Time>Open Date</Time>
  <Price>10.88</Price>
 </Book>
</Category>

Thanks,
Hx


Reply By: mhkay Reply Date: 8/21/2006 1:38:18 PM
The code you have shown is correct, so your error must be in code that you haven't shown. Perhaps the context node was wrong.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

Go to topic 48638

Return to index page 198
Return to index page 197
Return to index page 196
Return to index page 195
Return to index page 194
Return to index page 193
Return to index page 192
Return to index page 191
Return to index page 190
Return to index page 189