> I'm using the following xpath (works in visualizer)
No it doesn't "work in visualiser" (in case you mean the XPath
Visualizer)!
The XPath Visualiser returns the following error message:
"Error No.:-2147467259
Error: Node test expected here.
//Station[@name="Station1"]/-->(<--WI[Boards/Board[@sn="583230"][@finish]])[last()]]/@order"
So what's so strange in this error message?
with a
SelectSingleNode("xpath") statement.
//Station[@name="Station1"]/(WI[Boards/Board[@sn="583230"][@finish]])[la
st()]]/@order
The error message points out explicitly what's illegal with the syntax
of the above XPath expression. The exact offending symbol is marked.
To understand why a bracket cannot be used in place of a node-test one
must have a minimal familiarity with XPath 1.0. This requires to read
a good introductory level book on XSLT/XPath (all good books about
XPath that I'm aware of usually cover XSLT too).
Another note is about the way you present your problem:
- You do not provide the source xml document on which the XPath
expression is to be evaluated.
- You do not explain what nodes you want to select.
Presenting a problem in this way makes it extremely difficult for
anyone to guess and help.
This is definitely not a good way to ask a question and not
surprisingly there would not be useful answers.
Also, if the question is so basic (e.g. not understanding a good error
message explaining an obvious syntax error), very few people would be
tempted to provide an answer for someone who has not "done their
homework" (e.g. didn't read even the simplest and most introductory
book on the subject).
Answers to random questions are not a substitute for systematic
learning, which is required in order to understand any subject.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL