[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

do I have better option other than mode

Subject: do I have better option other than mode
From: "Pollington, Lee (ELSLON)" <lee.pollington@xxxxxxxxxxxxx>
Date: Mon, 20 Nov 2000 11:12:25 -0000
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.