tags:

views:

30

answers:

2

Hi,

Let say that I have xml like this:

<root>
    <node light="somevalue">message1</node>
    <node dark="somevalue">message2</node>
    <node>message3</node>
</root>

With xpath usage I need to get "message3".

Does anybody know how I can achieve this?

+1  A: 

I think you mean that you want to select nodes without attributes.

From http://stackoverflow.com/questions/1323755/xpath-how-to-select-nodes-which-have-no-attributes

//node[not(@*)]

This will select all nodes that do not have attributes.

Ryan Berger
+1  A: 
/root/node[not(@*)]/text()
Steven D. Majewski