Re: [xsl] xsl:include href problems - again

Subject: Re: [xsl] xsl:include href problems - again
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Mon, 17 Oct 2005 13:28:46 -0400
Hardy Merrill wrote:


I have a stylesheet in the document root which renders fine when I do these:


    <xsl:include href="includes/new_banner.xsl"/>
    <xsl:include href="includes/new_footer.xsl"/>

Why not just do that?




But does NOT work (***and I don't understand why***) if I add the leading slash like this:

    <xsl:include href="/includes/new_banner.xsl"/>
    <xsl:include href="/includes/new_footer.xsl"/>

that produces just a blank screen - no error.

Because your webserver is not providing the files, the filesystem is. You are transforming on your webserver machine. The transformation is not happening in the browser. If it was happening in the browser then the above should work.




I don't want to do this (doesn't work anyway and I don't know why, but might be
a permission issue with the "includes" directory):

    <xsl:include href="http://our.developmentserver.com/includes/new_banner.xsl"/>
    <xsl:include href="http://our.developmentserver.com/includes/new_footer.xsl"/>

because then when I migrate this xsl to our "test" and "prod" servers I'd have to
change the "our.developmentserver.com" to "our.testserver.com" and so on.

This should work, but it is a waste of network resources since the files are relative to the including XSL. I would use your first example above.



I'm looking for a way to have the include href's refer to things relative to the document root, without having to name the specific server in an http string. Is this possible?

yes. use your first example.


-Rob

Current Thread