[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:include href problems - again

Subject: Re: xsl:include href problems - again
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Mon, 17 Oct 2005 13:28:46 -0400
xsl include href example
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.