[Bug 4273] [FS] data on element()

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4273





------- Comment #2 from tim@cbcl.co.uk  2007-02-20 13:35 -------
Thanks for confirming that this might be a problem.

I agree that it seems reasonable to define:

-------------------------------------------------------
data on element * of type xs:anyType : xs:anyAtomicType

(although should it be xs:anyAtomicType or xs:anyAtomicType* ?)

But once you make this change, problems arise such as:

1 + <a>2</a>

Under the current rules for "data on" fn:data(<a>2</a>) is of type
xs:untypedAtomic, and so the query will type check correctly because the
xs:untypedAtomic values gets "fixed up" by function call argument conversion.

Changing "data on" to return anything other than xs:untypedAtomic means 
function call argument conversion isn't going to happen and so this query
will fail static type checking.

Secondly, if I understand the data model correctly, values cannot be
union types.  i.e. during schema validation a specific type from a union
gets selected by considering each type in the union in declaration order.
So what is the dynamic type of fn:data(<a>2</a>)?








But once you introduce this, you are landed with the problem that,
because only xs:untypedAtomic values are automatically converted by
function calls.

Received on Tuesday, 20 February 2007 13:35:09 UTC