Sign In/My Account | View Cart  
advertisement

Article:
 XSLT Reflection
Subject: Real Reflection ?
Date: 2003-11-07 04:57:59
From: Franck Guillaud
Response to: Real Reflection ?

University is far away from my memory now, but AFAIK reflection is the ability for a language to evaluate itself. Doesn't this imply evaluation of dynamical
constructs ?

No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Titles Only Titles Only Newest First
  • Real Reflection ?
    2003-11-10 12:41:12 Dimitre Novatchev [Reply]

    The FXSL functional programming library for XSLT makes it possible to dynamically generate new functions (and apply them). This can be done through a number of ways -- e.g. functional composition, partial application (currying) or what is equivalent to creation of new functions using lambda expressions.


    Read for example:


    http://www.idealliance.org/papers/extreme03/xslfo-pdf/2003/Novatchev01/EML2003Novatchev01.pdf


    or the PPT presentation at:


    http://www.idealliance.org/papers/extreme03/author-pkg/2003/Novatchev01/EML2003Novatchev01.zip



    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


  • Real Reflection ?
    2003-11-07 06:41:46 Jirka Kosek [Reply]

    It is a matter of definition, which can vary from person to person. But as Oleg said the reflection is only reflection -- it allows you to access code writen in some language within this language. This way works reflection in many other languages, e.g. Java.


    Dynamic evaluation of the code during the runtime means that you have programmatic access to compiler/interpreter at runtime. This is a built-in feature of some langauges. XSLT doesn't offer this, but it should be possible (at least in theory) to implement XSLT processor in XSLT and then you will be able to do dynamic evaluation at the runtime.

    • Real Reflection ?
      2005-01-17 12:00:15 mnl05 [Reply]

      I had a question regarding xsl revision. Once we dynamically generate xsl file and deploy it on cliet site, client might do some additional but restricted changes such as add few lines of text in between. In next phase, we might also do some changes in the xsl and now the challenge is to incorporate the changes the client has done in the previous version of xsl into new file we are going to deploy in this next phase. I would really appreciate the suggestion as to what would be the right approach.


      Best regards,
      mnl05


      • Real Reflection ?
        2005-01-18 07:03:49 Jirka Kosek [Reply]

        You can do this if you make your stylesheets modular. In every place where user is expected to insert something place call for named template (xsl:call-template). This template will be empty by default.


        Then deploy your stylesheet as two files -- main stylesheet and driver that will just import main stylesheet. Users will use driver stylesheet and once they want to modify something they can redefine appropriate named template in driver file.


        Such way in a future you will just distribute main stylesheet after changes because all customizations will be stored in the driver file.


        If you want more straightforward solution you can try to fiddle with tools like XmlDiff to propagate changes from user back to metadata that were used to create stylesheet dynamically.


Sponsored By: