'What does the function fn:data() do in exist-db?

I would like to know what the fn:data() function does in exist-db. I can't find the answer anywhere on the web.



Solution 1:[1]

I just found the answer to my own question. If anyone else is wondering about this, you can find more here: https://docs.microsoft.com/en-us/sql/xquery/data-accessor-functions-data-xquery?view=sql-server-ver15

Solution 2:[2]

It seems you have found one documentation of the data function, however, that is part of the MS SQL Server XQuery support.

In general, the W3C XQuery/XPath/XSLT functions are specified in https://www.w3.org/TR/xpath-functions/, so the data function in https://www.w3.org/TR/xpath-functions/#func-data.

Or use the eXist-db documentation if you want an eXist-db specific documentation, searchable at http://www.exist-db.org/exist/apps/fundocs/index.html: for the data function http://www.exist-db.org/exist/apps/fundocs/view.html?uri=http://www.w3.org/2005/xpath-functions&location=java:org.exist.xquery.functions.fn.FnModule&details=true#data.1

For the data function it might not matter but in general the "XQuery" support in non-XML databases like MS SQL is often not complete and/or not based on the current/latest spec so I would start with the W3C specification and then look at vendor specific documentation for the XQuery implementation in use instead of using third party documentation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sanlyn
Solution 2 Martin Honnen