Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl:attribute and xsl:for-each...

Status
Not open for further replies.

rjonesX

Technical User
Jun 18, 2001
56
US
Here is the problem, i have a form where the text value needs to be like this...

<input type=&quot;text&quot;><xsl:attribute name=&quot;value&quot;><xsl:for-each select=&quot;email&quot;><xsl:value-of select=&quot;name&quot; /> ~ <xsl:value-of select=&quot;email&quot; /></xsl:for-each></xsl:attribute>

but, you cant put a &quot;xsl:for-each&quot; within an attribute.

Does anyone have any ideas what i could do, maybe define a variable somehow that would equal the same as the for-each loop and put that in the attribute???

russ
 
rjonesX,

I dont know if you can do what you are wanting...but try <xsl:sort> in this way

<input type=&quot;text&quot;>
<xsl:value-of select=&quot;name()&quot; />
<xsl:for-each select=&quot;text&quot;>
<xsl:sort data-type=&quot;text&quot;/>
</xsl:for-each>
<xsl:value-of select=&quot;email()&quot; />
<xsl:for-each select=&quot;text&quot;>
<xsl:sort data-type=&quot;text&quot;/>
</xsl:for-each>

etc


Hope this helps

Aaron
 
Hi rjonesX,

i also don't understand exactly what you are looking for. Better you give a short XML-code and the expected result.
However, I would point the solution to the use of <xsl:variable>, but maybe I am wrong because I am not understanding you exactly.

Regards,

El Ekeko
 
i take it all back folks, i just made a really really stupid error and left out a &quot; (quotation mark). thanks for all of your help... if you want to see an example...


view the source and look at the hidden input in the form right after the body tag. The value is generated from an xml document which stores all the news stories on the site. Of course, this is really limited right now because the site is new so there is only 1 news story to search through :)

thanks

russ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top