how about
//abc[max(1,last()-1)]
?

BTW: abc[x] is short for abc[position()=x], which means it is _not_ the
xth abc in the document but an abc that is the xth child of whatever
parent.

cheers
Dierk

| -----Original Message-----
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] On Behalf Of George Policello
| Sent: Freitag, 16. Mai 2008 17:54
| To: [email protected]; Harihara Vinayakaram
| Subject: RE: [Webtest] Re: XPath implementation in WebTest
|
| I do not have an XPath manual in front of me at the moment
| but wonder if this would work.
|
|
|
| //abc[last()-1] | //abc[last()]
|
|
|
| It would in some scripting languages and some compiled languages.
|
|
|
| Also, a conditional could probably work using the “nilled(
//abc[last() -1] )” function in XPath.
|
|
|
| George
|
| ________________________________
|
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] On Behalf Of Harihara
| Vinayakaram
| Sent: Friday, May 16, 2008 8:40 AM
| To: [email protected]
| Subject: [Webtest] Re: XPath implementation in WebTest
|
|
|
| I am sorry but the xpath expression works the same way in
| Saxon as it does in webtest .
| So maybe I am looking for an xpath expression that gets the
| only node even if the expression is last() -1
|
| Regards
| Hari
|
|
|
| On Fri, May 16, 2008 at 8:49 PM, Harihara Vinayakaram
| <[EMAIL PROTECTED]> wrote:
|
| Hi
|   I am not sure if this is the right place to ask this
| question . But anyway
|
| My understanding is that the xpath exression //abc[last()-1]
| will return the last but one element named abc .
|
| It works most of the times except when there is only one element .
|
| In that case WebTest returns element not found while others
| like saxon for example returns the last element .
|
| Is this a bug ? or is my understanding wrong
|
| Regards
| Hari
|
|
|
|
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to