This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: template's match-set ? (feature request?)
- From: Wendell Piez <wapiez at mulberrytech dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 06 Sep 2002 12:56:18 -0400
- Subject: Re: [xsl] template's match-set ? (feature request?)
- References: <DD96E17B2F7BD3119213009027944BE00188A42A@DUBSEXC1>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Rob,
A pretty easy workaround to give you what you want is to adapt an
"architectural forms" approach.
So your match might look like:
<xsl:template match="*[@form='content-piece']" mode="mode-1">
<xsl:apply-templates/>
</xsl:template>
and in your schema you assign an attribute @form with a fixed value of
'content-piece' to every element you want processed this way.
Consider it a kind of poor-man's element typing.
Cheers,
Wendell
At 08:40 AM 9/6/2002, you wrote:
Hi,
[forgive me if this is already available. if so, what is it called?]
I was looking for the following functionality in the draft for XSLT2, but
could
not find it. It seems like it is possible.
Anyway, what I want to do is have a 'match-set' (sort of like attribute-set)
that I can 'use-match-set' on various templates with different modes.
For example:
<xsl:match-set name="content-pieces">
<xsl:match name="article"/>
<xsl:match name="faq"/>
<xsl:match name="job"/>
</xsl:match-set>
<xsl:template use-match-set="content-pieces" mode="mode-1">
<xsl:apply-templates/>
</xsl:template>
<xsl:template use-match-set="content-pieces" mode="mode-2">
<xsl:apply-templates/>
</xsl:template>
<xsl:template use-match-set="content-pieces" mode="mode-n">
<xsl:apply-templates/>
</xsl:template>
This would be useful to me because I am occiasionally adding new tags to my
schema that work the same in the XSLT, in many cases.
Does this exist in some other way? Is this a reasonable request if it does
not?
======================================================================
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