okay, jeg har fundet denher x-diagram ting som i princippet gør det rigtigt; nu skal jeg bare lige lure logikken..
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- match rod-noden -->
<xsl:template match="/">
<html>
<head>
<link href="xdiagram.css" rel="styleSheet" type="text/css" />
</head>
<body>
<xsl:apply-templates select="*"/>
</body>
</html>
</xsl:template>
<!-- match elementer -->
<xsl:template match="*">
<div>
<xsl:attribute name="class">indryk<xsl:value-of select="count(ancestor::*)" /></xsl:attribute>
<b><xsl:value-of select="name()" /> </b>
<xsl:apply-templates select="*|text()|@*" />
</div>
</xsl:template>
<!-- match tekst-nodes -->
<xsl:template match="text()">
<xsl:value-of select="." />
</xsl:template>
<!-- match attributter -->
<xsl:template match="@*">
[<xsl:value-of select="name()" />="<xsl:value-of select="." />"]
</xsl:template>
</xsl:stylesheet>
Tak. Smid nogle svar :)