Hi all, I am trying to validate an incoming xml post message against an xsd stored inside the basex. But I am getting this error [FODC0002] Resource 'sampledb/xsd/match.xsd' does not exist. 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%7C%7C/%3E%7C return validate:xsd($doc,'sampledb/xsd/match.xsd')
} catch BXVA0001 { 'Validation failed.' }
Thanks in advance.
On 06/25/2012 10:07 AM, Seenivasan Gunabalan wrote:
Hi all, I am trying to validate an incoming xml post message against an xsd stored inside the basex. But I am getting this error [FODC0002] Resource 'sampledb/xsd/match.xsd' does not exist. 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%7C%7C/%3E%7C 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%7C%7C/%3E%7C 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.
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
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.
Dear Seenivasan,
please note that BaseX is mainly an XQuery Processor. As the stylesheet will be transformed by another processor (either Java’s or Saxon’s XSLT implementation), it won‘t be possible to include files in the transformation that are stored in the database. Instead, you can try to extract all required files to a local directory (e.g. your working directory, or a temporary directory) and apply xslt from there. As you may know, the extraction of files can all be done in XQuery, using the DB and File Modules.
Hope this helps, Christian
On Mon, Jun 25, 2012 at 1:20 PM, Seenivasan Gunabalan seenivasan.gunabalan@dedalus.eu wrote:
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'/ 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.
basex-talk@mailman.uni-konstanz.de