Hi,
In an XSL page, how would I go about getting only for the first set of values, when using <xsl:for-each> tags? Maybe I need to use another tag besides xsl:for-each?
like, in the following code:
<xsl:element name="input">
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="name">SearchValue</xsl:attribute>
<xsl:for-each select="../SearchParams/Search">
<xsl:attribute name="value"><xsl:value-of select="@SearchValue"/></xsl:attribute>
</xsl:for-each>
</xsl:element>
I only want to get the first value that's in @SearchValue, which would be 'Smith', in the first <Search> tag from XML like the following:
<SearchParams>
<Search SearchValue = 'Smith' SearchField = 'LastName' />
<Search SearchValue = 'Mike' SearchField = 'FirstName' />
</SearchParams>
Thanks,
Ray
In an XSL page, how would I go about getting only for the first set of values, when using <xsl:for-each> tags? Maybe I need to use another tag besides xsl:for-each?
like, in the following code:
<xsl:element name="input">
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="name">SearchValue</xsl:attribute>
<xsl:for-each select="../SearchParams/Search">
<xsl:attribute name="value"><xsl:value-of select="@SearchValue"/></xsl:attribute>
</xsl:for-each>
</xsl:element>
I only want to get the first value that's in @SearchValue, which would be 'Smith', in the first <Search> tag from XML like the following:
<SearchParams>
<Search SearchValue = 'Smith' SearchField = 'LastName' />
<Search SearchValue = 'Mike' SearchField = 'FirstName' />
</SearchParams>
Thanks,
Ray