vrijdag 7 september 2007

Having fun with XAML (Silverlight) and SVG

Rationale
When I first became acquainted with Microsoft's XAML format (october 2005), my primary platform was Windows 2000. Support, examples and clip art were limited. It was then that I started to write an XSL-transformation from SVG to XAML, targeted at the 2003 namespace supported by a 3rd party tool, Xamlon. It came with its own pecularities, but hey, it worked (even on Windows 2000)! In order to test some files incompatible with Xamlon, I also wrote the reverse, a XAML to SVG transformation. This also worked with some more complex examples, like the samples for Microsoft Expression. Giraffes, parrots and hippos flooded my screen. Then I got busy with other things and let it rest...

2007
Recent developments like Silverlight, Andreia Gaita's SVG2XAML (part of Moonlight, the Mono port of Silverlight) and Sam Ruby's SVG to Silverlight Workbench, revived my interest in my own shelved pet project. I had to remove some 2003 namespace "artifacts", like RectangleTop and RectangleWidth. ID, TransformDecorator and Text became x:Key, RenderTransform and TextBlock, respectively. Attributes for shapes like Ellipse also changed slightly.

Consequences
This allowed some interesting techniques like:
- SVG on Internet Explorer, without the ASV (Adobe SVG Viewer) plugin required (the example also works on Mozilla with Silverlight installed)
- XAML/Silverlight on Mozilla, without the Silverlight plugin installed (doesn't work on IE, but that's a mimetype issue)

Examples
- Colored toucan (SVG to XAML)







- GreenFrond (XAML to SVG)









How can you help?
The XSLs need testing, code coverage and conformance tests. Bug reports are more than welcome. And there are many concepts and constructs that still need a counterpart, for instance filters and base64 encoded images in XAML. Some more posts on these, and some implementation issues are to follow in the next days.
Feel free to email your comments.

Updates
20071009 20:57: XMLs and XSLs must be read with async = false, corrected in Transform.js
20071013 22:42: Changes to xaml2svg.xsl, shapes.xsl, properties.xsl, bugs filed by Inkscape developers

27 opmerkingen:

davidbieber80 zei

The XSLs need testing, code coverage and conformance tests. Bug reports are more than welcome. And there are many concepts and constructs that still need a counterpart, for instance filters and base64 encoded images in XAML.
jump higher Electronic Cigarette reverse phone detective tava tea error fix

Unknown zei

That is really very good article. I am glad to know. Thanks!payday loan direct lender

Unknown zei

I think depending on the image your mileage may vary.

I have svg document, but when I printed it to XPS using Inkscape, the XAML used an ‘ImageBrush’ to render a png of the original image. payday loan lenders

Unknown zei

Hey, Thanks for sharing such a nice post..... payday loan lenders

khan22 zei

I got lot of useful information from this site. I recommended every one to read this site,Great articles. Thanks for sharing!
San Diego Podiatrist

Anoniem zei

they were is a pure fiction, a fiction necessary to make the case against Dick Scruggs, Sidney Backstrom and Zach Scruggs -- a fiction necessary for the government to win the war.
Plus Size Sarong

Unknown zei

thanks a lot for your valuable sharing ,right from the beginning till end it was really very informative .i can witness the experience and steps you have taken to accomplish this wonderful work.
http://necista-savjest.blogspot.com/2009/03/yep-here-are-second-and-third-release.html

Unknown zei

I think you’ve made some truly interesting points. Not too many people would actually think about this the way you just did. I’m really impressed that there’s so much about this subject that’s been uncovered and you did it so well, with so much class. Good one you, man! Really great stuff
Mothers Day Flowers

Unknown zei

I found this informative and interesting blog i think its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article.
Carbon Fiber Paddle

Unknown zei

I will always give a nice thrust look in to you from my bookmark feed. Coffee I don't actually comment and don't like to spend time in typing the comment. But here I have to do this because this deserves a good like.
Dog Life Jacket

rose zei

This is a Interesting post. I have been wondering about this issue,so thanks for posting. I’ll likely be coming back to your blog. Keep up great writing.
SARONG

rose zei

They were is a pure fiction, a fiction necessary to make the case against Dick Scruggs, Sidney Backstrom and Zach Scruggs -- a fiction necessary for the government to win the war.Thank.
Austin Real Estate

man zei

I got lot of useful information from this site. I recommended every one to read this site,Great articles. Thanks for sharing!
Austin Architects

checking zei

I will definitely share it with my other friends. Keep up the good work, I would to stay in contact with your posts.saga hair

checking zei

You have provided a great piece of information. I will definitely share it with my other friends. Keep up the good work, Not all accountants are dull,we are just the same as everyone else! Thanks for that great post, made my day! saga gold

dubaiexperies zei

I got lot of useful information from this site. I recommended every one to read this site,Great articles. Thanks for sharing!
Abilene Roofing Companies

Phil zei

Having fun with XAML, I have been googling it forrever, Thanks for posting this article.
Direct Payday loan lenders
Cash advance USA

Web design Los Angeles zei

Silver light is one of the best piece of software ever made for the web (Thanks just my opinion)
Payday loan lenders
Web Design in Los Angeles

Joanne zei

Very interesting, thanks for the technical details.


dog life jacket

leading zei

If you are looking for how to find a boyfriend just visit us and know about the tacts and ways to know how to find a boyfriend and how to satisfy your soulmate. You can find dating tips articles alongwith tips on how to find a boyfriend. Here you can know how to get him and how to make him happy with you and to keep him with you in a long term relation of pleasure.
To fidn a boyfriend

checking zei

if you want to know that how to get a boyfriend or how to find a boyfriend here is all the detail information about how to get a guy
How to Get a Boyfriend

How to Find a Boyfriend

How to Get a Guy

Juliette zei

Thanks for really useful tips.

http://www.edoglifejacket.co.uk/top/waterproof-dog-coats/

Juliette zei

Also meant to say thanks for sharing, has helped me out.

tiny/small waterproof dog coats

checking zei

thanks a lot for your valuable sharing ,right from the beginning till end it was really very informative .i can witness the experience and steps you have taken to accomplish this wonderful work.z-wave

leading zei

Hi i am looking for the solution of the question how to loss weight fast and quick in a natural way can you guide me please?

How to loss a weight

bye bye good night
thanks

Juliette Morgan zei

Interesting but a little over my head but thanks for sharing.

Xtra Dog fleece dog harness review

Unknown zei

Many thanks to the person who made this post, this was very informative for me. Please continue this awesome work. Sincerely…
Polo tshirts