On 06/25/2012 11:34 AM, Christian GrĂ¼n wrote:
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
Thanks Christian.
I have one more question to ask, will validate support validating xml against complex xsd?. I mean xsd importing many other xsds. I have one main xsd that import another 3 xsds. All these xsd were stored inside the database at
sampledb/xsd/
And I am passing the root xsd as accessed by doc() function to the validate function.
I am getting this error
Validation failed: src-resolve: Cannot resolve the name ' 'type definition' component.
Thanks.