webmasterbeta
New Member
I have some XML and an XSLT.
sample of XML
<Form>
<Field ID="rb_PreferredDeptCity" Name="preferredDeptCity" Mandatory="" Data=http://www.webdeveloper.com/forum/archive/index.php/"//ReferenceData/PreferredDeptCity" />
</Form>
<ReferenceData>
<PreferredDeptCity>Please select:London:Cardiff</PreferredDeptCity>
</ReferenceData>
I have some javascript which takes a series of parameters and writes a drop down box to the page. The : seperated list in PreferredDeptCity will form each element (handled by the JScript).
I have a variable defined in the page as such : <xsl:variable name="refData" select="Form/Field[@ID='rb_PreferredDeptCity']/@Data" />
and then I'm attempting : SelectItem("<xsl:value-of select="Form/Field[@ID='rb_PreferredDeptCity']/@Name" />","<xsl:value-of select="Labels/Label[@ID='rb_PreferredDeptCity']/@Content" />","<xsl:value-of select="Form/Field[@ID='rb_PreferredDeptCity']/@Mandatory" />","","<xsl:value-of select="$refData"/>");
SelectItem being the JScript method. When the drop down appears it contains one element which is '//ReferenceData/PreferredDeptCity' so it appears that the value-of select isn't happening and the value of refData is being passed straight to the HTML.
I'm sure this is something simple but it's doing my head in - any ideas?
sample of XML
<Form>
<Field ID="rb_PreferredDeptCity" Name="preferredDeptCity" Mandatory="" Data=http://www.webdeveloper.com/forum/archive/index.php/"//ReferenceData/PreferredDeptCity" />
</Form>
<ReferenceData>
<PreferredDeptCity>Please select:London:Cardiff</PreferredDeptCity>
</ReferenceData>
I have some javascript which takes a series of parameters and writes a drop down box to the page. The : seperated list in PreferredDeptCity will form each element (handled by the JScript).
I have a variable defined in the page as such : <xsl:variable name="refData" select="Form/Field[@ID='rb_PreferredDeptCity']/@Data" />
and then I'm attempting : SelectItem("<xsl:value-of select="Form/Field[@ID='rb_PreferredDeptCity']/@Name" />","<xsl:value-of select="Labels/Label[@ID='rb_PreferredDeptCity']/@Content" />","<xsl:value-of select="Form/Field[@ID='rb_PreferredDeptCity']/@Mandatory" />","","<xsl:value-of select="$refData"/>");
SelectItem being the JScript method. When the drop down appears it contains one element which is '//ReferenceData/PreferredDeptCity' so it appears that the value-of select isn't happening and the value of refData is being passed straight to the HTML.
I'm sure this is something simple but it's doing my head in - any ideas?