In this step you will add the instructions to assign the passed parameters to XSL variables.
The parameters are passed by the data source template (first three) and by the workflow itself (the fourth parameter).
There's no way to know which parameters to list here but by looking at the data source template and in the workflow (if they exist already), or to your notes (if you are about to create them).
The below code assigns the parameters to the XSL variables:
<xsl:variable name="folderPath" select="$pars/*/add[@key='folderPath']/@value" />
<xsl:variable name="sourceName" select="$pars/*/add[@key='sourceName']/@value" />
<xsl:variable name="copyrightName" select="$pars/*/add[@key='copyrightName']/@value" />
<xsl:variable name="srcPath" select="$pars/*/add[@key='srcPath']/@value" />
You may want to read the explanation about assigning variables in XSL (XSLT: about variables and assigning).
Note
In the above example, the names of XSL variables (e.g. <xsl:variable name="folderPath") and passed parameters (e.g. @key='folderPath') are kept by purpose the same - for better readability. Of course, they could also be different (not recommended).
Should the names of XSL variables be different of the names of passed parameters, in next steps, you should use the names of the XSL variables, and not the names of passed parameters.
Data Source template parameters
When you create a data source template, you can specify any number of parameters to pass to the workflow. All such parameters need to be read into variables in the XSLT. See Create a wire stories data source template for details on how to create parameters.
The purpose of the folderPath parameter in this example is to know in which GN4 folder to store received wire stories.
sourceName is a fixed string that identifies the wire provider.
copyrightName is the name of the copyright owner.
The values of these parameters are passed by the wire stories data source, and can be different for each data source, although many data sources can use the same template.
Workflow parameters
If your workflow contains (or you plan it will contain) the below code (or similar):
<ImportXml.Pars>
<wf:WorkflowParameterBinding
ParameterName="srcPath"
wf:Value="{wf:ActivityBind replicator, Path=DataOut[0].Info.SrcPath}" />
</ImportXml.Pars>
it means you need to add the reading of the srcPath parameter (in this example, only one parameter, as only one gets passed by the workflow - but of course, there could be more parameters as well):
<xsl:variable name="srcPath" select="$pars/*/add[@key='srcPath']/@value" />
The purpose of the srcPath parameter is to give you the file name of the original file, dropped in the input folder of the Back4 queue.
Entire code of this step
<?xml version="1.0" encoding="utf-8"?>
<!--
Simplified XSLT used to import AFP NewsML wires into the system
-->
<story name="{fn:createGuid()}" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="folderPath" select="$pars/*/add[@key='folderPath']/@value" />
<xsl:variable name="sourceName" select="$pars/*/add[@key='sourceName']/@value" />
<xsl:variable name="copyrightName" select="$pars/*/add[@key='copyrightName']/@value" />
<xsl:variable name="srcPath" select="$pars/*/add[@key='srcPath']/@value" />
</story>
Note
At this stage, the code is still incomplete and will still create a story with an automatic name, but no other content, as variables are read, but not used.