开发者

Is there a way to place an "xsl:value-of" into an inline string?

开发者 https://www.devze.com 2023-03-06 02:22 出处:网络
Ok here is an example what I\'m trying to accomplish: <div class=\"testClass1 {place xsl:value-of HERE}\"> </div> Is there any way to pull something like this off in XML/XSLT?

Ok here is an example what I'm trying to accomplish:

<div class="testClass1 {place xsl:value-of HERE}"> </div> Is there any way to pull something like this off in XML/XSLT?

Basically I just need to create an option to set the class for a wrapping div in XML..开发者_StackOverflow. Not sure if this is possible.


Use an Attribute-value-template:

<div class="testClass1 {xpath-expression}"> </div>

...or an xsl:attribute.

<div>
    <xsl:attribute name="class">testClass1 <xsl:value-of select="{xpath-expression}"/></xsl:attribute>
</div>


You can always go with

<div>
   <xsl:attribute name="class">testClass1 <xsl:value-of select="..." /></xsl:attribute>
<div>
0

精彩评论

暂无评论...
验证码 换一张
取 消