[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: apply-templates and predicates
Subject: Re: apply-templates and predicates
From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Date: Thu, 28 Apr 2005 10:40:24 +0100
|
Yes, I agree, thankyou - this is probably what I've been trying to
articulate! Our input is not particularly variable which is probably why
I've been favouring the former..
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: apply-templates and predicates
Date: Wed, 27 Apr 2005 12:05:57 -0400
Hi Tom,
At 08:37 AM 4/27/2005, you wrote:
when applying templates it is possible to filter out unwanted nodes in a
number of ways, one is by putting a predicate on the apply-templates
command and use modes if you have more than one filter. Another is to
apply-templates to all nodes and put a predicate on the template match -
this avoids the use of modes.
...
Can anyone provide any more or provide advantages of doing the latter?
One advantage of the latter method is that it is more robust in the face of
variable input. For example, if a source document comes in with an element
that hasn't been explicitly accounted for, it will pass through and give
you results for it, whereas in the former approach, it won't.
It makes the technique useful in generalized stylesheets that have to
handle a range of kinds of input. For example, if I had a generic
modification of the identity stylesheet whose only job was to filter out
all elements of a given namespace (and their descendants), I'd probably do
it that way.
Of course, this might be a bug, not a feature, depending on where you sit.
Sometimes you don't want your output to be unpredictable even if your input
is.
Cheers,
Wendell
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger 7.0 today!
http://messenger.msn.co.uk
Current Thread |
Wendell Piez - 27 Apr 2005 16:51:01 -0000
- tom tom - 28 Apr 2005 09:40:40 -0000 <=
tom tom - 27 Apr 2005 16:01:23 -0000
tom tom - 28 Apr 2005 09:31:17 -0000
|
|
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
RSS 2.0 |
|
Atom 0.3 |
|
|