Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Reinventing XAML? >Thread Next - Re: Reinventing XAML? Re: Reinventing XAML?To: NULL Date: 9/4/2008 10:45:00 AM "Siegfried Heintze" <siegfried@h...> wrote in message news:uJh2QIkDJHA.4428@T...... > We have an existing application written in C++ that displays bitmaps > (pixmaps, actually) on an embedded USB device. They chose C++ because they > tell me C++ is better for communicating with devices than C# (so they tell > me -- I did not make this decision). > > We wanted to use XAML to render our diagrams for our application. We > posted a query in the WPF forum and a response pointed us to the > documentation for hosting a XAML/WPF application in a C++ GUI. However, > they said that WPF does not use device contexts: it uses direct X > rendering contexts so writing to a bit map was difficult and slow. I'll > look into it further. > > My team leader tells me to start investigating reinventing XAML by means > of an XSLT that will generate C++ gdiplus code from XAML or SVG code. > > Hmmmm.... > > So here is an example of some SVG code which is extremely similar to XAML > code: > <path > d="M11.083,10.631l0.34-0.143l-1.247-3.032l1.305-0.114l-1.56-1.559L8.447,4.281L7.88,4.338L2.296,4.323c-0.195,0-0.354,0.159-0.354,0.355L0.709,3.629h9.212v1.332l2.384,2.408c0.053,0.053,0.083,0.125,0.083,0.199c0,0.146-0.11,0.269-0.255,0.283l-1.162,0.114l1.084,2.556c0.014,0.035,0.021,0.071,0.021,0.109c0,0.114-0.069,0.219-0.175,0.262l-0.618,0.248"/> > > The "M" means move to the absolute coordinates. "l" means lineto the next > relative coordinates, "c" means to make a simple bezier curve with > relative coordinates, etc... We have miles of this stuff we were going to > render with XAML and now I have to render with C++. > > So finally, here is my question: can I use standard XSL to parse that path > statement and generate C++ code or would I have to use non-standard > scripting (C#?) embedded in the XSL file to decypher it? I wish I could > steal the source code for the FireFox SVG rendering engine! > > Thanks! > Siegfried > Other than the fact that your team leader expects you to accomplish single handedly what dozens of Microsoft developers took many months to create I think it can be done. It would be a lot easier in XSLT 2.0 which has better string handling though, in version 1.0 you'd need extension functions which can be written in a number of languages depending on which processor you choose. The main contender for a version 2.0 processor is probably Saxon which can run on Java or .NET. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
