Xslt concat with a choice inside for everyone

Can I use Select inside 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;h=11', '&amp;q=',<xsl:value-of select="Quantity" />, )" />
    </xsl:attribute>
    </xsl:element>
</xsl:for-each>

      

+1


source to share


2 answers


Try the following:



<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;h=11', '&amp;q=', Quantity)" />
    </xsl:attribute>
  </xsl:element>
</xsl:for-each>

      

+4


source


No, since it is not well-formed XML, you cannot put the private XML element itself into a self-closing XML element, or I suppose in this case you cannot use the XML element in the XML attribute value



0


source







All Articles