Output from XSLT showing if SAXON Licence Features are enabled or not?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Output from XSLT showing if SAXON Licence Features are enabled or not?

Neil Hunter

Hi,

 

Is there a way, within an XSL style sheet, to test whether a Saxon (9.6 EE)  transformation is running with licence features enabled or not? Ideally, applying the transformation would just return: <result>true</result> or <result>false</result> accordingly. This might then form the basis for running an automated test on code deployment.

 

Thanks,

 

Neil


This communication is from The Royal Society of Chemistry, a company incorporated in England by Royal Charter (registered number RC000524) and a charity registered in England and Wales (charity number 207890). Registered office: Burlington House, Piccadilly, London W1J 0BA. Telephone: 0207 4378 6556, Facsimile: 0207 4490 3393 (Head Office). This communication (including any attachments) may contain confidential, privileged or copyright material. It may not be relied upon or disclosed to any person other than the intended recipient(s) without the consent of The Royal Society of Chemistry. If you are not the intended recipient(s), please (1) notify us immediately by replying to this email and delete all copies from your system and (2) note that disclosure, distribution, copying or use of this communication is strictly prohibited. Any advice given by The Royal Society of Chemistry has been carefully formulated but is necessarily based on the information available, and The Royal Society of Chemistry cannot be held responsible for accuracy or completeness. In this respect, any views or opinions presented in this email are solely those of the author and may not represent those of The Royal Society of Chemistry.

The Royal Society of Chemistry owes no duty of care and shall not be liable for any resulting damage or loss as a result of the use of this email and/or attachments. The Royal Society of Chemistry acknowledges that a disclaimer cannot restrict liability at law for personal injury or death arising through a finding of negligence. The Royal Society of Chemistry does not warrant that its emails or attachments are Virus-free: Please rely on your own screening.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Output from XSLT showing if SAXON Licence Features are enabled or not?

Michael Kay
I think the simplest is probably:

<xsl:function name="f:is-licensed-EE" as="xs:boolean">
  <xsl:variable name="v" select="system-property('xsl:product-version')"/>
  <xsl:sequence select="starts-with($v, 'EE') and not contains($v, '(unlicensed)')"/>
</xsl:function>

Most other methods I could think of would depend on other options, e.g. whether 3.0 is enabled, or whether schema-awareness is enabled, or whether streaming is enabled; or would be exposed to changes in later Saxon versions; or would be potentially expensive.

However, I think that this (and any other mechanism) is likely to fail with a dynamic error or worse if an invalid license is found - Saxon falls back to HE mode if there is no license file, but fails immediately if a license file is found that is invalid or expired.

Michael Kay
Saxonica


On 20 Feb 2017, at 15:07, Neil Hunter <[hidden email]> wrote:

Hi,

 

Is there a way, within an XSL style sheet, to test whether a Saxon (9.6 EE)  transformation is running with licence features enabled or not? Ideally, applying the transformation would just return: <result>true</result> or <result>false</result> accordingly. This might then form the basis for running an automated test on code deployment.

 

Thanks,

 

Neil


This communication is from The Royal Society of Chemistry, a company incorporated in England by Royal Charter (registered number RC000524) and a charity registered in England and Wales (charity number 207890). Registered office: Burlington House, Piccadilly, London W1J 0BA. Telephone: 0207 4378 6556, Facsimile: 0207 4490 3393 (Head Office). This communication (including any attachments) may contain confidential, privileged or copyright material. It may not be relied upon or disclosed to any person other than the intended recipient(s) without the consent of The Royal Society of Chemistry. If you are not the intended recipient(s), please (1) notify us immediately by replying to this email and delete all copies from your system and (2) note that disclosure, distribution, copying or use of this communication is strictly prohibited. Any advice given by The Royal Society of Chemistry has been carefully formulated but is necessarily based on the information available, and The Royal Society of Chemistry cannot be held responsible for accuracy or completeness. In this respect, any views or opinions presented in this email are solely those of the author and may not represent those of The Royal Society of Chemistry.

The Royal Society of Chemistry owes no duty of care and shall not be liable for any resulting damage or loss as a result of the use of this email and/or attachments. The Royal Society of Chemistry acknowledges that a disclaimer cannot restrict liability at law for personal injury or death arising through a finding of negligence. The Royal Society of Chemistry does not warrant that its emails or attachments are Virus-free: Please rely on your own screening.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Output from XSLT showing if SAXON Licence Features are enabled or not?

Neil Hunter

Michael,

 

Many thanks for this!  Everything else I tried had failed as you describe.

 

Regards,

 

Neil Hunter

RSC

 

From: Michael Kay [mailto:[hidden email]]
Sent: 20 February 2017 18:22
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Output from XSLT showing if SAXON Licence Features are enabled or not?

 

I think the simplest is probably:

 

<xsl:function name="f:is-licensed-EE" as="xs:boolean">

  <xsl:variable name="v" select="system-property('xsl:product-version')"/>

  <xsl:sequence select="starts-with($v, 'EE') and not contains($v, '(unlicensed)')"/>

</xsl:function>

 

Most other methods I could think of would depend on other options, e.g. whether 3.0 is enabled, or whether schema-awareness is enabled, or whether streaming is enabled; or would be exposed to changes in later Saxon versions; or would be potentially expensive.

 

However, I think that this (and any other mechanism) is likely to fail with a dynamic error or worse if an invalid license is found - Saxon falls back to HE mode if there is no license file, but fails immediately if a license file is found that is invalid or expired.

 

Michael Kay

Saxonica

 

 

On 20 Feb 2017, at 15:07, Neil Hunter <[hidden email]> wrote:

 

Hi,

 

Is there a way, within an XSL style sheet, to test whether a Saxon (9.6 EE)  transformation is running with licence features enabled or not? Ideally, applying the transformation would just return: <result>true</result> or <result>false</result> accordingly. This might then form the basis for running an automated test on code deployment.

 

Thanks,

 

Neil



 


This communication is from The Royal Society of Chemistry, a company incorporated in England by Royal Charter (registered number RC000524) and a charity registered in England and Wales (charity number 207890). Registered office: Burlington House, Piccadilly, London W1J 0BA. Telephone: 0207 4378 6556, Facsimile: 0207 4490 3393 (Head Office). This communication (including any attachments) may contain confidential, privileged or copyright material. It may not be relied upon or disclosed to any person other than the intended recipient(s) without the consent of The Royal Society of Chemistry. If you are not the intended recipient(s), please (1) notify us immediately by replying to this email and delete all copies from your system and (2) note that disclosure, distribution, copying or use of this communication is strictly prohibited. Any advice given by The Royal Society of Chemistry has been carefully formulated but is necessarily based on the information available, and The Royal Society of Chemistry cannot be held responsible for accuracy or completeness. In this respect, any views or opinions presented in this email are solely those of the author and may not represent those of The Royal Society of Chemistry.

The Royal Society of Chemistry owes no duty of care and shall not be liable for any resulting damage or loss as a result of the use of this email and/or attachments. The Royal Society of Chemistry acknowledges that a disclaimer cannot restrict liability at law for personal injury or death arising through a finding of negligence. The Royal Society of Chemistry does not warrant that its emails or attachments are Virus-free: Please rely on your own screening.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...