Reputation: 55759
Creating a text node in XQuery is done like so
text { 'foo' }
Can someone explain the syntax here? Is a function being invoked? If so, I would expect to see text('foo')
.
Upvotes: 0
Views: 179
Reputation: 1040
That's a computed constructor; XQuery syntax for creating nodes. The same syntax works for creating (for example) elements and attributes:
element hello {
attribute target { "world" }
}
See The XQuery spec for full details.
Upvotes: 1