How would you go about converting XAML to SVG and vice versa?
My initial approach it to use xslt to map the different elements and attributes, but I don't know enough about both syntaxes to even guess about the plausibility of such an approach.
How would you go about converting XAML to SVG and vice versa?
My initial approach it to use xslt to map the different elements and attributes, but I don't know enough about both syntaxes to even guess about the plausibility of such an approach.
I'm not sure if you quite understand the differences between XAML and SVG.
XAML is a language used to describe how a GUI will look under WinFX. SVG is a language used to describe how a vector image will look.
Neither of these are interchangeable.
Here'a a link to XSL's which help you do this: http://members.chello.nl/~a.degreef/XAML.html
There are tools out there as well which do this.
You can convert SVG to XAML, as WPF has plenty of vector graphics goodness. There are plenty of tools and plugins you can use to convert one to another.
While I think any SVG graphics can be converted to XAML, not all XAML can be converted to SVG.
Really, any object graph can (with some small limitations) be serialized to XAML, so it only makes sense that that "all" XAML can't be converted back.
Check out www.wpf-graphics.com as a starting point for converters, and don't forget google.
XAML is a superset of SVG, since it's an entire application description language. While SVG has some basic programmability functions (enough to build a Tetris game, for example), it's really a vector graphic format.
Some options:
As none of the above could fulfill my needs, I developed a set of conversion tools on my site
I have put some info about them on my site in the form of a library, online tool, usercontrol and batch app; an svgviewer for wpf will follow shortly.
Some of the points I tried to address (that I found more or less lacking in some of the existing tools):
You can try this version online; I am happy to implement any feature requests as long as they fit my priorities and schedule.
ps: Working on the Silverlight versions