4D v14.3XSLT SET PARAMETER |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
XSLT SET PARAMETER
XSLT SET PARAMETER
The XSLT SET PARAMETER command must be used jointly with the XSLT APPLY TRANSFORMATION command. It allows you to define values of variable parameters placed in an XSL style sheet when the XSLT transformation of an XML document begins. Using this command, it is possible to insert values coming from 4D processes in the XSL style sheets right before using XSLT APPLY TRANSFORMATION. Notes:
Pass the name of the XSL variable parameter to replace in paramName. This parameter must be present in the XSL style sheet as $toreplace. However, the $ character is not necessary in paramName. For example, if the instruction <xsl:template match=$myvar> is placed in the XSL file, simply pass “myvar” in paramName to set this parameter. In paramValue, pass the value that you wish to insert instead of the XSL variable in the transformed file. To use the above example, if you pass “title” in paramValue, the XSLT traansformation will take into account the <xsl:template match="title"> instruction (which set “title” elements as subject to style rules). If the value type is string, you must include it between single quotes (for example 'myvalue') — in addition to the double quotes of the 4D syntax ("'myvalue'"). Note: For a detailed description of XSL language, you can refer to a number of sites on the Internet dedicated to this language. For example, http://xml.org. To pass several parameters in an XSL style sheet, simply call the XSLT SET PARAMETER command several times. The parameters are “stacked” until the XSLT APPLY TRANSFORMATION call in the same process. Once XSLT APPLY TRANSFORMATION is executed, the “stack” of parameters is automatically deleted. The following example defines two XSL parameters then transforms the document mydoc.xml into an HTML file using the style sheet mysheet.xsl: XSLT SET PARAMETER("varstyle";"'bold'") If the command has been executed correctly, the system variable OK is set to 1. Otherwise, it is set to 0. |
PROPERTIES
Product: 4D
HISTORY
Created: 4D 2004 SEE ALSO
XSLT APPLY TRANSFORMATION ARTICLE USAGE
4D Language Reference ( 4D v12.4) Inherited from :
SET XSLT PARAMETER ( 4D v11 SQL Release 6) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||