i have a node with inner text and children’s also have inner Text.
how can i fetch current nodes inner text (without children and its inner Text).
For Example :
<myTag>
myTag Text
<child1>ch1 Text</child1>
<child2>ch2<child3></child3> Text</child2>
some text
</myTag>
Required Result (myTag Inner Text Only):
Find inner text of myTag:
1.myTag Text
<child1>
2.some text
<child2>
Find inner nodes by
x=myTagNode.getchildren()
for(var i=0;i<x.count();i++)
{
if(x[i].type==1)
{
alert(x[i].getName());
}
}
How can i get the inner Text (without children inner Text)?
Try using a treeWalker: