[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Is there a way to define groups of templates ?


Subject: Is there a way to define groups of templates ?
From: "Eran Pe'er" <eran@xxxxxxxxxxxxx>
Date: Thu, 17 Sep 1998 12:44:42 +0200

Is there a way to define groups of templates, so that when using the "xsl:process" & "xsl:process-children" commands we can specify what templates will be evaluated for the processing ?
 
For example: 
One group of templates for generating a TOC and a different group for generating the document's content.
 
The following is my offer for a possible solution:

<xsl:template match="/">
  <HTML>   
    <HEAD>     
    </HEAD>   
    <BODY>
 
 
<!-- Generate the TOC -->
    <xsl:process-children context="TOC"/>
 
 
<!-- Generate the document's content -->
    <xsl:process-children context="content"/>
 
 
    </BODY> 
  </HTML>
</xsl:template>
 
 
 
<!-- ---------------------------------------------------
This template will be activated only if the "TOC" context
is specified in the "xsl:process-children" command
  --------------------------------------------------- -->
<xsl:template match="title" context="TOC">
  
  generate a TOC line for the title ....
  
</xsl:template>
 

<!-- ---------------------------------------------------
This template will be activated only if the "content" context
is specified in the "xsl:process-children" command
  --------------------------------------------------- -->
<xsl:template match="title" context="content">
 
 
  generate a content line for the title ...
 
</xsl:template>
 
 
I think all this is somehow connected to
Issue (pattern-pi-target):
Should it be possible to have a pattern that matches a processing instruction?
 
 
Eran Pe'er

Current Thread