- From: John E. Simpson <simpson@polaris.net>
- Date: Fri, 14 Jan 2000 09:25:21 -0500
- To: xsl-list@mulberrytech.com, "'xsl-list@mulberrytech.com'" <xsl-list@mulberrytech.com>
- Cc: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
At 03:41 PM 01/13/2000 -0700, Mike Brown wrote: >[I wrote, earlier:] > > 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(). Okay, I understand about using document() (at least with one argument, as somebody -- Mike Kay? -- just said :). But then doesn't that document constitute a source tree, even if it consists of just a single root element? >...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> This is kind of what I meant by the term "generating data." I know you were simplifying for the sake of example; without wanting to flog the issue too much, and without necessarily asking for copious examples, could you describe a situation in which it makes sense to have XSLT do this? It seems like swatting flies with a hammer. Do you have some process hooked up at the back end which must take all its input from an XSLT processor? ><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> Yes, I can see this. Maybe I'm reading the spec too casually, but using the document() function to provide your sole source of "input" doesn't radically change the notion of having a source tree, does it? (Actually, even the word "radically" seems superfluous.) Somewhat less fuddled but still scratching my head... thanks if you can clarify further. =================================================================== John E. Simpson | Last night I stayed up late playing simpson@polaris.net | poker with Tarot cards. I got a full http://www.flixml.org | house and four people died. | (Stephen Wright)
Received on Friday, 14 January 2000 09:24:37 UTC