Unable to find the xsl file in xsl:include directive


Web tier: servlets, JSP, Web frameworks: Unable to find the xsl file in xsl:include directive

  1. I've develop a web site that use XSL trasformation and work fine until JBoss 3.2.5
    When install the ear file in JBoss 4.0.0 I receive this exception:

    java.xml.transform.TransormerConfigurationException caused by java.io.FileNotFoundException

    The error is throw in form-jsp.xsl:

    <?xml version="1.0" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:include href="/form-script-jsp.xsl"/>

    In order to avoid the error i must change the URI in href with absolute path http://localhost:8080/myapp/form-script-jsp.xsl

    Why? I must configure some thing in Jboss in order to avoid the error?

    Thanks in advance
  2. Problem is the entity resolver[ Go to top ]


    I have the same problem, it is to do with the way the xml entity resolver resolves your URL. You will probably find it is looking for a file called /formscript-script-jsp.xsl. By explictly entering http://xyz.ddd/abc you are telling it that it is not a file.

    My problem was that the same version of jboss running on the same version of jdk would load the xsl form the classpath on some machines, but not others. Go figure ;)

    Solution is to always use an unambigous uri, i.e. file://../../ or http:// etc.
  3. For more info: http://access1.sun.com/technotes/00762.html
  4. Can use a relative path?[ Go to top ]

    Thanks for your info

    I'd like to know if possible use a relative path in <xsl:include> directive without implement custom URIResolver then

    <xsl:include href="/form-script-jsp.xsl"> instead of
    <xsl:include href="file://C:/...../form-script-jsp.xsl"> or
    <xsl:include href="http://localhost:8080/...../form-script-jsp.xsl">

    Thanks in advance