REALbasic XML Project Format
REALbasic can export and import REALbasic projects
in XML format. XML is a structured, text-based data format that provides
a standard framework for representing data.
For a brief orientation to XML documents in general, see What Do XML Documents Look Like?.
The XML produced by REALbasic is well-formed, but it cannot be "validated"
because it does not include a "document type declaration."
Most of the content should be self-explanatory, with the aid of the
reference below. Whitespace is significant only in the content area
of the innermost tags; whitespace between one tag and another
is not significant.
The general structure of a REALbasic XML file is:
<RBProject Version="3.0">
<block type="SomeBlockType" ID="1234">
<SomeTag>Content goes here</SomeTag>
<AnotherTag>More content</AnotherTag>
</block>
<block type="AnotherBlockType" ID="5678">
<SomeOtherTag>More content here</SomeOtherTag>
</block>
</RBProject>
The file is divided into "blocks" which are major organizational units.
In general, there is one block for the project data (build settings,
etc.), followed by one block for each item in the Project window (see
block types). Each block has an "ID" which
is used to refer to the block (e.g., in the ObjContainerID tag). Some
tags identify groups and may contain other tags.
Markup Tags
The markup tags used by REALbasic XML are (in alphabetical order):
| |
| BindDestBindData |
|
bind destination binding data |
| BindDestData |
|
bind destination data |
| Binding |
|
an object binding |
| BindSource |
|
bind source |
| BindSourceBindData |
|
bind source binding data |
| BindSourceData |
|
bind source data |
| BuildFlags |
|
build flags: indicate target(s) and compression |
| BuildMacName |
|
name for Mac built apps |
| BuildMinSize |
|
minimum memory allocation for Mac built apps |
| BuildSize |
|
memory allocation for Mac built apps |
| BuildWinMDI |
|
Win32 MDI option |
| BuildWinName |
|
name for Win32 built apps |
| ColorPalette |
|
color palette |
| Constant |
|
constant |
| ConstantInstance |
|
constant value for a particular platform/language |
| Control |
|
control |
| ControlBehavior |
|
control behavior (event handlers etc.) |
| ControlIndex |
|
control array index |
| CurrentLanguage |
|
current language (for builds) |
| DefaultLanguage |
|
default language |
| DefaultViewID |
|
ID number of the default view |
| EditBounds |
|
position of an editing window |
| EditSplit |
|
position of a vertical splitter |
| Element |
|
element of a larger grouping |
| Encoding |
|
text encoding code |
| EndSelCol |
|
ending column of a selection |
| EndSelRow |
|
ending row of a selection |
| FileAlias |
|
alias to a file |
| FileType |
|
file type |
| FormDefn |
|
form (layout) definition |
| FullPath |
|
full path to a file |
| Hook |
|
event handler |
| HookInstance |
|
event handler instance (with code) |
| Icon |
|
icon data |
| InfoVersion |
|
package info string |
| Interfaces |
|
object's interface(s) |
| IsClass |
|
indicates whether the item is a class |
| IsInterface |
|
indicates whether the item is an interface |
| ItemData |
|
item data |
| ItemDeclaration |
|
item declaration |
| ItemDef |
|
item definition |
| ItemDescription |
|
item description |
| ItemDisabledHelp |
|
item disabled balloon help |
| ItemFlags |
|
item flags (meaning depends on context) |
| ItemFragName |
|
CFM fragment name |
| ItemHelp |
|
item balloon help |
| ItemIndex |
|
item index (number within a list) |
| ItemLanguage |
|
item language |
| ItemName |
|
item name (used for smaller entities than ObjName) |
| ItemParams |
|
item parameters |
| ItemPlatform |
|
item platform |
| ItemResult |
|
item result |
| ItemShortcut |
|
menu item shortcut |
| ItemSource |
|
item source |
| ItemSpecialMenu |
|
indicates a special (built-in) menu |
| ItemStyle |
|
item style |
| ItemText |
|
item text |
| ItemTransparent |
|
indicates the item is transparent |
| ItemType |
|
item type |
| ItemVersion |
|
item version |
| LastPositionH |
|
last horizontal position |
| LastPositionV |
|
last vertical position |
| LongVersion |
|
long version string |
| MacCreator |
|
Mac creator code |
| MajorVersion |
|
major version number |
| MenuHandler |
|
menu handler |
| MenuItem |
|
menu item |
| Method |
|
method |
| MinorVersion |
|
minor version number |
| NonRelease |
|
non-release number |
| ObjContainerID |
|
ID number of the folder which contains this project item |
| ObjName |
|
object name |
| ObjSize |
|
object size in bytes |
| PartialPath |
|
relative path to a file |
| Property |
|
property declaration (as in the code editor) |
| PropertyVal |
|
property value (as seen in the Properties window) |
| PropertyValue |
|
property value (not used) |
| Region |
|
region code |
| Release |
|
Development, Alpha, Beta, Final |
| ShortVersion |
|
short version string |
| SourceLine |
|
line of source code |
| StartSelCol |
|
starting column of a selection |
| StartSelRow |
|
starting row of a selection |
| SubVersion |
|
maintenance release number |
| Superclass |
|
object's superclass |
| Target |
|
target (reserved for future use) |
| WinMDICaption |
|
Win32 MDI caption |
|
Block Types
The possible values for the "type" attribute of the block tag are:
| |
| CFMPlugin |
|
CFM Plugin |
| Cursor |
|
mouse cursor image |
| Database |
|
database |
| Folder |
|
folder |
| Menu |
|
menu definition |
| Module |
|
class or module |
| Movie |
|
QuickTime media |
| Picture |
|
picture |
| Project |
|
project info |
| ProjectItem |
|
unknown project item |
| Resources |
|
resources file |
| Script |
|
AppleScript |
| Sound |
|
sound file |
| Window |
|
window definition |
| XCMDPlugin |
|
XCMD plugin |
|
Tag Content
String data within a tag must be marked up according to standard XML
rules. Every "<" is replaced with "<", each ">" is replaced with
">", and every ampersand is replaced with "&". Finally, if a non-Unicode string contains byte values less than 32 or
greater than 127, it is represented with a special " " tag, e.g.:
<Hex bytes="4">00C4A50B</Hex>
Example
Below is an abbreviated example of the XML import of a project containing
a window, a menu, and a global module. The window contains a PushButton
with code in its action event. The module contains a constant, a property,
and one method.
<?xml version="1.0"?> (XML preamble)
<RBProject Version="3.0"> (version of RB used)
<block type="Project" ID="0"> (project-wide settings)
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
...
</block>
<block type="Window" ID="-1236533132"> (here's the Window...)
<ObjName>Window1</ObjName>
<ObjContainerID>0</ObjContainerID>
<EditBounds>
<Rect left="100" top="80" width="534" height="390"/>
</EditBounds>
...
<PropertyVal Name="Name">Window1</PropertyVal>
<PropertyVal Name="Frame">0</PropertyVal>
<PropertyVal Name="HasBackColor">False</PropertyVal>
...
<FormDefn>
<ObjName>Window1</ObjName>
<ObjSize>120</ObjSize>
<Superclass>Applet</Superclass>
<IsInterface>0</IsInterface>
</FormDefn>
<ControlBehavior>
<ObjName></ObjName>
<ObjSize>116</ObjSize>
<Superclass>PushButton</Superclass>
<IsInterface>0</IsInterface>
<HookInstance>
<ItemName>Action</ItemName>
<ItemSource>
<StartSelRow>1</StartSelRow>
<StartSelCol>10</StartSelCol>
<EndSelRow>1</EndSelRow>
<EndSelCol>10</EndSelCol>
<SourceLine>Sub Action()</SourceLine>
<SourceLine>self.Close</SourceLine>
<SourceLine>End Sub</SourceLine>
</ItemSource>
</HookInstance>
</ControlBehavior>
<Control>
<ItemName>PushButton</ItemName>
<PropertyVal Name="Name">PushButton1</PropertyVal>
...
<PropertyVal Name="Caption">OK</PropertyVal>
<PropertyVal Name="Default">True</PropertyVal>
<PropertyVal Name="Cancel">False</PropertyVal>
<PropertyVal Name="Enabled">True</PropertyVal>
<ControlIndex>0</ControlIndex>
</Control>
</block>
<block type="Menu" ID="-1236533133"> (here's the Menu...)
<ObjName>Menu</ObjName>
<ObjContainerID>0</ObjContainerID>
<EditBounds>
<Rect left="100" top="100" width="300" height="200"/>
</EditBounds>
<MenuItem>
...
</MenuItem>
...
</block>
<block type="Module" ID="-1236533108"> (here's the Module...)
<ObjName>Module1</ObjName>
<ObjContainerID>0</ObjContainerID>
<IsClass>0</IsClass>
<EditBounds>
<Rect left="84" top="220" width="400" height="300"/>
</EditBounds>
<Interfaces></Interfaces>
<ObjName>Module1</ObjName>
<ObjSize>24</ObjSize>
<IsInterface>0</IsInterface>
<Property Flags="0">kEOL</Property>
<Method>
<ItemName>InitGlobals</ItemName>
<ItemParams></ItemParams>
<ItemResult></ItemResult>
<ItemFlags>0</ItemFlags>
<ItemSource>
<StartSelRow>4</StartSelRow>
<StartSelCol>0</StartSelCol>
<EndSelRow>4</EndSelRow>
<EndSelCol>0</EndSelCol>
<SourceLine>Sub InitGlobals()</SourceLine>
<SourceLine>// Set the correct line ending</SourceLine>
<SourceLine>#if TargetWin32 then</SourceLine>
<SourceLine>kEOL = chr(10)</SourceLine>
<SourceLine>#else</SourceLine>
<SourceLine>kEOL = chr(13)</SourceLine>
<SourceLine>#endif</SourceLine>
<SourceLine>End Sub</SourceLine>
</ItemSource>
</Method>
<Constant>
<ItemName>kPi</ItemName>
<ItemType>2</ItemType>
<ItemDef>3.14157</ItemDef>
</Constant>
</block>
</RBProject>
Please give us feedback: If you find errors or omissions in this document, please send feedback to: webmaster@realsoftware.com
2004 REAL Software, Incorporated. All rights reserved.
REAL Software, REALbasic and the REAL Software cube logo are registered trademarks of REAL Software, Inc. All other names mentioned are trademarks or registered trademarks of their respective holders in the United States and other countries.