Thunderstone Software Document Search, Retrieval, and Management
Search:
Vortex Manual
 

XSL Parameter Quoting

When passing parameters values to the XSL engine that are string constants, those values must be quoted twice.

<$names = "lang">
<$values = "'EN'">
<$result = (xsltApplyStylesheet($doc, $style, $names, $values))>

The values get two sets of quotes around them, both double and single. The Vortex assignment consumes the outer double quotes, which sets the Vortex variable $values to 'EN'. When the variable is referenced in XSL using <xsl:value-of select="$lang"/>, it resolves to <xsl:value-of select="'EN'"/>. This selects 'the string constant EN', which the desired behavior.

If the Vortex variable is set as <$values = "EN">, then Vortex consumes the quotes and the Vortex variable $values gets the value EN. When this is accessed in XSL using <xsl:value-of select="$lang"/>, it resolves to <xsl:value-of select="EN"/>. This selects 'the contents of the element <EN> in the XML document being transformed'.


Copyright © Thunderstone Software     Last updated: Mon Feb 18 10:28:15 EST 2013
 
Home   ::   Products   ::   Solutions   ::   How to Buy   ::   Support   ::   Contact Us   ::   News   ::   About
Copyright © 2013 Thunderstone Software LLC. All rights reserved.