Hi Seenivasan.
But I am getting this error [FODC0002] Resource 'sampledb/xsd/match.xsd' does not exist.
The path is resolved relative to your working directory and not the database. If you want to match it against a schema stored in the database, you must indeed use functions like db:open() or doc().
Hope this helps, Christian
I am sure the path is correct and the xsd file exists there. May I know where I am going wrong?
try { let $doc := <simple:root xmlns:simple='http://basex.org/simple%27/%3E return validate:xsd($doc,'sampledb/xsd/match.xsd')
} catch BXVA0001 { 'Validation failed.' }
Thanks in advance.
I found one mistake at my side. I stored .xsd file as of RAW format type. It worked, when I changed it in to .XML format type and restructured my code like this
try { let $doc := <simple:root xmlns:simple='http://basex.org/simple%27/%3E let $schema := fn:doc('sampledb/xsd/match.xsd') return validate:xsd($doc,$schema) } catch BXVA0001 { 'Validation failed.' }
But still my question is, how to validate by just passing the path of .xsd rather than fetching using fn:doc() and passing it as an parameter of type node()?.
Thanks.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk