I have a sample svg file (let's call it "myImage.svg") as code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg>
<g>
<rect
style="fill:#ff8080;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="rect3336"
width="100"
height="10"
x="0"
y="412.36221" />
</g>
</svg>
It is included in my project's directory.
In another JavaScript file, I would like to do something like this:
var file = getFile("myImage.svg");
var rect = file.getElement("rect");
rect.getAttribute("width") = "1000";
I've read many questions on StackOverflow but I'm at a loss at where to start to get my file.