Targeting SVG and XAML in a Single Application

The XML grammar "XAML" is a declarative programming language for directly instantiating classes from Microsoft's WinFX libraries; in particular, the presentation framework used for user interface, documents and drawing. XAML can be published directly as Browser content, or compiled along with event-driven procedural code into a client application.

The XAML elements for vector graphics and animation are closely modelled after SVG. Furthermore, SVG deployment scenarios are similar to XAML: SVG can be used as Browser content, or as user interface to a Web application when accompanied by event-driven procedural code (script).

XAML and SVG will be compared with respect to their features, syntax, deployment, connection to other languages, and usage scenarios. It will be argued that both languages are viable under appropriate usage scenarios, and that there are situations in which the two can co-exist.

For example, a number of applications used by graphic designers are capable of exporting and importing SVG. These applications can be used to specify the appearance of a graphical user interface. If that specification can be handed off to software developers as XAML, then it can be directly compiled into code. This streamlines workflow between designer and implementer, while ensuring that the designer's intent is accurately represented in code.

An advantage of SVG is that it is cross-platform, while an advantage of XAML is that it is optimized on one platform. Therefore one might generate content in both languages, but choose which to deliver based on information about the receiving platform.

Thus there are situations in which it is worthwhile to export both SVG and XAML from a single application. This problem is investigated, and solutions are presented. It is not always best to convert directly from SVG to XAML or vice-versa, since the features of one language are not a proper subset of the features of the other. Instead, both SVG and XAML can arise as the output of translations from a common source format.

Architectures involving both languages are explored in the context of content authoring, data-driven graphics, data-binding, adaptive layout, collaboration, content management, and other kinds of applications.

Dr. Philip A. Mansfield
SchemaSoft
#350 - 1190 Homer Street
Vancouver, BC  V6B 2X6
Canada
email: philipm@schemasoft.com
tel:   604-682-3404 x142