Basics

Structure

Structure of XSharper program is

<?xml version="1.0" encoding="utf-8"?>
<xsharper xmlns="http://www.xsharper.com/schemas/1.0" >
        <action id="action1">
        <action id="action2">
        <action>
        <action>
        ....
</xsharper>

Using XML immediately makes IntelliSense live in Visual Studio 2008: open .xsh file as XML, assign scheme to http://www.xsharper.com/schemas/1.0 , and Visual Studio will suggest attribute names, possible enumeration values and more.

To make developer's life easier, a few additional liberties are allowed:

  • namespaces may be skipped
  • element and attribute names are case-insensitive (I hate to remember whether it is username or userName or UserName or Username)
  • the topmost element may be removed

For example, "Hello world" program can be written as

<Print>Hello, world!</Print>

or even

<PRINT value="Hello, world!" />

As you see above, value attribute and element text are usually interchangeable.