Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: XSLT: modularizing select condition

Reply
Thread Tools

Re: XSLT: modularizing select condition

 
 
Martin Honnen
Guest
Posts: n/a
 
      08-04-2003


Aleksi Kallio wrote:
> I am doing this:
>
> <xsl:apply-templates select="field[contains(input/@name, 'title')]" />
> <xsl:apply-templates select="field[not (contains(input/@name,
> 'title'))]" />
>
> Ie. I first apply templates to field-elements that satisfy a given
> condition and then to rest of them. Condition will get very long and
> complex.
>
> What's the easiest way to modularize the condition, to avoid duplicating
> it?


You can store it in a variable
<xsl:variable ame="condition" select="contains..." />
and then use
<xsl:apply-templates select="field[$condition]" >
I think



--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Andy Fish
Guest
Posts: n/a
 
      08-04-2003
I bet you can't

IMHO you would need an extension such as EXSLT's 'dynamic' to do this.

"Martin Honnen" <> wrote in message
news:...
>
>
> Aleksi Kallio wrote:
> > I am doing this:
> >
> > <xsl:apply-templates select="field[contains(input/@name, 'title')]" />
> > <xsl:apply-templates select="field[not (contains(input/@name,
> > 'title'))]" />
> >
> > Ie. I first apply templates to field-elements that satisfy a given
> > condition and then to rest of them. Condition will get very long and
> > complex.
> >
> > What's the easiest way to modularize the condition, to avoid duplicating
> > it?

>
> You can store it in a variable
> <xsl:variable ame="condition" select="contains..." />
> and then use
> <xsl:apply-templates select="field[$condition]" >
> I think
>
>
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with while condition OR condition Bill W. Ruby 13 05-09-2011 09:42 PM
select gridview row without using select button? =?Utf-8?B?RGFiYmxlcg==?= ASP .Net 5 02-27-2009 02:56 AM
Condition outside loop or separate loop for different condition? - Java 12 06-15-2005 08:50 AM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57