Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Reinventing XAML?

From: "Joe Fawcett" <joefawcett@---------.------>
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 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent