Re: [xsl] Fw: repeat: XSLT 2.0 Req: Serial transforms (possibly dup of xsl:apply-transform request)

Subject: Re: [xsl] Fw: repeat: XSLT 2.0 Req: Serial transforms (possibly dup of xsl:apply-transform request)
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Sun, 04 Mar 2001 23:02:46 +0000

Curt Arnold wrote:
> 
> This may be a duplicate of the functionality that Ricardo Amador & M.Manuel
> Cabrita suggested (in
> http://lists.w3.org/Archives/Public/xsl-editors/2001JanMar/0093.html).
> However since I didn't fully understand their suggestion and didn't see a
> corresponding issue in the XSLT 2.0 requirements list, I'll state the
> particulars of my usage.
> 
You don't say if you checked out the automatic RTF->nodeset conversion
feature in XSLT 1.1
(http://www.w3.org/TR/xslt11/#section-Changes-from-XSLT-1.0), which
appears to do what you need. It is also the same behaviour that is
offered by exsl. It is what I think of "return by value", where an XSLT
1.1 template or exsl:return element can return content as a node-set.

The difference between this and "return by reference" is that if you
include node X in the return value, it is converted first to a string
then into a new node. It has the same value as the old node, but it *is*
a new node, and for example you could include both it and the old node
in the same nodeset without breaching the "no duplicates nodes in a
nodeset" constraint.

However your example below has no dependencies between the nodesets of
different phases, so "return by value" should be fine for you.

> 
> saxon -o temp1.xml source.xsd preprocessor.xsl
> saxon -o temp2.xml temp1.xml pass1.xsl
> saxon -o temp3.xml temp2.xml pass2.xsl
> saxon -o temp4.xml temp3.xml pass3.xsl
> ...
> saxon -o output.xml temp4.xml optimize.xsl
> 
I guess that in XSLT 1.1 it would look somewhat like this:

<xsl:template match="/">

  <xsl:variable name="temp1">
    <xsl:call-template name="pre-processor">
      <xsl:with-param name="raw" select="/"/>
    </xsl:call-template>
  </xsl:variable>

  <xsl:variable name="temp2">
    <xsl:call-template name="pass1">
      <xsl:with-param name="temp1" select="$temp1"/>
    </xsl:call-template>
  </xsl:variable>

  <!-- etcetera -->

</xsl:template>

> It would be beneficial if this type of serial transformation could be
> described in XSLT 2.0 so that the overall transformation process could be
> communicated via a binding between the source document and a single XSL file
> in case you wanted to perform the overall transformation on the client side.
> 
> p.s. Francis Norton suggested that it might be covered by the exsl
> initiative, however I didn't see it.
> 
Same, only using my:pre-processor(/) etc.

I think this does what you want - or have I misunderstood you
requirement?

Francis.

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


Current Thread