|
next
|
 Subject: svg can not view with msxml processor Author: semi ramis Date: 08 Aug 2006 08:52 PM
|
hi
i have an xsl file that generates SVG file. when i select the processor type "Built-in" everything is fine but if i select "msxml" processor i can't see svg preview.
Here is may xsl code
thanks
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:math="http://exslt.org/math"
extension-element-prefixes="math">
<xsl:output method="xml" media-type="image/svg+xml"/>
<xsl:template match="/">
<svg width="220" height="150" viewBox="0 0 220 150" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="MyFilter" filterUnits="userSpaceOnUse">
<feGaussianBlur in="SourceAlpha" stdDeviation="5" result="blur" />
<feOffset in="blur" dx="4" dy="4" result="offsetBlur" />
<feSpecularLighting in="blur" surfaceScale="5" specularConstant="0.75" specularExponent="20" lighting-color="#bbbbbb" result="specOut">
<fePointLight x="-5000" y="-10000" z="20000" />
</feSpecularLighting><feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut" />
<feComposite in="SourceGraphic" in2="specOut" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litPaint" />
<feMerge>
<feMergeNode in="offsetBlur" />
<feMergeNode in="litPaint" />
</feMerge>
</filter>
</defs>
<xsl:variable name="gaugeCount"><xsl:value-of select="count(//Gauge)"/></xsl:variable>
<!--<xsl:call-template name="math:sqrt">
<xsl:with-param name="number"><xsl:value-of select="$gaugeCount"/></xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="PrintTitles">
<xsl:with-param name="Title"><xsl:value-of select="$scale"/></xsl:with-param>
</xsl:call-template>-->
<xsl:call-template name="Gauge">
<xsl:with-param name="gauge">Gauge</xsl:with-param>
<xsl:with-param name="scale">0</xsl:with-param>
<xsl:with-param name="x">0</xsl:with-param>
<xsl:with-param name="y">0</xsl:with-param>
</xsl:call-template>
</svg>
</xsl:template>
<msxsl:script language="JavaScript" implements-prefix="math">
<![CDATA[
function sqrt(arg){ return Math.sqrt(arg);}
]]>
</msxsl:script>
<xsl:variable name="calcScale"><xsl:value-of select="math:sqrt(144)"/></xsl:variable>
<xsl:template name="DrawBackground">
<g id="backgraound">
<path id="pathMain" filter="url(#MyFilter)" stroke-width="0" stroke="none" fill="rgb(230,230,230)" d="M 25,125 a25,25 1 0,1 -25,-25 a100.0,100.0 0 0,1 200,0 a25,25 1 0,1 -25,25 l -50,0 a50,50 0 0,1 -50,0 z"/>
</g>
</xsl:template>
<xsl:template name="PrintTitles">
<xsl:param name="Title"></xsl:param>
<g>
<text id="title" x="110" y="20" font-size="10" anchor="middle"><xsl:value-of select="$Title"/></text>
</g>
</xsl:template>
<xsl:template name="PrintValues">
<g id="txtValues">
<text id="txtVal0" x="20" y="100.0" font-size="10">0</text>
<text id="txtVal1" x="30.717967697" y="60.0" font-size="10">33</text>
<text id="txtVal2" x="60.0" y="30.717967697" font-size="10">67</text>
<text id="txtVal3" x="100.0" y="20.0" font-size="10" text-anchor="middle">100</text>
<text id="txtVal4" x="140.0" y="30.717967697" font-size="10" text-anchor="end">133</text>
<text id="txtVal5" x="169.282032303" y="60.0" font-size="10" text-anchor="end">167</text>
<text id="txtVal6" x="180.0" y="100.0" font-size="10" text-anchor="end">200</text>
</g>
</xsl:template>
<xsl:template name="DrawArc">
<xsl:param name="startAngle"></xsl:param>
<xsl:param name="endAngle"></xsl:param>
<xsl:param name="Color"></xsl:param>
</xsl:template>
<xsl:template name="DrawNiddle">
<g id="niddle">
<rect id="rect" x="100.0" y="97,5" width="80.0" height="5" rx="10" ry="10" fill="blue" transform="rotate(-90 100 100)">
<animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="3s" fill="freeze" from="-180 100.0 100.0" to="-120 100.0 100.0"/>
</rect>
</g>
</xsl:template>
<xsl:template match="DrawTicks">
<g>
<path d="M12,100 a80,80 1 0,1 176 0" fill="none" stroke="black" stroke-width="9" stroke-dasharray="1 45"/>
<path d="M10,100 a80,80 1 0,1 180 0" stroke="black" stroke-width="4" stroke-dasharray="1 14.70796327" fill="none"/>
</g>
</xsl:template>
<xsl:template name="Gauge">
<xsl:param name="gauge"></xsl:param>
<xsl:param name="x"></xsl:param>
<xsl:param name="y"></xsl:param>
<xsl:param name="scale"></xsl:param>
<xsl:call-template name="DrawBackground"/>
<g filter="url(#MyFilter)">
<path id="Red" stroke-width="25" stroke="red" fill="none" d="M 20,100 a80,80 1 0,1 28.576991225 -61.28355545"/>
<path id="Yellow" stroke-width="25" stroke="yellow" fill="none" d="M 48.576991225,38.71644455 a80,80 1 0,1 65.314862988 -17.501064791"/>
<path id="Lime" stroke-width="25" stroke="lime" fill="none" d="M 113.891854213,21.215379759 a80,80 1 0,1 66.108145787 78.784620241"/>
</g>
<circle id="circle" filter="url(#MyFilter)" r="16,6666666666667" cy="100.0" cx="100.0" style="stroke-width: 3; stroke: rgb(100,100,100); fill: black"/>
<!--<xsl:call-template name="PrintTitles">
<xsl:with-param name="Title"><xsl:value-of select="@Title"/></xsl:with-param>
</xsl:call-template>-->
<g>
<text id="title" x="110" y="20" font-size="10" anchor="middle"><xsl:value-of select="$calcScale"/></text>
</g>
</xsl:template>
</xsl:stylesheet>
|
|
|
|