xsl:include and WAR Files

We are trying to deploy our application using WAR file approach. All our JSP and servlets are working fine.

We have our reports generated based on XSL files. XSl files are put into the war file.

In my transformation servlet, I am loading the original xsl file by calling getResourceAsStream(xslFileName);

During the xsl transformation if we have any includes for another xsl file, I am getting an exception

java.net.MalformedURLException: no protocol: myIncluded.xsl

Basically in my original XSL file I have the following line

<xsl:include href="myIncluded.xsl" />

Could somebody tell me what I should doing to get rid off this exception.

Thanks in advance

SK

[733 byte] By [ksreenivas] at [2007-9-26 2:33:53]
# 1

The href attribute needs a protocal to determin what kind of uri it is dealing with file,http, etc..

try changing this

> <xsl:include href="myIncluded.xsl" />

to this

<xsl:include href="file://./myIncluded.xsl" />

or this

<xsl:include href="file://myIncluded.xsl" />

I'm not sure how this plays out seeing how your using the getResourceAsStream method. I dont know if getting a resource this way will allow the xsl processor to resolve the url correctly or not. You may have to use a jar protocal or something like that to get it to work. You may even need to specify the absolute url to the include file.

bobd3 at 2007-6-29 9:57:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...