RE: interfaces for XSLT 2.0 templates

Thanks for this suggestion. It's an idea that we could build on, but as a
personal view, I think it's probably out of scope for the current round.

Michael Kay
Software AG

> -----Original Message-----
> From: Clarke, Agnes [mailto:Agnes_Clarke@nl.compuware.com] 
> Sent: 18 July 2002 12:48
> To: 'xsl-editors@w3.org'
> Subject: interfaces for XSLT 2.0 templates
> 
> 
> 
> Hi,
> 
> I often find myself defining templates that require numerous 
> parameters. This leads to two problems:
> 
> 1. making modifications to the list of parameters - I have to 
> do it in each template
> 
> 2. forgetting a parameter, and so losing critical data 
> without receiving a warning
> 
> So I would like to formally specify the interfaces of my 
> templates, using a syntax like this:
> 
> <xsl:interface name="interface1">
>    <xsl:param name="p1" />
>    <xsl:param name="p2" />
>    <xsl:param name="p3" />
> </xsl:interface>
> 
> <xsl:template name="foo" interface="interface1" />
> 
> This saves many, many lines of code in certain kinds of 
> stylesheet, and eliminates many simple errors.
> 
> It also makes possible a simplified syntax for parameter invocation:
> 
> <xsl:apply-templates select="*" interface="interface1" 
> params="('string', 'str2', $variable)" />
> 
> Which is equivalent to:
> 
> <xsl:apply-templates select="*">
>    <xsl:param name="p1" select="'string'" />
>    <xsl:param name="p2" select="'str2'" />
>    <xsl:param name="p3" select="$variable" /> </xsl:apply-templates>
> 
> Regards,
> 
> Agnes Clarke
> www.agslin.net
> 
> All men's miseries derive from not being
> able to sit quiet in a room alone.
> -- Blaise Pascal (1623 - 1662)
> 
> 
> -- 
> The contents of this e-mail are intended for the named 
> addressee only. It contains information that may be 
> confidential. Unless you are the named addressee or an 
> authorized designee, you may not copy or use it, or disclose 
> it to anyone else. If you received it in error please notify 
> us immediately and then destroy it. 
> 

Received on Thursday, 18 July 2002 11:38:17 UTC