1

my xml

<user>
 <name>John</name>
 <surname>Doe</surname>
</user>

my xslt

<xsl:template match="user">
 <xsl:value-of select="name"/> <xsl:value-of select="surname"/>
</xsl:template>

I want to preserve the space between the two "value-of" = I want the output to be John Doe and not JohnDoe.

Can I do it without adding <xsl:text> </xsl:text> ?

4

1 回答 1

2

您可以xml:space="preserve"在任何包含元素(xsl:template此处)上使用,但您也可以从模板的开头和结尾获取换行符和空格。

于 2013-09-05T08:40:10.213 回答