Subject: RE: [XPath] Type of the first child
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 27 Nov 2001 15:53:13 -0000
|
> I wrote the following predicate, which is to be true if the
> first child is a
> text node:
>
> not(name(*[1]))
>
> It seems to work, but is this correct?
No, it's wrong. "*" will always select an element node, and an element node
always has a name. not(name(node()[1])) would work, as would
node()[1][not(self::*)]
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|