Thank you Christian,
The detail of the true meaning of ‘size’ being especially important.
Regards, James
On 1 Jun 2015, at 13:16, Christian Grün christian.gruen@gmail.com wrote:
Dear James,
I agree it would be more consistent if both output had been designed to yield the same result. The reason why we initially omitted the size attribute with db:list-details was that the returned size has a different meaning for XML and binary data:
- For binary data, we can return the real byte size.
- For xml documents, we can only return the number of XML nodes of a document.
For now, I solved this by adding the size attribute to XML resources (as you suggested) and pointing out in the documentation how to interpret the values. Later on, it might be reasonable to rename the attribute to "bytes" and "nodes", respectively.
A new snapshot is available [1].
Thanks for the feedback, Christian
[1] http://files.basex.org/releases/latest/
On Sun, May 31, 2015 at 7:15 PM, James Ball basex-talk@jamesball.co.uk wrote:
Hello,
If I use the REST interface to get details of the resources in a database (http://localhost:8984/rest/TEST-DATABASE for example) the result is rest:resource elements that include size.
<rest:resource type="xml" content-type="application/xml" size="46”>
I assumed that db:list-details was the XQuery equivalent but the resource elements it returns do not include size.
<resource raw="false" content-type="application/xml" modified-date="2015-05-31T17:12:32.907Z”>
I’m sure it is staring me in the face but I can’t work out how to get the size value from within XQuery. Can someone point me in the right direction?
I’m trying to do some database pruning based on the size of the documents which would be very easy if I had rest:resource elements.
Many thanks, James