Subject: RE: [xsl] push-pull From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 19 Mar 2008 12:44:28 -0400 |
> > What is the best way for an xslt2 template declared like > this, for example: > <xsl:template name="pull" match="*" mode="push">... > to know or recognize when it is pulled or pushed. > (called by name or invoked by match and mode)? >
I don't think you can.
<xsl:template name="pull" match="*" mode="push"> <xsl:param name="pulled" select="false()"/> <xsl:if test="$pulled">...</xsl:if> ...
I've never been convinced it's a good idea to have such templates: it's hard to make sure that the entry conditions are the same whether it is invoked by apply or by call. In particular, when you are writing a match template it should be possible to assume that the context item matches the pattern, and allowing entry by name makes this assumption invalid.
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx 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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] push-pull, Michael Kay | Thread | Re: [xsl] Looping through multiple , David Carlisle |
[xsl] concatinating a varying numbe, Adil Ladhani | Date | Re: [xsl] compact code using loop, Wendell Piez |
Month |