Re: [xsl] Help moving away from named templates

Subject: Re: [xsl] Help moving away from named templates
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 02 May 2007 17:37:03 +0200
Steve wrote:


1) To display their profile I *could* do:

<xsl:apply-templates match="Records/Record/node()[name()='firstName']"/>

I second David's remarks, but perhaps you are searching a way to uniquely identify the node from your sample, which is currently not unique enough from a larger perspective? Depending on what info is present in your real data, you could take any amount of data that you can use to uniquely identify the user or the 'record'. Most notably: use the ID that you probably have from your database, and do the apply-templates such:


<xsl:apply-templates select="Record[@id ='123']" />
.....
<xsl:template match="Record">
   ... your action here ...
</xsl:template>



-- Abel

PS: you mention a call-template that you want to replace with apply-templates (which is often a good thing). Can we see (part of) your original code that you want to update? Surely you have something that currently does select certain 'records' correctly?

Current Thread