xsl-list
[Top] [All Lists]

RE: Reprocess template results in same stylesheet?

2004-01-05 05:50:49
You can do all the transformations in your pipeline in one stylesheet by
performing transformations within variables, with each variable
operating on the previous one.

So, as top-level variables you could have:

<xsl:variable name="firstVar-rtf"> 
  <xsl:apply-templates/> 
</xsl:variable> 
<xsl:variable name="firstVar" select="exsl:node-set($firstVar-rtf)"/> 

<xsl:variable name="secondVar-rtf"> 
  <xsl:for-each select="$firstVar"> 

This will select just the root node (/) of the temporary tree contained in
$firstVar

Must be:

    <xsl:for-each select="$firstVar/node()"> 

    <xsl:apply-templates/> 
  </xsl:for-each> 
</xsl:variable> 
<xsl:variable name="secondVar" select="exsl:nodet-set($secondVar-rtf)"/>


Here $firstVar operates on the source xml, and $secondVar works on the
'result' of the apply-templates in $firstVar.

The final link in the chain is of course:

<xsl:template match="/"> 
  <xsl:for-each select="$lastVar"> 

The same problem:

Must be:

    <xsl:for-each select="$lastVar/node()"> 


Dimitre Novatchev.
FXSL developer

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html







__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list