Subject: [xsl] Making an FAQ page from XML From: John Steel <john.steel@xxxxxxxxxxxxxxx> Date: Sun, 11 Feb 2007 21:39:42 +0000 |
(Borderline newbie alert!) Given this XML:
<faqlist xmlns:OTAMate="urn:schemas.otamate.com"> <faq> <q>Question One?</q> <a>Answer One</a> </faq> <faq> <q>Question Two?</q> <a>Answer Two.</a> </faq> <faq> <q>Question Three?</q> <a>Answer Three.</a> </faq> </faqlist>
1 Answer 1 2 Answer 2
<xsl:template match='*|@*'> <xsl:copy> <xsl:apply-templates select='node()|@*'/> </xsl:copy> </xsl:template>
<xsl:template match='faq'> <tr> <td valign='top' width='24' class="mText" style="font-size: 11px"> <xsl:value-of select="count(preceding-sibling::*) + 1"/> </td> <td class="mText" style="font-size: 11px"> <a href="#1"> <xsl:value-of select='q'/> </a> </td> </tr> </xsl:template>
-------------------------- http://www.phonewebcam.com john.steel@xxxxxxxxxxxxxxx
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: expression returns true b, bryan rasmussen | Thread | Re: [xsl] Making an FAQ page from X, Kamal Bhatt |
Re: [xsl] how to test previous node, Andrew Welch | Date | Re: [xsl] how to test previous node, Kamal Bhatt |
Month |