Re: [basex-talk] Strange behavior while adding existing elements into new element.

2017-06-21 Thread Jan Dölle

Hi Christian,

update {} as "quick copy" work.

Beside I checked the $sequence-of-elements for the special situation and 
it only contains elements from a document created by parse-xml. But the 
function which creates the sequence compares document elements against 
some database elements and makes a choice to pick elements from document 
or either db.


Thanks for your help

Jan



Am 20.06.2017 um 20:21 schrieb Christian Grün:

Hi Jan,

This reminds me of an open GitHub issue [1], but it’s just a guess.

Does your query work as expected if you append "update { }" to your
newly constructed element?

   let $new-element := element el {
  $sequence-of-elements } update { }

In BaseX, there are two different types of nodes: fragment nodes
(which are created by XQuery node constructors) and database nodes
(which are compact representations of XML trees). In your example, the
$sequence-of-elements (which, I guess, is a sequence of database
nodes) will be wrapped with an element constructor. By using "update
{}", your node will be copied and transformed to a database node. See
[2] for some more details on the update keyword.

Quite obviously this is just a workaround to test how your query
behaves. If it behaves correctly, I am pretty sure that [1] would need
to be fixed to get your query running correctly.

Cheers,
Christian

[1] https://github.com/BaseXdb/basex/issues/919
[2] http://docs.basex.org/wiki/Update#update


On Tue, Jun 20, 2017 at 8:09 PM, Jan Dölle  wrote:

Hi,

just before you asking me. No we wasn't to isolate the Problem for now.

Working on a complex transaction with database involved, we get the
following phenomenon.

declare function m:paths($el as element())
as xs:string*
{
   distinct-values(
 for $e in $item/descendant::*
 return
   string-join($e/ancestor-or-self::*/local-name(.), "/")
   )
};

This function should produce a list of paths to all child of $el. And it
works!

But sometimes we get some strange results. We created new element
constructed from others, may existing, elements.

let $sequence-of-elements := collect-some-elements($from-somewhere)
let $new-element := element el {  $sequence-of-elements }
return paths($new-element)

Most of the time we get as expected results like:

el/c1
el/c1/c12
el/c2
el/c2/c21
el/c2/c22
el/..

But sometimes it looks like that parents of the copied elements are not set
correctly:

oldParentOfc1/c1
oldParentOfc1/c1/c12
otherOld/ParentOfc2/c2
otherOld/ParentOfc2/c2/c21
otherOld/ParentOfc2/c2/c22
...

