Re: Fw: Is there a way to define groups of templates ?

Subject: Re: Fw: Is there a way to define groups of templates ?
From: James Clark <jjc@xxxxxxxxxx>
Date: Sat, 26 Sep 1998 08:01:51 +0700
Oren Ben-Kiki wrote:
> Suppose that it was valid to say:
> 
> <xsl:set name="my-variable" value="some-value">
> 
> And later specify, in any pattern, "variable(my-variable)='some-value'".
> This would be legal in qualifiers, and would behave just like
> "attribute(name)='value'" except it would access the global variables table
> instead of the element's attributes.
> 
> We'd also like 'xsl:set' to have an optional "global" modifier, which
> supresses reseting the variable to its original state once the current rule
> is done. The ability _not_ to restore the variable at the end of the rule
> gives raise to interesting possibilities...

> Do you see any disadvantage to this idea?

XSL isn't just intended for batch processing.  For example, XSL should
allow you to write a WYSIWYG XML editor that uses XSL to display the
XML.  It should be possible to construct the formatting object tree
incrementally.  Any sort of global state makes this very hard to do.
  
Also remember that the intended audience for XSL isn't people like you
(or I suspect most of the people on this list).  I would guess most
people on this list are comfortable writing a perl script or maybe a bit
javascript.  If XSL is to succeed, it must be accessible to people who
don't have those kinds of skills (eg graphic artists).  Although setting
and accessing variables is easy and intuitive for programmers or people
with programming experience, it isn't so good for non-programmers.

James



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


Current Thread