Is it not the case that because xs:anyURI is derived from xs:string, you can always go "up" the derivation, because the derived type is less general and always remains an instance of the more general type, but the more general type (casting "down" the path of derivation) is not necessarily an instance of the more derived type?
"``````````" is an entirely legitimate string, but it's not a URI, for example. So I think you might have to use (in your second example) one of the "make a URI" functions like iri-to-uri() or encode-for-uri() which make sure the string fits in the URI type. -- Graydon On Mon, Aug 13, 2018 at 12:35 PM Andreas Mixich <mixich.andr...@gmail.com> wrote: > I should have added, that this also does not succeed: > > declare variable $local:uri1 as xs:anyURI := xs:anyURI(" > http://example.com/batz/mongo/blah/index.html"); > > which leaves me even more baffled. > > -- > Minden jót, all the best, Alles Gute, > Andreas Mixich >