Jquery xslt concat前后的文本字符串<;新行/>;
我有以下xml:Jquery xslt concat前后的文本字符串<;新行/>;,jquery,xslt,Jquery,Xslt,我有以下xml: <node1> some text here <newline/> and some text here. </node1> 请帮忙。 谢谢 使用XSLT1.0 <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version=
<node1>
some text here
<newline/>
and some text here.
</node1>
请帮忙。
谢谢 使用XSLT1.0
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:template match="node1">
<xsl:value-of select="normalize-space()" />
</xsl:template>
</xsl:stylesheet>
您可以显示用于执行此操作的代码吗?您使用的是XSLT 1.0还是2.0?我使用的XSLT 1.0包含以下代码:您需要显示实际的XSLT代码(编辑您的帖子,不要将其添加到注释中)
normalize-space()
如果在正确的上下文中应用,应该可以正常工作。实际上,它必须转换为中间xml,然后再转换为html。我在这里尝试了一下,结果是“这里有一些文本,这里有一些文本”
some text here and some text here
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:template match="node1">
<xsl:value-of select="normalize-space()" />
</xsl:template>
</xsl:stylesheet>
some text here and some text here.