[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

xsi:type typing support

Howard Katz howardk at fatdog.com
Sat Mar 12 09:00:08 PST 2005


xsi type
 > -----Original Message-----
 > From: Michael Kay [mailto:http://xquery.com/mailman/listinfo/talk]
 > Sent: Saturday, March 12, 2005 6:49 AM
 > To: http://xquery.com/mailman/listinfo/talk; http://xquery.com/mailman/listinfo/talk
 > Subject: RE:  xsi:type typing support
 >
 > I think it's quite hard to find a subset that's meaningful. The only
 > approach I can think of that might be workable is to restrict yourself to
 > simple types only.
 >
 > But I can't imagine why users would want to add
 > xsi:type="decimal" to every
 > <price> element in their source document, when it would be much easier to
 > cast the value of the element to a decimal in their queries.

In general I agree. However:

1) There's no need for the user to cast if the data's already typed,
2) In some cases if desirable xsi:type could easily be added
programmatically via XQuery or XSLT to existing source,
2) The documents might be machine-generated, with xsi:type info supplied by
the source process,
3) In both cases the addition of xsi:type info would provide
self-documentation, and
4) might be useful for making programmatic decisions for example as to
whether to do sorting or not, as in

let $results :=
	<results>
		<result><number xsi:type="xs:int">02</number></result>
		<result><number xsi:type="xs:int">1</number></result>
	</results>
return
	if ( count( $results//number[ @xsi:type="xs:int" ] )
		 eq count( $results//number ) )
	then
		for $num in $results//number
		order by xs:integer($num)
		return $num
	else
		for $num in $results//number
		return $num

Howard

 > Michael Kay
 > http://www.saxonica.com/
 >
 > > -----Original Message-----
 > > From: http://xquery.com/mailman/listinfo/talk
 > > [mailto:http://xquery.com/mailman/listinfo/talk] On Behalf Of Howard Katz
 > > Sent: 12 March 2005 01:13
 > > To: http://xquery.com/mailman/listinfo/talk
 > > Subject:  xsi:type typing support
 > >
 > > I'd like to be able to provide some very simple typing
 > > support with my query
 > > engine. I don't however want to tackle the whole PSVI thing
 > > (not having that
 > > many productive years ahead of me), but would be quite happy
 > > if I could do a
 > > "schema lite" version of my engine that just supported
 > > xsi:type. Is that
 > > doable without going the whole schema validation route? I
 > > keep thinking that
 > > what I need to know is right there in the spec, but every time I start
 > > digging into it, my eyes start rolling upward in my head and
 > > vertigo quickly
 > > ensues. Any pointers? Help my autumn years be productive
 > > ones, please! :-)
 > >
 > > Howard
 > >
 > >
 > > _______________________________________________
 > > http://xquery.com/mailman/listinfo/talk
 > > http://xquery.com/mailman/listinfo/talk
 > >
 >
 >
 > _______________________________________________
 > http://xquery.com/mailman/listinfo/talk
 > http://xquery.com/mailman/listinfo/talk
 >




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.