No: in XQuery 3.0 functions are first-class objects, but types will have to wait until 4.0.

I've recently designed and implemented an interface to information about types, presented by means of dynamic functions: see

http://dev.saxonica.com/blog/mike/2012/05/#000190

but oddly, now you mention it, one thing I haven't done is provided an easy way to test whether an instance matches such a type!

Michael Kay
Saxonica

On 22/06/2012 21:23, David Lee wrote:

I'm 200% sure this doesnt exist but incase I'm off by 2.01x ...

There is no object of type 'type' is there ?

Suppose I wanted to write a function like this

declare function x:check( $expr , $type  , $error )

{

    if( $expr instance of $type ) then () else $error

};

called like

x:check( "test" ,  xs:string , "Should be a string" )

No go right ?

Just checking ...

XQuery reflection would be a really nice thing ...

that with XSD querying ...

----------------------------------------

David A. Lee

[email protected] <mailto:[email protected]>

http://www.xmlsh.org



_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to