[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: position() and last() problem

Subject: Re: position() and last() problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 8 Jan 2003 16:28:03 GMT
xsl ancestor position last
ancestor::con:view[1]

selects a node list of at most 1 node so position()=1=last() always
so the above would be equivalent to
ancestor::con:view[1][position()=last()]

I thought you had written


ancestor::con:view[1][position()!=last()]

which will always selct an empty node set as position() and last() are
both 1 so never not equal.

However U see you have written

"ancestor::con:view[1][position()]!=last()"

which is legal but compares the numeric value of the data content 
of the parent con:view element against the number of nodes in the
current node list at the point the xsl:if is evaluated.

[position()] is short for [position()=position()] which is always
true so the above is

"ancestor::con:view[1]!=last()"

which is

"parent::con:view != last()"

This almost certainly isn't what you want to do.

If I understand your problem you want to know if the parent has a
following sibling

test="parent::*/following-sibling::*"

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • position() and last() problem
    • jfi - Wed, 8 Jan 2003 10:44:55 -0500 (EST)
      • David Carlisle - Wed, 8 Jan 2003 11:28:16 -0500 (EST) <=
      • Michael Kay - Wed, 8 Jan 2003 13:23:17 -0500 (EST)
      • <Possible follow-ups>
      • Andrew Welch - Wed, 8 Jan 2003 11:43:53 -0500 (EST)
      • jfi - Wed, 8 Jan 2003 12:00:36 -0500 (EST)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.