xsl-list
[Top] [All Lists]

Re: xsl:include href - relative to document root?

2005-06-21 11:59:52
Hardy,

You should be able to reference the root directory using the standard
slash notation for root.  In other words:

/common/foo.xsl

will always start at the root directory of your application in the same way:

../common/foo.xsl

will move up one directory and then access the foo.xsl from the child
'common' directory if it exists...

Your other option if for some reason this is causing your troubles
would be to run a build process in which you dynamically generate the
absolute path for the machine the files reside on using:

Server.MapPath("/common/foo.xsl")

or whatever the correct directory location from the root of the site
happens to be...

On 6/21/05, Hardy Merrill <HMerrill(_at_)dhcr(_dot_)state(_dot_)ny(_dot_)us> 
wrote:
Ok, right idea but it's not working for me.

This works:

      <xsl:include
href="../../blah/blah/includes_xsl/replace_string.xsl" />

but this doesn't:

     <xsl:include
href="http://myserver.com/includes_xsl/replace_string.xsl"; />

That one produces this error in the browser:
========================
msxml4.dll error '80004005'

Error while parsing
"http://myserver.com/includes_xsl/replace_string.xsl";. No data is
available for the requested resource
========================

I've verified that the http path is correct - anyone know that doesn't
work?

Thanks.

Hardy Merrill


colin(_at_)colina(_dot_)demon(_dot_)co(_dot_)uk 6/21/2005 11:15 AM >>>
"Hardy" == Hardy Merrill 
<HMerrill(_at_)dhcr(_dot_)state(_dot_)ny(_dot_)us> writes:

    Hardy> Let me back up and ask a more general question.  In web
    Hardy> applications, how do other people organize style sheets so
    Hardy> that style sheets containing common code are located in one
    Hardy> place, and then how do application style sheets _using_
    Hardy> that common code refer to (xsl:include?) them?

One way is to have a directory called common, under the document root.

The you can xsl:include/import from
http://localhost/common/my-common.xsl.
That works for server-side transformations only.
--
Colin Adams
Preston Lancashire

--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>
--~--




-- 
<M:D/>

M. David Peterson
http://www.xsltblog.com

--~------------------------------------------------------------------
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>
--~--