This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with position() function


Andre --

Your problem is in this select:

<xsl:value-of select="//*[(name() = $elname) and
(parent::node()[position() = $n])]"/>

Each element has one parent.  Therefore, the size of the node-set
created by parent::node() will always be one since you can't have
multiple parents for an element.  Therefore, 

  parent::node()[position() = $n]

will only be true when n is 1 which is why you're only getting answers
for the first row.

Try:

<xsl:value-of select="(//*[name() = $elname])[position() = $n]"/>

Gary


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]