Subject: Re: [xsl] Muench method for two or three keys? (Sorting and Grouping) From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Sun, 16 Jan 2005 13:19:32 +0100 |
So what I need is a sheet that does the following:
a) sorts records by head
b) groups records so that if two subfield1's are children of heads with the same content they are put in the same record
c) repeats the same for subfield2's
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:key name="headkey" match="record" use="head"/> <xsl:key name="sub1" match="subfield1" use="../head"/> <xsl:key name="sub2" match="subfield2" use="../subfield1"/>
<xsl:template match="subfield2[text()]"> <item><xsl:value-of select="."/> <xsl:apply-templates select="../locater"/> </item> </xsl:template>
<xsl:template match="locater"> <xsl:if test="string-length()!=0"> <xsl:text>, </xsl:text> <seg type="locater"> <xsl:value-of select="."/> </seg> </xsl:if> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Vincit omnia simplicitas Keep it simple
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Muench method for two or thre, Daniel O'Donnell | Thread | [xsl] Yes, grouping is possible eve, Dimitre Novatchev |
[xsl] Muench method for two or thre, Daniel O'Donnell | Date | Re: [xsl] Muench method for two or , G. Ken Holman |
Month |