forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Williams" <william...@gmail.com>
Subject Re: DirectoryGenerator and href to content
Date Thu, 27 Jul 2006 11:51:41 GMT
On 7/27/06, Erik Stunkat <erik@stunkat.de> wrote:
> Hello,
>
> I have something like:
>
> xdocs/books/moderntrends/
>         /book1/
>                 - pdf file
>                 - pdf file
>         /book2/
>                 - pdf file
>                 - pdf file
>
> etc
>
> what I want:
> show the pdf files when I go to http://blablabla../books/moderntrends/book1
>
> and link to those files
>
> my sitemap:
>
> <map:pipeline>
> <map:match pattern="books/moderntrends/**" type="wildcard">
> <map:generate type="directory"
> src="{project:content.xdocs}/books/moderntrends/{1}/">
> <map:parameter name="depth" value="8"/>
> <map:parameter name="sort" value="directory"/>
> <map:parameter name="include" value="^({1})"/>
> </map:generate>
> <map:transform type="xslt" src="{project:resources.stylesheets}dir2.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>  </map:pipeline>
>
> my stylesheet:
>
> <xsl:template match="dir:directory|dir:file">
>         <li>
>         <xsl:value-of select="@name"/>
>                 <xsl:if test="name(.)='dir:directory'">
>               <!-- creating subdirectories -->
>                         <ul><xsl:apply-templates/></ul>
>
>             </xsl:if>
>             <xsl:for-each select="@name">
>              <a href="{generate-id(.)}">
>             <xsl:value-of select="."/>
>             </a>
>             </xsl:for-each>
>            </li>
> </xsl:template>
>
> <xsl:template match="/dir:directory">
>         <ul>
>                 <xsl:value-of select="@name"/>
>                 <!-- creating subdirectories -->
>                 <xsl:apply-templates/>
>               </ul>
> </xsl:template>
>
>
>
>
> this works for http://blablabla../books/moderntrends/
>
> not for http://blablabla../books/moderntrends/book1
>
>
> also I get something like:
>
> <li>
> 487-Infection_of_Mouse.pdf
> <a href="N10D95">487-Infection_of_Mouse.pdf</a>
> </li>
> ?
>     <li>
> 491-Cocultivation_as_a.pdf
> <a href="N10D9A">491-Cocultivation_as_a.pdf</a>
> </li>
>
> the href shows something wrong.
>
> any ideas?
> thanks
> erik stunkat

I don't have a really good appreciation for what you're trying to do
as your stylesheet seems to be off from your description above.  But I
think you should look at your regular expression for the "include"
parameter of the generator.   To see if that might be the issue, take
the param out and see what you get.

--tim

Mime
View raw message