fxsl

How to Trim in xslt?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 21:47:15
问题 I want to trim whitespace left and right in : <xsl:value-of select="Datas/Data[@key='Name']/string"/> How can I do that? 回答1: The easiest way is to use the trim template function of FXSL . This transformation : <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="trim.xsl"/> <xsl:output method="text"/> <xsl:template match="/"> '<xsl:call-template name="trim"> <xsl:with-param name="pStr" select="string(/*)"/> </xsl:call-template>' </xsl:template> <