xsl-list
[Top] [All Lists]

RE: alternative for modes

2004-02-12 04:21:38
Okay, thanks a lot for your input, I'll continue doing it on this way then.

Regards,

Peter

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
David Carlisle
Sent: donderdag 12 februari 2004 12:14
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] alternative for modes

  I did not meant it that way: imagine you have to parse a certain node 'x'
(+
  his children) more than 1 time in a stylesheet: each time the parsing of
'x'
  is exactly the same, but the parsing of 'x''s children is different. So
for
  each time I should call the same template for 'x', but that template
should
  call a different template for his children.

Ah what you want then is that the different processing of the children
are in different modes, but that your generic template acts like the
default templates and is "node neutral" in that it works in any mode and
calls apply-templates on the mode that it was called from rather tahn a
mode hard-wired into the code of the template.

Unfortunately this is not available in XSLT1 but (as you have found) it
is seen as a requirement and XSLT2 draft has a more flexible mode
arrangement that addresses this need (but XSLT2 specification is still
just a draft, although saxon7 implements much of it)

So in XSLT1 then something like you have is reasonable I think.

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>