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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT variable

Status
Not open for further replies.

castali

Programmer
Joined
Jan 26, 2004
Messages
24
Location
DE
XML file >>>>

<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;forEach.xslt&quot;?>
<page>
<items>
<item>js_one</item>
<item>js_two</item>
</items>
</page>


XSLT file >>>

<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; <xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; indent=&quot;yes&quot;/>
<xsl:template match=&quot;/&quot;>
<xsl:for-each select=&quot;//page/items/item&quot;>
<xsl:variable name=&quot;it&quot; select=&quot;.&quot;/>
<div class=&quot;{$it}&quot;><xsl:value-of select=&quot;.&quot;/></div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


and I don't get the {$it}

how can I put a value between double quotes ?

class=&quot;?&quot;

thank you
 
Code:
<div>
  <xsl:attribute name=&quot;class&quot;>
    <xsl:value-of select=&quot;.&quot;/>
  </xsl:attribute>
</div>
 
thank you !

I just found it

<div>
<xsl:attribute name=&quot;class&quot;><xsl:value-of select=&quot;.&quot;/></xsl:attribute>

<xsl:value-of select=&quot;.&quot;/>

</div>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top