xsl-list
[Top] [All Lists]

Re: [xsl] shortest way to write this xsl:if statement

2012-06-15 08:30:23
On 15 June 2012 14:24, henry human <henry_human(_at_)yahoo(_dot_)de> wrote:
sorry, but the resul with the xpath- query is the same. The if statement is 
ended after first finding of 'A'

but there are at least for findings for B, C, D which should lead to creation 
of the code bellow of th if-statement
??

Put the xpath in an apply-templates:

<xsl:apply-templates select=" the xpath to select the elements goes here "/>

and then add a template:

<xsl:template match=" the match pattern ">

</xs:template>

Don't use for-each.  You might need to add a mode if you already have
templates matching the elements you are processing here.

You don't need the if test because if the apply-templates selects
nothing, nothing will get processed.

-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--