RE: XSL file / "standalone" stylesheets - why not?

> Okay, I'll bite: If there's a root node but no "data source 
> from which the source tree was constructed," then what is
> the thing being transformed?

Data from documents referred to via document(), or nothing.

Transformation is not really what's happening, anyway. It's
creation of a new tree based on the root node of the "main"
source tree, and *possibly* other nodes in that source tree
or other source trees obtained via document().

> Are you talking about using XSLT to generate, I don't
> know... XML test data or something? Or using XSLT to
> operate on a streamed-in input tree (a la stdin) instead
> of an actual storage unit (like a file)?
> 
> Or...?

No, I "transform" tons of data from various source trees.
I just don't always need to have anything in the primary
source tree except for a root node that allows the processor
to begin processing. Examples:

<xsl:stylesheet ...>
  <xsl:template match="/">
    <p>Hello World</p>
  </xsl:template>
</xsl:stylesheet>

<xsl:stylesheet ...>
  <xsl:template match="/">
    <xsl:apply-templates select="document('foo.xml')" mode="bar"/>
  </xsl:template>
  <xsl:template match="/" mode="bar">
    <p>There are <xsl:value-of select="count(//node())"/> nodes in
foo.xml</p>
  </xsl:template>
</xsl:stylesheet>

Received on Thursday, 13 January 2000 17:41:09 UTC