W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > June 2007

Re: Call tomorrow?

From: Sean Owen <srowen@google.com>
Date: Tue, 5 Jun 2007 12:37:53 -0400
Message-ID: <e920a71c0706050937t5b926891l82b33705fea13f57@mail.gmail.com>
To: "Miguel Garcia" <miguel.garcia@fundacionctic.org>
Cc: public-mobileok-checker@w3.org

Wow, much better! I didn't know about this. If it works, feel free to commit.

On 6/5/07, Miguel Garcia <miguel.garcia@fundacionctic.org> wrote:
> Hi,
>
> We have found out that TransformerFactory class has an URIResolver
> handler. This handler returns a Source object to a resource specified by
> a href and a base.
>
> With this handler and Java ClassLoader we could import xsl from jar
> files.
> We prefer to attach the source code before commit such changes to allow
> some discussion about this solution.
>
> Also I highlight some of the code to give and idea:
>
> final TransformerFactory factory =TransformerFactory.newInstance();
> factory.setURIResolver( new XSLTURIResolver() );
>
> final Transformer transformer=factory.newTransformer(new
> StreamSource(xslStream));
>
> transformer.transform(new DOMSource(results.getMokiDocument()),
>                                         domResult);
> return runTest(domResult.getNode());
>
> and our URIResolver implementation:
>
> private static class XSLTURIResolver implements URIResolver {
>
>                 public Source resolve(String href, String base) {
>                         //if (href.contains("xsl")) {
>                                 return new
> StreamSource((InputStream)this.getClass().getClassLoader().getResourceAs
> Stream("org/w3c/mwi/mobileok/basic/xslt/"+href));
>                         //}
>                 }
>         }
>
>
> Regards
>
>
Received on Tuesday, 5 June 2007 16:38:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:13:03 GMT