Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

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

Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Alex Muir-2
Greetings,

I'm wondering what regex engine saxon9he-api.dll 9.7.0.15 will use
when the ;n flag is set?

I use regex buddy to develop regular expressions. Currently I'm using
a .NET 2.0-4.6 setting. Is that an appropriate setting?

I'm doing an in memory conversion as follows. Does the in memory
conversion use a different regex than a non in memory conversion?

                XSLTConversionCommand conversionCommand = new
XSLTConversionCommand()
                {
                    PathOfInputXml = simplifiedWorkOrder,
                    PathOfInputXsl =
dataDictionaryRepository.GetByKey("WORK_ORDER_ANALYSIS.xsl").Value
                };
                IXsltConvertor xsltConvertor = new InMemoryXsltConvertor()
                {
                    ConvertCommand = conversionCommand
                };
                string xml = xsltConvertor.Convert();
                workOrder.AnalysisResultXml = xml;


Regards
Alex Muir
Chief Data Engineer/Architect
Jahtoe Technology
tech.jahtoe.com

------------------------------------------------------------------------------
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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Alex Muir-2
On Sat, Apr 22, 2017 at 3:33 PM, Alex Muir <[hidden email]> wrote:
> I'm doing an in memory conversion as follows. Does the in memory
> conversion use a different regex than a non in memory conversion?

actually the code should be the following. The other code is a facade
over the Saxon API.

           Saxon.Api.Processor processor = new Saxon.Api.Processor();
           Saxon.Api.XsltCompiler compiler = processor.NewXsltCompiler();
           Saxon.Api.DomDestination destination = new
Saxon.Api.DomDestination();
           Saxon.Api.XsltExecutable executable =
compiler.Compile(xslStringAsStream);
           Saxon.Api.XsltTransformer transformer = executable.Load();
           transformer.SetInputStream(xmlStringAsStream, new
System.Uri(@"D:\Upwork\WorkOrderAnalysis\XSLT"));
           transformer.Run(destination);
           string finalOutput =  destination.XmlDocument.InnerXml;



Regards
Alex Muir
Chief Data Engineer/Architect
Jahtoe Technology
tech.jahtoe.com

------------------------------------------------------------------------------
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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Michael Kay
In reply to this post by Alex Muir-2
When you run on .NET and use the ";n" flag, Saxon compiles and executes the regular expression using the classes in

System.Text.RegularExpressions

This won't depend on how you run the transformation.

Michael Kay
Saxonica


> On 22 Apr 2017, at 16:33, Alex Muir <[hidden email]> wrote:
>
> Greetings,
>
> I'm wondering what regex engine saxon9he-api.dll 9.7.0.15 will use
> when the ;n flag is set?
>
> I use regex buddy to develop regular expressions. Currently I'm using
> a .NET 2.0-4.6 setting. Is that an appropriate setting?
>
> I'm doing an in memory conversion as follows. Does the in memory
> conversion use a different regex than a non in memory conversion?
>
>                XSLTConversionCommand conversionCommand = new
> XSLTConversionCommand()
>                {
>                    PathOfInputXml = simplifiedWorkOrder,
>                    PathOfInputXsl =
> dataDictionaryRepository.GetByKey("WORK_ORDER_ANALYSIS.xsl").Value
>                };
>                IXsltConvertor xsltConvertor = new InMemoryXsltConvertor()
>                {
>                    ConvertCommand = conversionCommand
>                };
>                string xml = xsltConvertor.Convert();
>                workOrder.AnalysisResultXml = xml;
>
>
> Regards
> Alex Muir
> Chief Data Engineer/Architect
> Jahtoe Technology
> tech.jahtoe.com
>
> ------------------------------------------------------------------------------
> 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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Alex Muir-2
Thanks,, and that is what regex buddy is using as well

On Sat, Apr 22, 2017 at 7:37 PM, Michael Kay <[hidden email]> wrote:
> When you run on .NET and use the ";n" flag, Saxon compiles and executes the regular expression using the classes in
>
> System.Text.RegularExpressions

and to confirm the ignore case flags="i;n" should work correct with
that syntax?

<xsl:analyze-string select="." regex="{$regex.hvac.problems.B}" flags="i;n">

Currently my regex are only working lower case.


