Re: [xsl] Re: [xslt transform & grouping] Using the Muenchian Method?

Subject: Re: [xsl] Re: [xslt transform & grouping] Using the Muenchian Method?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 5 Oct 2004 17:48:52 +0100
  no output at all. only <Documents></Documents> after adding

    <xsl:template match="Documents">
	<xsl:apply-templates select="*[@filter='' or @filter=$filter]"/>


I was debugging your xpaths not the whole stylesheet.

You process all the Document elements twice
once here:

		<xsl:apply-templates select="*[@filter=$filter]"/>

that never produces any visible output as you don't have any templates matching
Document elements (or child elements) and the default  templates just
copy character data so you just get character data and that is all
white space as all the elements are empty so you just get the
indentation without the elements.

then you process them again with


<xsl:for-each 
select="Document[@filter=$filter]

so you probably want to amend that [] to allow filter=""

Your next problem will be

Article[count(.|key('by-info',@info)[1])=1]

as that just selects the Article element that is first in this key in
document order, but if the first in document order has been filtered out
you will get nothing.

So you probably need

select="Document[@filter='' or @filter=$filter]/
      Article[count(.|key('by-info',@info)[@filter='' or @filter=$filter][1])=1]">

so you select the first Article (after filtering) that is in this key.

But it depends exactly what output you _do_ want.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread