Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old November 29th, 2007, 09:50 AM
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
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.
Reply With Quote
  #12 (permalink)  
Old November 29th, 2007, 09:56 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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 -/
Reply With Quote
  #13 (permalink)  
Old November 29th, 2007, 09:58 AM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
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
Reply With Quote
  #14 (permalink)  
Old November 29th, 2007, 12:59 PM
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default

hey, thanks it worked perfect!!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:25 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.