Find the Ancestor Parent
Posted: Thu Dec 22, 2022 11:56 am
Hi Team,
I need the ancestor parent of the child node. Please find the below example.
In the below example if my cursor is at any postion i should get parent as disclaimer.
say my cursor is at para of first footnote or second footnote i should get parent as disclaimer.
I am using below methods to get parent but i am getting immediate parent not the ancestor one.
getCommonAncestor();
getStrictCommonAncestor
Please help me on this.
<disclaimer>
<para>
<text.line/>
</para>
<footnote ID=""
xmlns="">
<footnote.body>
<para>
<label.designator/>
</para>
</footnote.body>
</footnote>
<footnote ID=""
xmlns="">
<footnote.body>
<para>
<label.designator/>
</para>
</footnote.body>
</footnote>
</disclaimer>
I need the ancestor parent of the child node. Please find the below example.
In the below example if my cursor is at any postion i should get parent as disclaimer.
say my cursor is at para of first footnote or second footnote i should get parent as disclaimer.
I am using below methods to get parent but i am getting immediate parent not the ancestor one.
getCommonAncestor();
getStrictCommonAncestor
Please help me on this.
<disclaimer>
<para>
<text.line/>
</para>
<footnote ID=""
xmlns="">
<footnote.body>
<para>
<label.designator/>
</para>
</footnote.body>
</footnote>
<footnote ID=""
xmlns="">
<footnote.body>
<para>
<label.designator/>
</para>
</footnote.body>
</footnote>
</disclaimer>