tags:

views:

38

answers:

2

Hi,

I'm trying to retrieve data that's put outside element blocks.

Sample;

<td>
  <b>abc</b> 123 <b>def</b> 456 <b>ghi</b>
</td>

So from this sample I would like to get the 123 and 456.

On this site I found some samples with a not() and that seems to work a bit in the right direction but then 123 & 456 are removed because he only shows the 'other elements'.

So /td/.[not(b)] won't give results at all.

How can I make the date that isn't in an element apear again?

if I only use /td then the data outside an element is shown.

Thanks in advance,
     Edwin

A: 

You need to use text(). See here for an example that is almost identical to you situation.

geowa4
Thanks! that was exactly what I'm looking for.
Edwin
A: 

You should look into XML Node Types, you can specify to only select text nodes. For example:

/td/text()

should return you a list of all the text nodes underneath td

ChrisCM
A bit new to this site but I can't seem to flag your responce.I'll register and mark it as helpfull! :)Thanks to the both, still overwhelmed by the fast response.
Edwin
My reputation isn't high enough yet to mark it but thanks again.
Edwin
only 2 away from being able to upvote. btw flagging means that you think it is offensive. don't do that.
geowa4
I ment the 'This was a good answer flag' ;)
Edwin