xsl-list
[Top] [All Lists]

document() function and two passes (was '')

2003-07-28 04:12:02


dear sir,

Can a single xsl take two inputs.
or can an xsl after one transformation take the transformed xml as its
input
which is applied by another xsl and is included the main xsl.

Check out the document() function to reference multiple xml files during a 
transformation.

To perform two passes (or more) in a single transformation, perform the first 
pass within a variable, then apply the second pass on the contents of that 
variable.  You can do this as many times as you like, and its what makes xslt 
so powerful.

For example:

<xsl:variable name="first-pass-rtf">
  <xsl:apply-templates/>
</xsl:variable>
<xsl:variable name="first-pass" select="vendor:node-set($first-pass-rtf)"/>

<xsl:variable name="second-pass">
  <xsl:for-each select="$first-pass">  
    <xsl:apply-templates/>
  </xsl:for-each>
</xsl:variable>

cheers
andrew 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/2003
 

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



<Prev in Thread] Current Thread [Next in Thread>
  • document() function and two passes (was ''), Andrew Welch <=