[Bug 17206] New: Making dynamic evaluation via xsl:evaluate more dynamic

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17206

           Summary: Making dynamic evaluation via xsl:evaluate more
                    dynamic
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XSLT 3.0
        AssignedTo: mike@saxonica.com
        ReportedBy: jakub@maly.cz
         QAContact: public-qt-comments@w3.org


The new instruction evaluate allows for dynamic evaluation of expressions in
stylesheets. 

This: 
<xsl:evaluate xpath="'1 + 1'">
</xsl:evaluate>
Returns 2

All variables in the evaluated expression must be bound using with-param, like
in
<xsl:evaluate xpath="'$p1 + $p2'">
  <xsl:with-param name="p1" select="1" />
  <xsl:with-param name="p2" select="2" /> 
</xsl:evaluate> Which returns 3. 

The syntactic rules for with-param are I think the same as in the case of
call-template. Aren't those unnecessarily restrictive in this case? 
I suppose (please correct me, if I am wrong) the cost of dynamic evaluation
would not change much, if attribute value template was allowed for the
attribute name of with-param in evaluate, such e.g.: 
<xsl:evaluate xpath="'$p1 + $p2'">
  <xsl:with-param name="{'p' || '1'}" select="1" />
  <xsl:with-param name="{'p' || '2'}" select="2" /> 
</xsl:evaluate>

Did this question arise when semantics of evaluate was discussed? 
I have encountered a situation where this would come in handy (well, it would
provide an alternative solution to a problem which I solved differently), so
maybe those applications that require dynamic evaluation would appreciate it as
well. I was a bit surprised that it is not possible, because it feels
appropriate to me. When dealing with dynamic evaluation, why not let the names
of variables to by dynamic as well? 

Jakub Maly.  
http://www.xrg.cz

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Saturday, 26 May 2012 20:45:38 UTC