XAML and Standards

10/30/2003 3:55:14 PM

XAML and Standards

I have seen a number of complaints of Avalon not using standards like SVG, HTML, CSS and Javascript. I just wanted to mention a few counterarguments.

First, XAML does use WVG (Windows Vector Graphics), which is based off of SVG, with the requirement that WVG deviate as little as possible from SVG, but without placing any onerous requirements on WVG. I believe most, if not all, of the differences involve naming; SVG does not conform to the FxCop naming rules of PascalCasing and use of full EnglishWords. I believe that there is a trivial transform that could be applied to transform SVG to WVG; I used one once. There is a whole world of software that lives and breathes SVG, and WVG is designed to make it easy, but not effortless, to use those tools.

Second, XAML can use JScript, which is one of .NET languages alongside C# and VB.NET.

Third, the CSS syntax was considered. There were two versions of Avalon. The first version did use a CSS syntax for specifying properties. The old version of Avalon was eventually discarded, though most of the code was were ported over to the current version, we got from PDC. The old version was fairly advanced, more so than the PDC version, and many non-Avalon developer had a chance to work on and comment on the new version. Many of them complained about CSS: There were a number of limitations in the syntax. One was that it was not XML. Another was that CSS had no mechanism for dealing with advanced techniques like complex properties or visual trees (which allows a control to appear radically different). I am sure that there were many other issues. The new version adopted the XML based syntax to address problems in the old model. Who knows, Microsoft might still allow the CSS Syntax and convert into on the fly into the corresponding XML. (Update: Chris Anderson has this to sayabout the move from CSS to XML. )

Lastly, XAML versus HTML. Well, if HTML was any good for developing a desktop UI, we wouldn't have XUL. XAML was an attempt to design from the ground up a good UI language, whereas original philosophy of HTML was designed to avoid specifying formatting, so as to be viewable through any browser in any device. XAML also has a one-to-one correspondence with .NET objects, so that instead of using XAML, you can actually write code to build the interface in exactly the same way it was specified in XAML, but in a different syntax. It's also much easier to build new controls that can then be used directly in XAML; this is not possibly in HTML.






Net Undocumented is a blog about the internals of .NET including Xamarin implementations. Other topics include managed and web languages (C#, C++, Javascript), computer science theory, software engineering and software entrepreneurship.

Social Media