Re: [xsl] Muenchain method

Subject: Re: [xsl] Muenchain method
From: "Jean-Pierre Lamon gipi@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 27 May 2017 08:55:17 -0000
Thank you so much Martin. You save my week end :-)


De : Martin Honnen martin.honnen@xxxxxx
Envoyi : samedi 27 mai 2017 10:34
@ : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : Re: [xsl] Muenchain method

You might want to move to XSLT 2.0 with nested for-each-group where these
kind of problems don't occur, in your case you have defined the key for any
elements but only want to apply it with Muenchian grouping for a subtree,
therefore you have to use a key concatenating the id of the parent node and
the value you want to use:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="";
<>  version="1.1"
    <xsl:output method="html" indent="yes"/>

    <xsl:key name="idxaut"
    <xsl:key name="idxtit" match="indexsort" use="concat(generate-id(..),
'|', .)"/>

    <xsl:template name="AUTHOR" match="collection">

            <xsl:sort select="normalize-space(.)" lang="de-CH"/>
            <xsl:sort select="../indexsort"/>

            <!-- on affiche l'auteur -->
            <xsl:for-each select="current()[count(. | key('idxaut', .)[1]) =
                    <xsl:value-of select="."/>
                <xsl:for-each select="key('idxaut', .)">
                    <xsl:sort select="../indexsort"/>
                    <xsl:for-each select="../indexsort[count(. |
key('idxtit', concat(generate-id(..), '|', .))[1]) = 1]">
                        <xsl:for-each select="key('idxtit',
concat(generate-id(..), '|', .))">

                            <!--<xsl:if test="position()=1"> -->
                            <xsl:for-each select="../datafield[@tag=245]">
                                <xsl:value-of select="."/>
                            <xsl:value-of select="concat(' | ',../recno)"/>
                            <!--</xsl:if> -->


    <xsl:template match="collection">
            <xsl:call-template name="AUTHOR"/>


Am 26.05.2017 um 22:58 schrieb Jean-Pierre Lamon gipi@xxxxxxxxxx:

For a bibliographic list, I'm trying to display author/title index entries.
I'm using the Muenchain method to group books by author/titles.
There's an index for author and titles. Titles are generated from the
indexsort XML node.

Could you try to generate this list with the attached files and see the
result :

The problem :

Affentranger, Urban 1944- (DE-588)1072229609
        Die Renovation der Klosterkirche Disentis im 19. und 20. Jahrhundert
/ Urban Affentranger | 6
        Turnen und Sport an der katholischen Kantonsschule Disentis
1833-1842 / Urban Affentranger | 5
        Turnen und Sport an der katholischen Kantonsschule Disentis
1833-1842 / Urban Affentranger | 7
Blum, Roger 1945- (DE-588)131690035
        Alfred Oberer - Steuermann im Hintergrund / Roger Blum | 3
        Die Mechanik der Politik in Baselland / Roger Blum | 2
Czouz-Tornare, Alain-Jacques 1957- (DE-588)158860152
Pavillon, Olivier
        Introduction / Olivier Pavillon | 1
  --> Introduction / Alain-Jacques Czouz-Tornare | 4 --> should be under

XSL-List info and archive <>
EasyUnsubscribe <-list/2586163>  (by
email <> )

Current Thread