I am trying to get only top-level text and none of the child text. So I have the following xml:
<job>
text1
<input> text2 </input>
</job>
and I would like to get only the parent text (text1). So in this example, I would do
node.getTextContent();
and get text1, not the text1text2one that currently gives getTextContent. Now I read the man pages , and I know that they say that getTextContent returns the concatenated string of all the children with the parent. But I would like the text from the parent. Another way I thought about this is to try to isolate the parent from the children and run the getTextContent command only for the parent, but I don't know how much this is possible.
Any help would be appreciated
, -Josh