2013-04-26 57 views
0

我有我的xml下面的peice。使用substring-before和substring来检查是否包含'。'

<para>As set out in paragraph 2.006 above it is also possible that a Hong Kong Court may appoint an overseas liquidator to act in a Hong Kong liquidation provided that the court is satisfied as to his suitability to act. </para> 

这里我想检查'。'之前是否有空格。和2之前('。'之前2个地方),我使用下面的语句来得到它,但无法得到它,但它不工作。请让我知道我该如何修改这个。

<xsl:if test=" contains(substring-before(substring(current(),2,1),'.'),' ')"/> 

感谢

回答

3

看来,这是你喜欢做什么:

 <xsl:if test=" contains( 
      substring (current(), 
         string-length(
          substring-before(current(), '.') 
         ) -1,2) 
       ,' ')"> 

这个测试的最后两个字符的第一个点之前“”如果他们包含空间。 (我不确定是否应该对最后两个或三个字符进行测试,但这很容易适应)

+0

感谢您的朋友, – Marsoni 2013-04-26 14:18:30