[xsl] How to get innermost ancestor

Subject: [xsl] How to get innermost ancestor
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxx>
Date: Mon, 24 Jul 2006 11:22:25 +0530
Could anyone please let me know that how could I get the innermost ancestor of "imagedata" by xslt. If I want most inner ancestor of <imagedata fileref="abc.tif"/> having attribute "userlevel" than it should return "<sec2 userlevel="4.1.2.1"> not "<chapter userlevel="3.1.2">.

thanks
...JSR

Source XML
<chapter userlevel="3:1.2">
<title>Structuring learning</title>
<sect1>
<title>Introduction</title>
<sect2 userlevel="4:1.2.1">
<title>Common issues</title>
<para>...</para>
<mediaobject>
<imageobject>
<imagedata fileref="abc.tif" format="TIFF"/>
</imageobject>
</mediaobject>
<sect3 userlevel="5:1.2.1">
<title>Common issues</title>
<para>...</para>
<mediaobject>
<imageobject>
<imagedata fileref="abc1.tif" format="TIFF"/>
</imageobject>
</mediaobject>
</sect3>
</sect2>
</sect1>
</chapter>

Current Thread