Validate XML against RNG schema
Wednesday, 21 June 2017 · 3 messages · last reply 22 Jun 2017
DS
Dharmendra Singh21 Jun 2017 08:14 #
Hi all,
I have loaded the RNG schema using function db:store and also loaded the XML in the DB which has to be validated, but i am getting the error, below is my code:
let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc')
let $schema := bin:decode-string($binary)
return
let $input := db:open('onix') return
validate:rng($input, $schema)
when i run this code i get the error invalid XML charcter(20)
so what i am doing wrong here.
please find the attached RNG schema file and XMLPS
Paul Swennenhuis22 Jun 2017 12:50 #
Oops ...
Not recommended to post 8 Mb to the list Dharmendra.
Paul
Quoted text · Dharmendra Singh · 19 lines
On 21-6-2017 8:14, Dharmendra Singh wrote: > Hi all, > > I have loaded the RNG schema using function db:store and also loaded > the XML in the DB which has to be validated, but i am getting the > error, below is my code: > > > let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc') > let $schema := bin:decode-string($binary) > return > let $input := db:open('onix') > return validate:rng($input, $schema) > > when i run this code i get the error invalid XML charcter(20) > > so what i am doing wrong here. > > please find the attached RNG schema file and XML
DS
Dharmendra Singh22 Jun 2017 14:58 #
Hi Paul,
I am really sorry about that i will take care in the future
Regards
Dharmendra Kumar Singh
Quoted text · Paul Swennenhuis · 1 line
On Thursday, 22 June 2017 4:20 PM, Paul Swennenhuis <paul at swennenhuis.nl> wrote:
Oops ...
Not recommended to post 8 Mb to the list Dharmendra.
Paul
On 21-6-2017 8:14, Dharmendra Singh
Quoted text · Paul Swennenhuis · 91 lines
wrote: > > > > > > > > > > > > Hi > all, > > > > > > I > have loaded the RNG schema using function db:store > and also loaded the XML in the DB which > has to be validated, but i am getting > the error, below is my code: > > > > > > > > > > let $binary := > db:retrieve('onix','/relaxng/publishers-51cr.rnc') > > let $schema := > bin:decode-string($binary) > > return > > let $input := > db:open('onix') > > return > validate:rng($input, $schema) > > > > > > when i run this code i > get the error invalid XML charcter(20) > > > > > > so what i am doing wrong > here. > > > > > > please find the attached > RNG schema file and XML > > > > > > > > > > > > > > > > > > > > > > > >
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery