xsl:param/@required

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

xsl:param/@required

cmarchand
Hello,

it seems xsl:param/@required at stylesheet level is not supported by saxon-HE, but is by Saxon-EE.
Is it correct ?

Christophe

------------------------------------------------------------------------------

_______________________________________________
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: xsl:param/@required

cmarchand
Sorry, my problem is at xsl:function level.

<xsl:function name="local:nomPropre" as="xs:string">
        <xsl:param name="s" as="xs:string" required="yes"/>
        <xsl:value-of select="concat(upper-case(substring($s,1,1)),lower-case(substring($s,2)))"/>
</xsl:function>

This does not compile with Saxon-HE 9.7.0.1, but it does with Saxon-EE 9.5.1.5

According to specification (https://www.w3.org/TR/xslt-30/#parameter-type), @required for xsl:function has yes for value ; I understand this as @required is applicable for xsl:function.

Am I right ?

Christophe

Le 08/04/2016 12:08, Christophe Marchand a écrit :
Hello,

it seems xsl:param/@required at stylesheet level is not supported by saxon-HE, but is by Saxon-EE.
Is it correct ?

Christophe


------------------------------------------------------------------------------

_______________________________________________
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: xsl:param/@required

alan.painter-2
Christophe,

I read the specs this way:


http://www.w3.org/TR/xslt20/#element-param

The optional required attribute may be used to indicate that a parameter is mandatory. This attribute may be specified for stylesheet parameters and for template parameters; it must not be specified for function parameters, which are always mandatory.


http://www.w3.org/TR/xslt-30/#element-param

As a child of xsl:function to define a parameter to a stylesheet function, which may be supplied when the function is called from an XPath expression. In this case the permitted attributes are name and as. Function parameters are set positionally by means of the argument list in an XPath function call.


So the attribute required cannot be specified on param elements used within functions for XSLT2 or XSLT3, from my reading.

hope this helps

cheers





De :        Christophe Marchand <[hidden email]>
A :        Mailing list for the SAXON XSLT and XQuery processor <[hidden email]>
Date :        04/08/2016 01:04 PM
Objet :        Re: [saxon] xsl:param/@required




Sorry, my problem is at xsl:function level.

<xsl:function name="local:nomPropre" as="xs:string">
        <xsl:param name="s" as="xs:string" required="yes"/>
        <xsl:value-of select="concat(upper-case(substring($s,1,1)),lower-case(substring($s,2)))"/>
</xsl:function>

This does not compile with Saxon-HE 9.7.0.1, but it does with Saxon-EE 9.5.1.5

According to specification (
https://www.w3.org/TR/xslt-30/#parameter-type), @required for xsl:function has yes for value ; I understand this as @required is applicable for xsl:function.

Am I right ?

Christophe

Le 08/04/2016 12:08, Christophe Marchand a écrit :
Hello,

it seems xsl:param/@required at stylesheet level is not supported by saxon-HE, but is by Saxon-EE.
Is it correct ?

Christophe


******************************************************************
Ce message a ete transmis par Internet. Son emetteur peut ne pas etre
l'emetteur annonce. Son contenu et toute piece jointe peuvent ne pas
etre exacts.
This message originated from the Internet. Its originator may or may
not be who they claim to be and information contained in the message
and any attachments may or may not be accurate.
------------------------------------------------------------------------------


******************************************************************
Ce message a ete transmis par Internet. Son emetteur peut ne pas etre
l'emetteur annonce. Son contenu et toute piece jointe peuvent ne pas
etre exacts.
This message originated from the Internet. Its originator may or may
not be who they claim to be and information contained in the message
and any attachments may or may not be accurate.
_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


Ensemble adoptons des gestes responsables : N'imprimez ce mail que si necessaire. Les informations contenues dans ce message et les pieces jointes (ci-apres denomme le message) sont confidentielles et peuvent etre couvertes par le secret professionnel. Si vous n'etes pas le destinataire de ce message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez recu ce message par erreur, nous vous remercions de le supprimer de votre systeme, ainsi que toutes ses copies, et d'en avertir immediatement HSBC France et ses filiales par message de retour. Il est impossible de garantir que les communications par messagerie electronique arrivent en temps utile, sont securisees ou denuees de toute erreur, alteration, falsification ou virus. En consequence, HSBC France et ses filiales declinent toute responsabilite du fait des erreurs, alterations, falsifications ou omissions qui pourraient en resulter.

Consider the environment before printing this mail. The information contained in this e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message by error, please delete it and all copies from your system and notify the sender immediately by return e-mail. E-mail communications cannot be guaranteed to be timely secure, error or virus-free. The sender does not accept liability for any errors or omissions which arise as a result.


------------------------------------------------------------------------------

_______________________________________________
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: xsl:param/@required

cmarchand
It does !
After reading again the spec, I remember that parameters are always mandatory for functions, and so, the required attribute has nothing to do on such a parameter.

The thing that drives me in errors, is that Saxon-EE does not throw error when compiling this.

Thanks,
Christophe

Le 08/04/2016 13:36, [hidden email] a écrit :
Christophe,

I read the specs this way:


http://www.w3.org/TR/xslt20/#element-param

The optional required attribute may be used to indicate that a parameter is mandatory. This attribute may be specified for stylesheet parameters and for template parameters; it must not be specified for function parameters, which are always mandatory.


http://www.w3.org/TR/xslt-30/#element-param

As a child of xsl:function to define a parameter to a stylesheet function, which may be supplied when the function is called from an XPath expression. In this case the permitted attributes are name and as. Function parameters are set positionally by means of the argument list in an XPath function call.


So the attribute required cannot be specified on param elements used within functions for XSLT2 or XSLT3, from my reading.

hope this helps

cheers





De :        Christophe Marchand [hidden email]
A :        Mailing list for the SAXON XSLT and XQuery processor [hidden email]
Date :        04/08/2016 01:04 PM
Objet :        Re: [saxon] xsl:param/@required




Sorry, my problem is at xsl:function level.

<xsl:function name="local:nomPropre" as="xs:string">
        <xsl:param name="s" as="xs:string" required="yes"/>
        <xsl:value-of select="concat(upper-case(substring($s,1,1)),lower-case(substring($s,2)))"/>
</xsl:function>

This does not compile with Saxon-HE 9.7.0.1, but it does with Saxon-EE 9.5.1.5

According to specification (
https://www.w3.org/TR/xslt-30/#parameter-type), @required for xsl:function has yes for value ; I understand this as @required is applicable for xsl:function.

Am I right ?

Christophe

Le 08/04/2016 12:08, Christophe Marchand a écrit :
Hello,

it seems xsl:param/@required at stylesheet level is not supported by saxon-HE, but is by Saxon-EE.
Is it correct ?

Christophe


******************************************************************
Ce message a ete transmis par Internet. Son emetteur peut ne pas etre
l'emetteur annonce. Son contenu et toute piece jointe peuvent ne pas
etre exacts.
This message originated from the Internet. Its originator may or may
not be who they claim to be and information contained in the message
and any attachments may or may not be accurate.
------------------------------------------------------------------------------


******************************************************************
Ce message a ete transmis par Internet. Son emetteur peut ne pas etre
l'emetteur annonce. Son contenu et toute piece jointe peuvent ne pas
etre exacts.
This message originated from the Internet. Its originator may or may
not be who they claim to be and information contained in the message
and any attachments may or may not be accurate.
_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


Ensemble adoptons des gestes responsables : N'imprimez ce mail que si necessaire. Les informations contenues dans ce message et les pieces jointes (ci-apres denomme le message) sont confidentielles et peuvent etre couvertes par le secret professionnel. Si vous n'etes pas le destinataire de ce message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez recu ce message par erreur, nous vous remercions de le supprimer de votre systeme, ainsi que toutes ses copies, et d'en avertir immediatement HSBC France et ses filiales par message de retour. Il est impossible de garantir que les communications par messagerie electronique arrivent en temps utile, sont securisees ou denuees de toute erreur, alteration, falsification ou virus. En consequence, HSBC France et ses filiales declinent toute responsabilite du fait des erreurs, alterations, falsifications ou omissions qui pourraient en resulter.

Consider the environment before printing this mail. The information contained in this e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message by error, please delete it and all copies from your system and notify the sender immediately by return e-mail. E-mail communications cannot be guaranteed to be timely secure, error or virus-free. The sender does not accept liability for any errors or omissions which arise as a result.


------------------------------------------------------------------------------


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------

_______________________________________________
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: xsl:param/@required

Michael Kay
In reply to this post by cmarchand
There has been a change in the spec in this area.

According to the current XSLT 3.0 candidate recommendation, we've aligned the rules for attributes on xsl:variable and xsl:param so that an implicit/mandatory value can always be written explicitly. Thus xsl:function/xsl:param/@required can now be specified, but it can only take the value "yes". The full table is here:


In XSLT 2.0, xsl:function/xsl:param/@required was disallowed. This was different from the situation with xsl:function/xsl:param/@tunnel, which was allowed so long as it took the value "no". When we introduced xsl:param/@static we spotted the inconsistency and decided to bring them all into line: we don't disallow an attribute simply because there is only one value that makes sense.

Saxon is trying desperately to conform to either the 2.0 rules or the 3.0 rules depending on how it is invoked. I don't guarantee that we always get it right. Complicating the matter further is that if you run Saxon as an XSLT 2.0 processor but specify version="3.0" in the stylesheet, then it tries to follow the rules for a 2.0 processor running in forwards compatibility mode, which say that both @required="yes" and @required="no" should be ignored. Frankly this isn't helpful to users, quite apart from making testing a nightmare. Assuming that we get 3.0 to recommendation status before Saxon 9.8 comes out, I shall probably drop support for strict XSLT 2.0 conformance - ie things like this will follow the XSLT 3.0 rules unconditionally.

Michael Kay
Saxonica


On 8 Apr 2016, at 11:08, Christophe Marchand <[hidden email]> wrote:

Hello,

it seems xsl:param/@required at stylesheet level is not supported by saxon-HE, but is by Saxon-EE.
Is it correct ?

Christophe
------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------

_______________________________________________
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: xsl:param/@required

cmarchand
Sure, it's complicated !
Thanks Mikael, to bring the light to us !

Best regards,
Christophe

Le 08/04/2016 16:04, Michael Kay a écrit :
There has been a change in the spec in this area.

According to the current XSLT 3.0 candidate recommendation, we've aligned the rules for attributes on xsl:variable and xsl:param so that an implicit/mandatory value can always be written explicitly. Thus xsl:function/xsl:param/@required can now be specified, but it can only take the value "yes". The full table is here:


In XSLT 2.0, xsl:function/xsl:param/@required was disallowed. This was different from the situation with xsl:function/xsl:param/@tunnel, which was allowed so long as it took the value "no". When we introduced xsl:param/@static we spotted the inconsistency and decided to bring them all into line: we don't disallow an attribute simply because there is only one value that makes sense.

Saxon is trying desperately to conform to either the 2.0 rules or the 3.0 rules depending on how it is invoked. I don't guarantee that we always get it right. Complicating the matter further is that if you run Saxon as an XSLT 2.0 processor but specify version="3.0" in the stylesheet, then it tries to follow the rules for a 2.0 processor running in forwards compatibility mode, which say that both @required="yes" and @required="no" should be ignored. Frankly this isn't helpful to users, quite apart from making testing a nightmare. Assuming that we get 3.0 to recommendation status before Saxon 9.8 comes out, I shall probably drop support for strict XSLT 2.0 conformance - ie things like this will follow the XSLT 3.0 rules unconditionally.

Michael Kay
Saxonica


On 8 Apr 2016, at 11:08, Christophe Marchand <[hidden email]> wrote:

Hello,

it seems xsl:param/@required at stylesheet level is not supported by saxon-HE, but is by Saxon-EE.
Is it correct ?

Christophe
------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
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

regex error in Saxon 9.5/6/7

Tom De Herdt
In reply to this post by cmarchand
Hi,

After upgrading from Saxon 9.4 to 9.6, a regular expression that worked
fine suddenly throws a java.lang.ArrayIndexOutOfBoundsException.

The expression attempts to normalize space between numbers and selected
SI units. Below is a stylesheet that isolates the problem.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
   <xsl:template match="/">
     <test>
       <xsl:value-of select="
         replace('30 dB','
         ([0-9])\s+
         (
           (
           [hkMGTPdcmµnpf]?([mgsAKNJWCVFSTHLl])
           | ([ch]a|t|dB)
           | ((k|Ki|[MGTP]i?)?(B|bit))
           | (KB?)
           )
           (\W|$)
         )
         ','$1&#xA0;$2','x')"
       />
     </test>
   </xsl:template>
</xsl:stylesheet>

I tested it in oXygen 15.2 using Saxon-PE 9.5.1.3 and with several
version of Saxon 9.6 and 9.7 for .NET on Windows 7.

It works fine in Saxon 9.4, it also works fine in 9.5 and 9.6/7 when
using the native regex engine with flags "!" resp. ";j" or ";n". So I
guess it has something to do with the new Jakarta-based regex
implementation introduced in 9.5.

The error only occurs when there is a match.

Could it be a bug, or is the regular expression invalid (or simply too
horrible to be processed by decent regex matchers)?

Thanks,
regards,
Tom De Herdt


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
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: regex error in Saxon 9.5/6/7

Michael Kay
Thanks for reporting it. I have created a bug entry here where you can track it:

https://saxonica.plan.io/issues/2735

I've reproduced it and it should be easy enough to fix. The problem appears to occur when the replacement string of fn:replace ends with a single-digit group reference (like $2) and the regex contains more than 9 captured groups; so the code is looking to see if $2 is followed by another digit.

Michael Kay
Saxonica




> On 5 May 2016, at 18:11, Tom De Herdt <[hidden email]> wrote:
>
> Hi,
>
> After upgrading from Saxon 9.4 to 9.6, a regular expression that worked
> fine suddenly throws a java.lang.ArrayIndexOutOfBoundsException.
>
> The expression attempts to normalize space between numbers and selected
> SI units. Below is a stylesheet that isolates the problem.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="2.0">
>   <xsl:template match="/">
>     <test>
>       <xsl:value-of select="
>         replace('30 dB','
>         ([0-9])\s+
>         (
>           (
>           [hkMGTPdcmµnpf]?([mgsAKNJWCVFSTHLl])
>           | ([ch]a|t|dB)
>           | ((k|Ki|[MGTP]i?)?(B|bit))
>           | (KB?)
>           )
>           (\W|$)
>         )
>         ','$1&#xA0;$2','x')"
>       />
>     </test>
>   </xsl:template>
> </xsl:stylesheet>
>
> I tested it in oXygen 15.2 using Saxon-PE 9.5.1.3 and with several
> version of Saxon 9.6 and 9.7 for .NET on Windows 7.
>
> It works fine in Saxon 9.4, it also works fine in 9.5 and 9.6/7 when
> using the native regex engine with flags "!" resp. ";j" or ";n". So I
> guess it has something to do with the new Jakarta-based regex
> implementation introduced in 9.5.
>
> The error only occurs when there is a match.
>
> Could it be a bug, or is the regular expression invalid (or simply too
> horrible to be processed by decent regex matchers)?
>
> Thanks,
> regards,
> Tom De Herdt
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
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: regex error in Saxon 9.5/6/7

Tom De Herdt
Ok, thanks for your prompt reply!

Best regards,
Tom De Herdt

On 5/05/2016 19:33, Michael Kay wrote:

> Thanks for reporting it. I have created a bug entry here where you can track it:
>
> https://saxonica.plan.io/issues/2735
>
> I've reproduced it and it should be easy enough to fix. The problem appears to occur when the replacement string of fn:replace ends with a single-digit group reference (like $2) and the regex contains more than 9 captured groups; so the code is looking to see if $2 is followed by another digit.
>
> Michael Kay
> Saxonica
>
>
>
>
>> On 5 May 2016, at 18:11, Tom De Herdt <[hidden email]> wrote:
>>
>> Hi,
>>
>> After upgrading from Saxon 9.4 to 9.6, a regular expression that worked
>> fine suddenly throws a java.lang.ArrayIndexOutOfBoundsException.
>>
>> The expression attempts to normalize space between numbers and selected
>> SI units. Below is a stylesheet that isolates the problem.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> version="2.0">
>>    <xsl:template match="/">
>>      <test>
>>        <xsl:value-of select="
>>          replace('30 dB','
>>          ([0-9])\s+
>>          (
>>            (
>>            [hkMGTPdcmµnpf]?([mgsAKNJWCVFSTHLl])
>>            | ([ch]a|t|dB)
>>            | ((k|Ki|[MGTP]i?)?(B|bit))
>>            | (KB?)
>>            )
>>            (\W|$)
>>          )
>>          ','$1&#xA0;$2','x')"
>>        />
>>      </test>
>>    </xsl:template>
>> </xsl:stylesheet>
>>
>> I tested it in oXygen 15.2 using Saxon-PE 9.5.1.3 and with several
>> version of Saxon 9.6 and 9.7 for .NET on Windows 7.
>>
>> It works fine in Saxon 9.4, it also works fine in 9.5 and 9.6/7 when
>> using the native regex engine with flags "!" resp. ";j" or ";n". So I
>> guess it has something to do with the new Jakarta-based regex
>> implementation introduced in 9.5.
>>
>> The error only occurs when there is a match.
>>
>> Could it be a bug, or is the regular expression invalid (or simply too
>> horrible to be processed by decent regex matchers)?
>>
>> Thanks,
>> regards,
>> Tom De Herdt
>>
>>
>> ------------------------------------------------------------------------------
>> Find and fix application performance issues faster with Applications Manager
>> Applications Manager provides deep performance insights into multiple tiers of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free trial!
>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...