home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Audio / Office2010 / InfoPath.en-us / InfLR.cab / IPDSINTL.DLL_1033 / HTML / OPTIONBUTTON.XCT < prev    next >
Extensible Markup Language  |  2010-03-29  |  6KB  |  1 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?><!-- _lcid="1033" _version="" --><!-- _LocalBinding --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"><xsl:output method="html"></xsl:output><xsl:param name="XPath"></xsl:param><xsl:template match="*|@*"><xsl:variable name="xsdType" select="xd:aj_getPropByName('xsdType')"></xsl:variable><xsl:variable name="typedOnValue"><xsl:choose><xsl:when test="$xsdType = 'boolean'"><xsl:choose><xsl:when test="(. = 'true') or (. = 'false') or (. = '')">true</xsl:when><xsl:when test="(. = '0') or (. = '1')">1</xsl:when></xsl:choose></xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="typedOffValue"><xsl:choose><xsl:when test="$xsdType = 'boolean'"><xsl:choose><xsl:when test="(. = 'true') or (. = 'false') or (. = '')">false</xsl:when><xsl:when test="(. = '0') or (. = '1')">0</xsl:when></xsl:choose></xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="strTrueString"><!-- _locID_text="OptionButtonLabel_True_DisplayText"  _locComment="{StringCategory=TXT}" -->Yes</xsl:variable><xsl:variable name="strFalseString"><!-- _locID_text="OptionButtonLabel_False_DisplayText"  _locComment="{StringCategory=TXT}" -->No</xsl:variable><xsl:variable name="enumValues" select="xd:aj_getEnumerationVals(.)"></xsl:variable><xsl:variable name="cenumValues"><xsl:choose><xsl:when test="$XPath"><xsl:value-of select="count($enumValues)"></xsl:value-of></xsl:when><xsl:otherwise><xsl:value-of select="number(0)"></xsl:value-of></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="nodeID" select="xd:aj_getNodeID(.)"></xsl:variable><xsl:variable name="currentNode" select="."></xsl:variable><xsl:choose><xsl:when test="$cenumValues > 0"><xsl:for-each select="$enumValues"><xsl:call-template name="InsertOptionButton"><xsl:with-param name="onValue" select="string(.)"></xsl:with-param><xsl:with-param name="nodeID" select="$nodeID"></xsl:with-param><xsl:with-param name="currentNode" select="$currentNode"></xsl:with-param><xsl:with-param name="optionsCount" select="number(1)"></xsl:with-param></xsl:call-template></xsl:for-each></xsl:when><xsl:when test="$xsdType = 'boolean'"><xsl:call-template name="InsertOptionButton"><xsl:with-param name="onValue" select="$typedOnValue"></xsl:with-param><xsl:with-param name="nodeID" select="$nodeID"></xsl:with-param><xsl:with-param name="currentNode" select="$currentNode"></xsl:with-param><xsl:with-param name="optionsCount" select="number(1)"></xsl:with-param></xsl:call-template><xsl:call-template name="InsertOptionButton"><xsl:with-param name="onValue" select="$typedOffValue"></xsl:with-param><xsl:with-param name="nodeID" select="$nodeID"></xsl:with-param><xsl:with-param name="currentNode" select="$currentNode"></xsl:with-param><xsl:with-param name="optionsCount" select="number(1)"></xsl:with-param></xsl:call-template></xsl:when><xsl:otherwise><xsl:variable name="Count" select="xd:aj_getPropByName('OptionsCount')"></xsl:variable><xsl:variable name="optionsCount"><xsl:choose><xsl:when test="$Count > 0"><xsl:value-of select="$Count"></xsl:value-of></xsl:when><xsl:otherwise><xsl:value-of select="'1'"></xsl:value-of></xsl:otherwise></xsl:choose></xsl:variable><xsl:call-template name="InsertOptionButton"><xsl:with-param name="onValue" select="number(1)"></xsl:with-param><xsl:with-param name="nodeID" select="$nodeID"></xsl:with-param><xsl:with-param name="currentNode" select="$currentNode"></xsl:with-param><xsl:with-param name="optionsCount" select="number($optionsCount)"></xsl:with-param></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="InsertOptionButton"><xsl:param name="onValue"></xsl:param><xsl:param name="nodeID"></xsl:param><xsl:param name="currentNode"></xsl:param><xsl:param name="optionsCount" select="number(1)"></xsl:param><xsl:variable name="scriptingID" select="xd:aj_getComponentID()"></xsl:variable><DIV><INPUT TYPE="RADIO" CLASS="xdBehavior_Boolean" TITLE="" xd:CtrlId="{$scriptingID}" xd:xctname="OptionButton" xd:aj_bound0="xd:value" xd:aj_if="CHECKED" xd:aj_tabIndex="0" tabIndex="0"><xsl:choose><xsl:when test="$XPath"><xsl:attribute name="NAME"><xsl:value-of select="generate-id($currentNode)"></xsl:value-of></xsl:attribute><xsl:attribute name="xd:aj_type">0</xsl:attribute><xsl:attribute name="xd:aj_attrtype_msovalue">text</xsl:attribute><xsl:attribute name="xd:aj_node_msovalue"><xsl:value-of select="$XPath"></xsl:value-of></xsl:attribute><xsl:attribute name="xd:aj_uniqueid_msovalue"><xsl:value-of select="$nodeID"></xsl:value-of></xsl:attribute><xsl:attribute name="xd:onValue"><xsl:value-of select="$onValue"></xsl:value-of></xsl:attribute><xsl:attribute name="xd:value"><xsl:value-of select="$currentNode"></xsl:value-of></xsl:attribute><xsl:attribute name="xd:boundProp">xd:value</xsl:attribute><xsl:attribute name="xd:binding"><xsl:value-of select="$XPath"></xsl:value-of></xsl:attribute><xsl:if test="string($currentNode) = string($onValue)"><xsl:attribute name="CHECKED">CHECKED</xsl:attribute></xsl:if></xsl:when><xsl:otherwise><xsl:attribute name="xd:onValue"><xsl:value-of select="$onValue"></xsl:value-of></xsl:attribute><xsl:attribute name="xd:value">false</xsl:attribute></xsl:otherwise></xsl:choose></INPUT></DIV><xsl:if test="$optionsCount > 1"><xsl:call-template name="InsertOptionButton"><xsl:with-param name="onValue" select="number($onValue + 1)"></xsl:with-param><xsl:with-param name="nodeID" select="$nodeID"></xsl:with-param><xsl:with-param name="currentNode" select="$currentNode"></xsl:with-param><xsl:with-param name="optionsCount" select="number($optionsCount - 1)"></xsl:with-param></xsl:call-template></xsl:if></xsl:template></xsl:stylesheet>