tags:

views:

519

answers:

2

Can i use a Select within a concat in xslt? eg

<xsl:for-each select="root/OrderItems/lineitem">
  <xsl:element name="img">
    <xsl:attribute name="src">
    <xsl:value-of select="concat('http://www.site.com/r&amp;amp;h=11', '&amp;q=',<xsl:value-of select="Quantity" />, )" />
    </xsl:attribute>
    </xsl:element>
</xsl:for-each>
+2  A: 

Try this:

<xsl:for-each select="root/OrderItems/lineitem">
  <xsl:element name="img">
    <xsl:attribute name="src">
      <xsl:value-of 
        select="concat('http://www.site.com/r&amp;amp;h=11', '&amp;q=', Quantity)" />
    </xsl:attribute>
  </xsl:element>
</xsl:for-each>
Andrew Hare
A: 

No, because it is not well formed XML, you cannot put a self closing XML element within a self closing XML element, or I suppose in this case you cannot use an XML element in the value of an XML attribute

Nick Allen - Tungle139