Custom Web Publishing Guide

Table Of Contents
Converting CDML solutions to FileMaker XSLT 139
CDML tag name: Option
Tag replaced with all the values in the value list of the field in that layout
CDML syntax: [FMP-Option: FieldName, List=ValueListName]
Note To be converted properly, the "[FMP-Option]" CDML tag requires field(s) on the layout that reference
the specified value list(s).
XSLT-CWP conversion:
1 <xsl:variable name="valuelist-name" select="$layout/fml:FMPXMLLAYOUT/fml:LAYOUT/fml:FIELD[@NAME = 'field3']/
fml:STYLE/@VALUELIST"/><xsl:for-each select="$layout/fml:FMPXMLLAYOUT/fml:VALUELISTS/
fml:VALUELIST[@NAME = $valuelist-name-4]/fml:VALUE"><option value="{current()}"><xsl:if test="current() = $default-
record/fmrs:field[@name = 'field3']/fmrs:data[1]"><xsl:attribute name="selected">selected</xsl:attribute></
xsl:if><xsl:value-of select="current()"/></option></xsl:for-each>
1 when current context is a record: use fmrs:field[@name = 'FieldName']/fmrs:data[1] above
1 otherwise: use /fmrs:fmresultset/fmrs:resultset/fmrs:record[1]/fmrs:field[@name = 'FieldName']/
fmrs:data[1] above
1 parameter 'List' is ignored: <!-- CDML2XSLT WARNING: [FMP-Option] 'List' parameter not supported
by XSLT-CWP
-->
1 if inside an SGML tag/attribute: <!-- CDML Converter ERROR: [FMP-Option] not in a valid location -->
1 if used in document: $layout variable is created at top-level of document
Conversion example
Original
CDML:
<select name="Groups">
[FMP-option: Groups]
</select>
Converted
XSLT-CWP:
<select>
<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">
<option value="{current()}"><xsl:if test="current() = $default-record/fmrs:field[@name = 'Groups']/
fmrs:data[1]"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:value-of
select="current()"/></option></xsl:for-each>
</select>
Converted
Result:
<select name="Groups">
<option> Production
<option selected> Sales
<option> Support
</select>