|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: exit <xsl:for-each> or change <xsl:variable>
> Here is the actual problem. If the processor comes across a > $next-table$ > cell it should: > > <xsl:if test="(cell[1]/data)='$next-table$'"> > </table><table border="1"> > </xsl:if> > > but that is not possible is it. Is there a way to do this? I > would like to > end the current table and start a new one when the value > '$next-table$' > shows up. You're thinking procedurally, and you're thinking in terms of writing tags, rather than writing nodes. This is a grouping problem. Use standard grouping techniques (www.jenitennison.com/xslt/grouping). The grouping key (the property of a node that determines whether two nodes are in the same group) in your case is something like: generate-id(preceding-sibling::cell[data='$next-table'][1]) that is, two nodes are in the same group if they both have the same node as the most recent $next-table$ cell. With XSLT 2.0 / Saxon 7.0 you can use pattern-based grouping: <xsl:for-each-group select="cell" group-starting-at="cell[data='$next-table']"> <table> <xsl:for-each select="current-group()"> <tr> .... </tr> </xsl:for-each> </table> </xsl:for-each-group> Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






