Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5942

Custom URIResolve not used to load XSTL script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.3
    • 2.10.4, 2.11.0
    • camel-xslt
    • None
    • Windows, Java 1.6

    • Unknown

    Description

      My problem is to load a XSLT script from database or provided as byte array but not as file in classpath or http.

      A custom uri resolver would do the job. XsltEndpoint uses a ResourceHelper to load the XSTL resource instead of a given custom uri resolver.

          private synchronized void loadResource(XsltBuilder xslt, String resourceUri) throws TransformerConfigurationException, IOException {
              LOG.trace("{} loading schema resource: {}", this, resourceUri);
              // prefer to use URL over InputStream as it loads better with http
              URL url = ResourceHelper.resolveMandatoryResourceAsUrl(getCamelContext().getClassResolver(), resourceUri);
              xslt.setTransformerURL(url);
              // now loaded so clear flag
              cacheCleared = false;
          }
      

      The ResourceHelper or this method should use the same URIResolver as XsltBuilder.

      Another way would be to make the method above protected to be able to overwrite the behaviour.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            t.gueldner Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: