Re: [xsl] Problems sorting data

Subject: Re: [xsl] Problems sorting data
From: Glenn Thomas Hvidsten <gth@xxxxxxxxx>
Date: Mon, 04 Jul 2005 16:07:41 +0200
David Carlisle wrote:
without any nested xsl:templates?

I can't really guess what a nested template would mean.

A template within a template


<template>
	<template>
	</template>
</template>


But I considered what you said about having a template within another template was not a good thing and twisted my mind around that. So now I've got this XSLT (also added the string to the sorting, courtesy of David):


<xsl:template match="report">
    <xsl:apply-templates match="contents"/>
</xsl:template>

<xsl:template match="contents">
	<xsl:apply-templates>
		<xsl:sort select="member[@name='idstring']/string"/>
	</xsl:apply-templates>
</xsl:template>

<xsl:template match="object[@type='standard']">
    <xsl:value-of select="member[@name='idstring']"/>
    <xsl:value-of select="member[@name='id']"/>
    <xsl:value-of select="member[@name='title']"/>
</xsl:template>


This workes just the way I want it, so unless you guys can see something wrong with this I can happily get out of the office :)


GTH

Current Thread