Thanks, Andrew.

Yes, that worked perfectly. It lops off the ".xml" extension to give you
a "Cocoon-style" url.

Now...on to another issue. ;)

Joe

On Fri, 2006-11-10 at 18:09 +0000, Andrew Stevens wrote:
> >From: "J.D. Williams" <[EMAIL PROTECTED]>
> >Reply-To: users@cocoon.apache.org
> >To: users@cocoon.apache.org
> >Subject: RE: XPathDirectory generator styling help
> >Date: Fri, 10 Nov 2006 08:31:30 -0600
> >
> >Hi Ard,
> >
> >I did, in fact, get it to work with some tweaking of the xsl. The
> >snippets follow.
> >
> >What I would like to do now is strip the ".xml" file extension from the
> >resulting href in the html. Suggestions?
> ....
> >     <xsl:template match="dir:file">
> >         <xsl:element name="a">
> >             <xsl:attribute name="href">
> >                 <xsl:value-of select="@name"/>
> >             </xsl:attribute>
> >             <xsl:apply-templates select="dir:xpath"/>
> >         </xsl:element>
> >     </xsl:template>
> 
> How about
>             <xsl:attribute name="href">
>                 <xsl:value-of select="substring-before(@name, '.xml')"/>
>             </xsl:attribute>
> ?  Or, if you think the characters ".xml" may appear more than once in the 
> filename (substring-before only looks up to the first occurrence) then maybe
>             <xsl:attribute name="href">
>                 <xsl:value-of select="substring(@name, 1, 
> string-length(@name) - 4)"/>
>             </xsl:attribute>
> would be better?  That assumes you don't also have e.g. any .js files in the 
> directory, though.
> 
> 
> Andrew.
> --
> http://pseudoq.sourceforge.net/
> 
> _________________________________________________________________
> Windows Live Messenger has arrived. Click here to download it for free! 
> http://imagine-msn.com/messenger/launch80/?locale=en-gb
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to