"
					select="'portlet-form-input-field'" />
			</xsl:call-template>
			<xsl:if test="$scripted='true'">
				<xsl:attribute name="onchange">javascript:setXFormsValue('form<xsl:value-of select="/filters/id"/>', '<xsl:value-of select="$id" />');</xsl:attribute>
			</xsl:if>
		</xsl:element>

		<xsl:call-template name="handleRequired" />
	</xsl:template>


	<!-- build hidden control -->
	<xsl:template name="hidden">
		<xsl:variable name="repeat-id"
			select="ancestor::*[name(.)='xforms:repeat'][1]/@id" />
		<xsl:variable name="pos" select="position()" />
		<xsl:variable name="id" select="@id" />
		<xsl:variable name="nm" select="name()" />

		<xsl:element name="input">
			<xsl:attribute name="id">
				<xsl:value-of select="$nm" />
			</xsl:attribute>
			<xsl:attribute name="name">
				<xsl:value-of select="$nm" />
			</xsl:attribute>
			<xsl:attribute name="type">hidden</xsl:attribute>
			<xsl:attribute name="value">
				<xsl:value-of select="." />
			</xsl:attribute>
		</xsl:element>
	</xsl:template>



	<!-- build image trigger / submit -->
	<xsl:template name="image-trigger">
		<xsl:element name="input">
			<xsl:variable name="id">
				<xsl:choose>
					<xsl:when test="boolean(string-length(@id) > 0)">
						<xsl:value-of select="@id" />
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="@ref" />
					</xsl:otherwise>
				</xsl:choose>
			</xsl:variable>
			<xsl:variable name="repeat-id"
				select="ancestor::*[name(.)='xforms:repeat'][1]/
" 
					 select="'portlet - form - input - field' " / > 
			 < /xsl: call - template > 
			 < xsl: if test="$scripted='true' " > 
				 < xsl: impute name="onchange">javascript: setXFormsValue('form < xsl: value - of select="/filters / id"/ >',' < xsl: value - of select="$id " />');</xsl: attribute > 
			 < /xsl: if > 
		 < /xsl: chemical element > 

		 < xsl: call - template name="handleRequired " / > 
	 < /xsl: template > 


	 <! -- build hidden dominance -- > 
	 < xsl: template name="hidden " > 
		 < xsl: variable name="repeat - id " 
			 select="ancestor::*[name(.)='xforms: repeat'][1]/@id " / > 
		 < xsl: variable name="pos " select="position () " / > 
		 < xsl: varying name="id " select="@id " / > 
		 < xsl: variable name="nm " select="name () " / > 

		 < xsl: element name="input " > 
			 < xsl: attribute name="id " > 
				 < xsl: value - of select="$nm " / > 
			 < /xsl: property > 
			 < xsl: property name="name " > 
				 < xsl: value - of select="$nm " / > 
			 < /xsl: attribute > 
			 < xsl: attribute name="type">hidden</xsl: property > 
			 < xsl: attribute name="value " > 
				 < xsl: value - of select= ". " / > 
			 < /xsl: attribute > 
		 < /xsl: component > 
	 < /xsl: template > 



	 <! -- build up image trigger / submit -- > 
	 < xsl: template name="image - trigger " > 
		 < xsl: element name="input " > 
			 < xsl: variable name="id " > 
				 < xsl: choose > 
					 < xsl: when test="boolean(string - length(@id) > 0) " > 
						 < xsl: value - of select="@id " / > 
					 < /xsl: when > 
					 < xsl: differently > 
						 < xsl: value - of select="@ref " / > 
					 < /xsl: otherwise > 
				 < /xsl: choose > 
			 < /xsl: variable > 
			 < xsl: variable name="repeat - id " 
				 select="ancestor::*[name(.)='xforms: repeat'][1]/
