This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: grouping after filtering (follow on question: about meucheun method)



Hi Joerg,
thanks for your reply. I have try the solution you've provided however, it seems to give me the same results as before (i.e. some data can not be display)... i had a look at the source file, it did not displays some result because the processor (i am using xalan-c 1.3) already spotted the data beforehand. (actually i had just spotted a mistake in my example ... i was suppose to group the type only, given that author='author2'. So my key should be <xsl:key name="books" match="book" use="type"/>
)

in my 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>
...
say i was looking for all the type of books written by aurthor2, using the following call the processor will skip the type which it sees before (e.g. sc-fi will not be shown as it already appears previously for author1)

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

therefore i was wondering is there a way to overcome this? (as you suggested) i though by filtering the data first before using the mucheun method (via multiple predicate) could solve the problem, however, it seems it doesn't like. please could you give me some advise over this?

Many thanks

Regards Kit

_________________________________________________________________
使用全球最多人使用的電子郵件服務 MSN Hotmail:http://www.hotmail.com


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]