BaseXdb/basex — Issue #413: XQJ: enhancing server protocol
Author: ChristianGruen
Created: 2012-03-02 00:21:17+00:00
State: open
Labels: API, feature

**XDM Meta Data**

1. XDM item kind
2. XDM item type
3. URI field

**1. XDM item kind (required for every result item)**

This can be a byte as far as the binary protocol is concerned, representing any one of these:

atomic
document-node() - binary or text documents or better still, if you can distinguish further:
- document-node(text())
- document-node(binary())
document-node(element())
element()
attribute()
namespace-node()
processing-instruction()
comment()
text()

**2. XDM item type (mandatory)**

this too can be a byte as far as the protocol is concerned, this basically represents:

xs:integer, xs:date, xs:dateTime, etc. All XDM atomic item types must be supported.

**3. URI field (populated for the following):**

* **document-node()** items where the item returned exists within the Database. If I performed fn:doc($URI), on a subsequent query, where $URI is what was given in the URI field, I would retrieve the same document again.
* **attribute()** items, to signify the namespace of the attribute, the value of the String: "local name" and "prefix" (if available) as well as of course its value.
* **xs:QName** items, to signify its namespace, I also require its prefix if available and of course its local name.