Re: [xsl] Create Table

Subject: Re: [xsl] Create Table
From: "Eric J. Bowman" <eric@xxxxxxxxxxxxxxxx>
Date: Mon, 22 Mar 2010 19:42:18 -0600
bernie bonn  wrote:

> HI Eric & List,
> Thanks for this solution.  There is another gotcha.  I realized I
> didn't make clearthat, all the changes are inside of one parent
> element  <interface-categories name='Source Changes'
> category='Source'>. So I need to switch on <data> children inside of
> that.  How I know it is the start of a new change and table row, is
> the data node will have the attribute 'changes'  <data
> section='changes' field='file'></data>.
> There can be mutliple 'changes' inside the parent element
> <interface-changes>. I apologize, for not being clear.  Any
> additional guidance is sure appreciated.

OK, I see what you need now.  I'm relatively new at this myself, and
only deal with XSLT 1.  I'll reply in a bit with some code, then see
how the pros would do it, because I'm kinda curious about different
approaches to this problem, myself.


I'm happy to answer any questions about <table> markup (off-list as
it's o/t), since I'm a real stickler about proper <table> design. The
output _could_ leave the top-left cell as an empty <td>, the file names
could be marked up with <th>, and all the @scope's removed.

The table would then be using the "Basic algorithm" [1] for machine-
readability.  Column widths may be assigned using <col> and <colgroup>
elements, preceding <thead>.  Column widths may be assigned as ratios,
instead of the columns being either sized-to-fit or equal-width.

As with any object in (X)HTML, you must assign @width to enable
single-pass rendering in browsers.  With tables the width can be zero
in the (X)HTML and set using CSS.  The CSS table-layout:fixed directive
is also required for single-pass rendering, that's why I stuck it in

So my next example will have slightly different <table> markup, but
just one <tbody>, as I was imagining non-existent structure in your
source file, before.  I recommend the next example over the last one --
all accessibility devices grok the Basic algorithm, but the same can't
be said for @scope, unfortunately.



Current Thread