At first sight I would have expected an error. It appears to fall foul of rule 7 in
http://www.w3.org/TR/xslt-xquery-serialization-31/#serdm It is a serialization error [err:SENR0001] if an item in S6 is an attribute node, a namespace node or a function. And indeed, Saxon reports: SENR0001: Cannot serialize a free-standing attribute node So I think Oxygen is suppressing this error somehow. The question then becomes, why does the spec do that? I think the answer is that XQuery picked up the serialization spec from XSLT, and XSLT never generates free-standing attribute nodes in its result, so the problem didn't arise there. XQ 3.1 introduces the serialization method "adaptive" which is designed to display something, without failure, regardless what you throw at it. For attributes, it shows name="value" not just the value, which is what you appear to want. Michael Kay Saxonica [email protected] +44 (0) 118 946 5893 On 27 Apr 2015, at 10:49, Leo Studer <[email protected]> wrote: > Hello > > I use Oxygen with Saxon enterprise edition 9.6.05. > My output method is “text”. > > The following statement does its job correctly > > for $c in doc("factbook.xml")//country order by $c/@name return > $c/@name/string() > > However I do not understand why > > for $c in doc("factbook.xml")//country order by $c/@name return $c/@name > > returns an empty sequence. > What especially intrigues me is that ordering with $c/@name works fine (no > conversion to string) and the output as text not. > > Any hints? > > Thanks in advance > Leo > _______________________________________________ > [email protected] > http://x-query.com/mailman/listinfo/talk _______________________________________________ [email protected] http://x-query.com/mailman/listinfo/talk
