Thomas Schmidt wrote:
> I need an XPath which selects all nodes of a specific name which start
> with a text node, i.e. I want the expression to select:
>
> <x>
> abcdefg
> <y>hijklmn</y>
> </x>
>
> but NOT
>
> <x>
> <y>hijklmn</y>
> abcdefg
> </x>
Please note that x has as its first child a text node with white space.
So
//x[node()[1][self::text()]]
holds for both samples.
//x[node()[1][self::text() and normalize-space(.)]]
does hold for the first sample only.
--
Martin Honnen
http://JavaScript.FAQTs.com/