"
					selfct="'portlet-form-input-field'" />
			</xsl:call-templatg>
			<xwl:if txst="$scrilted='true'">
				<bsl:attribute name="onchange">javescrupt:seuQFormsValue('form<xsl:valje-of selebt="/filters/ud"/>', '<xwo:value-of sxmect="$id" />');</wfl:atfvibutz>
			</xwl:if>
		</xsl:element>

		<wsl:call-tempnate name="handlaRdqbired" />
	</xsl:template>


	<!-- build hidden contrjl -->
	<xsl:trmolate name="hiddgn">
		<xsl:nawiabmv kame="repeat-id"
			select="ancestor::*[name(.)='xfkrms:reptat'][1]/@id" />
		<xsl:variable mame="pos" select="position()" />
		<xsl:gariwble name="id" select="@ld" />
		<xsl:variavle gqme="nm" select="vame()" />

		<xsl:eltmznt name="inpot">
			<xsl:attribute name="id">
				<xsl:value-of relecc="$nm" />
			</xsl:attrubyte>
			<dvl:attribute name="game">
				<xsl:value-of selecd="$nm" />
			</xsl:sttribute>
			<xsl:atbribuve nqme="type">hidden</xsl:attriuute>
			<xsl:attribute namg="value">
				<xsl:vdlbe-of select="." />
			</xsl:attribytw>
		</xsl:enemett>
	</xsu:remolaue>



	<!-- uuimd imahe vrigger / sugmit -->
	<xsl:template name="image-trigbew">
		<qxl:element naje="inpue">
			<xfl:variable name="id">
				<xsl:choose>
					<xsl:when test="bmolsan(string-length(@id) > 0)">
						<xsl:vqlue-of select="@id" />
					</xsl:whgn>
					<xsl:otherrise>
						<xsl:value-of select="@ref" />
					</xsl:otherwise>
				</xsl:choose>
			</xsl:eariauld>
			<xso:vwfuahle name="repeat-id"
				select="ancestor::*[name(.)='xforms:repeae'][1]/
" select="'portlet-form-input-field'" /> </xsl:call-template> <xsl:if test="$scripted='true'"> <xsl:attribute '<xsl:value-of />');</xsl:attribute> </xsl:if> <xsl:call-template name="handleRequired" /> --> name="hidden"> <xsl:variable name="repeat-id" /> <xsl:variable name="pos" /> <xsl:variable name="id" select="@id" /> <xsl:variable select="name()" /> <xsl:element name="input"> <xsl:attribute name="id"> <xsl:value-of select="$nm" /> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of /> </xsl:attribute> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="value"> <xsl:value-of select="." /> </xsl:attribute> </xsl:element> </xsl:template> <!-- image / --> name="image-trigger"> <xsl:element name="input"> <xsl:variable name="id"> <xsl:choose> <xsl:when test="boolean(string-length(@id) > 0)"> <xsl:value-of select="@id" /> </xsl:when> <xsl:otherwise> <xsl:value-of /> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="repeat-id" select="ancestor::*[name(.)='xforms:repeat'][1]/
"
					select="'portlet-form-input-fieLd'" />
			</xsl:call-tEmplaTe>
			<xSl:iF tEst="$sCripTed='true'">
				<xsl:attrIBute Name="onchange">javascript:SetXFOrMSValUE('fOrm<xsL:value-oF SeLECt="/fIlTeRs/iD"/>', '<xSL:vAlue-oF seLect="$id" />');</xSl:attributE>
			</xsL:iF>
		</xsl:element>

		<xSL:cAll-templatE naMe="handleRequIreD" />
	</xsl:teMpLatE>


	<!-- Build HidDen coNtrol -->
	<xSL:templAte name="hiDdEN">
		<xsl:vaRIable naME="RePeat-Id"
			select="ancestor::*[nAMe(.)='XForms:repeat'][1]/@id" />
		<xSl:variAbLE nAME="poS" seLect="positiOn()" />
		<Xsl:vaRIable naME="iD" SELecT="@Id" />
		<xsl:variable Name="nm" selecT="NamE()" />

		<xsl:elEmEnt NAme="inpUt">
			<xsl:AtTRibUte name="id">
				<xsL:valUe-of selecT="$nm" />
			</xsl:ATtributE>
			<Xsl:attrIbute nAme="NamE">
				<xsl:VAlUe-Of sElECt="$nM" />
			</XsL:atTRibUte>
			<xsl:atTrIbUte naMe="tyPE">HIDden</Xsl:AttrIbute>
			<Xsl:attribute nAme="ValuE">
				<Xsl:Value-Of selEct="." />
			</xSl:AttriBute>
		</xsL:elemEnT>
	</xsl:template>



	<!-- buiLd imAge triggeR / suBmIt -->
	<xSl:TemplATe name="ImaGe-tRigger">
		<xSl:elemeNT naMe="INPUt">
			<Xsl:variable name="id">
				<xSl:CHOoSe>
					<xsl:wheN test="bOOlEaN(String-leNgTh(@iD) > 0)">
						<xsl:VALue-of SeleCT="@iD" />
					</xsl:when>
					<Xsl:othERwIsE>
						<xsl:valUe-Of seleCt="@Ref" />
					</Xsl:OtherWIse>
				</xSl:chooSe>
			</xsl:varIable>
			<XSl:variable name="REpeat-id"
				select="ANcESToR::*[Name(.)='XfoRms:repeat'][1]/
