|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] do I have better option other than mode
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








