Re: [xsl] Pattern "node()" and document nodes

Subject: Re: [xsl] Pattern "node()" and document nodes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 25 Feb 2010 16:33:47 +0000
On 25/02/2010 16:25, Mukul Gandhi wrote:
On Thu, Feb 25, 2010 at 9:27 PM, Florent Georges<lists@xxxxxxxxxxxx> wrote:
  Could someone confirm that the pattern "node()" matches a
document node?

It is.

I think, this test can verify that:

<xsl:template match="/">
    <xsl:if test=". instance of node()">

This will print "true", if what you've started is true.

Mukul's code shows that the node test node() is true for document nodes, but the pattern node() doesn't match document nodes for the same reason that the xpath expression node() doesn't select document nodes.
in both cases they are abbreviations of child::node() and document nodes are never children.


________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

Current Thread