You don't say why you think it's a bug, but it isn't.
The query retrieves an attribute node, and a single freestanding attribute node
cannot be serialized - see the Serialization spec for details of this error
condition. The way you solve the problem depends on what you actually want as
the output. If you want the output in the form
example, you would have to construct this yourself. If you just want the value,
then call the string() function.
many cases with idref you really want the containing element, which you can get
by calling idref(xyz)/..
The query bellow
for $x in
run on Saxon 8.7J gives the following error:
Error on line 3 of
SENR0001: Cannot serialize a
free-standing attribute node (person)
Query processing failed: Run-time
errors were reported
To me this looks like a bug, isn't?