• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xsl design

 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why is xsl the way it is?. Why can't a variable once assigned a value cannot be re-assigned. Can someone illustrate with a simple example as to why xsl designers chose to design the language that way?
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by karthik Guru:
why is xsl the way it is?. Why can't a variable once assigned a value cannot be re-assigned. Can someone illustrate with a simple example as to why xsl designers chose to design the language that way?



reassignment is more expensive than new assignment(and having a new variable in the stack). Probably that is why!!!
 
Author
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the goals of XSLT design was to make separate templates totally independent and free of side effects. This means that the output of a template depends solely on its input, parameters, and global constants - and on nothing else. In particular, the result of a template does NOT depend on the order in which the templates are executed. This has significant practical advantages (e.g. you can run the templates in parallel) and generally makes the stylesheet much more modular and easier to maintain. Non-changeable variables are an important part of this approach.

Languages similar to XSLT in this respect are called _functional_. Read this classic paper for the rationale and the advantages of functional programming:

http://www.md.chalmers.se/~rjmh/Papers/whyfp.html
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic