[xquery-talk] Union types

Srdjan Djuricic sdjuricic at galdosinc.com
Fri Jan 12 13:20:55 PST 2007


Thank you for your reply, I think my question was not clear.  How can I
determine during run time what I should cast the literal value to?  If a
type is just an atomic value ( which I find out during run time from the
xsd schema ) then I just cast the literal value for that atomic type.
However, if I have unions I can not determine what my 'mask' should be.
As an approach I tried using "instance of" operator to check literal
values but that does not return the result that I was looking for.  As
an example I used 1999-12-31T12:00:00 to check if it is xs:dateTime and
it gave me false.  I am a beginner when it comes to X-Query.  



-----Original Message-----
From: James A. Robinson [mailto:jim.robinson at stanford.edu] 
Sent: Friday, January 12, 2007 1:11 PM
To: Srdjan Djuricic
Cc: talk at x-query.com
Subject: Re: [xquery-talk] Union types 

> The problem occurs if myProp is a simpleType with an union.  I do not 
> know how to cast the input data.  I tried using "instance of" on the 
> literal value operator but quickly found out that
> instance of xs:dateTime yields false.  If I don't do any casting I get

> an exception.
> Are there any suggestion as to how to deal with this issue?

Does '$foo castable as xs:dateTime' help you?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       jim.robinson at stanford.edu
Stanford University HighWire Press      http://highwire.stanford.edu/
+1 650 7237294 (Work)                   +1 650 7259335 (Fax)

More information about the talk mailing list