On 09/25/2014 05:56 PM, 
[email protected]<mailto:[email protected]> wrote:
Hi All,

What should be the best way to schema validate of multiple documents. We have 
100+ schema of inbound sources and the data is not tagged with any namespace.

Earlier I used to write separate module xquery file importing one schema at a 
time and then calling it from main module. The approach seems not to be 
scalable with 100+ sources since import schema part of below query can't be 
made dynamic. Also I am thinking to modify inbound source files to incorporate 
with schema namespace as last option.

Please advise.

You don't need to actually import the schema, as long as there is only one
schema for each namespace. We will automatically apply any schema in scope
for that namespace.

You might also try the extension "validate full" which returns a validation 
report
rather than throwing errors.

//Mary


Thanks
Abhishek
-----------------------------------------------------------------------------------------------------------------

xquery version "1.0-ml";

module namespace val= "http://test.com";<http://test.com>;

import schema default element namespace "" at "/resources/xsd/source1.xsd";

declare function val:validate-document ($xml) {
    validate strict {
        document{$xml}
    }
};

-----------------------------------------------------------------------------------------------------------------
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful. Where permitted by applicable law, this e-mail 
and other e-mail communications sent to and from Cognizant e-mail addresses may 
be monitored.


_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to