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

position()

Subject: position()
From: Natalie Rooney <nrooney@xxxxxxxxxxxxx>
Date: Tue, 09 Nov 1999 10:41:14 -0600
position of rooney
Hi,

I have the following xml structure:

    <USERS>
          <USER>bunch of attributes</USER>
          <USER>bunch of attributes</USER>
          <USER>bunch of attributes</USER>
    </USERS>

I want to display the first user in a different way from the others.
So, here is what I tried to do:

<xsl:value-of select="//USERS/USER[1]/*[name()=$tagName]"/>

here $tagName is the attribute I want to display.  This works fine.
Then somewhere else, I try the following:

<xsl:for-each select="//USERS/USER[position() > 1]">

This returns nothing.  I am using the XSL:P processor to combine the xml
and xsl into html.  I have seen people mention problems using >, so I
also tried

<xsl:for-each select="//USERS/USER[not(position()=1)]">

Same result.  The weird thing is that when I use this:

<xsl:value-of select="count(//USERS/USER[position()=1])/>
or
<xsl:value-of select="count(//USERS/USER[position()=last()])/>

the returned value is 3.  but when I try position=2 or 3, the returned
value is 0.  Any hints??

Thanks,
Natalie


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


Current Thread
  • position()
    • Natalie Rooney - Tue, 09 Nov 1999 10:41:14 -0600 <=

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.