This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [XPath] Type of the first child


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]