Re: [Hypercontent-users] Displaying list
Brought to you by:
alexvigdor
From: Alex V. <al...@bi...> - 2007-09-05 14:19:38
|
Hi Carl, Are you familiar with the Muenchian grouping method? http://www.jenitennison.com/xslt/grouping/muenchian.html That works well when you have many or dynamic categories, although in your case since you have only two fixed categories you could always do something like Academic Staff <xsl:apply-templates select="/cms:wrapper/cms:include/page/ staffbodytext[@academic='yes']"/> Support Staff <xsl:apply-templates select="/cms:wrapper/cms:include/page/ staffbodytext[@academic='no']"/> Cheers, Alex On Sep 5, 2007, at 7:10 AM, Carl P Barrow wrote: > All, > > I'm just trying to accomplish something in XSL and having a some > trouble. There is probably another way of doing it so any pointers/ > ideas welcome. > > All I'm doing it creating a list of staff with contact details from > files in a staff directorty. This list is split into two section > 'Academic' and 'Support' depending on a flag in the XML file. Then > displaying Academic Staff above the Support Staff in a unordered > list. This works, but the problem is that I want to split then into > two lists so that I can have a header/tite for each list, but I'm > having problems. Heres what I have at the moment: > > <xsl:template name="lister"> > <xsl:variable name="academic" select="/cms:wrapper/ > cms:include/page/staffbodytext/@academic"/> > <xsl:apply-templates select="/cms:wrapper/cms:include/page/ > staffbodytext"/> > </xsl:template> > > > > <xsl:template match="staffbodytext"> > <xsl:variable name="emailadd" select="@email"/> > <xsl:variable name="role" select="@roles"/> > <xsl:variable name="academic" select="@academic"/> > <xsl:variable name="include" select="ancestor::cms:include"/> > <xsl:choose> > <xsl:when test="($academic='yes')"> > <li> > <a href="{$rel-project-base}{$include/ > @directory}{$include/@basename}.html"> > <strong> > <xsl:value-of select="@firstname"/> > <xsl:text> </xsl:text> > <xsl:value-of select="@lastname"/> > </strong> > </a><xsl:text> </xsl:text> > <xsl:value-of select="@position"/> > <xsl:choose> > <xsl:when test="string-length($role)!=0"> > <xsl:text>,</xsl:text> > </xsl:when> > <xsl:otherwise> </xsl:otherwise> > </xsl:choose> > <xsl:text> </xsl:text> > <xsl:value-of select="@roles"/> > <br/> Tel:01482 46<xsl:value-of > select="@extention"/>, Email: <a > href="mailto:{$emailadd}"> > <xsl:value-of select="@email"/> > </a> > </li> > </xsl:when> > <xsl:when test="($academic='no')"> > <li> > <a href="{$rel-project-base}{$include/ > @directory}{$include/@basename}.html"> > <strong> > <xsl:value-of select="@firstname"/> > <xsl:text> </xsl:text> > <xsl:value-of select="@lastname"/> > </strong> > </a><xsl:text> </xsl:text> > <xsl:value-of select="@position"/> > <xsl:choose> > <xsl:when test="string-length($role)!=0"> > <xsl:text>,</xsl:text> > </xsl:when> > <xsl:otherwise> </xsl:otherwise> > </xsl:choose> > <xsl:text> </xsl:text> > <xsl:value-of select="@roles"/> > <br/> Tel:01482 46<xsl:value-of > select="@extention"/>, Email: <a > href="mailto:{$emailadd}"> > <xsl:value-of select="@email"/> > </a> > </li> > </xsl:when> > </xsl:choose> > </xsl:template> > > Thanks > Carl > > ************************************* > > Carl Barrow > Systems Integrator > e-Services > The University of Hull > Cottingham Road > Hull > HU6 7RX > Ext. 6838 > > ************************************* > > > > ********************************************************************** > ******************* > To view the terms under which this email is distributed, please go > to http://www.hull.ac.uk/legal/email_disclaimer.html > ********************************************************************** > *******************--------------------------------------------------- > ---------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Hypercontent-users mailing list > Hyp...@li... > https://lists.sourceforge.net/lists/listinfo/hypercontent-users |