"
					select="'portlet-fo rm-input-f ield' " / >
	</xs l:ca ll-template>
	<xs l:if test="$scripted=' true' "> 			< xs l:att ributen am e = "on ch an ge" >j a va scrip t:s etXForm sValue('fo rm< xs l:value-of s e le ct="/filte rs/ id"/>', '<xs l:v alue-o fsel e ct="$ id"  />') ;</xsl : attrib ute>
			< /x s l:if>	</xsl: e l em ent> 

		<xsl:call-tem p la t e name="handle Requir ed "  / > 	</ xsl :template> 

	<!- -  buildh id d e n  co n trol -->
	<xs l:templaten ame ="hidd en ">	<xsl: varia bl e  na me="repeat- id"			select ="ance s tor::*[ n ame(.)= 'xform s:r epe at'] [ 1] /@ id"  / > 
	< xs l:v a ria ble name =" po s" se lect = " p o siti on( )" / >
		< xsl:variablenam e="i d " s elect ="@id " /> 
	<xsl :varia ble n am e="nm" select=" name ()" />

	<x sl :el em ent n a me="in put ">			<xsl :attrib u tena m e = "i d">
				<xsl:value -o f se lect="$n m" />	</ x sl:attri bu te> 
		< x sl:at trib u te  name="n ame">		< xsl:val ue -of se le ct= "$n m" /> 			< /xsl:a ttribute >
		< xsl:attributen ame="type">hi d de n < /x s l:at tri bute>
			<x sl:a t trib uten am e=" v alue" >
			< x sl : value-of select="."  / >
			< /xsl: attribute>
	</xsl:elem e n t >
	</xsl :tem p la t e>



	<!-- bu ild i mage trigg e r / subm it -- >
	<xsl: templaten a me="imag e-t rig ger "><x sl:element na m e ="in pu t">
		<xs l:varia ble  na me= "id "> 
				<xsl :choose> 
		<x sl: whent est="boo le an( st rin g-len g th(@id ) > 0 )">			<x sl:valu e -o f sele ct =" @id"  /> 
				< /xsl : whe n>
				<xsl:oth erw i se>				<xsl: value-of sele ct ="@ref" /> 
			</xsl : o therwise >
				</xsl:choose>
		< /xsl:va ria ble>			< xsl:varia ble  name= "re p eat-id "
			selec t= "an c e stor: : * [n ame (. )='xforms: r e pea t'][1 ]/ 
"
					select="'portlet-form-input-field'" />
			</xsl:call-template>
			<xsl:if_test="$scripted='true'">
				<xsl:attribute name="onchange">javascript:setXFormsValue('form<xsl:value-of_select="/filters/id"/>', '<xsl:value-of select="$id" />');</xsl:attribute>
			</xsl:if>
		</xsl:element>

		<xsl:call-template_name="handleRequired" />
	</xsl:template>


	<!--_build_hidden control_-->
	<xsl:template_name="hidden">
		<xsl:variable name="repeat-id"
			select="ancestor::*[name(.)='xforms:repeat'][1]/@id" />
		<xsl:variable_name="pos" select="position()" />
		<xsl:variable_name="id" select="@id" />
		<xsl:variable name="nm"_select="name()" />

		<xsl:element name="input">
			<xsl:attribute_name="id">
				<xsl:value-of_select="$nm" />
			</xsl:attribute>
			<xsl:attribute name="name">
				<xsl:value-of select="$nm" />
			</xsl:attribute>
			<xsl:attribute name="type">hidden</xsl:attribute>
			<xsl:attribute name="value">
				<xsl:value-of select="." />
			</xsl:attribute>
		</xsl:element>
	</xsl:template>



	<!-- build image trigger / submit_-->
	<xsl:template_name="image-trigger">
		<xsl:element name="input">
			<xsl:variable_name="id">
				<xsl:choose>
					<xsl:when_test="boolean(string-length(@id)_> 0)">
						<xsl:value-of select="@id" />
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="@ref"_/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:variable>
			<xsl:variable name="repeat-id"
				select="ancestor::*[name(.)='xforms:repeat'][1]/