Hallo Philipp,
doc.xml - wobei doc.xml als Eingabe benutzt wurde, was
So, ich habe mal auf die schnelle einen XSL-Sheet geschrieben, der mit deiner XML-Datei funktioniert:
Ich habe nciht alles (z.B. kein Inhaltsverzeichniss) gemacht, aber das wirst du schon sehen:
Grüße
Thomas
----------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" indent="yes" />
<xsl:template match="/component">
<html>
<head>
<title><xsl:value-of select="name" /></title>
<style>
<![CDATA[
.class_title { text-color: #00ff00; font-family: Arial; font-size: 25pt; }
.method_title { font-family: Arial; background-color: #999999; text-color: #000000; border-width: 1px; border-color: #000000; border-style: solid; }
.class_table { width: 500px; border-width: 1px; border-color: #000000; border-style: solid; }
.desc_title { vertical-align: top; font-family: Arial; font-size: 10pt; }
.desc_value { font-size: 10pt; }
.in_title { vertical-align: top; font-family: Arial; font-size: 10pt; }
.in_value { font-size: 10pt; }
.out_title { vertical-align: top; font-family: Arial; font-size: 10pt; }
.out_value { font-size: 10pt; }
.notes_title { vertical-align: top; font-family: Arial; font-size: 10pt; }
.notes_value { font-size: 10pt; }
]]>
</style>
</head>
<body>
<xsl:apply-templates select="class"/>
</body>
</html>
</xsl:template>
<xsl:template match="class">
<a name="{@name}" id="{name}"></a>
<h1 class="class_title" id="class_{@name}">
<xsl:value-of select="@name" />
</h1>
<table class="class_table" id="class_table_{@name}">
<xsl:for-each select="method">
<tr>
<td class="method_title" colspan="3">
<xsl:value-of select="@restriction" /> 
<a name="{@name}" id="{@name}">
<xsl:value-of select="@name" />
</a>
</td>
</tr>
<xsl:if test="description">
<tr>
<td class="desc_title">Description:</td>
<td class="desc_value">
<xsl:value-of select="." />
</td>
</tr>
</xsl:if>
<xsl:if test="in and (in !='')">
<tr>
<td class="in_title">Input:</td>
<td class="in_value">
<xsl:apply-templates />
</td>
</tr>
</xsl:if>
<xsl:if test="out and (out !='')">
<tr>
<td class="out_title">Output:</td>
<td class="out_value">
<xsl:apply-templates />
</td>
</tr>
</xsl:if>
<xsl:if test="notes">
<tr>
<td class="notes_title">Notes:</td>
<td class="notes_value">
<xsl:value-of select="." />
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="item">
<xsl:value-of select="@type" />: <xsl:value-of select="." />
<xsl:if test="@class">
(Class: <a href="#{.}"><xsl:value-of select="." /></a>)
</xsl:if>
</xsl:template>
</xsl:stylesheet>