forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lorenz Froihofer <>
Subject [PATCH] normalize hrefs in site before selecting entries for tab
Date Thu, 13 May 2004 13:49:58 GMT

following issue:

My site.xml contains something similar to:

   <category1 tab="tab-1" href="category1/" label="Category 1">
     <entry1 label="My Entry 1" href="entry1/index.html" />
     <entry2 label="My Entry 2" href="../entry2/index.html" />

All entries should correspond to the tab "tab-1". During pipeline 
processing the hrefs of the entries are translated to
href="category1/entry1/index.html" for entry 1
href="category1/../entry2/index.html" for entry 2

In resources/stylesheets/site2site-selectnodes.xsl a path comparison is 
performed for incomming requests by using the starts-with() method.

The issue is now that an incomming request for entry2 is
"entry2/index.html" but the entry in the site.xml during processing is 
"category1/../entry2/index.html". Therefore, the comparison fails with 
the result that for entry 2 the content of all available tabs is shown 
in the menu.

To resolve this issue, I suggest to normalize the href-attributes before 
calling "site2site-selectnodes.xsl". This can be achieved by copying the 
attached normalizehrefs.xsl  to the "resources/stylesheets" directory 
and applying the patch to "context/menu.xmap".

The patch adds one line to menu.xmap:
<map:transform src="resources/stylesheets/normalizehrefs.xsl" />

After this, the href attribute of entry2 in the example above is 
normalized to "entry2/index.html" and the comparison by using the 
starts-with() function succeeds.

Kind regards,
   Lorenz Froihofer.

View raw message