Hi Massimo, 

sorry, I'm a little in a hurry:
The spec states: 
http://www.w3.org/TR/xpath-datamodel/#dm-is-id
Exactly what constitutes an ID depends in part on how the data model was constructed, see 6.2 Element Nodes and 6.3 Attribute Nodes.
which says: 
is-id
If the attribute is named xml:id and its [attribute type] property does not have the value ID, then [xml:id] processing is performed. This will assure that the value does have the type ID and that it is properly normalized. If an error is encountered during xml:id processing, an implementation may raise a dynamic error. The is-id property is always true for attributes named xml:id.

as BaseX does not check/care for the types when parsing, we follow: 
The is-id property is always true for attributes named xml:id.

I hope I read the spec right; others will correct me :-)

Best
Michael
Am 31.10.2012 um 14:44 schrieb Massimo Franceschet <massimo.franceschet@uniud.it>:


Il giorno 31/ott/2012, alle ore 14:39, Michael Seiferle ha scritto:

Hi Massimo,
Hi Ben,

BaseX has no direct support for extracting the information, that for a given document the ID is renamed to "@key" (even with help of a DTD).
This is why those example queries fail to function as expected. BaseX will however work if the ID attribute is named @id.

Thanks Michael, this explains the failure. Strange behavior, anyway. I know that ID-type attributes can have any name, not necessarily the name id. Is BaseX behavior coherent with W3C specifications?

Best,

Massimo