[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: grouping after filtering (follow on question: abou

Subject: Re: grouping after filtering (follow on question: about meucheunmethod)
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Fri, 05 Jul 2002 00:10:45 +0200
grouping after muenchian
There, where you use the key() function, the Muenchian Method itself, add a filter, similar to the following:

<xsl:apply-templates select="book[@author='author2'][generate-id() = generate-id(key('books', concat(author, '::', type)))]"/>

Regards,

Joerg

Hi,

Thanks for the reply, however, i was wondering how could i group the data after the orginial xml has been filtered (without writing an intermediate file)?
in the previous example
...
<book>
<author>author1</author>
<name>x box</name>
<type>sc-fi</type>
</book>
<book>
<author>author2</author>
<name>elf story</name>
<type>adventure</type>
</book>
<book>
<author>author1</author>
<name>the return of Dr who</name>
<type>sc-fi</type>
</book>
<book>
<author>author2</author>
<name>something2</name>
<type>sc-fi</type>
</book>
...


what happen if you wish to filter some data out before grouping the item?

for instance
<xsl:template match="book">
<xsl:if test="author='author2'">
<xsl:call-template select="test"/>
</xsl:if>
</xsl:template>

<xsl:template name="test"/>
<!--start grouping the data-->

</xsl:template>

however, if i started to group at this stage (which i want to group it at this stage) using the mucheun method, it will group the unwanted data (the filtered out data) as well as the wanted data which could result to losing data, therefore i was wondering whether it is possible to do so, or do i need to look for another way of grouping them? any feed back would be a great assist.

Many thanks

Regards
Kit


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.