is there any operation such as trim in xslt?

前端 未结 4 1965
再見小時候
再見小時候 2020-12-17 19:31

i wrote a xslt code which converts a xml file to a html file which contains lot of tables, one of the column contains messages(very long messages), but that line starts with

4条回答
  •  心在旅途
    2020-12-17 20:10

    Unfortunately you don't say what you expect your "trim()" function to do. But from your description of the requirement, I would guess that normalize-space() is close enough:

    starts-with(normalize-space(message), 'Verification passed'))
    

    The XPath normalize-space() function differs from the Java trim() method in that (a) it replaces internal sequences of whitespace characters by a single space, and (b) it has a slightly different definition of whitespace.

提交回复
热议问题