xsl:include / xsl:import question

Here should go questions about transforming XML with XSLT and FOP.
Daniel
Posts: 2
Joined: Tue Jul 11, 2006 12:07 am

xsl:include / xsl:import question

Post by Daniel »

Hi.. here's my question :

I'm developing a Struts App that produces a XML that is transformed via XSLT to the final html page.

When I deploy my webapp things work as expected. However, the problem arises when using oXygen for create / debug the xsl. Inside oXygen (thru eclipse), all my <xsl:import> or <xsl:include> give me a java.io.FileNotFoundException.

This problem only happens when using the URI relative to tomcat (i.e. <xsl:include href="/resources/xsl/login.xsl"> ).
If I use relative paths the problem goes away, but then I have to go thru all the XSL changing back the imports and exports to the original paths when re-deploying to Tomcat.

I already browsed the oXygen forum looking for an answer and also tried Googleing for a similar issue and possible answer....

Any help would be appreciated.


Daniel
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

You can use an XML Catalog to map the URIs of the included/imported modules.


Regards,
Sorin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Daniel,

oXygen has support for opening HTTP URLs so instead of opening the local files open the actual http resources and the include/import locations will work.
Otherwise it is just like you will look with a browser to a local file that makes a reference like /test/test.html. If you look at the local file with the browser then /test/test.html will not be resolved to the correct location but if you look at the file served by the web server then the /test/test.html will be solved and served by the web server correctly.

Best Regards,
George
Post Reply