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
  #1 (permalink)  
Old February 3rd, 2008, 02:09 PM
Registered User
 
Join Date: Feb 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default xpath contains error 'has an invalid token'

Criteria/Students/Student/Name[last='Robert'&&first=''&&middle='']

i am getting an error invalid token.
can any help me in this regards

Reply With Quote
  #2 (permalink)  
Old February 3rd, 2008, 02:11 PM
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

Replace "&&" with "and"

/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
  #3 (permalink)  
Old February 3rd, 2008, 02:18 PM
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

The boolean "and" operator in XPath is spelt "and", not "&&".

It's best not to guess at XPath syntax, you will often guess wrong.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #4 (permalink)  
Old February 4th, 2008, 10:55 AM
Registered User
 
Join Date: Feb 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DOMNode.ParentNode.SelectSingleNode("Criteria/Students/Student/Name[last='Robert'and first=''and middle='']")
is also not working. since i am search student name using last name , first name and middle name.


Reply With Quote
  #5 (permalink)  
Old February 4th, 2008, 11:01 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Can you show an example of the XML that you are searching?

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #6 (permalink)  
Old February 4th, 2008, 11:12 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

When you say it is "also not working", do you mean it still fails with the "invalid token" error message? Or is it not working in some different way?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #7 (permalink)  
Old February 4th, 2008, 11:28 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

Yes, an example of your XML is needed.


/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
  #8 (permalink)  
Old February 5th, 2008, 02:31 AM
Registered User
 
Join Date: Feb 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Superb it is working fine thanks a lot

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
Invalid Token sani723 XSLT 2 December 25th, 2007 01:42 AM
XPath Invalid token Hughesie78 XSLT 13 November 29th, 2007 12:59 PM
error LNK2020 unresolved token rachappa Visual C++ 1 January 12th, 2006 08:05 AM
Can't get past "Token StartElement" error Colonel Angus Classic ASP XML 1 August 10th, 2005 01:21 PM
Token error using process.start Raif ASP.NET 1.0 and 1.1 Professional 3 August 17th, 2004 08:42 PM



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


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