我只想在,
需要时添加''
我检查<xsl:when test="$myvar!=''">
所以它不会像:
,one,two,three
但会
one,two,three
改为
但它说
变量 $myvar 尚未声明;
<xsl:variable name="myvar">
<xsl:for-each select="$header/Packaging[@type='european']/UPCPackagingLevelCode">
<xsl:choose>
<xsl:when test="$myvar!=''">
<xsl:value-of select="concat(',',.)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>