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 March 20th, 2006, 04:33 AM
Registered User
 
Join Date: Mar 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Newbie quick question

<cost>
<time value="Season">
<openingtype>1</openingtype>
<price>£3</price>
</time>
<time value="OffSeason">
<openingtype>2</openingtype>
<price>£1</price>
</time>
</cost>

Hi, I need to access the variables in side this chunk of XML code and am unsure of how to go about it. I need the xslt to specify 'Season' or 'OffSeason' and get the according 'openingtype' and 'price'. At the moment when I try <xsl:value-of select="cost/time/openingtype"/> and <xsl:value-of select="cost/time/price"/> the xslt returns the code as that for the 'Season' time value.

Any help would be greatly appreciated.

Andy



 
Old March 20th, 2006, 05:05 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is what predicates are for.

select="cost/time[@value=$xxx]/price"

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
Quick Question! arcadium Java GUI 1 August 5th, 2008 02:16 AM
quick question treasacrowe Classic ASP Databases 2 August 30th, 2004 08:27 AM
Quick Question Ben Horne Forum and Wrox.com Feedback 1 March 22nd, 2004 03:29 PM
Quick If Then Question hcweb Classic ASP Basics 2 March 13th, 2004 02:13 PM





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