Parse SVG Fragment

Lets get some SVG markup loaded as a Fragment, and do something with it.
Note, it gets loaded into Snap as a fragment.


var s = Snap("#svgout");
var myFrag = Snap.parse('<defs> \
    <path id="MyPath" \
          d="M 100 200 \
             C 200 100 300   0 400 100 \
             C 500 200 600 300 700 200 \
             C 800 100 900 100 900 100" /> \
  </defs> \
 <text font-family="Verdana" font-size="42.5"> \
  <textPath id="myTextPath" xlink:href="#MyPath"> \
      Some text can go in here  \
    </textPath> \
 </text>\
');

s.append( myFrag );
var tp = s.select("#myTextPath");
tp.animate({ 'startOffset': 2000 }, 5000 );



   


        
The actual svg markup looks like this (when you've clicked on run)....