[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

static vars or how to write dirty tags

Subject: static vars or how to write dirty tags
From: friepoertner <friepoertner@xxxxxxxxxxxxx>
Date: Thu, 25 Oct 2001 12:20:20 +0200
how to write dirty
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>&lt;/tr&gt;</eval> but eval does not work ...!?

Greets,

Ingo

--
Ingo Friepoertner
friepoertner@xxxxxxxxxxxxx


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.