Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6532

TransformXML Documentation doesn't explain usage of dynamic properties in stylesheets

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.9.2
    • Fix Version/s: None
    • Labels:
      None

      Description

      In the TransformXML Documentation there is a section on Dynamic Properties. It says:

      "These XSLT parameters are passed to the transformer."

      There is no mention on how to use the parameters in a XSLT. Maybe go to add this information to this section:

      From the Saxon documentation:

       

      These parameters are accessible within the stylesheet as normal variables, using the $name syntax, provided they are declared using a top-level xsl:param element. If there is no such declaration, the supplied parameter value is silently ignored.

      If the xsl:param element has an as attribute indicating the required type, then the string value supplied on the command line is cast to this type: this may result in an error, for example if an integer is required and the supplied value cannot be converted to an integer. If the parameter is declared with the option static="yes" (new in XSLT 3.0) then the value is supplied as a static parameter value.

       

      Example:

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

          <xsl:output method="xml"/>

          <xsl:param name = "parameterName" />

          <xsl:template match="/">
              <hdr:messageId><xsl:value-of select="$parameterName"/></hdr:messageId>                                
          </xsl:template>    
          
      </xsl:stylesheet>

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              skin27 Raymond
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: