I think I have had this problem, and my recollection is

let $xsd:=doc( $xsdURI)
validate:xsd-info($doc1, $xsd) 

does  not work, but 

validate:xsd-info($doc1, $xsdURI)

does. I guess the problem with the first case is that the base-uri info is not getting though to the validation component. 
The bigger problem of includes in XSLT or XSD not working for sources in the database would seem to require a custom resolver class.
Something like those discussed [1] and [2]

/Andy

[1] http://stackoverflow.com/questions/7236291/saxon-error-with-xslt-import-statement
[2] http://stackoverflow.com/questions/22538071/java-xml-schema-validator-with-custom-resource-resolver-fails-to-resolve-element




On 12 September 2014 16:31, Christian Grün <christian.gruen@gmail.com> wrote:
> It would be wonderful if imports/includes could be automatically resolved -
> the "validate" module could then be extremely useful!

As we use external code for processing XSD, I'm not quite sure if we
can do something about this. - Could you possibly provide us with a
self-contained example that we can use for testing?

Thanks,
Christian



>
> Best regards,
> Hans-Juegen
>
> PS: My experiment:
>
> ======================================================
> let $docURI := '... a document URI ...'
> let $xsdURI := '... the corresponding schema URI ...'
>
> let $xsd := doc($xsdURI)
> let $tns := $xsd/xs:schema/@targetNamespace
> let $doc1 := doc($docURI)
> let $doc2 :=
>     document {
>         element {node-name($doc1/*)} {
>             attribute xsi:schemaLocation {concat($tns, ' ', $xsdURI)},
>             $doc1/*/(@*, node())
>         }
>     }
> return
>     <results>{
>         <result1>{validate:xsd-info($doc1, $xsd)}</result1>,
>         <result2>{validate:xsd-info($doc2)}</result2>
>     }</results>
> ======================================================
>
>   =>
>
> <results>
>   <result1>Fatal:src-resolve: Name "communication:ShoppingCartFetchRS" kann
> nicht als "type definition"-Komponente aufgelöst werden.</result1>
>   <result2/>
> </results>
>
>