Re: [xsl] XSL Stylesheet and using a metadata file

Subject: Re: [xsl] XSL Stylesheet and using a metadata file
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Tue, 15 Feb 2005 18:06:12 +0100
Tempore 14:16:06, die 02/15/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Jim Neff <jneff@xxxxxxxxxxxxxxx>:

	<xsl:apply-templates select="$field_definitions/type_AA0/*[(plan_id
= current()/provider[1]/claim[1]/plan_id) or (not(plan_id) and
(not(field_no=../type_AA0/*[plan_id =
current()/provider[1]/claim[1]/plan_id]/field_no)))]">

Hi,


this Xpath will never return any node unless there are two 'type_AA0' elements nested.
type_AA0/*[../type_AA0]



Try writing:
<xsl:apply-templates select="$field_definitions/type_AA0/*[(plan_id
= current()/provider[1]/claim[1]/plan_id) or (not(plan_id) and
(not(field_no=../*[plan_id = current()/provider[1]/claim[1]/plan_id]/field_no)))]">


I'm not sure why you're doing a test on the 'field_no'.

Wouldn't this suffice?
<xsl:apply-templates select="$field_definitions/type_AA0/*[(plan_id
= current()/provider[1]/claim[1]/plan_id) or (not(plan_id) and
(not(../*[plan_id = current()/provider[1]/claim[1]/plan_id])))]">



P.S. You could also use keys to increase performance and make the expression easier to understand...


regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Spread the wiki (http://www.wikipedia.org)

Current Thread