You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Timm, Sean" <ST...@mailgo.com> on 2000/01/20 21:10:14 UTC

Relative Path Problem?

I realize this may not be a Cocoon problem, and it may be a ServletExec 2.2
or IIS problem, but if you have any idea what is wrong, please let me know!

I've got the latest CVS updates for Cocoon, but I'm still having a problem
with relative paths.  I'm using IIS 5.0 and ServletExec 2.2.  I've got the
following XML that I hit through /TestProj/test.xml:
------------------------------------------------------
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<?cocoon-process type="xslt"?>

<Images>
<BackgroundImage>images/test.gif</BackgroundImage>
</Images>
------------------------------------------------------

test.xsl is located in /TestProj as well and looks as follows:
------------------------------------------------------
<?xml version="1.0"?>
<?cocoon-format type="text/html"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/Images">
<HTML>
<BODY  bgcolor="white" onLoad="setfocus();">
<xsl:attribute name="style">
<xsl:choose>
<xsl:when test="Background[. !='']">
background-image:url(
<xsl:value-of select="Background" />); background-repeat:no-repeat;
</xsl:when>
</xsl:choose>
</xsl:attribute>

<H1>Test</H1>

</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------

Cocoon processes the XSL against the XML and successfully outputs the page,
but the image is not found because the browser isn't treating /TestProj as
the current directory.  I can only seem to get the image if I change it to
refer directly to /TestProj/images/test.gif instead of images/test.gif.

Does anyone know if this is a problem with Cocoon, IIS, or ServletExec (or
me :) ) ?

Thanks!

- Sean T.