You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Raymond (JIRA)" <ji...@apache.org> on 2019/08/07 14:16:00 UTC

[jira] [Created] (NIFI-6532) TransformXML Documentation doesn't explain usage of dynamic properties in stylesheets

Raymond created NIFI-6532:
-----------------------------

             Summary: TransformXML Documentation doesn't explain usage of dynamic properties in stylesheets
                 Key: NIFI-6532
                 URL: https://issues.apache.org/jira/browse/NIFI-6532
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Documentation &amp; Website
    Affects Versions: 1.9.2
            Reporter: Raymond


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>

 

 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)