I have been running some tests with regards to xsl:include and xsl:import
with the same results on both and I am wondering if someone can explain this
behavior to me!
First off the xslt file is being loaded as in
dim myXSLT as new XslTransform()
myXSLT.load("scripts/clnt.home.body.xslt")
The load craps out when I change the xsl:include, tried all of the following
is xsl:import as well. The file contains a href to a file called
clnt.cmn.xslt. It contains some standard templates with names that render
particular html that is common to the site. The file is stored in a physical
directory, C:\allianceShared\xslt\clnt.cmn.xslt.
The directory allianceShared is a virtual directory in the web site called
shared and resides at the root. The transform file I am loading is off the
root within a directory called scripts. Here is the structure laid out
c:\allianceShared
xslt\
clnt.cmn.xslt
c:\AllianceNet (Website root, domain name
http://allianceNet)
shared\ (Virtual directory pointing at
c:\allianceShared)
scripts\
clnt.home.body.xslt (transformation file being loaded)
home.aspx (file making the call )
Now here is the strange thing on loading the clnt.home.body.xslt file from
within home.aspx
example 1 : works
<xsl:import href="c:\allianceShared\xslt\clnt.cmn.xslt"/> - works
example 2: works, surprise!
<xsl:import href="http://allianceNet/shared/xslt/clnt.cmn.xslt"/>
example 3: fails
<xsl:import href="../shared/xslt/clnt.cmn.xslt"/>
Now thinking that '..' usually means something else in the xslt world I
created the same virtual directory 'shared' under the scripts directory,
hence the next example/
example 4: fails
<xsl:import href="shared/xslt/clnt.cmn.xslt"/>
Now what is interesting is, example 1 works even though you are supposed to
be supplying an href? If example 2 works, meaning that it does recognize the
virtual directory 'shared' why would example 3 or 4 fail?
Of note I have other xslt files that have xsl:import statements with the
href="../somefile.xslt" and they work, but only if they are dealing with
physical directories in the web site not virtual ones.
Any thought on this?
Looking forward to seeing if Oleg can explain this one :-)
Cheers
Keith