Re: [xsl] Use of xsl:document

Subject: Re: [xsl] Use of xsl:document
From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Date: Thu, 22 Jun 2006 12:15:21 +0100
Sorry I called it a function by mistake, I meant the xsl:document element and I was actually thinking something along the lines of:

<xsl:variable name="Xml" as="document-node()">
<xsl:document>
<xsl:sequence select="document('file.xml')"/>
</xsl:document>
</xsl:variable>

I think you've answered this with your second point.


From: David Carlisle <davidc@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Use of xsl:document
Date: Thu, 22 Jun 2006 11:58:38 +0100

> Should I be using the xsl:document function instead?
there is no _function_ called xsl:document.
there is an xsl:document element (instruction). this has a different
function it _generates_ a document node rather than selecting one.
So the relationship between
select="document(...) and <xsl:document is like teh relationship between
select="abc" and <xsl:element  name="abc"
one selects existing nodes from input documents, the other generates new
nodes.

> Is there any use for the xsl:document function other than the fact it allows
> validation?


Not a lot as (for XSLT1 compatibility) a document node is implictly
generated whenever you use xsl:variable with content (and no as
attribute) so there are not many times that you need to explictly
generate a document node with xsl:document.

David


________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________


_________________________________________________________________
Are you using the latest version of MSN Messenger? Download MSN Messenger 7.5 today! http://join.msn.com/messenger/overview


Current Thread