I have run into a probelm using the style tag when trying to use
includes/imports. I would like to suggest that the StyleTag from xtags
configure the xslt transformer so that it resolves all included and
imported stylesheets in the same way the tag resolves a URI, for
example, through a URL, a relative URL, or a resource.

Here's the code I've added to my version of xtags:

    public int doEndTag() throws JspException {
        if ( xml == null || xsl == null ) {
            throw new JspException( "Must specify both XML and an XSLT
to style" );
        }

        // Prepare an input source for the data
        Source data = getSource(xml);

        // Prepare an input source for the stylesheet
        Source style = getSource(xsl);

        // Prepare an output source for the outputs
        Result result = getResult();

        // Use JAXP to perform the stylesheet
        try {
            TransformerFactory factory =
TransformerFactory.newInstance();
            factory.setURIResolver(new URIResolver() {

                public Source resolve(String href, String base)
                   throws TransformerException {
                    try {
                        return getSource(href);
                    }
                    catch(javax.servlet.jsp.JspException e) {
                        return null;
                    }
                }

            });
            Transformer transformer = factory.newTransformer(style);
            configure(transformer);
            transformer.transform( data, result );
            if ( stringWriter != null ) {
                pageContext.getOut().write( stringWriter.toString() );
            }
        }
        catch (TransformerException e) {
            handleException(e);
        }
        catch (IOException e) {
            handleException(e);
        }
        finally {
            stringWriter = null;
        }
    return EVAL_PAGE;
    }

-Brian De Vries

-- 
Brian De Vries  --  Sr. Software Engineer
mailto:[EMAIL PROTECTED]   http://www.intraware.com
Voice: 925.253.6516             Fax: 925.253.4542
-------------------------------------------------------
Intraware...Control Your Technology

Reply via email to