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 November 29th, 2007, 09:50 AM
Authorized User
 
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default

hey,
here is my XML:
<Banks>
  <Bank>
    <nsc>000000</nsc>
    <bank>Clears through Bank name</bank>
    <branch>london uk</branch>
  </Bank>
  <Bank>
    <nsc>111111</nsc>
    <bank>Clears through Bank name</bank>
    <branch>Dublin Irl</branch>
  </Bank>
  <Bank>
    <nsc>000000</nsc>
    <bank>Clears through Bank name</bank>
    <branch>Manc uk</branch>
  </Bank>
  <Bank>
    <nsc>111111</nsc>
    <bank>Bank two</bank>
    <branch>Dublin Irl</branch>
  </Bank>

</Banks>

so I have drop down with a lis distinct bank, once they select the bank a 2nd drop down shows list of distinct branch.
once they select the branch, i was to display the <nsc> value.

<Banks> is root node
<Bank> is parent
<bank> and <nsc> are siblings .. you can correct me there im relatively new to XML.
 
Old November 29th, 2007, 09:56 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The following xpath should get you the nsc element:

/Banks/Bank/nsc[../bank='A' and ../branch='B']

/- Sam Judson : Wrox Technical Editor -/
 
Old November 29th, 2007, 09:58 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Well yes, you would expect an expression passed to SelectNodes() to evaluate to a node-set, and an expression that uses the "and" operator will evaluate to a boolean. So what result were you expecting for your expression?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 29th, 2007, 12:59 PM
Authorized User
 
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default

hey, thanks it worked perfect!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
xpath contains error 'has an invalid token' XMLUser XSLT 7 February 5th, 2008 02:31 AM
Invalid Token sani723 XSLT 2 December 25th, 2007 01:42 AM
error LNK2020 unresolved token rachappa Visual C++ 1 January 12th, 2006 08:05 AM
WSE 2.0 Sending Username Token jpitzer .NET Web Services 2 April 28th, 2005 02:17 PM
Unrecognized token was found Dennis Huisman BOOK: Professional Crystal Reports for VS.NET 0 September 6th, 2004 07:08 AM





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