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

Re: Modes - Necessary Construct or Syntactic Sugar

Subject: Re: Modes - Necessary Construct or Syntactic Sugar
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 19 Mar 2013 09:19:18 +0000
Re:  Modes - Necessary Construct or Syntactic Sugar
On 19/03/2013 08:58, Ihe Onwuka wrote:
Suppose there was a genuine use case for modes. By genuine I mean the
transform requires me to process the same nodes more than once and in
different ways.

Can I do this without using modes.

The first thing that comes to mind is creating an separate stylesheet
for the "2nd mode" and applying it's template rules via apply-imports.
No, this doesn't work. If you only have one mode, then apply-templates selecting a given node N will always select the same template rule. Modes are the only way you can have two different rules that apply to the same node in different circumstances.

Michael Kay
Saxonica

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.