You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Don Brown <do...@gmail.com> on 2006/12/01 09:05:32 UTC

Re: [STRUTS2] XSLTResult ERROR

You need to include the protocol "request:".  Therefore, it should look like:

<xsl:variable name="page"
> select="document('request:WEB-INF/pages/welcome.xml')/page" />

Don

On 10/27/06, Kimus Linuxus <ki...@gmail.com> wrote:
> Hi,
>
> I'm using the xslt resut type and I cant use xsl:include, xsl:import, or
> document()!
>
> I have a main,xsl file that includes another xsl in the same directory.
> And gives me the following error:
>
> ERROR:  '/home/share/software/develop/eclipse/variables.xsl (No such
> file or directory)'
> FATAL ERROR:  'Could not compile stylesheet'
> Oct 26, 2006 11:21:10 AM org.apache.struts2.views.xslt.XSLTResult
> execute
> SEVERE: Unable to render XSLT Template, '/WEB-INF/templates/main.xsl'
> javax.xml.transform.TransformerConfigurationException: Could not compile
> stylesheet
> at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
> at
> org.apache.struts2.views.xslt.XSLTResult.getTemplates(XSLTResult.java:335)
> at org.apache.struts2.views.xslt.XSLTResult.execute(XSLTResult.java:254)
>
> also if I do:
> <xsl:variable name="page"
> select="document('/home/develop/portal/webapp/WEB-INF/pages/welcome.xml')/page" />
>
> in the main.xsl gives me the following error:
>
> ERROR:  'File not found: Cannot handle procotol of
> resource /home/develop/portal/webapp/WEB-INF/pages/welcome.xml' (***
> here protocol is misspelled!! ***)
> ERROR:  'com.sun.org.apache.xalan.internal.xsltc.TransletException:
> java.io.FileNotFoundException: /home/develop/portal/webapp/WEB-INF/pages/welcome.xml'
> Oct 26, 2006 11:24:27 AM org.apache.struts2.views.xslt.XSLTResult
> execute
> SEVERE: Unable to render XSLT Template, '/WEB-INF/templates/main.xsl'
> javax.xml.transform.TransformerException:
> com.sun.org.apache.xalan.internal.xsltc.TransletException:
> com.sun.org.apache.xalan.internal.xsltc.TransletException:
> java.io.FileNotFoundException: /home/develop/portal/webapp/WEB-INF/pages/welcome.xml
>         at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:644)
>         at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
>         at
> org.apache.struts2.views.xslt.XSLTResult.execute(XSLTResult.java:279)
>
> the file EXISTS!!
>
>
> I taked a look at the XSLTResult source and there is a line that
> contains:
> transformer.setURIResolver(getURIResolver());
>
> This code adds ths URI Resolver to be called by the processor when it
> encounters an xsl:include, xsl:import, or document()
> function. The default is an instance of ServletURIResolver, which
> operates relative to the servlet context. So, what is wrong?!
>
>
> thank you
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org