xsl-list
[Top] [All Lists]

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

2010-02-25 10:34:10
On 25/02/2010 16:25, Mukul Gandhi wrote:
On Thu, Feb 25, 2010 at 9:27 PM, Florent Georges<lists(_at_)fgeorges(_dot_)org> 
 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()">
        true
    </xsl:if>
</xsl:template>

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.

David


________________________________________________________________________
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. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--