Issue with URI Resolver in Saxon 9.7?

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

Issue with URI Resolver in Saxon 9.7?

Jorge Williams-2
Hello all,

I’m converting some code from 9.4.0-9 to 9.7.0-6  and am struggling a bit with URI Resolver.

My code chains resolvers in the following manner…(using the JAX-P interface).

1. Instantiate a factory (net.sf.saxon.TransformerFactoryImpl)
2. Save the original URI resolver… ORIGINAL_RESOLVE <- transformerFactory.getURIResolver
3. Add custom factory level resolver FACTORY_RESOLVE.  The FACTORY_RESOLVE attempts to resolve a URI using some custom rules if it can’t resolve it makes a resolve call to ORIGINAL_RESOLVE.
….. in another part of my program ….
4. Create Templates (calling newTemplates from the factory)
5. Create a transformer (calling newTransformer from the templates)
6. Get the URI resolver from the transformer by calling getURIResolver   (Should be FACTORY_RESOLVE)
7. Add a custom transformer level resolver TRANSFORM_RESOLVE,  This resolver attempts to resolve a URI — if it can’t it makes a call to the resolver obtained in step 6 (should be FACTORY_RESOLVE).

In 9.4 everything works great…under 9.7 step 6 returns null instead of FACTORY_RESOLVE which breaks things for me.

Any ideas?

Thanks,

-jOrGe W.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: Issue with URI Resolver in Saxon 9.7?

Michael Kay
Please track this issue here:

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

I think you are right: although the Javadoc for Transformer.setURIResolver() and Transformer.getURIResolver() is silent on the matter, the Javadoc for TransformerFactory.setUIRResolver() says that it is used by default for calls on document() as well as xsl:include and xsl:import, which implies it is the default for the run-time URIResolver.

It's complicated by the fact (and perhaps caused by the fact) that the JAXP interface is now implemented as a layer on top of the s9api interface, and in s9api the URIResolver can also be specified per-compilation at the level of the XsltCompiler.

Michael Kay
Saxonica


> On 16 Jul 2016, at 07:06, Jorge Williams <[hidden email]> wrote:
>
> Hello all,
>
> I’m converting some code from 9.4.0-9 to 9.7.0-6  and am struggling a bit with URI Resolver.
>
> My code chains resolvers in the following manner…(using the JAX-P interface).
>
> 1. Instantiate a factory (net.sf.saxon.TransformerFactoryImpl)
> 2. Save the original URI resolver… ORIGINAL_RESOLVE <- transformerFactory.getURIResolver
> 3. Add custom factory level resolver FACTORY_RESOLVE.  The FACTORY_RESOLVE attempts to resolve a URI using some custom rules if it can’t resolve it makes a resolve call to ORIGINAL_RESOLVE.
> ….. in another part of my program ….
> 4. Create Templates (calling newTemplates from the factory)
> 5. Create a transformer (calling newTransformer from the templates)
> 6. Get the URI resolver from the transformer by calling getURIResolver   (Should be FACTORY_RESOLVE)
> 7. Add a custom transformer level resolver TRANSFORM_RESOLVE,  This resolver attempts to resolve a URI — if it can’t it makes a call to the resolver obtained in step 6 (should be FACTORY_RESOLVE).
>
> In 9.4 everything works great…under 9.7 step 6 returns null instead of FACTORY_RESOLVE which breaks things for me.
>
> Any ideas?
>
> Thanks,
>
> -jOrGe W.
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: Issue with URI Resolver in Saxon 9.7?

Ilya Vinarsky
This was the bug I wanted to report.  If you fix it, our code will no longer need a workaround.

-----Original Message-----
From: Michael Kay [mailto:[hidden email]]
Sent: Saturday, July 16, 2016 6:58 AM
To: Mailing list for the SAXON XSLT and XQuery processor <[hidden email]>
Subject: Re: [saxon] Issue with URI Resolver in Saxon 9.7?

