xpath to select text nodes and <br>

Marek (archive)

Usenet Archive
Joined
Feb 14, 2002
Messages
70
Reaction score
0
Hello,

I need to select all descendant text nodes and br elements using a xpath query. So this xml:

<a>
<b>text a</b> text b<br />
<c>text c</c> text d<br />
</a>

results in this node list:

1. text a
2. text b
3. <br>
4. text c
5. text d
6. <br>

I tried a/descendant::*[text or self::br] but that got me some weird results.

Thanks
 

szomiz

Usenet Archive
Joined
Dec 15, 2004
Messages
11
Reaction score
0
I tried a/descendant::*[text or self::br] but that got me some weird results.

a/descendant::node[self::text or self::br]

a/descendant::node[not(node)]

sz.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top