On Jan 24, 9:01 am, Nicholas <nbar...@gmail.com> wrote:
For a short summary on my issue, all that remains is the text()
function returning the string of all the node values under the one i'm
currently working with. This is by design, but I don't want it to do
this and for the life of me cannot discover a way to exclude all the
child nodes from text()!.

The XML example:
<letter>
<paragraph>data
<paragraph>more data
<paragraph>even more data
</paragraph></paragraph></paragraph>
</letter>

I've designed a recursive function to move through the list until it
reaches the end. However, the output looks like this (using the
example above):

1. data more data even more data
2. more data even more data
3. even more data

So, how can i get the text from only the node i'm currently working
with instead of the text from the current and all child nodes? I've
tried various filters and selectors but the results are always the
same, either everything or nothing.

I wrote a plugin for this sort of thing:

http://plugins.kswedberg/textchildren/

interactive demo:

http://plugins.kswedberg/textchildren/#demo

--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

Reply via email to