Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-1122

[patch] allow some xsl-function calls with omitted args


    • Type: Improvement
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: fo/unqualified
    • Labels:
    • Environment:
      Operating System: other
      Platform: Other
    • External issue ID:


      This patch allows xsl-functions to be called without
      property name if the xsl spec 1.0 allows one optional
      arg and if omitted the arg is substituted with the
      property for which the expression is being evaluated.

      If the PropetyParser dedects at the end of the parseArgs
      method, that only one arg is missing (compared with the
      expected count of args) and the function object
      allows padding with the function name for which the
      function is called it appends the function name to the
      arg list.

      Changes to Function.java:

      • expand the interface with the declaration for the
        padArgsWithPropertyName method.

      Changes to FunctionBase.java:

      • insert a default method body for the padArgsWithPropertyName
        method that returnes false which is the normal case (don't
        allow padding).

      Changes to FromParentFunction.java:

      • let the padArgsWithPropertyName method return true to
        indicate that filling up the number of args with the
        property name for which the expression is being evaluated.

      Changes to PropertyParser.java:

      • call the parseArgs method with the full function object
        insted only with the nbArgs counter.
      • expanded the parseArgs method as mentioned in the
        general describtion above.

      Open issues / questions:

      • should the arg created in the parseArgs method of the
        PropetyParser be a NCnameProperty instead of a
        StringProperty? The supplemented args are always
        property names and therefore NCNames but i didn't
        see an advantage and choosed the more general
        StringProperty but i am not shure whats better.


      • if the patch is acceptable than adjust the other functions
        who also allow padding with the property name - if i find
        corresponding classes :
      • system-font
      • inherited-property-value
      • (from-parent) done
      • from-nearest-specified-value
      • from-table-column
      • merge-property-values


        1. properties_omitted_propertyname.fo
          3 kB
          gerhard oettl
        2. exprPadWithPropName.patch
          4 kB
          gerhard oettl
        3. exprPadWithPropName.patch
          6 kB
          gerhard oettl
        4. exprPadWithPropName.fo
          3 kB
          gerhard oettl



            • Assignee:
              fop-dev@xmlgraphics.apache.org fop-dev
              gerhard.oettl@oesoft.at gerhard oettl
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: