p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: Merging multiple table declarations ?


Message #1 by Marra Roberto <Roberto@l...> on Tue, 17 Jul 2001 15:46:39 +0200
Marra Roberto [mailto:Roberto@l...] wrote:
> Matching a fo:table node, how do I read following nodes until 
> a condition 
> is reached?

You really cannot do what you are asking directly, but this is the way I
have done this in the past (thanks to some suggestions from Mr. Kay):

1. determine the position of the next node that matches the condition.  
	<xsl:variable name="nextPos" 
 
select="count(following::table[@mastertable='y']/preceding-sibling::*)+1"/>
2. determine the position of the current node
	<xsl:variable name="thisPos"
select="count(preceding-sibling::*)+1"/>
3. Loop thorough each node with a position() between $thisPos and $nextPos
	<xsl:for-each select="table[position() >=$thisPos and
                                  position() < $nextPos]"/>

You may have to adjust the xsl:for-each select to get the exact nodes that
you want but you should get the picture.

PS: I don't deal with namespaces very well, so I removed them.  I'll let
someone else make a comment on that subject.

-- 
Kipp E. Howard - Sr. Software Engineer @ CourtLink
kipp.howard@c...   
(xxx) xxx-xxxx  or  (xxx) xxx-xxxx  ext 1837 

  Return to Index