[oXygen-user] validate XML files in eXist collection

Radu Coravu
Fri Dec 21 07:32:41 CST 2007


Dear Joris,

Thank you for contacting us.
Unfortunately batch validation of all XML documents in a collection is 
not yet possible. We will add  a feature request.
However you can use XQuery to perform a batch validation in eXist. Here 
is an example to get you started:

xquery version "1.0";
declare namespace  validation="http://exist-db.org/xquery/validation";

<validationReport>{
let $parentPath := "/db/test/"
let $schemaPath := "/db/test/personal.xsd"
let $childrenPaths := xmldb:get-child-resources($parentPath)
for $child in $childrenPaths
let $path := fn:concat($parentPath, $child)
where fn:ends-with($child, ".xml")
return <validate name="{$path}">
     {validation:validate-report(xs:anyURI($path), xs:anyURI($schemaPath))}
</validate>
}
</validationReport>

Regards,
Radu

-- 
Radu Coravu 
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Graaumans, Joris wrote:
> Hi,
>  
> I've setup a connection with eXist in oXygen 9.0. I can open files, edit them, run xqueries, etc. However, I was wondering: it is possible to validate all XML documents in a collection? Preferably against an external XML Schema.
>  
> Thanks in advance,
>  
> Joris 
>  
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user




More information about the oXygen-user mailing list