<b>Xslt hier:</b>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes" version="1.0" standalone="no"
doctype-system="-//W3C//DTD SVG 1.1//EN"
doctype-public="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"/>
<xsl:template match="/data">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%">
<xsl:apply-templates select="year"/>
</svg>
</xsl:template>
<xsl:template match="year">
<xsl:call-template name="plot-line">
<xsl:with-param name="y1" select="value"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="plot-line">
<xsl:param name="y1"/>
<xsl:element name="rect">
<xsl:attribute name="x">13.5%</xsl:attribute>
<xsl:attribute name="y"><xsl:value-of select="40-$y1*5"/>%</xsl:attribute>
<xsl:attribute name="width">3%</xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$y1*5"/>%</xsl:attribute>
<xsl:attribute name="class">Fill-B</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
<b>XMl Hier</b>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="Pfad"?>
<?xml-stylesheet type="text/css" href="Pfad"?>
<data>
<year>
Ytd
<value>1.1</value>
</year>
</data>
<b>Ergebnis :</b>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg
PUBLIC "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" "-//W3C//DTD SVG 1.1//EN">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%">
<rect xmlns="" x="13.5%" y="34.5%" width="3%" height="5.5%" class="Fill-B"/>
</svg>
Probleme:
1. Durch diese xmlsn bei "rect" wird das svg net dargestellt, wenn ich nun bei xmlns:ww..... ein xmlns:svg... draus mache ist das xmlns bei "rect" weg jedoch wird es dann trozdem net angezeigt...
Woran könnte das liegen??
2.
Ich will das Css wie in XML gehsen einbinden, kann man das so machen oder wird das net funktionieren?