xsl-list
[Top] [All Lists]

Re: Can XSLT remember the occurrence of an element?

2005-04-27 10:52:08
----- Original Message ----- From: "Thorsten Scherler" <thorsten(_at_)apache(_dot_)org>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Wednesday, April 27, 2005 6:43 PM
Subject: [xsl] Can XSLT remember the occurrence of an element?


Hello list,

can XSLT remember the occurrence of an element?

e.g. XML:
<forrest:view type="xhtml">
 <forrest:contract name="meta"/>
 <forrest:hook name="container">
   <forrest:contract name="grouplogo"/>
   <forrest:contract name="searchbox"/>
   <forrest:hook name="spacer" />
   <forrest:contract name="nav"/>
   <forrest:contract name="content"/>
 </forrest:hook>
 <forrest:contract name="searchbox"/>
 <forrest:contract name="feedback"/>
</forrest:view>

e.g. XSL:
<xsl:for-each select="forrest:view[(_at_)type=$format]//forrest:contract">
 <xi:include 
href="cocoon://get(_dot_)contract(_dot_){$format}(_dot_){(_at_)name}"/>
</xsl:for-each>

The xsl would include now *two* times the searchbox contract, but it
*has to* be only one time.

Any ideas how I could change the xsl to only include *one* instance of a
contract despite it is *two or more* times called? Is there a way that
xsl remembers the occurrence of an element in the above given example?

TIA

salu2
--
thorsten

Basically you need to get a distinct list. See this link on grouping on how to do this:
http://www.jenitennison.com/xslt/grouping/muenchian.html

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