-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tembug,

On 2/19/2010 6:26 AM, tembugs tembugs wrote:
> When I use multi-level context path in tomcat, I have folders created with #
> inside webapps like folder1#folder2#folder3.  The xsl files inside my web
> module tries to import other xsl files in the same hierarchy like,inside
> file1.xsl, I do,
> 
> <xsl:import href="file2.xsl">
> 
> but this throws an exception "java.net.MalformedURLException: no
> protocol:file2.xsl".  I tried to give with protocol like,
> <xsl:import
> href="file:///C:\tomcat5\webapps\folder1#folder2#folder3\xsl\file2.xsl">

Try:

<xsl:import href="file:file2.xsl" />

> but it fails throwing an exception that java.io.FileNotFound Exception:
> C:\tomcat5\webapps\folder1.
> Can anyone guide me on this?  I am totally blocked on this.......
> 
> If the # character need to be encoded in xsl, how do I do it?  Can anyone
> share a sample on this?

I had the same problem using Cocoon with a multi-level context path
(i.e. one that contains / marks) and it didn't work at all: the problem
is that the # mark is not a legal character in a path: it separates the
path from an anchor in a URL. In the case of Cocoon, even using "&#35;"
or "%23" in the URL didn't work because of the number of times the URL
appears to be re-parsed in Cocoon.

You may be able to try:

<xsl:import
href="file:///C:\tomcat5\webapps\folder1&#x23;folder2&#x23;folder3\xsl\file2.xsl">

or

<xsl:import
href="file:///C:\tomcat5\webapps\folder1&#x23;folder2&#x23;folder3\xsl\file2.xsl">

or

<xsl:import
href="file:///C:\tomcat5\webapps\folder1&#35;folder2&#35;folder3\xsl\file2.xsl">

...but it's possible that it's just not going to find your file. Another
option would be to either put the .xsl files somewhere else where there
are no # characters in the path, or use symlinks to effectively achieve
the same result.

Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt+tLwACgkQ9CaO5/Lv0PCptgCgrDTK1YTofipiQzc/geF5hgfy
/zQAoMAcFZ1gN3pOLL8dC5iLmbidLaoW
=t1ID
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to