Discussion:
[basex-talk] How to run XSLT 2.0 in BaseX
Dharmendra Singh
2017-06-21 09:19:20 UTC
Permalink
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 :=    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">    <xsl:variable name="editmode" select="dharam"/>    <xsl:variable name="EDIT-FULL" select="dharam"/>    <xsl:template match="/">        <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else 'ouput'"/>    </xsl:template></xsl:stylesheet>
return 
xslt:transform(<p>1111</p>, $xslt)


RegardsDharmendra Kumar Singh
Christian Grün
2017-06-21 09:24:34 UTC
Permalink
Did you check out the documentation (http://docs.basex.org/wiki/XSLT_Module)?


On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
<xsl:variable name="editmode" select="dharam"/>
<xsl:variable name="EDIT-FULL" select="dharam"/>
<xsl:template match="/">
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
</xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Dharmendra Singh
2017-06-21 09:45:57 UTC
Permalink
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 <***@gmail.com> 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
Post by 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 :=
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
    <xsl:variable name="editmode" select="dharam"/>
    <xsl:variable name="EDIT-FULL" select="dharam"/>
    <xsl:template match="/">
        <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
    </xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Christian Grün
2017-06-21 09:50:33 UTC
Permalink
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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
<xsl:variable name="editmode" select="dharam"/>
<xsl:variable name="EDIT-FULL" select="dharam"/>
<xsl:template match="/">
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
</xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Dharmendra Singh
2017-06-21 10:09:23 UTC
Permalink
 xslt:version() returning 1.0 and my XSLT expression for the 2.0 like   <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else 'ouput'"/>
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 <***@gmail.com> 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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
    <xsl:variable name="editmode" select="dharam"/>
    <xsl:variable name="EDIT-FULL" select="dharam"/>
    <xsl:template match="/">
        <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
    </xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Christian Grün
2017-06-21 10:12:55 UTC
Permalink
Post by Dharmendra Singh
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
Post by Dharmendra Singh
xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else
'ouput'"/>
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
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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
<xsl:variable name="editmode" select="dharam"/>
<xsl:variable name="EDIT-FULL" select="dharam"/>
<xsl:template match="/">
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
</xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Dharmendra Singh
2017-06-21 10:40:15 UTC
Permalink
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
Post by Dharmendra Singh
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
Post by Dharmendra Singh
  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else
'ouput'"/>
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
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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
    <xsl:variable name="editmode" select="dharam"/>
    <xsl:variable name="EDIT-FULL" select="dharam"/>
    <xsl:template match="/">
        <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
    </xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Dharmendra Singh
2017-06-21 11:25:32 UTC
Permalink
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 <***@gmail.com> 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
Post by Dharmendra Singh
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
Post by Dharmendra Singh
  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else
'ouput'"/>
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
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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
    <xsl:variable name="editmode" select="dharam"/>
    <xsl:variable name="EDIT-FULL" select="dharam"/>
    <xsl:template match="/">
        <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
    </xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Christian Grün
2017-06-21 12:00:24 UTC
Permalink
Post by Dharmendra Singh
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?
Post by 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.
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
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
Post by Dharmendra Singh
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
Post by Dharmendra Singh
xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else
'ouput'"/>
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
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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
<xsl:variable name="editmode" select="dharam"/>
<xsl:variable name="EDIT-FULL" select="dharam"/>
<xsl:template match="/">
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
</xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Dharmendra Singh
2017-06-21 12:27:46 UTC
Permalink
Thanks for you guidance Christian it worked for me as you suggested.

RegardsDharmendra Kumar Singh
  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?
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
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
Post by Dharmendra Singh
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
Post by Dharmendra Singh
  xslt:version() returning 1.0 and my XSLT expression for the 2.0 like
<xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea' else
'ouput'"/>
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
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
Post by 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'
[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
Did you check out the documentation
(http://docs.basex.org/wiki/XSLT_Module)?
On Wed, Jun 21, 2017 at 11:19 AM, Dharmendra Singh
Post by 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 :=
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
version="2.0">
    <xsl:variable name="editmode" select="dharam"/>
    <xsl:variable name="EDIT-FULL" select="dharam"/>
    <xsl:template match="/">
        <xsl:value-of select="if($editmode eq $EDIT-FULL) then 'textarea'
else 'ouput'"/>
    </xsl:template>
</xsl:stylesheet>
return
xslt:transform(<p>1111</p>, $xslt)
Regards
Dharmendra Kumar Singh
Loading...