This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Can you apply a template match on a copy node?


Mike,

There's also <xsl:attribute-set> and the xsl:use-attribute-set attribute, if you really don't want to layer it into CSS (which is what I would do). You could combine this with Joerg's suggestion of parameters. I would think that between attribute sets and calling templates by name (which you could do, for example, to handle your smiley-to-image scenario) you'd pretty much have what you need to avoid a second pass (which is effectively what you say you want to do). FWIW, I think your instinct is right to avoid that unless you have more demanding requirements that it meets.

Cheers,
Wendell

At 06:39 AM 9/23/2002, you wrote:
Yep looks like css is the best solution. I'm just experimenting really, but there are plenty of scenarios where I have wanted to apply a template to a node written out in another match, so that I can reuse a single style definition.

Example(ish): I have a forum which replaces smilies in message threads.

If all text nodes always go through the text() match I have a single place I can pass smilies into gifs by inserting an image tag. If my generic image match can then be applied to this new image node, then I have one central place where my images can be processed generically, such as appending image directory to the src attribute of any image. It also means one central place where smilie replacement may be turned on/off.

I know there are plenty of other ways of handling these scenarios but the central matches solution is much neater and cleaner, and takes the emphasis away from the template creator having to consider the bigger picture. ie. think about appending variables to attributes etc.

======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]