Hi, is it possible to put vaariable inside HTML/XSL attribute (style attribute)

*Percent is the variable

sample: <div class='rating' style='width:$Percent%;'>

Recommended Answers

All 2 Replies

Naa, you must output it, with echo in PHP, document.write in Js

set it as variable (PHP output), e.g:

<root somevariable="<?php echo 'somevalue'; ?>">

put in to the XSLT file:

<div class='rating'>
<xsl:attribute name="style">
    <xsl:value-of select="//@somevariable"/>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.