Dear France,
try to change the call to validate:xsd by passing in the URI to the file instead of the xsd document. I remember that there was an issue we discussed several months ago about the XSD validation and XSLT transformation and the URI resolution that Christian fixed for the scenario where URIs are directly passed to the functions as strings [1].
Marco.

[1] Message ID: <CAP94bnOEv3oskaQOiRMzdEmnhxn6zuDXHYxCoOSrkvdAdBzQzw@mail.gmail.com> with subject "URI resolution" and related thread ....

On 07/15/2013 09:21 PM, France Baril wrote:

<xs:schema id="schema-images" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 
<xs:include schemaLocation="HowToContent_Common.xsd"/>
  ...

 
</xs:element>
</xs:schema>


Does not pickup the definitions in the common .xsd files when running validate:xsd. It returns errors for items defined in the 'included' .xsd.

Referencing a 'sub-DTD' does work with the DTD (validate:dtd) when the common element is included using a similar path. 

<!ENTITY % common 

     PUBLIC "-//MOTOROLA//DTD HOW2 COMMON//EN"
             "HowToContent_Common.mod">
%common;


How do I get validate:xsd to grab the sub-components? I'm currently using validate:xsd like this:

let $xsd := db:open('AppResources')/*[@id=$xsd-id]

try {
                                  validate:xsd($xml-file, $xsd)
                             } catch * {
                                   <li style="color:red;"><p>File '{$xml-file/base-uri()}' doesn&apos;t validate against the '{$xsd/base-uri()}' schema.</p><p>{'Error [' || $err:code || ']: ' || $err:description}</p></li>
                             } 


My files validate correctly when I run validation in XML Oxygen, so I know the XSD itself is working. 

I tried using lower caps in the xs:include reference as I noticed that the .xsd files get renamed to lower caps on import (but not DTDs [because they were considered raw and unindexed?]). Anyhow, it didn't help.

Regards,

France

--
France Baril
Architecte documentaire / Documentation architect
france.baril@architextus.com
(514) 572-0341


_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk