Custom Web Publishing Guide

Table Of Contents
160 FileMaker Server Advanced Custom Web Publishing Guide
CDML tag name: Value List Item
Tag is replaced with the next element of a value list. This is always found within a [FMP-ValueList] loop.
CDML syntax: [FMP-ValueListItem: Checked, Encoding], where Encoding is 'Raw', 'URL', or 'HTML' (default)
XSLT-CWP conversion:
1 when inside SGML element attribute value: {current()}
1 otherwise: <xsl:value-of select="current()" />
1 when outside of a [FMP-ValueList] loop: <!-- CDML Converter ERROR: [FMP-ValueListItem] outside of [FMP-
ValueList]
-->
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() =
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>
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-record/
fmrs:field[@name = 'Groups']/fmrs:data[1]"><xsl:attribute name="checked">checked</
xsl:attribute></xsl:if></input><xsl:value-of select="{current()}" />
Conversion example