Hello,
After adding the suggested line I got an exception lake it last case.
select="Document[(_at_)filter='' or
@filter=$filter]/Article[count(.|key('by-info',@info)[(_at_)filter='' or
@filter=$filter][1])=1]">
/Michael
From: David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Re: [xslt transform & grouping] Using the Muenchian
Method?
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="*[(_at_)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="*[(_at_)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[(_at_)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[(_at_)filter='' or @filter=$filter]/
Article[count(.|key('by-info',@info)[(_at_)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
________________________________________________________________________
--+------------------------------------------------------------------
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>
--+--
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/