Hi,
I'm trying to access some custom data emitted into an SVG document by Visio 2007. I've used jquery.svg.js by Keith Wood. Unfortunately, even with the svgdom extension, I am not able to get to the shape I'm after to animate it.
Here's what the SVG looks like:
...
<g id="group4-6" transform="translate(30.7955,-30.7955)" v:mID="4" v:groupContext="group" v:layerMember="0;1">
<v:custProps>
<v:cp id="helloWorld" v:nameU="AgentName" v:lbl="AgentName" v:type="0" v:langID="3081" v:val="VT4(Bob)"/>
</v:custProps>
<v:userDefs>
<v:ud v:nameU="Show" v:val="VT0(1):5"/>
</v:userDefs>
<title>Sheet.4</title>
<g id="shape5-7" ...
I'm trying to access the group 'shape5-7', by navigating to it relative to the custom property containing 'Bob'. i.e. I want to animate the shape with Bob attached to it. I tried the following, but I got nothing back.
$("v:cp[v:val*=Bob]:parent:parent > g:first", desk)
.each(function(i, item) { Log('found something'); })
.animate({ svgFill: 'red' }, 2000)
.animate({ svgFill: 'white' }, 2000);
I've tried it with and without the XML namespace prefixes. And I know that the shape can be found in the SVG DOM, since $("#shape5-7")
finds the right shape and animates nicely. It looks like as soon as I try to access non-SVG elements in the SVG DOM I get failures. Am I asking too much of the jquery.svg.js library here, or am I just missing something?
I am using the modified version of jquery with the 1.4.2 version of jquery.svg.js running in Google Chrome 2.0.172.43. I'm in the proof-of-concept phase at the moment, so if you can show me how to do the same task using the Raphael or ProcessingJS libraries (or any other), I'd be willing to switch. JQuery-centric solutions are my preference though.
Thanks
Andrew Matthews