Please track this issue here:

https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fsaxonica.plan.io%2fissues%2f2843&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=KdmHhelIqkdXakOKUk4Ry0qZUx735zMRYXd0i3BTxBA%3d

I think you are right: although the Javadoc for Transformer.setURIResolver() and Transformer.getURIResolver() is silent on the matter, the Javadoc for TransformerFactory.setUIRResolver() says that it is used by default for calls on document() as well as xsl:include and xsl:import, which implies it is the default for the run-time URIResolver.

It's complicated by the fact (and perhaps caused by the fact) that the JAXP interface is now implemented as a layer on top of the s9api interface, and in s9api the URIResolver can also be specified per-compilation at the level of the XsltCompiler.

Michael Kay
Saxonica


> On 16 Jul 2016, at 07:06, Jorge Williams <[hidden email]> wrote:
>
> Hello all,
>
> I’m converting some code from 9.4.0-9 to 9.7.0-6  and am struggling a bit with URI Resolver.
>
> My code chains resolvers in the following manner…(using the JAX-P interface).
>
> 1. Instantiate a factory (net.sf.saxon.TransformerFactoryImpl)
> 2. Save the original URI resolver… ORIGINAL_RESOLVE <-
> transformerFactory.getURIResolver 3. Add custom factory level resolver FACTORY_RESOLVE.  The FACTORY_RESOLVE attempts to resolve a URI using some custom rules if it can’t resolve it makes a resolve call to ORIGINAL_RESOLVE.
> ….. in another part of my program ….
> 4. Create Templates (calling newTemplates from the factory) 5. Create
> a transformer (calling newTransformer from the templates)
> 6. Get the URI resolver from the transformer by calling getURIResolver   (Should be FACTORY_RESOLVE)
> 7. Add a custom transformer level resolver TRANSFORM_RESOLVE,  This resolver attempts to resolve a URI — if it can’t it makes a call to the resolver obtained in step 6 (should be FACTORY_RESOLVE).
>
> In 9.4 everything works great…under 9.7 step 6 returns null instead of FACTORY_RESOLVE which breaks things for me.
>
> Any ideas?
>
> Thanks,
>
> -jOrGe W.
>
> ----------------------------------------------------------------------
> -------- What NetFlow Analyzer can do for you? Monitors network
> bandwidth and traffic patterns at an interface-level. Reveals which
> users, apps, and protocols are consuming the most bandwidth. Provides
> multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make
> informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev
> _______________________________________________
> saxon-help mailing list archived at
> https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsaxon.
> markmail.org%2f&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64
> 808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=5cPHC
> CNnxcVYDFa2U1pJLxJA%2f3ztKga4GvXnhadzI4M%3d
> [hidden email]
> https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2flists
> .sourceforge.net%2flists%2flistinfo%2fsaxon-help&data=01%7c01%7cilyavi
> n%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141a
> f91ab2d7cd011db47%7c1&sdata=3iD2rCOGKc7y2vyNp30yn%2fAx7ZLcyuZNYcUfDgEB
> eec%3d



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsaxon.markmail.org%2f&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=5cPHCCNnxcVYDFa2U1pJLxJA%2f3ztKga4GvXnhadzI4M%3d
[hidden email]
https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2flists.sourceforge.net%2flists%2flistinfo%2fsaxon-help&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=3iD2rCOGKc7y2vyNp30yn%2fAx7ZLcyuZNYcUfDgEBeec%3d 
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
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: Issue with URI Resolver in Saxon 9.7?

Jorge Williams-2
Looks like the issue has been resolved!

Thanks Michael, looking forward to the next release,

-jOrGe W.

________________________________________
From: Ilya Vinarsky <[hidden email]>
Sent: Sunday, July 17, 2016 1:20 AM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Issue with URI Resolver in Saxon 9.7?

This was the bug I wanted to report.  If you fix it, our code will no longer need a workaround.

