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 19th, 2008, 12:57 PM
Registered User
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple criteria on a select query?

Can I use something like that:

<xsl:value-of select="path1[criteria1]path2[criteria2]element/text()">

What I am trying to do is selecting one name/value pair value after another from several named name/value sets.

Thanks!
JB

 
Old March 19th, 2008, 01:01 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

What you have is not syntactically correct. You might want
Code:
<xsl:value-of select="path1[criteria1]/path2[criteria2]/element/text()"/>
 
Old March 19th, 2008, 01:25 PM
Registered User
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Syntactically correct or not - it is unimportant. What I would like to know is whether I can have multiple criteria or not. Does your snippet work? I am in Biztalk and that does not work for me for some reason.

 
Old March 19th, 2008, 01:33 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

You can have multiple predicates e.g.
  foo[predicate1][predicate2]
You can also use boolean operators 'and' or 'or' e.g.
  foo[predicate1 and predicate2]
  foo[predicate1 or predicate2]

As for a working snippet, you will need to post the input XML first to allow us the suggest an XPath expression specific to that input.

 
Old March 19th, 2008, 01:52 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's no point saying something doesn't work unless you tell us exactly what you did and exactly how it failed.

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
IIF multiple criteria stealthdevil Access VBA 10 November 28th, 2007 11:37 AM
Select first child node that matches criteria priya81 XSLT 4 July 3rd, 2007 10:32 AM
Multiple criteria for a Report stealthdevil Access VBA 33 June 8th, 2006 10:38 AM
Criteria query with multiple fields penta Access 8 October 25th, 2004 11:54 AM
select rows based on a criteria and paste ashu_gupta75 Excel VBA 2 July 30th, 2004 01:32 AM





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