Returns a Boolean


Each function in Table 6.2 returns a Boolean.

Table 6.2: XPath 1.0 functions that return a Boolean value
Open table as spreadsheet

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.




SOA for the Business Developer. Concepts, BPEL, and SCA
SOA for the Business Developer: Concepts, BPEL, and SCA (Business Developers series)
ISBN: 1583470654
EAN: 2147483647
Year: 2004
Pages: 157
Authors: Ben Margolis

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net