xsl-list
[Top] [All Lists]

Re: xsl:include href problems - again

2005-10-17 10:28:46
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>