 |
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
|
|
|

February 3rd, 2008, 02:09 PM
|
Registered User
|
|
Join Date: Feb 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

February 3rd, 2008, 02:11 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Replace "&&" with "and"
/- Sam Judson : Wrox Technical Editor -/
|

February 3rd, 2008, 02:18 PM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
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
|

February 4th, 2008, 10:55 AM
|
Registered User
|
|
Join Date: Feb 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

February 4th, 2008, 11:01 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
Can you show an example of the XML that you are searching?
--
Joe ( Microsoft MVP - XML)
|

February 4th, 2008, 11:12 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
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
|

February 4th, 2008, 11:28 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Yes, an example of your XML is needed.
/- Sam Judson : Wrox Technical Editor -/
|

February 5th, 2008, 02:31 AM
|
Registered User
|
|
Join Date: Feb 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Superb it is working fine thanks a lot
|
|
 |