This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: [XPath] Type of the first child
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 27 Nov 2001 15:53:13 -0000
- Subject: RE: [xsl] [XPath] Type of the first child
- Reply-to: xsl-list at lists dot mulberrytech dot com
> 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