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

Subject: Re: [xsl] Pattern "node()" and document nodes
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Thu, 25 Feb 2010 22:28:51 +0530
On Thu, Feb 25, 2010 at 10:03 PM, David Carlisle <davidc@xxxxxxxxx> wrote:
> 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.

I agree. <xsl:template match="node()" .. or say, xsl:value-of
select=""node()/.. etc can never select a document node with pattern,
node() (as you rightly said, that in these cases, node() is an
abbreviation for, child::node()).

But the test ". instance of node()" returns true for document node,
because document node is a kind of node.

Thanks, for the clarification.

Mukul Gandhi

Current Thread