I'm working on code to generate SVG dynmically via the web. When I try to create an element to display one of the shapes in the <def> section of the SVG file I'm getting unexpected output.
Below I'm trying to create a node called <use> with the following attribute xlink:href.
XML Output
Notice the code is outputting:
I expected to see:
Why is this happening and how can I get the resluts necessary for the SVG to work properly?
--Rick
Below I'm trying to create a node called <use> with the following attribute xlink:href.
Code:
svgElem = SvgXml.CreateElement("use", "[URL unfurl="true"]http://www.w3.org/2000/svg");[/URL]
svgElem.SetAttribute("xlink:href", "#" + sheetName);
RootNode.ChildNodes[1].FirstChild.AppendChild(svgElem);
XML Output
Code:
<?xml version="1.0" standalone="yes"?>
<svg width="800" height="600" xmlns="[URL unfurl="true"]http://www.w3.org/2000/svg">[/URL]
<def>
<rect id="13-81X76.5X3.5" x="0" y="0" widht="800" height="600" style="fill:none;stroke:rgb(0,0,255);stroke-width:.05" />
</def>
<g transform="translate(20, 585)">
<g transform="scale(0.95, -0.95)">
<use href="#13-81X76.5X3.5" />
</g>
</g>
</svg>
Notice the code is outputting:
Code:
<use href="#13-81X76.5X3.5" />
I expected to see:
Code:
<use xlink:href="#13-81X76.5X3.5" />
Why is this happening and how can I get the resluts necessary for the SVG to work properly?
--Rick