Each function in Table 6.2 returns a Boolean.
Function | Meaning |
---|---|
contains(string, string) | Indicates whether the first argument includes a string equal to the second argument. Given our main example, each the following expressions resolves to true because the string lark is within the string Skylark. contains('Skylark','lark') contains(descendant::Model[4],'lark') contains(descendant::Model[position() >= 4],'lark') The first argument in the third expression returns the nodes whose string values are Skylark and Speedster; however, only the first node is available, and the only tested string value is Skylark. The next expression resolves to false because string operations are case-sensitive. contains('Skylark,'LARK') |
false() | Returns false |
not(Boolean) | Returns the opposite value to the value of the argument. |
starts-with (string, string) | Indicates whether the first argument starts with a string equal to the second argument. Given our main example, each the following expressions resolves to true because the string Sky is at the beginning of the string Skylark. starts-with('Skylark','Sky') starts-with(descendant::Model[4],'Sky') starts-with(descendant::Model[position() >= 4],'Sky') The first argument in the third expression returns the nodes whose string values are Skylark and Speedster; however, only the first node is available, and the only tested string value is Skylark The next expression resolves to false because string operations are case-sensitive. starts-with('Skylark','SKY' |
true() | Returns true. |