[xquery-talk] anonymous schema import?

Michael Kay mhk at mhk.me.uk
Tue May 2 10:44:26 PDT 2006

> Well, if you were just using the in-scope schemas for the 
> purpose of validation then the prefix isn't needed. For instance,
> 	import schema 'http://example.com/books';
> 	validate { doc( 'books.xml' ) }
> doesn't ever need to refer to anything in the schema directly 
> so there's no need for a prefix.

In principle in this situation there's also no need for the "import schema"
declaration either - but it's probably as good a way as any of telling the
system where to find a schema to do the validation.

Another reason for not declaring a prefix in the "import schema" is that you
might prefer to declare it in an element constructor: this has different
semantics, in that it causes the namespace binding to appear in the result

Michael Kay

More information about the talk mailing list