xsl-list
[Top] [All Lists]

Re: [xsl] Managing cross references when combining XML files into one document

2006-12-29 11:35:31
At 11:21 AM 12/29/2006, you wrote:
You can try to break the processing into stages by using something
simple such as:

<!-- source: Michael Kay (I think) -->
<xsl:variable name="phase-1-output">
 <xsl:apply-templates select="/" mode="phase-1"/>
</xsl:variable>

<xsl:variable name="phase-2-output">
 <xsl:apply-templates select="$phase-1-output" mode="phase-2"/>
</xsl:variable>

<xsl:template match="/">
 <xsl:copy-of select="$phase-8-output"/>
</xsl:template>

This is standard practice -- but in XSLT 2.0, not 1.0. (I think you meant 'phase-2-output' in the xsl:copy-of, not phase-8.)

It's possible only in XSLT 1.0 if an extension function is available to turn the results of applying templates in phase 1 into a node set, which can be offered as input to the templates in phase 2.

I am unaware whether Xalan-C (the OP's processor) offers this extension function, which is commonly called node-set().

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
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
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>