Hi , I am uisng java api and using xpath to parse my xml.
I have a xml likethis -
<animals>
<dog>
<looks>dangerous </looks>
<bites> hard </bites>
<growls> yes </growls>
</dog>
<cat>nothing special</cat>
</animals>
I would like a xpath condition to print
<dog>
<looks>dangerous </looks>
<bites> hard </bites>
<growls> yes </growls>
</dog>
But I am not able to now.If i use /animal/dog/text() it gives dangerous.But I guess it is used print text alone.Is there a way using xpath condition to fetch a block of xml?
EDIT :
Thanks a lot for your responses.Appreciate your time spent on this.Is there way to do it in java without printing the inner text ?
Here is where my XPATH condition goes -
public static final String XPATH_INPUT_DATA="//text()";
Thanks, Vivek