RE: interfaces for XSLT 2.0 templates

"Kay, Michael" <[email protected]>
Newsgroups gmane.org.w3c.xsl-editors
Message-ID <[email protected]>
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:[email protected]] 
> Sent: 18 July 2002 12:48
> To: '[email protected]'
> 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. 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.