cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierpaolo Fumagalli <p...@apache.org>
Subject Re: Sitemap and Links...
Date Fri, 31 Dec 1999 00:21:34 GMT
Ben Laurie wrote:
> 
> There's a problem with ambiguity here. Since you use the translation
> both ways, it could be impossible to work out the URL from the "source",
> which you need to do your URL translation magic below (that is, if two
> URLs map to the same source file but with different filters, then you
> are sunk).

Very true... We didn't think to this one... (in other words, thanks for
the hint :)

I was thinking about "translating" uris in the same area, and, if a
match wasn't found, then looking again into the sitemap (top-down) to
resolve the link, but I must agree that is not a feasible solution.
Let's examine this example:

<sitemap>
  <process uri="flowers/*.html" translate="*.xml">
    <producer name="file"/>
    <processor name="xslt">
      <param name="stylesheet" value="flowers.xsl"/>
    <processor>
    <serializer name="html"/>

  <process uri="diamonds/*.html" translate="*.xml">
    <producer name="file"/>
    <processor name="xslt">
      <param name="stylesheet" value="diamonds.xsl"/>
    <processor>
    <serializer name="html"/>

  <process uri="flowers/xsp/*.html" translate="*.xsp">
    <producer name="xsp"/>
    <processor name="xslt">
      <param name="stylesheet" value="flowers.xsl"/>
    <processor>
    <serializer name="html"/>

  <process uri="diamonds/xsp/*.html" translate="*.xsp">
    <producer name="xsp"/>
    <processor name="xslt">
      <param name="stylesheet" value="diamonds.xsl"/>
    <processor>
    <serializer name="html"/>
</sitemap>

Using that algorithm, in fact, if I have a link to "doc.xml" in an xsp
called "test.xsp", from both areas ("/flowers/xsp/test.html", or
"/diamonds/xsp/test.html"), I would be always linked to
"/flowers/doc.html" because the target of the link is not present in the
same area, and so the first one is always matched.

A "quick dirty" solution would be specifying (again in the sitemap) a
"context" for URL translation (context="flowers" in the first and third
area and context="diamonds" in the second and the fourth), but I don't
like it, since it adds a lot of complexity, and it could be very hard to
debug...

Does anyone have another possible solution (HELP HELP!!!! :)

Also, we might want to force the user to select a "context" (imagine
something like:
...
  View document with <link href="doc.xml">current stylesheet</link>
  <link href="doc.xml" ?????>or with another one </link>
...

	Pier (dubious...)

Mime
View raw message