normalize-space()
함수를 사용하면 결과는 앞뒤 공백 문자가 모두 제거 된 문자열입니다.
그러나 중첩 공백 문자 그룹은 공백 문자 하나로 바뀝니다.
마지막 효과를 원하지 않으면 FXSL 1.x (FXSL은 전적으로 XSLT 1.0으로 작성 됨) 템플릿 기능인 trim
을 사용하는 것이 좋습니다. 이 변환은 다음과 같은 XML 문서에 적용
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="trim.xsl"/>
<!-- to be applied on trim.xml -->
<xsl:output method="text"/>
<xsl:template match="/">
'<xsl:call-template name="trim">
<xsl:with-param name="pStr" select="string(/*)"/>
</xsl:call-template>'
</xsl:template>
</xsl:stylesheet>
:
<someText>
This is some text
</someText>
원하는 정확한 결과 여기
는 trim
템플릿/기능을 이용하여 작은 예이며 생산 :
'This is some text'