Html 我怎样才能使用;xsl:attribute";要设置用于显示图像的src URL?
下面的代码未显示我要显示的图像:Html 我怎样才能使用;xsl:attribute";要设置用于显示图像的src URL?,html,xml,xslt,Html,Xml,Xslt,下面的代码未显示我要显示的图像: <img"> <xsl:attribute name="src"> <xsl:value-of select="//image"/> </xsl:attribute> </img> 尽管图像的路径存在!你知道这段代码有什么问题吗?你可以试着用变量来做 <xsl:variable name="imgSrc" select="//image" /> &l
<img">
<xsl:attribute name="src">
<xsl:value-of select="//image"/>
</xsl:attribute>
</img>
尽管图像的路径存在!你知道这段代码有什么问题吗?你可以试着用变量来做
<xsl:variable name="imgSrc" select="//image" />
<img src="$imgSrc" alt=""/>
您可以使用此
<img>
<xsl:attribute name="src">
<xsl:value-of select='imgsource'/>
</xsl:attribute>
</img>
但是
在xml内部,必须有带变量imgsource的图像路径,如下所示:
<imgsource>http://www.test.com/Images/image.JPG</imgsource>
http://www.test.com/Images/image.JPG
因此,imgsource就像一个变量,而不是图像的路径。请编辑问题并清理代码。我不认为它真的有星号和不匹配的引号。