Custom Web Publishing Guide

Table Of Contents
146 Custom Web Publishing Guide
CDML tag name: Value List Checked
Tag is replaced with the word "checked" for every value list item that has been selected in the specified field.
This is always found within a [FMP-ValueList] loop.
CDML syntax: <input name="fieldname" value="fieldvalue" [FMP-ValueListChecked]>
XSLT-CWP conversion:
1 <xsl:if test="current() = fmrs:field[@name = 'fieldname']/fmrs:data[1]"><xsl:attribute
name="checked">checked</xsl:attribute></xsl:if>
1 when outside of a [FMP-ValueList] loop: <!-- CDML Converter ERROR: [FMP-ValueListChecked]
outside of [FMP-ValueList] -->
1 if not inside an SGML 'input' tag:<!-- CDML Converter ERROR: [FMP-ValueListChecked] not in a valid
location -->
1 if used in document: $layout variable is created at top-level of document
Converted
XSLT-CWP:
<xsl:variable name="valuelist-name" select="$layout/fml:FMPXMLLAYOUT/fml:LAYOUT/
fml:FIELD[@NAME = 'Groups']/fml:STYLE/@VALUELIST"/>
<xsl:for-each select="$layout/fml:FMPXMLLAYOUT/fml:VALUELISTS/fml:VALUELIST[@NAME =
$valuelist-name]/fml:VALUE">
<!-- CDML2XSLT WARNING: [FMP-ValueList] 'List' parameter not supported by XSLT-CWP -->
<input type="radio" name="Groups" value="{current()}"><xsl:if test=". = $current-record/fmrs:field[@name =
'Groups']/fmrs:data[1]"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></
input><xsl:value-of select="{current()}" />
Converted
Result:
<input type="radio" name="Groups" value="Production">Production
<input type="radio" name="Groups" value="Sales" checked>Sales
<input type="radio" name="Groups" value="Support">Support
Conversion example
Original
CDML:
[FMP-ValueList: Groups, List=GroupList]
<input type="radio" name="Groups" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-
ValueListItem]
[/FMP-ValueList]
Converted
XSLT-CWP:
<xsl:variable name="valuelist-name" select="$layout/fml:FMPXMLLAYOUT/fml:LAYOUT/
fml:FIELD[@NAME = 'Groups']/fml:STYLE/@VALUELIST"/>
<xsl:for-each select="$layout/fml:FMPXMLLAYOUT/fml:VALUELISTS/fml:VALUELIST[@NAME = $valuelist-
name]/fml:VALUE">
<!-- CDML2XSLT WARNING: [FMP-ValueList] 'List' parameter not supported by XSLT-CWP -->
<input type="radio" name="Groups" value="{current()}"><xsl:if test="current() = fmrs:field[@name =
'Groups']/fmrs:data[1]">
<xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input><xsl:value-of
select="{current()}" />
</xsl:for-each>
Conversion example