This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
do I have better option other than mode
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: do I have better option other than mode
- From: "Pollington, Lee (ELSLON)" <lee dot pollington at biomednet dot com>
- Date: Mon, 20 Nov 2000 11:12:25 -0000
- Reply-To: xsl-list at mulberrytech dot com
Hi all,
I working on a stylesheet covering over 170 elements. Many elements have an
"id" attribute. Now I want to output an HTML target for every element with
and "id", I thought
<xsl:if test="@id">.....</xsl:if>
would be a bit messy in every template that needed it, so I thought I could
do:
<xsl:template match="*[@id]">
<a name="{@id}"/>
<xsl:apply-templates select="." mode="has-id"/>
</xsl:template>
<xsl:template match="fig" mode="has-id">.....</xsl:template>
However that still means knowing which templates are going to need that mode
and on the face of it makes the templates themselves less reusable, it
doesn't look too efficient either, but I don't know about that. I was hoping
to do something a little more generic.
Any suggestions?
Kind regards
Lee
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list