<?
xml version="1.0" encoding="UTF-8" ?>
<?
xml-stylesheet type="text/xsl" href="neudokument.xsl" ?>
<Dokumente>
<Name type="System">Hipath</Name>
<Name type="PC">PC_A</Name>
<Name type="Switch">Switch_A</Name>
</Dokumente>
xsl.datei:
<?
xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="
xml"
doctype-public="-//
W3C//DTD SVG 1.0//EN"
doctype-system="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
encoding="ISO-8859-1"
media-type="image/svg+
xml"
version="1.0"
indent="yes"
/>
<xsl:template match="/">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="graph" style="stroke:black;stroke-width:5px">
<rect x="10" y="10" height="50" width="100" fill="
url(
#verlauf)" />
</symbol>
</defs>
<xsl:for-each select="Dokumente/Name">
<xsl:sort select="@type" order="ascending" data-type="text" />
<xsl:variable name="anzahl_spalten" select="2" />
<xsl:variable name="pos_x" select="50 + 150 *(((position()-1) mod $anzahl_spalten))" />
<xsl:variable name="pos_y" select="50 + 90 *(((position()-1) div $anzahl_spalten))"/>
<use xlink:href="
#graph" >
<xsl:attribute name="x">
<xsl:value-of select="$pos_x"/>
</xsl:attribute>
<xsl:attribute name="y">
<xsl:value-of select="$pos_y"/>
</xsl:attribute>
</use>
<text x="10" y="20">
<xsl:attribute name="x">
<xsl:value-of select="$pos_x + 50" />
</xsl:attribute>
<xsl:attribute name="y">
<xsl:value-of select="$pos_y + 35"/>
</xsl:attribute>
<xsl:value-of select="@type" />
</text>
</xsl:for-each>
</svg>
</xsl:template>
</xsl:stylesheet>