Horst Gutmann wrote:

Hi :-)
I just read the part of the XSL specification about modi on templates but I have a probably quite stupid question: Is it somehow possible to call-template ALL templates, no matter what mode they have set?

I'm pretty sure that only one template can be used at any given level. You can match elements and in in a separate template match attributes, but it always comes down to one template at one point. If you're trying to cascade the results of one to the next you'd need to manually specify it (call the second template within the first). Same goes for having results side-by-side of the same input passed to each plugin_test*, you'd need to manually name them.

So I guess at some point you could call all the templates and just pass
in a copy of the current node. Eg,

(I haven't tested this code, there's probably a few typos)

<xsl:template match="/">
   <root>
       <xsl:call-template name="plugin_test1">
          <xsl:with-param name="data"><xsl:copy-of/></xsl:with-param>
       </xsl:call-template>
       <xsl:call-template name="plugin_test2">
          <xsl:with-param name="data"><xsl:copy-of/></xsl:with-param>
       </xsl:call-template>
   </root>
</xsl:template>

<xsl:template name="plugin_test1" priority="1">
   <xsl:param name="data"/>
   hello
</xsl:template>

<xsl:template name="plugin_test2" priority="2">
   <xsl:param name="data"/>
   world
</xsl:template>

When you call a named template it can't even be based on a name defined
in a variable, so wildcards are certainly out.

Generally when I'm trying to match for some naming convention (like
plugin_test1 through to plugin_test9999) it's easier to do it in two
stages... make the result of the 1st XSLT another XSLT that names all
the plugins, and then apply that. That way the 2nd stage XSLT is static
(so far as the processor is concerned) but it adjusts.



.Matthew Cruickshank
http://holloway.co.nz/phpilfer << xslt php framework that's looking for
developers
******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to