cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <>
Subject Re: mental note (WAS Common practice: how to keep links to html-trees consistent)
Date Sun, 01 Sep 2002 05:37:44 GMT
On Wednesday, August 28, 2002, at 01:00 AM, Steven Noels wrote:

> Something we still should think about (still catching up on mail):
> </Steven>

Thanks for pointing this out. To solve the problem I came up some time 
ago with a simple transformer which augments the href attribute of any 
element with the full path. The full path can be specified in the 
sitemap like below:

     <map:transformers default="xslt">
      <map:transformer name="augment"

       <map:match pattern="doc/*.html">
         <map:generate src="docs/{1}.xml"/>
         <map:transform type="augment">
           <map:parameter name="mount" value="samples/flow/"/>
         <map:serialize type="xml"/>

In this example for any request for a document from the docs/ 
directory, the source XML document is first processed through the 
"augment" transformer, defined in the map:components as above. This 
replaces all the href attributes of any element with the concatenated 
value of the "mount" attribute followed by the original value of the 
attribute. E.g. in our sample if we had an element in the original XML 
doc like

<link href="index.html"/>

This becomes

<link href="samples/flow/index.html"/>

after the processing.

Ovidiu Predescu <> (Weblog) (Apache, GNU, 
Emacs ...)

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message