[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: shortest way to write this xsl:if statement

Subject: Re: shortest way to write this xsl:if statement
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Fri, 15 Jun 2012 14:30:05 +0100
Re:  shortest way to write this xsl:if statement
On 15 June 2012 14:24, henry human <henry_human@xxxxxxxx> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.