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]

Reply via email to