|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] static vars or how to write dirty tags
Hi list,
Now I can create a multirow table-head from an existing tree ... but as xml is not as flexible as html is, i can't create row endings (</tr>) where I need them ... The xml-file:
<chart>
<column>
<name>foo</name>
<column>
<name>bar</name>
</column>
</column>
</chart>( complete 2 - 4 layers ...) My stylesheet : <xsl:template match="chart">
<table><tr>
<xsl:apply-templates select="descendant::column">
<xsl:sort select="count(ancestor::column)"/>
</xsl:apply-templates>
</tr></table><xsl:template match="column">
<xsl:variable name="colspan" select="count(.//column[not(column)])"/>
<td colspan="{$colspan}"><xsl:value-of select="name"/></td>
<xsl:if test="count(following-sibling::column) = 0">
</tr><tr> <!-- :-) well, thats what I want to do ... -->
</xsl:if>
</xsl:template>Sometimes I think xml could be more flexible ... the output would be clean html ... :-) In php I would solve this problem printing all the <td> ... </td> in a var until end of the current row ... $foo .="<td> ...</td>"; Is there a solution like this in xsl ? My next idea was <eval></tr></eval> but eval does not work ...!? Greets, Ingo -- Ingo Friepoertner friepoertner@xxxxxxxxxxxxx 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
|

Cart








