|
Subject: Re: [xsl] Conditional selecting From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 13 Dec 2004 17:34:14 GMT |
Greetings,
Here is a snip of the XSL stylesheet that uses this :
<xsl:apply-templates select="$field_definitions/*[@type = 'EA0']">
<!-- number() makes sure we process field_no as a
number and not a string, otherwise 11 comes before 9 ;) -->
<xsl:sort select="number(field_no)"
order="ascending"/>
better to use
<xsl:sort select="field_no" order="ascending" data-type="number"/>
I think.
<xsl:with-param name="current_context" select="."/>
Why this param, couldn't you just use . in the called template?
</xsl:apply-templates>
I select those records that match the "EA0" record type and then sort them
according to field_no.
My question is in regards to field_no 47. What I want to do is select the
record IF there is a plan_id instead of the record without a plan id. Not
all records will have a plan id.
So if there is a child element of the record node that has a value in the
plan_id field then use that record number instead of the record with the
same number that DOES NOT have the plan_id.
something like:
select="$field_definitions/*[@type = 'EA0']
[plan_id or not(field_no=../*[@type = 'EA0'][plan_id]/field_no)]
Thanks in advance,
Jim Neff
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Conditional selecting, Jim Neff | Thread | RE: [xsl] Conditional selecting, Jim Neff |
| [xsl] Group and filter with XSL, contest.vix | Date | RE: [xsl] Group and filter with XSL, Pieter Reint Siegers |
| Month |