This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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>&lt;/tr&gt;</eval> but eval does not work ...!?

Greets,

Ingo

-- 
Ingo Friepoertner
friepoertner@globalpark.de


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]