xsl-list
[Top] [All Lists]

RE: [xsl] How to get innermost ancestor

2006-07-24 01:11:48
The innermost ancestor of an element that has an attribute @userlevel is
given by the expression

ancestor::*[(_at_)userlevel][1]

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: J. S. Rawat [mailto:jrawat(_at_)techbooks(_dot_)com] 
Sent: 24 July 2006 06:52
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com; 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] How to get innermost ancestor

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>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>