- From: Jonathan Robie <jonathan.robie@datadirect.com>
- Date: Sun, 15 Feb 2004 18:49:24 -0500
- To: XML Query Comments <public-qt-comments@w3.org>
If an element has a complex type with complex content, the
typed-value() accessor raises a type error when applied to the
element. So if the Cities element has a known type, the following
raises a type error:
<Cities>
<City>
<CityId>01</CityId>
<Longitude>100</Longitude>
<Latitude>32</Latitude>
</City>
<City>
<CityId>02</CityId>
<Longitude>54</Longitude>
<Latitude>24</Latitude>
</City>
</Cities> * 2
If you the same element is placed in a document node, the
typed-value() accessor returns its string value, as an instance
of xdt:untypedAny. Consider the following query.
document {
<Cities>
<City>
<CityId>01</CityId>
<Longitude>100</Longitude>
<Latitude>32</Latitude>
</City>
<City>
<CityId>02</CityId>
<Longitude>54</Longitude>
<Latitude>24</Latitude>
</City>
</Cities>
} * 2
This query succeeds. Either both queries should succeed,
or both should fail.
Jonathan
Received on Sunday, 15 February 2004 18:51:56 UTC