If we do a copy of the result  like parse-xml(serialize($new-element))/*
and call paths() again, everything looks now as expected.

We call the function what products such results, isolated within a
test-script with exact the same inputs. But suddenly the result was correct.

Then we copied the inputs of the function within the integration (parse-xml,
serialize). But it failed again.

Also notable is, that the "bad result" is stable. It produces always the
same result on same inputs (no random).

So we have no idea to isolate the issue.

Any suggestions?

Best Regards

Jan

--

Jan Dölle
E-Mail: basex-l...@id1.de Telefon +49-69-244502-0 Home: www.id1.de

Information Design One AG, Baseler Straße 10, 60329 Frankfurt am Main
Registereintrag: Amtsgericht Frankfurt am Main, HRB 52596
Vorstand: Robert Peters, Aufsichtsrat: Christian Hecht (Vorsitz)






Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Dharmendra Singh
Thanks for you guidance Christian it worked for me as you suggested.

RegardsDharmendra Kumar Singh 

On Wednesday, 21 June 2017 5:30 PM, Christian Grün 
 wrote:
 

 >  right now i am trying to set the path of the saxon9ee.jar
> environment variable/path

Saxon needs to be specified in the Java classpath. How do you start BaseX?


On Wed, Jun 21, 2017 at 1:25 PM, Dharmendra Singh  wrote:
> Hi Christian,
>
> As i have checked by running function xslt:processor() it is using java now
> , so how can i use the saxon9ee.jar  for the XSLT 2.0 can you describe the
> process.
>
>
> C:\Users\dharmendra.singh\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\dharmendra.singh\AppData\Local\Programs\Python\Python36\;C:\Users\dharmendra.singh\AppData\Local\Apps\cURL\bin;C:\Program
> Files (x86)\Microsoft VS
> Code\bin;C:\Users\dharmendra.singh\AppData\Roaming\npm,D:\Software\SaxonEE9-8-0-1J\saxon9he.jar
>
> but it is not working
>
>
>
>
> On Wednesday, 21 June 2017 4:10 PM, Dharmendra Singh 
> wrote:
>
>
> As per documentation By default, this module uses Java’s XSLT 1.0, so if use
> 2.0 we need to add saxon9he.jar in the classpath
>
> Regards
> Dharmendra Kumar singh
>
>
> On Wednesday, 21 June 2017 3:43 PM, Christian Grün
>  wrote:
>
>
>> so can you please tell me what should i do.
>
> Sure: Read the documentation and find out why xslt:version() returns 1.0. ;)
>
>
> On Wed, Jun 21, 2017 at 12:09 PM, Dharmendra Singh
>  wrote:
>>  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
>> 
>>
>> as per xslt 2.0 expression  is right so can you please tell me what should
>> i
>> do.
>>
>>
>> Regards
>> Dharmendra kumar singh
>>
>>
>> On Wednesday, 21 June 2017 3:20 PM, Christian Grün
>>  wrote:
>>
>>
>> So Saxon is included in your classpath, and xslt:version() returns
>> 2.0? In that case, you’ll obviously need to check your XSLT
>> expression.
>>
>>
>> On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
>>  wrote:
>>> Yes the example which has been given for the 2.0 running perfect but when
>>> i
>>> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else
>>> 'ouput'
>>> in my example it is giving error:
>>>
>>> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL)
>>> then
>>> 'textarea' else 'ouput''.'
>>> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>>>
>>> and same code running on my oxygen editor.
>>>
>>>
>>> Regards
>>> Dharmendra Kumar Singh
>>>
>>>
>>> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>>>  wrote:
>>>
>>>
>>> Did you check out the documentation
>>> (http://docs.basex.org/wiki/XSLT_Module)?
>>>
>>>
>>> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>>>  wrote:
 Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
 xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
 run
 XSLT 2.0, below is my code.



 let $xslt :=
    http://www.w3.org/1999/XSL/Transform";
 xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
 version="2.0">
    
    
    
        
    
 

 return

 xslt:transform(, $xslt)



 Regards
 Dharmendra Kumar Singh
>>>
>>>
>>
>>
>
>
>
>

   

Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Christian Grün
>  right now i am trying to set the path of the saxon9ee.jar
> environment variable/path

Saxon needs to be specified in the Java classpath. How do you start BaseX?


On Wed, Jun 21, 2017 at 1:25 PM, Dharmendra Singh  wrote:
> Hi Christian,
>
> As i have checked by running function xslt:processor() it is using java now
> , so how can i use the saxon9ee.jar  for the XSLT 2.0 can you describe the
> process.
>
>
> C:\Users\dharmendra.singh\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\dharmendra.singh\AppData\Local\Programs\Python\Python36\;C:\Users\dharmendra.singh\AppData\Local\Apps\cURL\bin;C:\Program
> Files (x86)\Microsoft VS
> Code\bin;C:\Users\dharmendra.singh\AppData\Roaming\npm,D:\Software\SaxonEE9-8-0-1J\saxon9he.jar
>
> but it is not working
>
>
>
>
> On Wednesday, 21 June 2017 4:10 PM, Dharmendra Singh 
> wrote:
>
>
> As per documentation By default, this module uses Java’s XSLT 1.0, so if use
> 2.0 we need to add saxon9he.jar in the classpath
>
> Regards
> Dharmendra Kumar singh
>
>
> On Wednesday, 21 June 2017 3:43 PM, Christian Grün
>  wrote:
>
>
>> so can you please tell me what should i do.
>
> Sure: Read the documentation and find out why xslt:version() returns 1.0. ;)
>
>
> On Wed, Jun 21, 2017 at 12:09 PM, Dharmendra Singh
>  wrote:
>>  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
>> 
>>
>> as per xslt 2.0 expression  is right so can you please tell me what should
>> i
>> do.
>>
>>
>> Regards
>> Dharmendra kumar singh
>>
>>
>> On Wednesday, 21 June 2017 3:20 PM, Christian Grün
>>  wrote:
>>
>>
>> So Saxon is included in your classpath, and xslt:version() returns
>> 2.0? In that case, you’ll obviously need to check your XSLT
>> expression.
>>
>>
>> On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
>>  wrote:
>>> Yes the example which has been given for the 2.0 running perfect but when
>>> i
>>> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else
>>> 'ouput'
>>> in my example it is giving error:
>>>
>>> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL)
>>> then
>>> 'textarea' else 'ouput''.'
>>> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>>>
>>> and same code running on my oxygen editor.
>>>
>>>
>>> Regards
>>> Dharmendra Kumar Singh
>>>
>>>
>>> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>>>  wrote:
>>>
>>>
>>> Did you check out the documentation
>>> (http://docs.basex.org/wiki/XSLT_Module)?
>>>
>>>
>>> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>>>  wrote:
 Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
 xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
 run
 XSLT 2.0, below is my code.



 let $xslt :=
http://www.w3.org/1999/XSL/Transform";
 xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
 version="2.0">





 

 return

 xslt:transform(, $xslt)



 Regards
 Dharmendra Kumar Singh
>>>
>>>
>>
>>
>
>
>
>


Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Dharmendra Singh
Hi Christian,
As i have checked by running function xslt:processor() it is using java now , 
so how can i use the saxon9ee.jar  for the XSLT 2.0 can you describe the 
process. right now i am trying to set the path of the saxon9ee.jar
environment variable/path


C:\Users\dharmendra.singh\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\dharmendra.singh\AppData\Local\Programs\Python\Python36\;C:\Users\dharmendra.singh\AppData\Local\Apps\cURL\bin;C:\Program
 Files (x86)\Microsoft VS 
Code\bin;C:\Users\dharmendra.singh\AppData\Roaming\npm,D:\Software\SaxonEE9-8-0-1J\saxon9he.jar

but it is not working

 

On Wednesday, 21 June 2017 4:10 PM, Dharmendra Singh 
 wrote:
 

 As per documentation By default, this module uses Java’s XSLT 1.0, so if use 
2.0 we need to add saxon9he.jar in the classpath
RegardsDharmendra Kumar singh 

On Wednesday, 21 June 2017 3:43 PM, Christian Grün 
 wrote:
 

 > so can you please tell me what should i do.

Sure: Read the documentation and find out why xslt:version() returns 1.0. ;)


On Wed, Jun 21, 2017 at 12:09 PM, Dharmendra Singh
 wrote:
>  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
> 
>
> as per xslt 2.0 expression  is right so can you please tell me what should i
> do.
>
>
> Regards
> Dharmendra kumar singh
>
>
> On Wednesday, 21 June 2017 3:20 PM, Christian Grün
>  wrote:
>
>
> So Saxon is included in your classpath, and xslt:version() returns
> 2.0? In that case, you’ll obviously need to check your XSLT
> expression.
>
>
> On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
>  wrote:
>> Yes the example which has been given for the 2.0 running perfect but when
>> i
>> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else
>> 'ouput'
>> in my example it is giving error:
>>
>> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL)
>> then
>> 'textarea' else 'ouput''.'
>> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>>
>> and same code running on my oxygen editor.
>>
>>
>> Regards
>> Dharmendra Kumar Singh
>>
>>
>> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>>  wrote:
>>
>>
>> Did you check out the documentation
>> (http://docs.basex.org/wiki/XSLT_Module)?
>>
>>
>> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>>  wrote:
>>> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
>>> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
>>> run
>>> XSLT 2.0, below is my code.
>>>
>>>
>>>
>>> let $xslt :=
>>>    http://www.w3.org/1999/XSL/Transform";
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
>>> version="2.0">
>>>    
>>>    
>>>    
>>>        
>>>    
>>> 
>>>
>>> return
>>>
>>> xslt:transform(, $xslt)
>>>
>>>
>>>
>>> Regards
>>> Dharmendra Kumar Singh
>>
>>
>
>

   

   

Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Dharmendra Singh
As per documentation By default, this module uses Java’s XSLT 1.0, so if use 
2.0 we need to add saxon9he.jar in the classpath
RegardsDharmendra Kumar singh 

On Wednesday, 21 June 2017 3:43 PM, Christian Grün 
 wrote:
 

 > so can you please tell me what should i do.

Sure: Read the documentation and find out why xslt:version() returns 1.0. ;)


On Wed, Jun 21, 2017 at 12:09 PM, Dharmendra Singh
 wrote:
>  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
> 
>
> as per xslt 2.0 expression  is right so can you please tell me what should i
> do.
>
>
> Regards
> Dharmendra kumar singh
>
>
> On Wednesday, 21 June 2017 3:20 PM, Christian Grün
>  wrote:
>
>
> So Saxon is included in your classpath, and xslt:version() returns
> 2.0? In that case, you’ll obviously need to check your XSLT
> expression.
>
>
> On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
>  wrote:
>> Yes the example which has been given for the 2.0 running perfect but when
>> i
>> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else
>> 'ouput'
>> in my example it is giving error:
>>
>> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL)
>> then
>> 'textarea' else 'ouput''.'
>> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>>
>> and same code running on my oxygen editor.
>>
>>
>> Regards
>> Dharmendra Kumar Singh
>>
>>
>> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>>  wrote:
>>
>>
>> Did you check out the documentation
>> (http://docs.basex.org/wiki/XSLT_Module)?
>>
>>
>> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>>  wrote:
>>> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
>>> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
>>> run
>>> XSLT 2.0, below is my code.
>>>
>>>
>>>
>>> let $xslt :=
>>>    http://www.w3.org/1999/XSL/Transform";
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
>>> version="2.0">
>>>    
>>>    
>>>    
>>>        
>>>    
>>> 
>>>
>>> return
>>>
>>> xslt:transform(, $xslt)
>>>
>>>
>>>
>>> Regards
>>> Dharmendra Kumar Singh
>>
>>
>
>

   

Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Christian Grün
> so can you please tell me what should i do.

Sure: Read the documentation and find out why xslt:version() returns 1.0. ;)


On Wed, Jun 21, 2017 at 12:09 PM, Dharmendra Singh
 wrote:
>  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
> 
>
> as per xslt 2.0 expression  is right so can you please tell me what should i
> do.
>
>
> Regards
> Dharmendra kumar singh
>
>
> On Wednesday, 21 June 2017 3:20 PM, Christian Grün
>  wrote:
>
>
> So Saxon is included in your classpath, and xslt:version() returns
> 2.0? In that case, you’ll obviously need to check your XSLT
> expression.
>
>
> On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
>  wrote:
>> Yes the example which has been given for the 2.0 running perfect but when
>> i
>> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else
>> 'ouput'
>> in my example it is giving error:
>>
>> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL)
>> then
>> 'textarea' else 'ouput''.'
>> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>>
>> and same code running on my oxygen editor.
>>
>>
>> Regards
>> Dharmendra Kumar Singh
>>
>>
>> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>>  wrote:
>>
>>
>> Did you check out the documentation
>> (http://docs.basex.org/wiki/XSLT_Module)?
>>
>>
>> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>>  wrote:
>>> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
>>> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
>>> run
>>> XSLT 2.0, below is my code.
>>>
>>>
>>>
>>> let $xslt :=
>>>http://www.w3.org/1999/XSL/Transform";
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
>>> version="2.0">
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>> return
>>>
>>> xslt:transform(, $xslt)
>>>
>>>
>>>
>>> Regards
>>> Dharmendra Kumar Singh
>>
>>
>
>


Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Dharmendra Singh
 xslt:version() returning 1.0 and my XSLT expression for the 2.0 like   

as per xslt 2.0 expression  is right so can you please tell me what should i do.

RegardsDharmendra kumar singh 

On Wednesday, 21 June 2017 3:20 PM, Christian Grün 
 wrote:
 

 So Saxon is included in your classpath, and xslt:version() returns
2.0? In that case, you’ll obviously need to check your XSLT
expression.


On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
 wrote:
> Yes the example which has been given for the 2.0 running perfect but when i
> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else 'ouput'
> in my example it is giving error:
>
> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL) then
> 'textarea' else 'ouput''.'
> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>
> and same code running on my oxygen editor.
>
>
> Regards
> Dharmendra Kumar Singh
>
>
> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>  wrote:
>
>
> Did you check out the documentation
> (http://docs.basex.org/wiki/XSLT_Module)?
>
>
> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>  wrote:
>> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
>> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
>> run
>> XSLT 2.0, below is my code.
>>
>>
>>
>> let $xslt :=
>>    http://www.w3.org/1999/XSL/Transform";
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
>> version="2.0">
>>    
>>    
>>    
>>        
>>    
>> 
>>
>> return
>>
>> xslt:transform(, $xslt)
>>
>>
>>
>> Regards
>> Dharmendra Kumar Singh
>
>

   

Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Christian Grün
So Saxon is included in your classpath, and xslt:version() returns
2.0? In that case, you’ll obviously need to check your XSLT
expression.


On Wed, Jun 21, 2017 at 11:45 AM, Dharmendra Singh
 wrote:
> Yes the example which has been given for the 2.0 running perfect but when i
> am adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else 'ouput'
> in my example it is giving error:
>
> [bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL) then
> 'textarea' else 'ouput''.'
> FATAL ERROR:  ': line 1: Required attribute 'select' is missing.'
>
> and same code running on my oxygen editor.
>
>
> Regards
> Dharmendra Kumar Singh
>
>
> On Wednesday, 21 June 2017 2:54 PM, Christian Grün
>  wrote:
>
>
> Did you check out the documentation
> (http://docs.basex.org/wiki/XSLT_Module)?
>
>
> On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
>  wrote:
>> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
>> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to
>> run
>> XSLT 2.0, below is my code.
>>
>>
>>
>> let $xslt :=
>>http://www.w3.org/1999/XSL/Transform";
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
>> version="2.0">
>>
>>
>>
>>
>>
>> 
>>
>> return
>>
>> xslt:transform(, $xslt)
>>
>>
>>
>> Regards
>> Dharmendra Kumar Singh
>
>


Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Dharmendra Singh
Yes the example which has been given for the 2.0 running perfect but when i am 
adding the line "if($editmode eq $EDIT-FULL) then 'textarea' else 'ouput' in my 
example it is giving error:
[bxerr:BXSL0001] ERROR:  'Syntax error in 'if($editmode eq $EDIT-FULL) then 
'textarea' else 'ouput''.'FATAL ERROR:  ': line 1: Required attribute 'select' 
is missing.'
and same code running on my oxygen editor.

RegardsDharmendra Kumar Singh 

On Wednesday, 21 June 2017 2:54 PM, Christian Grün 
 wrote:
 

 Did you check out the documentation (http://docs.basex.org/wiki/XSLT_Module)?


On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
 wrote:
> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to run
> XSLT 2.0, below is my code.
>
>
>
> let $xslt :=
>    http://www.w3.org/1999/XSL/Transform";
> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
> version="2.0">
>    
>    
>    
>        
>    
> 
>
> return
>
> xslt:transform(, $xslt)
>
>
>
> Regards
> Dharmendra Kumar Singh


   

Re: [basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Christian Grün
Did you check out the documentation (http://docs.basex.org/wiki/XSLT_Module)?


On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
 wrote:
> Hi all i am trying to run XSLT 2.0 but it is giving the error when i run
> xslt 1.0 it fine but i am not able to run XSLT 2.0, is there any way to run
> XSLT 2.0, below is my code.
>
>
>
> let $xslt :=
> http://www.w3.org/1999/XSL/Transform";
> xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs"
> version="2.0">
> 
> 
> 
> 
> 
> 
>
> return
>
> xslt:transform(, $xslt)
>
>
>
> Regards
> Dharmendra Kumar Singh


[basex-talk] How to run XSLT 2.0 in BaseX

2017-06-21 Thread Dharmendra Singh
Hi all i am trying to run XSLT 2.0 but it is giving the error when i run xslt 
1.0 it fine but i am not able to run XSLT 2.0, is there any way to run XSLT 
2.0, below is my code.


let $xslt :=    http://www.w3.org/1999/XSL/Transform"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; exclude-result-prefixes="xs" 
version="2.0">        
        
        
return 
xslt:transform(, $xslt)


RegardsDharmendra Kumar Singh

Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Dharmendra Singh
Thanks Marc and Christian,
As said Christian i have done as well
validate:rng(doc('/onix/jats/EL.2015.2835.xml'),'/relaxng/publishers-51cr.rnc',true())

and i am getting the same error : [bxerr:BXVA0001] Validation failed: 
file:///C:/Users/DHARME~1.SIN/AppData/Local/Temp/BaseX-8123818404127734568.tmp, 
1:1: syntax error
i think XML is not valid.
One again thanks to Everyone, i got the solution.
RegardsDharmendra Kumar Singh 

On Wednesday, 21 June 2017 2:19 PM, Dharmendra Singh 
 wrote:
 

 HI Christian,
How have you loaded the 'publishers-51cr.rnc' schema into database because i am 
loading the schama using function  db:store so it is being loaded as binary 
then i am retrieving using function db:retrive so i it can be  problem in 
loading  the schema. 

On Wednesday, 21 June 2017 1:54 PM, Christian Grün 
 wrote:
 

 As Marc said, the third argument needs to be set to true.

I created a new 'onix' database with a single XML document and the
passed on RelaxNG file, and the validatio could be successfully
started (it stopped with the error message '[bxerr:BXVA0001]
Validation failed', because my XML document did not match the schema.

What happens if you directly reference your XML document and RelaxNG file?

  validate:rng('doc.xml','publishers-51cr.rnc',true())




On Wed, Jun 21, 2017 at 10:16 AM, Dharmendra Singh
 wrote:
> Hi Marc,
>
> I have done as you said to use true() as third param but still i am getting
> the same error, below is my code.
>
> let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc')
> let $schema := bin:decode-string($binary)
> let $input := db:open('onix')
> return
> validate:rng($input,$schema,true())
>
>
> On Wednesday, 21 June 2017 1:29 PM, Marc van Grootel
>  wrote:
>
>
> No problem. Just use the validate:rng#3. Provide true() as the third
> param and it should happily process compact syntax for you.
> Getting includes to work is a different matter though so your schema
> should probably be standalone. Otherwise, maybe, store the schemas on
> the filesystem.
>
> Cheers,
> --Marc
>
> On Wed, Jun 21, 2017 at 9:36 AM, Imsieke, Gerrit, le-tex
>  wrote:
>> Hi Dharmendra,
>>
>> The function validate:rng() seems to only accept a Relax NG *XML syntax*
>> document as its 2nd argument. You can convert the rnc file to rng using
>> trang and store it in the DB as a regular XML file.
>>
>> Gerrit
>>
>> On 6/21/17 8:20 AM, 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.
>>
>>
>> --
>> Gerrit Imsieke
>> Geschäftsführer / Managing Director
>> le-tex publishing services GmbH
>> Weissenfelser Str. 84, 04229 Leipzig, Germany
>> Phone +49 341 355356 110, Fax +49 341 355356 510
>> gerrit.imsi...@le-tex.de, http://www.le-tex.de
>>
>> Registergericht / Commercial Register: Amtsgericht Leipzig
>> Registernummer / Registration Number: HRB 24930
>>
>> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
>> Thomas Schmidt, Dr. Reinhard Vöckler
>
>
>
>
> --
> --Marc
>
>

   

   

Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Christian Grün
> How have you loaded the 'publishers-51cr.rnc' schema into database because i
> am loading the schama using function  db:store so it is being loaded as
> binary then i am retrieving using function db:retrive so i it can be
> problem in loading  the schema.

Yes, that’s fine. Have you tried to directly access the files, as
described in my last mail?



> On Wednesday, 21 June 2017 1:54 PM, Christian Grün
>  wrote:
>
>
> As Marc said, the third argument needs to be set to true.
>
> I created a new 'onix' database with a single XML document and the
> passed on RelaxNG file, and the validatio could be successfully
> started (it stopped with the error message '[bxerr:BXVA0001]
> Validation failed', because my XML document did not match the schema.
>
> What happens if you directly reference your XML document and RelaxNG file?
>
>   validate:rng('doc.xml','publishers-51cr.rnc',true())
>
>
>
>
> On Wed, Jun 21, 2017 at 10:16 AM, Dharmendra Singh
>  wrote:
>> Hi Marc,
>>
>> I have done as you said to use true() as third param but still i am
>> getting
>> the same error, below is my code.
>>
>> let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc')
>> let $schema := bin:decode-string($binary)
>> let $input := db:open('onix')
>> return
>> validate:rng($input,$schema,true())
>>
>>
>> On Wednesday, 21 June 2017 1:29 PM, Marc van Grootel
>>  wrote:
>>
>>
>> No problem. Just use the validate:rng#3. Provide true() as the third
>> param and it should happily process compact syntax for you.
>> Getting includes to work is a different matter though so your schema
>> should probably be standalone. Otherwise, maybe, store the schemas on
>> the filesystem.
>>
>> Cheers,
>> --Marc
>>
>> On Wed, Jun 21, 2017 at 9:36 AM, Imsieke, Gerrit, le-tex
>>  wrote:
>>> Hi Dharmendra,
>>>
>>> The function validate:rng() seems to only accept a Relax NG *XML syntax*
>>> document as its 2nd argument. You can convert the rnc file to rng using
>>> trang and store it in the DB as a regular XML file.
>>>
>>> Gerrit
>>>
>>> On 6/21/17 8:20 AM, 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.
>>>
>>>
>>> --
>>> Gerrit Imsieke
>>> Geschäftsführer / Managing Director
>>> le-tex publishing services GmbH
>>> Weissenfelser Str. 84, 04229 Leipzig, Germany
>>> Phone +49 341 355356 110, Fax +49 341 355356 510
>>> gerrit.imsi...@le-tex.de, http://www.le-tex.de
>>>
>>> Registergericht / Commercial Register: Amtsgericht Leipzig
>>> Registernummer / Registration Number: HRB 24930
>>>
>>> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
>>> Thomas Schmidt, Dr. Reinhard Vöckler
>>
>>
>>
>>
>> --
>> --Marc
>>
>>
>
>


Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Dharmendra Singh
HI Christian,
How have you loaded the 'publishers-51cr.rnc' schema into database because i am 
loading the schama using function  db:store so it is being loaded as binary 
then i am retrieving using function db:retrive so i it can be  problem in 
loading  the schema. 

On Wednesday, 21 June 2017 1:54 PM, Christian Grün 
 wrote:
 

 As Marc said, the third argument needs to be set to true.

I created a new 'onix' database with a single XML document and the
passed on RelaxNG file, and the validatio could be successfully
started (it stopped with the error message '[bxerr:BXVA0001]
Validation failed', because my XML document did not match the schema.

What happens if you directly reference your XML document and RelaxNG file?

  validate:rng('doc.xml','publishers-51cr.rnc',true())




On Wed, Jun 21, 2017 at 10:16 AM, Dharmendra Singh
 wrote:
> Hi Marc,
>
> I have done as you said to use true() as third param but still i am getting
> the same error, below is my code.
>
> let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc')
> let $schema := bin:decode-string($binary)
> let $input := db:open('onix')
> return
> validate:rng($input,$schema,true())
>
>
> On Wednesday, 21 June 2017 1:29 PM, Marc van Grootel
>  wrote:
>
>
> No problem. Just use the validate:rng#3. Provide true() as the third
> param and it should happily process compact syntax for you.
> Getting includes to work is a different matter though so your schema
> should probably be standalone. Otherwise, maybe, store the schemas on
> the filesystem.
>
> Cheers,
> --Marc
>
> On Wed, Jun 21, 2017 at 9:36 AM, Imsieke, Gerrit, le-tex
>  wrote:
>> Hi Dharmendra,
>>
>> The function validate:rng() seems to only accept a Relax NG *XML syntax*
>> document as its 2nd argument. You can convert the rnc file to rng using
>> trang and store it in the DB as a regular XML file.
>>
>> Gerrit
>>
>> On 6/21/17 8:20 AM, 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.
>>
>>
>> --
>> Gerrit Imsieke
>> Geschäftsführer / Managing Director
>> le-tex publishing services GmbH
>> Weissenfelser Str. 84, 04229 Leipzig, Germany
>> Phone +49 341 355356 110, Fax +49 341 355356 510
>> gerrit.imsi...@le-tex.de, http://www.le-tex.de
>>
>> Registergericht / Commercial Register: Amtsgericht Leipzig
>> Registernummer / Registration Number: HRB 24930
>>
>> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
>> Thomas Schmidt, Dr. Reinhard Vöckler
>
>
>
>
> --
> --Marc
>
>

   

Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Christian Grün
As Marc said, the third argument needs to be set to true.

I created a new 'onix' database with a single XML document and the
passed on RelaxNG file, and the validatio could be successfully
started (it stopped with the error message '[bxerr:BXVA0001]
Validation failed', because my XML document did not match the schema.

What happens if you directly reference your XML document and RelaxNG file?

  validate:rng('doc.xml','publishers-51cr.rnc',true())




On Wed, Jun 21, 2017 at 10:16 AM, Dharmendra Singh
 wrote:
> Hi Marc,
>
> I have done as you said to use true() as third param but still i am getting
> the same error, below is my code.
>
> let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc')
> let $schema := bin:decode-string($binary)
> let $input := db:open('onix')
> return
> validate:rng($input,$schema,true())
>
>
> On Wednesday, 21 June 2017 1:29 PM, Marc van Grootel
>  wrote:
>
>
> No problem. Just use the validate:rng#3. Provide true() as the third
> param and it should happily process compact syntax for you.
> Getting includes to work is a different matter though so your schema
> should probably be standalone. Otherwise, maybe, store the schemas on
> the filesystem.
>
> Cheers,
> --Marc
>
> On Wed, Jun 21, 2017 at 9:36 AM, Imsieke, Gerrit, le-tex
>  wrote:
>> Hi Dharmendra,
>>
>> The function validate:rng() seems to only accept a Relax NG *XML syntax*
>> document as its 2nd argument. You can convert the rnc file to rng using
>> trang and store it in the DB as a regular XML file.
>>
>> Gerrit
>>
>> On 6/21/17 8:20 AM, 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.
>>
>>
>> --
>> Gerrit Imsieke
>> Geschäftsführer / Managing Director
>> le-tex publishing services GmbH
>> Weissenfelser Str. 84, 04229 Leipzig, Germany
>> Phone +49 341 355356 110, Fax +49 341 355356 510
>> gerrit.imsi...@le-tex.de, http://www.le-tex.de
>>
>> Registergericht / Commercial Register: Amtsgericht Leipzig
>> Registernummer / Registration Number: HRB 24930
>>
>> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
>> Thomas Schmidt, Dr. Reinhard Vöckler
>
>
>
>
> --
> --Marc
>
>


Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Dharmendra Singh
Hi Marc,
I have done as you said to use true() as third param but still i am getting the 
same error, below is my code.
let $binary := db:retrieve('onix','/relaxng/publishers-51cr.rnc')let $schema := 
bin:decode-string($binary)let $input := 
db:open('onix')returnvalidate:rng($input,$schema,true()) 

On Wednesday, 21 June 2017 1:29 PM, Marc van Grootel 
 wrote:
 

 No problem. Just use the validate:rng#3. Provide true() as the third
param and it should happily process compact syntax for you.
Getting includes to work is a different matter though so your schema
should probably be standalone. Otherwise, maybe, store the schemas on
the filesystem.

Cheers,
--Marc

On Wed, Jun 21, 2017 at 9:36 AM, Imsieke, Gerrit, le-tex
 wrote:
> Hi Dharmendra,
>
> The function validate:rng() seems to only accept a Relax NG *XML syntax*
> document as its 2nd argument. You can convert the rnc file to rng using
> trang and store it in the DB as a regular XML file.
>
> Gerrit
>
> On 6/21/17 8:20 AM, 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.
>
>
> --
> Gerrit Imsieke
> Geschäftsführer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> gerrit.imsi...@le-tex.de, http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard Vöckler



-- 
--Marc

   

Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Marc van Grootel
No problem. Just use the validate:rng#3. Provide true() as the third
param and it should happily process compact syntax for you.
Getting includes to work is a different matter though so your schema
should probably be standalone. Otherwise, maybe, store the schemas on
the filesystem.

Cheers,
--Marc

On Wed, Jun 21, 2017 at 9:36 AM, Imsieke, Gerrit, le-tex
 wrote:
> Hi Dharmendra,
>
> The function validate:rng() seems to only accept a Relax NG *XML syntax*
> document as its 2nd argument. You can convert the rnc file to rng using
> trang and store it in the DB as a regular XML file.
>
> Gerrit
>
> On 6/21/17 8:20 AM, 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.
>
>
> --
> Gerrit Imsieke
> Geschäftsführer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> gerrit.imsi...@le-tex.de, http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard Vöckler



-- 
--Marc


Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Imsieke, Gerrit, le-tex
jing/trang is a Java tool for converting Relax NG schemas and for 
validating with these schemas. If you are using oXygen XML, it is 
integrated with the product and you can use it to convert rnc to rng.


It is maintained on Github 
(https://github.com/relaxng/jing-trang/releases), although I don’t think 
there is a binary distribution.


There is a page about trang, 
http://www.thaiopensource.com/relaxng/trang.html, although some of the 
links are broken.


The download page seems to be functional though: 
https://code.google.com/archive/p/jing-trang/downloads


Invocation is described on 
http://www.thaiopensource.com/relaxng/trang-manual.html


Gerrit

On 6/21/17 9:50 AM, Dharmendra Singh wrote:

Hi Gerrit,

Thanks for your response can you please explain what is trang is this a 
function or something else, can you please provide me the example or 
sample to convertrnc file to rng using

trang

Regards
Dharmendra Kumar Singh


On Wednesday, 21 June 2017 1:06 PM, "Imsieke, Gerrit, le-tex" 
 wrote:



Hi Dharmendra,

The function validate:rng() seems to only accept a Relax NG *XML syntax*
document as its 2nd argument. You can convert the rnc file to rng using
trang and store it in the DB as a regular XML file.

Gerrit

On 6/21/17 8:20 AM, 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.


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsi...@le-tex.de , 
http://www.le-tex.de 


Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler





--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsi...@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler


Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Dharmendra Singh
Hi Gerrit,
Thanks for your response can you please explain what is trang is this a 
function or something else, can you please provide me the example or sample to 
convert  rnc file to rng using trang
RegardsDharmendra Kumar Singh

On Wednesday, 21 June 2017 1:06 PM, "Imsieke, Gerrit, le-tex" 
 wrote:
 

 Hi Dharmendra,

The function validate:rng() seems to only accept a Relax NG *XML syntax* 
document as its 2nd argument. You can convert the rnc file to rng using 
trang and store it in the DB as a regular XML file.

Gerrit

On 6/21/17 8:20 AM, 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.

-- 
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsi...@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler


   

Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Christian Grün
Dear Singh,

Could you please pass us on your schema file?

Thanks in advance,
Christian



On Wed, Jun 21, 2017 at 8:20 AM, 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.


Re: [basex-talk] Validate XML against RNG schema

2017-06-21 Thread Imsieke, Gerrit, le-tex

Hi Dharmendra,

The function validate:rng() seems to only accept a Relax NG *XML syntax* 
document as its 2nd argument. You can convert the rnc file to rng using 
trang and store it in the DB as a regular XML file.


Gerrit

On 6/21/17 8:20 AM, 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.


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsi...@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler