GET queries data about XPath axes and functions. For this, the XPath axis or function is sent with URI. Depending on whether the request is an XPath axis or an XPath function, different Content-Type are used for the response.
When the XPath axis addresses one target, the addressed target is the root element of the returned XML structure. If the XPath addresses multiple targets, their XML structure is combined in the root element collection.
If the XPath addresses only one attribute, the value is returned as plain text. Also the result of XPath functions is returned as plain text. Decimal results use float, booleans the values true and false.
The XPath processing is strict and does not accept unnecessary spaces.
GET /<xpath> HTTP/1.0
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ (identifier)
GET /xmex!/books/attribute::genre HTTP/1.0
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ books
GET /xmex!/books/@genre HTTP/1.0
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ books
GET /xmex!count(/books/book) HTTP/1.0
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ books
HTTP/1.0 200 Success
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Storage-Revision: Revision (number)
Storage-Space: Total/Used (bytes)
Storage-Last-Modified: Timestamp (RFC822)
Storage-Expiration: Timestamp (RFC822)
Storage-Expiration-Time: Timeout (milliseconds)
Content-Length: (bytes)
Response-Body:
The result of the XPath request
HTTP/1.0 200 Success
Date: Wed, 11 Nov 2020 12:00:00 GMT
Access-Control-Allow-Origin: *
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Storage-Revision: 123
Storage-Space: 262144/1363 bytes
Storage-Last-Modified: Wed, 11 Nov 20 12:00:00 +0000
Storage-Expiration: Wed, 11 Nov 20 12:00:00 +0000
Storage-Expiration-Time: 900000 ms
Content-Length: 26
Content-Type: application/xml
Execution-Time: 4 ms
<?xml version="1.0"?>
...
HTTP/1.0 200 Success
Date: Wed, 11 Nov 2020 12:00:00 GMT
Access-Control-Allow-Origin: *
Storage: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Storage-Revision: 123
Storage-Space: 262144/1363 bytes
Storage-Last-Modified: Wed, 11 Nov 20 12:00:00 +0000
Storage-Expiration: Wed, 11 Nov 20 12:00:00 +0000
Storage-Expiration-Time: 900000 ms
Content-Length: 26
Content-Type: text/plain
Execution-Time: 4 ms
...
- Request was successfully executed
- TODO:
- Storage header is invalid, 1 - 64 characters (0-9A-Z_) are expected
- XPath is missing or malformed
- Storage does not exist
- An unexpected error has occurred.