Jump to content

xslt unique values for a dropdownlist using xslt


Recommended Posts

hi I'm new to xslt world. I'm understanding that xslt is not a procedure language. What I'm trying to achieve is a cascaded dropdown list, where the values showed in the lower level dropdown list will be depend on the value selected in the upper level dropdown. The parsing of the data and populating the data to the lower level dropdown is done through javascript. Here is my xml <FormElement type="dropdown" id="Parent" label="CC1" associatedChildID="Child" cascadingLevels="2" required="no" labelafter="" labelAfterStyle="Plain" tooltip="" status="" copy="true" changed="0" visibility="visible"><choice value="1|234" status=""/><choice value="2|345" status=""/><choice value="2|245" status=""/><choice value="2|456" status=""/><choice value="3|456" status=""/><choice value="3|344" status=""/><choice value="4|333" status=""/><choice value="4|567" status=""/><choice value="5|" status=""/><choice value="6|345" status=""/></FormElement> Here is my xslt <xsl:when test="@associatedChildID!=''" ><xsl:variable name="dataVal"><xsl:for-each select="choice"><xsl:value-of select="concat(.,@value,',')"/></xsl:for-each></xsl:variable><asp:DropDownList id="{@id}" runat="server" style="{@visibility}" onchange="populateData(this,'{@associatedChildID}','{$dataVal}','{@cascadingLevels}')" RepeatColumns="5" CssClass="frmValue" ><asp:ListItem Value=""><xsl:value-of select="''"/></asp:ListItem><xsl:variable name="uniqueChecker"><xsl:variable name="listValue" select="substring-before(@value,'|')"/><xsl:for-each select="choice"><[color="#2b91af

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...