xsl-list
[Top] [All Lists]

Re: [xsl] To find out immediate following tag(S)

2008-10-07 06:55:53
It was just a snippet of code not the full templates...you can try
something like below....you need to make changes according to the
actual requirement...

<xsl:template match="a">
<a>
<xsl:for-each-group select="current-group() except ."
           group-starting-with="a1 | b1">
           <xsl:apply-templates select="." mode="group"/>
</xsl:for-each-group>
</a>
</xsl:template>

<xsl:template match="a1 | b1">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>



On Tue, Oct 7, 2008 at 12:04 PM, J. S. Rawat <jrawat(_at_)aptaracorp(_dot_)com> 
wrote:
output of this is
<doc>ten</doc>
only

At 11:43 AM 10/7/2008, Mandar Jagtap wrote:

Well...in that case you need to use xsl:for-each-group, I guess...for
example...

<xsl:template match="a">
<xsl:for-each-group select="current-group() except ."
           group-starting-with="a1 | b1">
           <xsl:apply-templates select="." mode="group"/>
</xsl:for-each-group>
</xsl:template>

Hope this helps!!

....Mandar Jagtap


On Tue, Oct 7, 2008 at 9:47 AM, J. S. Rawat 
<jrawat(_at_)aptaracorp(_dot_)com> wrote:
Following line is copying all the following siblings. But we need
immediate
following siblings!!!

following-sibling::*....


--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>
--~--





-- 
Thanks & Regards,
Mandar

--~------------------------------------------------------------------
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>
--~--