Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Cannot enter data into Dynamic Table cells

From: David Carlisle <davidc@--------->
To:
Date: 7/1/2004 2:56:00 PM
the problem seems to be the line :

  <xsl:for-each select="current()[position()]/following::*[position() &lt; 
   5]">


a predicate [] with a numeric value is shorthand for
[position()=that value]
so foo[2] is foo[position()=2] etc

you have
[position()]
which is[position()=position()]
which is [true()] so is no filter at all.
so your first step in the Xpath is just equivalent to
current()
so it could be ommitted as relative Xpath's are always interpreted
relative to the current node.
so it is equivalent to

following::*[position() &lt; 5]
which is legal, but not what you want, it selects the next 4 eleemnt
nodes after the current node _in the source document_

You want (I think) the next four items in your $unique-ref set, which
you can't do directly using any axis.

The five items you want are
<xsl:for-each select="$unique-ref[position() mod 5 = 1]">
<xsl:variable name="n" select="position() - 1"/>
...
something with
$unique-ref[$n * 5 +1]
$unique-ref[$n * 5 +2]
$unique-ref[$n * 5 +3]
$unique-ref[$n * 5 +4]
$unique-ref[$n * 5 +5]

so on your first iteration, $n will be 0 and you'll get
$unique-ref[1] .. $unique-ref[5]
on your second, $n will be 1 and you'l get
$unique-ref[6] .. $unique-ref[10]

David


-- 
The LaTeX Companion
  http://www.awprofessional.com/bookstore/product.asp?isbn=0201362996
  http://www.amazon.co.uk/exec/obidos/tg/detail/-/0201362996/202-7257897-0619804


________________________________________________________________________
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
________________________________________________________________________


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent