My XSLT generates a HTML document containing (almost) nothing except
<h*> and <table>. I wrote it as a template reflecting the <html>
structure, with called templates pulling in the data from the XML
source. It is within these called templates that the various <table>
elements (of differing structure) are generated.
An new requirement demands that all the various <table> elements are
to be wrapped with another <table> (with a single <tr>) for layout
purposes, adding one <td> with uniform contents to the <td> containing
the original table.
I cannot insert two different template calls producing the outer
table's introduction and completion, respectively: they each would
contain unbalanced data.
I know it can be done by adding the new HTML stuff to all the called
templates, which isn't nice as it duplicates code, in many different
places.
If I had realized this new requirement earlier - would there be a good
solution while still retaining the "pull" structure? How do I handle
the generation of different tables from within a single "wrapper"
table template? One big <choose> driven by a parameter seems to be the
only option. (Something like a "function reference" for callable
templates would enable me to write what I'd consider a "clean" program
structure.)
I wouldn't be surprised if there is there anything I've overlooked.
Regards
Wolfgang
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--