Regards
Alex Muir
Chief Data Engineer/Architect
Jahtoe Technology
tech.jahtoe.com

------------------------------------------------------------------------------
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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Michael Kay

> On 24 Apr 2017, at 18:45, Alex Muir <[hidden email]> wrote:
>
> Thanks,, and that is what regex buddy is using as well
>
> On Sat, Apr 22, 2017 at 7:37 PM, Michael Kay <[hidden email]> wrote:
>> When you run on .NET and use the ";n" flag, Saxon compiles and executes the regular expression using the classes in
>>
>> System.Text.RegularExpressions
>
> and to confirm the ignore case flags="i;n" should work correct with
> that syntax?

Interesting. I think the ";n" option was introduced in 9.5, and in all releases since 9.5 the code in DotNetRegularExpression.setFlags() reads:

case 'i':
   // flags |= RegexOptions.IgnoreCase;
    break;

Note the commenting out of the relevant line. I've absolutely no idea why it's commented out. We will have to do some tests before reinstating it. I will raise a bug entry.

Michael Kay
Saxonica

>
> <xsl:analyze-string select="." regex="{$regex.hvac.problems.B}" flags="i;n">
>
> Currently my regex are only working lower case.
>
>
> Regards
> Alex Muir
> Chief Data Engineer/Architect
> Jahtoe Technology
> tech.jahtoe.com
>
> ------------------------------------------------------------------------------
> 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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Alex Muir-2
On Mon, Apr 24, 2017 at 9:24 PM, Michael Kay <[hidden email]> wrote:
> Interesting. I think the ";n" option was introduced in 9.5, and in all releases since 9.5 the code in DotNetRegularExpression.setFlags() reads:
>
> case 'i':
>    // flags |= RegexOptions.IgnoreCase;
>     break;
>
> Note the commenting out of the relevant line. I've absolutely no idea why it's commented out. We will have to do some tests before reinstating it. I will raise a bug entry.

More than interesting really,, is that approximately 4 years old?

I'd be happy to test a dll with that uncommented. I'm supposed to demo
the development end of day Tuesday. I'll bet lunch that it will have
no negative effect. Well I hope anyway!

Actually I suppose I can Install-Package Saxon-HE -Version 9.4.0.9 in
the mean time.


Regards
Alex Muir
Chief Data Engineer/Architect
Jahtoe Technology
tech.jahtoe.com

------------------------------------------------------------------------------
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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Alex Muir-2
On Mon, Apr 24, 2017 at 10:46 PM, Alex Muir <[hidden email]> wrote:
> Actually I suppose I can Install-Package Saxon-HE -Version 9.4.0.9 in
> the mean time.

Oh but will the code I pasted earlier work with 9.4 I wonder? I'll
test in the morning..

Regards
Alex Muir
Chief Data Engineer/Architect
Jahtoe Technology
tech.jahtoe.com

------------------------------------------------------------------------------
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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Michael Kay
I traced back and I think ";n" was introduced in 9.5.

Testing will be trivial - it's doing a .NET build containing the change that takes time.

Michael Kay
Saxonica

> On 24 Apr 2017, at 23:50, Alex Muir <[hidden email]> wrote:
>
> On Mon, Apr 24, 2017 at 10:46 PM, Alex Muir <[hidden email]> wrote:
>> Actually I suppose I can Install-Package Saxon-HE -Version 9.4.0.9 in
>> the mean time.
>
> Oh but will the code I pasted earlier work with 9.4 I wonder? I'll
> test in the morning..
>
> Regards
> Alex Muir
> Chief Data Engineer/Architect
> Jahtoe Technology
> tech.jahtoe.com
>
> ------------------------------------------------------------------------------
> 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
|

Re: Which Regex Engine does saxon9he-api.dll 9.7.0.15 use

Alex Muir-2
On Tue, Apr 25, 2017 at 7:09 AM, Michael Kay <[hidden email]> wrote:
> I traced back and I think ";n" was introduced in 9.5.

Good point. I tried and can confirm that I can't use 9.4 with the
regular expressions I've written which do need the ;n


Regards
Alex Muir
Chief Data Engineer/Architect
Jahtoe Technology
tech.jahtoe.com

------------------------------------------------------------------------------
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