You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by jh...@virbus.de on 2001/04/24 17:59:54 UTC

[C2] Incorrect Linkresolving?

Hello,

I could need your help, because I have a problem, which I have not been able to solve it until now. I use the Cocoon2 (Version 2.0a4) commandline.

I have:

test1.xml in Cocoon2-Directory/webapp/docs/samples/test
test2.xml in Cocoon2-Directory/webapp/docs/samples/test/testnav/testnav
test.jpg  in Cocoon2-Directory/webapp/docs/samples/test/libimg

test1.xml:

<?xml version="1.0"?>

<page>
    <testimg/>
    <testa/>		{not in test2.xml}
</page>

test2.xml:

<?xml version="1.0"?>

<page>
    <testimg/>
</page>

A XSL which creates following HTML:

<html>
    <head><title>test</title></head>
    <body>
        <img src="libimg/test.jpg"/>
        <a href="test2"/>		{only in test1.xml; these links (img- and a-tags) will be resolved from cocoon}
    </body>
</html>

In the sitemap.xmap:

<map:match pattern="libimg/test.jpg">
    <map:read src="{absolute Cocoon2-Directory}/webapp/docs/samples/test/libimg/test.jpg" mime-type="image/jpg"/>
</map:match>

<map:match pattern="test1">
    <map:generate src="{absolute Cocoon2-Directory}/webapp/docs/samples/test/test1.xml"/>
    <map:transform src="stylesheets/test.xsl"/>
    <map:serialize type="html"/>
</map:match>

<map:match pattern="test2">
    <map:generate src="{absolute Cocoon2-Directory}/webapp/docs/samples/test/testnav/testnav/test.xml"/>
    <map:transform src="stylesheets/test.xsl"/>
    <map:serialize type="html"/>
</map:match>

My problem now is the following:

"run.sh test1" works fine with link-resolving.

directory site:

test1.html
libimg/test.jpg
testnav/testnav/test2.html
testnav/testnav/libimg/test.jpg.html

In the test1.html there is a correct link to test2.html and a correct link to the test.jpg.

BUT: In the test2.html there is a img-link to "libimg/test.jpg.html" and in this file (libimg/test.jpg.html) is written: "page not available".
In theory i think it's the same match-pattern in sitemap, Cocoon2 must find the jpg, but it doesn't.

A second fact is, that C2 doesn't resolve the link with "../../libimg/test.jpg". It creates a second libimg-directory as you can see above. But it's more or less a feature.

And the third fact: there is no loop detection. If I the test2.xml is in the same directory as test1.xml and with a link to test1, C2 will work forever, because it links to test1 to test 2 to test1
and so on.

The first problem is the most important, because I see no mistakes in my code. I first started with relative links in sitemap - there MUST be problems. Ok, but not with absolute paths. I tried it with
"run.sh test2" too - the same problem. It doesn't find the test.jpg.

I would appreciate your help.

Thx in advance,

Joerg

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>