Hi, I'm trying to render tabular data in an HTML document using XSL to
transform XML data into an HTML table. Some of the tabular data
appears as droplists (implemented by the HTML Select and Option tags).
All the droplists have the same option entries that a user can choose
from.
Is there anyway to reuse a single "master" branch in the XML document
that contains all the option entries for all the select droplists in
the XSL document? As there can be hundreds of skills, it wouldn't be
practical to keep repeating the option data as childnodes for each
skill node in the XML document.
The style sheet looks like:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/skills">
<TABLE>
<TR>
<TD>Skill</TD>
<TD>Expertise</TD>
</TR>
<xsl:apply-templates select="*">
</xsl:apply-templates>
</TABLE>
</xsl:template>
<!--END OF STYLE SHEET -->
<xsl:template name="list" match="skill">
<TR>
<TD><!-- skill name -->
<xsl:value-of select="current()" disable-output-escaping="yes"/>
</TD>
<TD<!-- expertise droplist name -->
<SELECT>
<xsl:attribute name="ID"><xsl:value-of
select="concat('expertiseID_',position())"/></xsl:attribute>
<xsl:attribute name="NAME"><xsl:value-of
select="concat('expertiseNAME_',position())"/></xsl:attribute>
<OPTION></OPTION>
</SELECT></TD></TR>
</xsl:template>
</xsl:stylesheet>