Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

A Standards-based Look at XAML's Features

Microsoft's Longhorn will introduce XAML, an application development framework for Web and Windows apps. But just how different is XAML from the already-available public standards set by the W3C?


advertisement
icrosoft's XAML markup language floats on top of the .NET platform. It is compiled into .NET classes, usually C#, which reduces it to a set of objects. Along with a host of other XML dialects it is an example of a new type of specification for GUIs. This article takes a look at XAML's tags to see what—if anything—is new in them.

There are many such GUI specifications now, a few being Mozilla's XUL, Oracle's UIX, Macromedia's Flex and the XML files created by the Gnome Glade tool. Although not W3C standards, some of these new GUI specifications are already on the W3C standards track. An example is the box model used within Mozilla's XUL, which is headed toward inclusion in future CSS drafts.

The original and most popular source of XML definitions is, however, still the World Wide Web Consortium. The W3C is responsible for formalizing XML and many XML applications such as XHTML and SVG. Given that these standards are mostly complete, do we really need all these new XML GUI dialects? Microsoft's XAML is a new spin on XML-based GUI description languages, borrowing very little syntax from established standards. Let's see if it's a radical improvement in some way, or if it's merely familiar old friends dressed up in new clothes.

XAML vs. CSS2
For this article, I grabbed a handful of W3C standards and a list of XAML tags. I matched the tags up according to functionality where possible, and then sorted them by W3C standards. Here are the results. The first thing that struck me is the way XAML expresses quite a bit of style information using whole tags. Table 1 shows the bits of XAML that closely match aspects of the CSS2 specification:

Table 1. XAML tags that duplicate CSS2 functionality.

XAML Tag

CSS2 Feature



Description

AdaptiveMetricsContext

pt (pointsize), user-defined stylesheets.

Styling of text for maximum user readability

Bold

font-weight : bold

Bold text

Border

border

Borders surrounding other content

FlowPanel

display : block

A multi-line block that reflows when resized

Inline

display : inline

A section of content held within a single line

Italic

font-style : italic

Italic text

PropertyTrigger

pseudoselectors like :hover and :active.

logic bound to common events in the UI

PageBreak

page-break-after

Support for paginated display.

ScrollViewer

scroll

scrolling support for content larger than its viewport.

SmallCaps

font-variant : smallcaps

Text in all small capitals.

Subscript

vertical-align : sub; font-size : smaller

Make the text smaller and raised above previous text

Superscript

vertical-align : super; font-size : smaller

Make the text smaller and lowered below previous text

Underline

text-decoration: underline

Text with an underscore beneath it


Why XAML doesn't use CSS2 is a mystery. Perhaps that'll change by the time the final Longhorn release is upon us. At least then we'd have all the alternatives for these CSS2 properties, not just a sprinkling of them. Of course, XAML has an extensible tag set to fall back on, so a great deal of further styling can be added if a need arises.

It's easy to see how beginners using XAML styling might benefit from a <Bold> tag—after all, that's the way HTML got started, and using <B> is still one of the charms of HTML for most beginners. But XAML ain't HTML. Its focus on application GUIs means that XAML users are likely to be a bit more competent than HTML beginners. CSS provides a simple and flexible way to do styling, and CSS's separation of style information from XML content makes XML documents really easy to work with. That's worth a lot for most developers. At this stage, XAML's styling tags look like tasty options that are probably too lightweight for real developers.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap