[xquery-talk] xsi:type typing support

Howard Katz howardk at fatdog.com
Mon Mar 14 10:21:40 PST 2005


 > The fact that the user could quite legitimately expect
 > xsi:type="xsd:int" to
 > be equivalent, if the prefix xsd is assigned to the relevant URI.
 >
 > You could of course to a proper QName comparison by calling the
 > appropriate
 > function to expand the QName; but it seems odd to do this kind of
 > manipulation for the xsi:type attribute just so that you don't
 > have to do it
 > for the content of the element.

I've been doing some reading over the weekend (XML Schema Parts I and II and
some of the SOAP spec), and I think I have a better idea of what you're
talking about. Are you saying (please correct me if I'm wrong): If I were
going to be doing qname comparisons of that type (which you're not crazy
about in any event), it would be better to :

(1) have the xsi: and xsd: namespaces declared formally in the instance
document, and
(2) do the comparisons properly using fn:resolve-QName() and the like.

I'm not sure what you mean by the last statement: "just so that you don't
have to do it for the content of the element". Are you referring back to
your earlier question about why didn't I just cast the value of the element
directly and be done with it?

Howard

 >
 > (The user might also legitimately expect xsi:type="xs:short" to
 > work, since
 > it should be OK to use a subtype in place of its parent type. This is a
 > separate problem with the approach.)
 >
 > Michael Kay
 > http://www.saxonica.com/
 >
 >




More information about the talk mailing list