When record definition has field(s) of non-string type (say, integer), and query returns a ROW of such record, there's no easy way for Roxie to return an empty XML tag representing such ROW.
There are few issues with that:
1. It seems inconsistent, since we can do this with datasets; simple ds:= will do, even if dataset contain such rows.
2. It is not possible to tell the difference between "didn't find" data and "didn't try to find"; in both cases integral fields will be returned as sub-tags with a default value.
3. Non-empty XML tag can be treated by a client as indication of certain query activity; bad practice, but happens anyway: at this very moment we have to implement a awkward solution on ESP side to handle such case.
Sample query code:
<part name="abc" type="xsd:byte"/> </message> */
export test_service() := macro
abc:= 0 : stored ('abc');
rec := record
integer i; //if change to a string type, then blank xml tag can be returned
rec_result := record
dataset (rec) ds_r;
rec_result format () := transform
Self.k := abc;
Self.r := row (, rec); // empty dataset won't work either
Self.ds_r := ; // works for datasets
res := dataset ([format ()]);
output (res, named('results'));