On Wed, Feb 20, 2013 at 7:27 AM, Dirk Reske <dirk.re...@gmx.net> wrote: > Hi, > > no, the uriResolver is used to resolve the xslt file only. > I've found a way, using a processor, that creates a XMLReader using the > CatalogResolver and puts a SAXSource using this xmlReader into the exchange. > > @Override > public void process(Exchange exchange) throws Exception { > InputStream inputStream = exchange.getIn().getBody(InputStream.class); > > XMLReader xmlReader = XMLReaderFactory.createXMLReader(); > xmlReader.setEntityResolver(new CatalogResolver()); > exchange.getIn().setBody(new SAXSource(xmlReader, new > InputSource(inputStream))); > } > > The Transformer used by the xsltComponent will then use this xmlReader. > > Dirk >
Maybe the camel xslt component can be enhanced to support to plugin a custom EntityResolver? We love contributions so feel free to work on a patch for such an improvement, if that is possible to do. http://camel.apache.org/contributing.html > -------- Original-Nachricht -------- >> Datum: Tue, 19 Feb 2013 20:04:54 +0100 >> Von: Claus Ibsen <claus.ib...@gmail.com> >> An: users@camel.apache.org >> Betreff: Re: Make xslt component not to validate dtd\'s (or use local copy) > >> On Tue, Feb 19, 2013 at 1:56 PM, <freak...@gmx.net> wrote: >> > Hello, >> > >> > We are using the camel xslt component to transform a xhtml file. But for >> > transforming the file, the used XMLReader tries to download the dtd from >> thw >> > w3c website. >> > >> > Is it possible, to tell the xslt component, to configure the xml reader >> to >> > use local version (e.g. by using xml catalogs) or not to validate dtd's >> at >> > all? >> > >> >> Hi >> >> You can use a custom uriResolver. Would that do the trick? >> http://camel.apache.org/xslt >> >> > thanks >> > Dirk >> >> >> >> -- >> Claus Ibsen >> ----------------- >> Red Hat, Inc. >> FuseSource is now part of Red Hat >> Email: cib...@redhat.com >> Web: http://fusesource.com >> Twitter: davsclaus >> Blog: http://davsclaus.com >> Author of Camel in Action: http://www.manning.com/ibsen -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen