Hello,
Is there any other way to select nodes between First
list and second list using following-sibling of first
list and preceding-sibling of second list.
Can you give me the criteria like using both
following-sibling and prceding-sibling of second
list.
Thanks
Regards,
Raj
--- Mukul Gandhi <gandhi(_dot_)mukul(_at_)gmail(_dot_)com> wrote:
Hi Raj,
Please try this approach. It uses a recursive
named template.
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/main">
<output>
<xsl:call-template
name="select-sibling-elements">
<xsl:with-param name="node" select="list[1]"
/>
</xsl:call-template>
</output>
</xsl:template>
<xsl:template name="select-sibling-elements">
<xsl:param name="node" />
<xsl:if
test="not(name($node/following-sibling::*[1]) =
'list')">
<xsl:copy-of
select="$node/following-sibling::*[1]" />
<xsl:call-template
name="select-sibling-elements">
<xsl:with-param name="node"
select="$node/following-sibling::*[1]" />
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
On 11/17/05, Arulraj <p_arulraj(_at_)yahoo(_dot_)com> wrote:
Hi,
I have the following XML fragment..
<main>
<list>
<item/>
</list>
<table/>
<p name="head1"/>
<p name="head2"/>
<list>
<item/>
</list>
<p name="head3"/>
<list/>
</main>
In my XSL, i want to search the following-sibling
of
<list> item.
so, from the first <list> i am selecting the
following-siblings
it should select only sibling before the next
<list>.
like <table/>, <p name="head1/> and <p
name="head2"/>.
How to do that search criteria in the XSL?
Thanks in advance
Raj
--~------------------------------------------------------------------
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>
--~--
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.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>
--~--