user2708013
user2708013

Reputation: 417

Difference between xs:string and xs:string+ in XQuery

What is the difference between xs:string and xs:string+ in XQuery in Marklogic or please point me to an article that can help understand.

Upvotes: 1

Views: 327

Answers (1)

mcernak
mcernak

Reputation: 9130

The difference is:

  • xs:string represents one string
  • xs:string+ represents a sequence containing one or more strings

You can read more about it here.

An occurrence indicator can be used at the end of a sequence type to indicate how many items can be in a sequence. The occurrence indicators are:

  • ? For zero or one items
  • * For zero, one, or many items
  • + For one or many items If no occurrence indicator is specified, it is assumed that the sequence can have one and only one item. For example, a sequence type of xs:integer matches one and only one atomic value of type xs:integer. A sequence type of xs:string* matches a sequence that is either the empty sequence or contains one or more atomic values of type ...

Upvotes: 5

Related Questions