This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
What is the typed value of an empty element constructor? What does count(data(<e/>)) return? <e/> is a direct element constructor. The rules that define the typed value and string value for a direct element constructor are described in 3.7.1.3 Content, 5h and 5i. Although the data model explicitly says that for data model construction, an empty element's string value is an empty string, this parallel part of the XQuery spec does not. We need to make this case explicit in the XQuery spec.
This is the change I suggest: 5.h. The string-value property is equal to the concatenated contents of the text-node descendants in document order. <add>If there are no text-node descendants, the string-value property is an empty string.</add>
Jonathan, Thanks for your comment. It has been accepted and implemented. With your concurrence, this comment is now closed.