BaseX 9.0.1 and validate:xsd-info

Thursday, 26 April 2018 · 4 messages · last reply 30 Apr 2018
FB
France Baril26 Apr 2018 16:30 #
Hi, This used to work, but it doesn't anymore. Setup: Create a db called AppResources and put any xsd in it with the root id set to 'schema-test-validate'. .xq: Expected result: validation error. Result I get: Stopped at *path*/xsd-validate-test.xq, 6/30: [FODC0002] Resource 'test-to-delete.xsd' does not exist. I checked, the xsd does exist on my file system. I also validated content against it. The .xsd works, it does validate content outside of baseX. Can you help? Thanks!
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com
FB
France Baril26 Apr 2018 16:31 #
I forgot to paste the .xq content:
let $xsd := db:open('AppResources')/*[@id = 'schema-test-validate']
let $xsd-name := tokenize($xsd/base-uri, '/')[last()]
let $file-sys-xsd := 'test-to-delete.xsd'
let $out := file:write($file-sys-xsd, $xsd)
let $xml := <app-definitions><invalid/></app-definitions>
let $res := validate:xsd-info($xml, $file-sys-xsd)
return $res
Quoted text · France Baril · 31 lines
On Thu, Apr 26, 2018 at 4:30 PM, France Baril <france.baril at architextus.com> wrote: > Hi, > > This used to work, but it doesn't anymore. > > Setup: Create a db called AppResources and put any xsd in it with the root > id set to 'schema-test-validate'. > .xq: > > > Expected result: validation error. > Result I get: > Stopped at *path*/xsd-validate-test.xq, 6/30: > [FODC0002] Resource 'test-to-delete.xsd' does not exist. > > I checked, the xsd does exist on my file system. I also validated content > against it. The .xsd works, it does validate content outside of baseX. > > Can you help? Thanks! > > > > > > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com >
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com
CG
Christian Grün26 Apr 2018 17:36 #
Hi France,
Quoted text · France Baril · 2 lines
> let $xsd := db:open('AppResources')/*[@id = 'schema-test-validate'] > let $xsd-name := tokenize($xsd/base-uri, '/')[last()]
In your code, there seems to be no reference to the $xsd-name variable. Is this intentional?
Quoted text · France Baril · 1 line
> [FODC0002] Resource 'test-to-delete.xsd' does not exist.
This indicates that your file is not found in your file system. You could prefix the filename with file:base-dir() or file:current-dir(), or an absolute path in order to see which path is correct in your environment. If this doesn’t help, and if you want us to reproduce the problem, feel free to provide us with a little self-contained example. Best, Christian
Quoted text · France Baril · 45 lines
> let $file-sys-xsd := 'test-to-delete.xsd' > let $out := file:write($file-sys-xsd, $xsd) > let $xml := <app-definitions><invalid/></app-definitions> > let $res := validate:xsd-info($xml, $file-sys-xsd) > return $res > > On Thu, Apr 26, 2018 at 4:30 PM, France Baril <france.baril at architextus.com> > wrote: >> >> Hi, >> >> This used to work, but it doesn't anymore. >> >> Setup: Create a db called AppResources and put any xsd in it with the root >> id set to 'schema-test-validate'. >> .xq: >> >> >> Expected result: validation error. >> Result I get: >> Stopped at path/xsd-validate-test.xq, 6/30: >> [FODC0002] Resource 'test-to-delete.xsd' does not exist. >> >> I checked, the xsd does exist on my file system. I also validated content >> against it. The .xsd works, it does validate content outside of baseX. >> >> Can you help? Thanks! >> >> >> >> >> >> >> -- >> France Baril >> Architecte documentaire / Documentation architect >> france.baril at architextus.com > > > > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Baril30 Apr 2018 15:26 #
That worked, thanks.
Quoted text · Christian Grün · 73 lines
On Thu, Apr 26, 2018 at 5:36 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi France, > > > let $xsd := db:open('AppResources')/*[@id = 'schema-test-validate'] > > let $xsd-name := tokenize($xsd/base-uri, '/')[last()] > > In your code, there seems to be no reference to the $xsd-name > variable. Is this intentional? > > > [FODC0002] Resource 'test-to-delete.xsd' does not exist. > > This indicates that your file is not found in your file system. You > could prefix the filename with file:base-dir() or file:current-dir(), > or an absolute path in order to see which path is correct in your > environment. > > If this doesn’t help, and if you want us to reproduce the problem, > feel free to provide us with a little self-contained example. > > Best, > Christian > > > > let $file-sys-xsd := 'test-to-delete.xsd' > > let $out := file:write($file-sys-xsd, $xsd) > > let $xml := <app-definitions><invalid/></app-definitions> > > let $res := validate:xsd-info($xml, $file-sys-xsd) > > return $res > > > > On Thu, Apr 26, 2018 at 4:30 PM, France Baril < > france.baril at architextus.com> > > wrote: > >> > >> Hi, > >> > >> This used to work, but it doesn't anymore. > >> > >> Setup: Create a db called AppResources and put any xsd in it with the > root > >> id set to 'schema-test-validate'. > >> .xq: > >> > >> > >> Expected result: validation error. > >> Result I get: > >> Stopped at path/xsd-validate-test.xq, 6/30: > >> [FODC0002] Resource 'test-to-delete.xsd' does not exist. > >> > >> I checked, the xsd does exist on my file system. I also validated > content > >> against it. The .xsd works, it does validate content outside of baseX. > >> > >> Can you help? Thanks! > >> > >> > >> > >> > >> > >> > >> -- > >> France Baril > >> Architecte documentaire / Documentation architect > >> france.baril at architextus.com > > > > > > > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com >
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com

⚡Generated with XQuery