File: todo2html-2.xslt

package info (click to toggle)
devtodo 0.1.20%2Bgit20200830.0ad52b0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 964 kB
  • sloc: ansic: 5,307; cpp: 3,908; perl: 112; sh: 106; makefile: 45; csh: 2
file content (30 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0"?> 

<!--
	XSLT example courtesy of Daniel Patterson, posted to the devtodo forums
	at http://sourceforge.net/forum/forum.php?thread_id=114904&forum_id=69460

	This example, AFAIK, generates HTML from the devtodo XML database.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
	<xsl:output xsl:method="html" xsl:indent="no"/> 

	<xsl:template xsl:match="todo"> 
		<xsl:call-template xsl:name="note-list"/> 
	</xsl:template> 

	<xsl:template xsl:name="note-list"> 
		<ul> 
			<xsl:apply-templates xsl:select="note"/> 
		</ul> 
	</xsl:template> 

	<xsl:template xsl:match="note"> 
		<li><xsl:value-of xsl:select="."/> 
		<xsl:if xsl:test="count(note) > 0">
			<xsl:call-template xsl:name="note-list"/> 
		</xsl:if>
		</li> 
	</xsl:template> 
</xsl:stylesheet>