Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery xslt concat前后的文本字符串<;新行/>;_Jquery_Xslt - Fatal编程技术网

Jquery xslt concat前后的文本字符串<;新行/>;

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=

我有以下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="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.