Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2006, 12:59 PM
Authorized User
 
Join Date: Aug 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT - test the value is true or false

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


 
Old August 21st, 2006, 01:38 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is 9:00 > 08:30 true or false? cJeffreywang ASP.NET 2.0 Basics 5 February 3rd, 2008 12:16 AM
boolean value shows true and false in the datagrid debjanib ASP.NET 2.0 Basics 2 March 23rd, 2007 08:38 AM
XSLT - Function to test value haixia XSLT 5 August 14th, 2006 09:31 AM
Boolean True/False to Yes/No peterasimpson VB How-To 2 February 6th, 2006 07:58 PM
Yes/No in DB showing True/False in ASP query miller2000 Classic ASP Databases 2 June 17th, 2004 10:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.