Subject: RE: [xsl] XSL - using for-each with sort - can't access previous sorted nod e From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 26 Nov 2003 15:10:32 -0500 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" extension-element-prefixes="exslt">
<xsl:variable name="metaRTF"> <xsl:apply-templates select="document($files)/*/meta" mode="init"/> </xsl:variable>
<xsl:template match="meta" mode="init"> <!-- ... selects stuff out of the meta elements at the top level, and adds some special stuff ... --> </xsl:template>
<!-- trimming the metadata model not to include this stuff --> <xsl:template match="source | remark" mode="init"/>
<!-- most of the init mode is an identity transform --> <xsl:template match="node()|@*" mode="init"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates mode="init"/> </xsl:copy> </xsl:template>
<!-- the variable declaration to create a node-set we can process out of the result of the 'init' pass --> <xsl:variable name="meta-collection" select="exslt:node-set($metaRTF)"/>
<!-- leaving this around just in case we need it --> <xsl:template match="/" mode="debug"> <xsl:copy-of select="$meta-collection"/> </xsl:template>
<xsl:template match="/"> <html> <!-- html stuff goes here--> <body> <!-- more html stuff goes here --> <div class="portfolio"> <xsl:apply-templates select="$meta-collection/meta"> </div> </body> </html> </xsl:template>
<!-- we process our "initialized" node set in the unnamed mode --> <xsl:template match="meta"> <!-- etc.... --> </xsl:template>
I hope this helps, Wendell
Would it be too much trouble to ask either of you for an example of a two-pass process?
====================================================================== 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] XSL - using for-each with, Wickersty, Jeff | Thread | [xsl] Comparing values in a 2nd XML, JOHN MARSHALL |
Re: [xsl] Dynamic Tables, jderbyshire | Date | Re: [xsl] Recursion, J.Pietschmann |
Month |