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
Xml XSLT-删除特殊字符_Xml_Xslt - Fatal编程技术网

Xml XSLT-删除特殊字符

Xml XSLT-删除特殊字符,xml,xslt,Xml,Xslt,我想从内容中删除特殊字符和空格 <litem><para>■ <emph type="bold">Target:</emph> Water</para></litem> <litem><para>◆ Wound-healing response within the dermis and epidermis via application of heat without creating a trau

我想从内容中删除特殊字符和空格

<litem><para>■ <emph type="bold">Target:</emph> Water</para></litem>
<litem><para>◆ Wound-healing response within the dermis and epidermis via application of heat without creating a traumatic wound</para></litem>
输出是,

<litem><para><emph type="bold">Target:</emph> Water</para></litem>
<litem><para>Wound-healing response within the dermis and epidermis via application of heat without creating a traumatic wound</para></litem>
我使用了这个XSLT

<xsl:output use-character-maps="m1"/>    
<xsl:character-map name="m1">
    <xsl:output-character character="■" string=""/>
    <xsl:output-character character="◆" string=""/>
</xsl:character-map>

在使用上述xslt时,只有一个特殊字符被删除,而不是不需要的spce。我想删除带有空格的字符。能否请您指导我们。

请尝试仅删除项目段落第一个文本子项中以这两个字符之一开头并后跟可选空白的任何文本。如果希望对其他文本节点具有相同的效果,则可能需要调整匹配模式,但该键在正则表达式模式中使用“^”来指示仅匹配字符串的开头。

那么,删除空格字符的具体标准是什么?通常,您可以在XSLT2或XSLT3中使用正则表达式和替换函数,或使用xsl:analyze string XSLT2和3或analyze string函数XSLT3来查找和处理某些字符串模式。嗨,Martin,我想删除带有空格的特殊字符。我尝试过替换方法,但没有给出正确的输出。请参阅我的xslt。上面的xslt正在合并内容,如下所示。■目标:目标:水◆在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,在没有治疗创伤的情况下,伤口愈合反应在没有治疗创伤的情况下,请您指导。