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 February 3rd, 2008, 02:09 PM
Registered User
 
Join Date: Feb 2008
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

 
Old February 3rd, 2008, 02:11 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Replace "&&" with "and"

/- Sam Judson : Wrox Technical Editor -/
 
Old February 3rd, 2008, 02:18 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
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
 
Old February 4th, 2008, 10:55 AM
Registered User
 
Join Date: Feb 2008
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.


 
Old February 4th, 2008, 11:01 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old February 4th, 2008, 11:12 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
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
 
Old February 4th, 2008, 11:28 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
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 -/
 
Old February 5th, 2008, 02:31 AM
Registered User
 
Join Date: Feb 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Superb it is working fine thanks a lot






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





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