Re: XML result format and datatypes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(I'm don't think this is an essential feature, but I felt it was worth 
mentioning)

The results binding format doesn't type datatyped literals in a way xml 
schema-aware tools can use.

Use case: sorting results.

Example (abbreviated):

<results>
   <result>
     <number datatype="http://www.w3.org/2001/XMLSchema#int">02</number>
     <value>second</value>
   </result>
   <result>
     <number datatype="http://www.w3.org/2001/XMLSchema#int">1</number>
     <value>first</value>
   </result>
</results>

Stylesheet (abbreviated again):

<xsl:template match="results">
   <xsl:for-each select="result">
     <xsl:sort select="number"/>
     <xsl:value-of select="value"/>
   </xsl:for-each>
</xsl:template>

Value 'second' comes before 'first'.

Using xsi:type="xsd:int" in the result format would enable schema aware 
tools (such as Saxon-SA) to perform more useful processing.

I appreciate the relationship between rdf and xml datatypes is not 
straightforward, but it would certainly be useful to process values 
correctly when possible.

Suggested resolutions:

1) Assume the user typically knows the type, and so will use casting
(xsd:int(number)).

2) Include both datatype and xsi:type attributes where the rdf datatype 
maps to an xsd type: <number datatype="..." xsi:type="...">

Damian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCFd7hAyLCB+mTtykRArF6AJ0csv8zJG0ReiBWT6LjIPPDJVkiTACdGUuc
ZzIVqZc8MSKRy9IeemFaZg0=
=fzbi
-----END PGP SIGNATURE-----

Received on Friday, 18 February 2005 12:26:46 UTC