-----Original Message-----
From: Michael Kay [mailto:[hidden email]]
Sent: Saturday, July 16, 2016 6:58 AM
To: Mailing list for the SAXON XSLT and XQuery processor <[hidden email]>
Subject: Re: [saxon] Issue with URI Resolver in Saxon 9.7?

Please track this issue here:

https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fsaxonica.plan.io%2fissues%2f2843&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=KdmHhelIqkdXakOKUk4Ry0qZUx735zMRYXd0i3BTxBA%3d

I think you are right: although the Javadoc for Transformer.setURIResolver() and Transformer.getURIResolver() is silent on the matter, the Javadoc for TransformerFactory.setUIRResolver() says that it is used by default for calls on document() as well as xsl:include and xsl:import, which implies it is the default for the run-time URIResolver.

It's complicated by the fact (and perhaps caused by the fact) that the JAXP interface is now implemented as a layer on top of the s9api interface, and in s9api the URIResolver can also be specified per-compilation at the level of the XsltCompiler.

Michael Kay
Saxonica


> On 16 Jul 2016, at 07:06, Jorge Williams <[hidden email]> wrote:
>
> Hello all,
>
> I’m converting some code from 9.4.0-9 to 9.7.0-6  and am struggling a bit with URI Resolver.
>
> My code chains resolvers in the following manner…(using the JAX-P interface).
>
> 1. Instantiate a factory (net.sf.saxon.TransformerFactoryImpl)
> 2. Save the original URI resolver… ORIGINAL_RESOLVE <-
> transformerFactory.getURIResolver 3. Add custom factory level resolver FACTORY_RESOLVE.  The FACTORY_RESOLVE attempts to resolve a URI using some custom rules if it can’t resolve it makes a resolve call to ORIGINAL_RESOLVE.
> ….. in another part of my program ….
> 4. Create Templates (calling newTemplates from the factory) 5. Create
> a transformer (calling newTransformer from the templates)
> 6. Get the URI resolver from the transformer by calling getURIResolver   (Should be FACTORY_RESOLVE)
> 7. Add a custom transformer level resolver TRANSFORM_RESOLVE,  This resolver attempts to resolve a URI — if it can’t it makes a call to the resolver obtained in step 6 (should be FACTORY_RESOLVE).
>
> In 9.4 everything works great…under 9.7 step 6 returns null instead of FACTORY_RESOLVE which breaks things for me.
>
> Any ideas?
>
> Thanks,
>
> -jOrGe W.
>
> ----------------------------------------------------------------------
> -------- What NetFlow Analyzer can do for you? Monitors network
> bandwidth and traffic patterns at an interface-level. Reveals which
> users, apps, and protocols are consuming the most bandwidth. Provides
> multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make
> informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev
> _______________________________________________
> saxon-help mailing list archived at
> https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsaxon.
> markmail.org%2f&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64
> 808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=5cPHC
> CNnxcVYDFa2U1pJLxJA%2f3ztKga4GvXnhadzI4M%3d
> [hidden email]
> https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2flists
> .sourceforge.net%2flists%2flistinfo%2fsaxon-help&data=01%7c01%7cilyavi
> n%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141a
> f91ab2d7cd011db47%7c1&sdata=3iD2rCOGKc7y2vyNp30yn%2fAx7ZLcyuZNYcUfDgEB
> eec%3d



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsaxon.markmail.org%2f&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=5cPHCCNnxcVYDFa2U1pJLxJA%2f3ztKga4GvXnhadzI4M%3d
[hidden email]
https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2flists.sourceforge.net%2flists%2flistinfo%2fsaxon-help&data=01%7c01%7cilyavin%40microsoft.com%7c2340ec8966e64808b93808d3ad8181a2%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=3iD2rCOGKc7y2vyNp30yn%2fAx7ZLcyuZNYcUfDgEBeec%3d
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help