Quantcast

analyze-string issue from 9.6.0.8 onwards

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

analyze-string issue from 9.6.0.8 onwards

Imsieke, Gerrit, le-tex
I just spent hours chasing an issue which can be distilled to this example:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">

   <xsl:variable name="regex" as="xs:string"
     select="'^(\p{Lu}{2}_\p{Lu}{3}_)?((\d{5})_)?(\d{5}).*$'" />
   <xsl:variable name="basename" as="xs:string"
     select="'UV_STD_00000_39000_Test'" />

   <xsl:template name="main">
     <xsl:analyze-string select="$basename" regex="{$regex}">
       <xsl:matching-substring>
         <xsl:message
           select="for $i in (1 to 4)
                   return concat($i, ':', regex-group($i))"/>
       </xsl:matching-substring>
     </xsl:analyze-string>
   </xsl:template>
</xsl:stylesheet>

The output in HE 9.5.1.2, HE 9.6.0.7, and PE 9.6.0.7 is as expected:
1:UV_STD_ 2:00000_ 3:00000 4:39000

 From HE/PE 9.6.0.8 on, also in the most recent HE 9.7.0.8 version, the
output is:
1: 2: 3: 4:39000

Is it likely that there will be a fix also for the 9.6 branch? We are
partly tied to what XML Calabash supports, and 9.7 is not supported yet.

Gerrit

--
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
[hidden email], 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

------------------------------------------------------------------------------
_______________________________________________
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: analyze-string issue from 9.6.0.8 onwards

Michael Kay
Thanks for reporting it.

Filed as a bug here (where you can track progress if I forget to report back here):

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

Test case analyze-string-096 added to XSLT 3.0 test suite.

Michael Kay
Saxonica

> On 21 Sep 2016, at 00:58, Imsieke, Gerrit, le-tex <[hidden email]> wrote:
>
> I just spent hours chasing an issue which can be distilled to this example:
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
>
>   <xsl:variable name="regex" as="xs:string"
>     select="'^(\p{Lu}{2}_\p{Lu}{3}_)?((\d{5})_)?(\d{5}).*$'" />
>   <xsl:variable name="basename" as="xs:string"
>     select="'UV_STD_00000_39000_Test'" />
>
>   <xsl:template name="main">
>     <xsl:analyze-string select="$basename" regex="{$regex}">
>       <xsl:matching-substring>
>         <xsl:message
>           select="for $i in (1 to 4)
>                   return concat($i, ':', regex-group($i))"/>
>       </xsl:matching-substring>
>     </xsl:analyze-string>
>   </xsl:template>
> </xsl:stylesheet>
>
> The output in HE 9.5.1.2, HE 9.6.0.7, and PE 9.6.0.7 is as expected:
> 1:UV_STD_ 2:00000_ 3:00000 4:39000
>
> From HE/PE 9.6.0.8 on, also in the most recent HE 9.7.0.8 version, the
> output is:
> 1: 2: 3: 4:39000
>
> Is it likely that there will be a fix also for the 9.6 branch? We are
> partly tied to what XML Calabash supports, and 9.7 is not supported yet.
>
> Gerrit
>
> --
> 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
> [hidden email], 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
>
> ------------------------------------------------------------------------------
> _______________________________________________
> 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 
Loading...