Subject: Re: [xsl] XHTML -to- WIKI ... so close ... yet not close enough From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Sun, 06 Feb 2005 20:00:35 +0100 |
I am wishing to take XHTML to Wiki format. The Wiki format is relatively straight forward with no major complications. I have written most of the XSLT file but I am having problems (fun?) with working with embedded lists.Hi,
<ul> <li>Element1</li> <li>Element2 <ul> <li>Element2.1 <ul> <li>Element2.1.1</li> </ul> </li> </ul> </li> <li>Element 3</li> </ul> Should be converted to:
- Element1 - Element2 -- Element2.1 --- Element2.1.1 - Element3
<xsl:template match="li"> <xsl:text> </xsl:text> <xsl:for-each select="ancestor::ul">-</xsl:for-each> <xsl:text> </xsl:text> <xsl:apply-templates/> </xsl:template>
<xsl:template match="text()"> <xsl:value-of select="normalize-space(.)"/> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Spread the wiki (http://www.wikipedia.org)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XHTML -to- WIKI ... so cl, Wendell Piez | Thread | Re: [xsl] XHTML -to- WIKI ... so cl, omprakash . v |
Re: [xsl] Decimal precision, Dimitre Novatchev | Date | Re: [xsl] xsl:when, xsl:otherwise q, Nick Roberts |
Month |