XSL/XML Select and Option HTML tags
- From: "Andy" <anedza@xxxxxxxxxxxxxxxxxxxxxx>
- Date: 18 Oct 2006 14:09:55 -0700
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 *** looks like:
<xsl:style*** 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 *** -->
<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:style***>
.
- Follow-Ups:
- Re: XSL/XML Select and Option HTML tags
- From: Martin Honnen
- Re: XSL/XML Select and Option HTML tags
- From: John Saunders
- Re: XSL/XML Select and Option HTML tags
- Prev by Date: [Announce] Stylus Studio 2007 Reviewed by CRN Magazine
- Next by Date: Re: Deserializing an Object from XML Using Schema
- Previous by thread: [Announce] Stylus Studio 2007 Reviewed by CRN Magazine
- Next by thread: Re: XSL/XML Select and Option HTML tags
- Index(es):