[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: "if-condition-return something" idiom : is it
On 16/06/2014 13:19, Kerry, Richard richard.kerry@xxxxxxxx wrote:
The <xsl:choose><xsl:when><xsl:otherwise> construct is probably most appropriate for cases where the scope of the conditionality is very localised (and would involve not just patterns on the context item, as in this case where you have variables). It also has the benefit of a strict and explicit test-precedence order.And just to be clear, I am asking about XSLT1. (I am doing DocBook transformations and am trying to parse dates as strings) In cases where the conditionality is much more based on conditions pertaining to the context item (i.e. predicates on the node/subtree) and certainly where such possibilities are shared between different situations, then pattern-matching <xsl:template> declarations invoked through <xsl:apply-templates> may be more suitable and extensible. Be warned however that this issue of whether conditionality is explicitly controlled within result trees or attached as predicates to templates can raise semi-religious fervour amongst some parts of the community!
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|