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

Re: Controlling process flow in a stylesheet?

Subject: Re: Controlling process flow in a stylesheet?
From: "Michael Müller-Hillebrand mmh@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Aug 2014 18:53:18 -0000
Re:  Controlling process flow in a stylesheet?
Am 21.08.2014 um 19:59 schrieb Michael Kay:

> If the parent has a content model A, B, C, D, and any of the four might be
absent, then you could try doing
>
> <xsl:apply-templates select="optional(A, $A), optional(B, $B), optional(C,
$C), optional(D, $D)"/>
>
> where optional(X, Y) is a function that selects X if present or Y otherwise,
and $A, $B etc are global variables containing default elements of each type
(or some other marker to indicate that the element is absent).

Can the function be avoided by writing

<xsl:apply-templates select="(A, $A)[1], (B, $B)[1], (C, $C)[1], (D,
$D)[1]"/>

This method was mentioned earlier in this list and I used it since several
times as a method to handle default values.

- Michael

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.