XML code of a Library Element

Top  Previous  Next

Here is a library element example. On the left side we see its view on the Project Explorer, on the center its view on the Page Design Area and on the right its XML code.

To see the XML code of an element, right click on it on the library explorer,  and choose "Shell | Send to mmEd" command from the context menu.

element_on_prjex

element_on_pda

  <?xml version="1.0" encoding="UTF-8"?>

  <form name="SubmitForm">

   <rect>30,39,209,91</rect>

   <elements>

     <button name="SubmitButton">

       <rect>10,52,188,24</rect>

     </button>

     <editbox name="UserName">

       <rect>70,13,130,24</rect>

     </editbox>

     <text name="text21">

       <rect>10,13,58,24</rect>

       <value>Name:</value>

     </text>

   </elements>

  </form>

 

The library element is based on a Form Element. The form element is named as "SubmitForm" and contains child elements;

A button named as "SubmitButton"
A text named as "text21"
An Edit Box named as "UserName"

 

The order of the elements can be different in the project explorer and in the XML. Elements are sorted in ascending order in the project explorer.

XML Code

Lets first have a look to the following definition which is the first line in XML.

<?xml version="1.0" encoding="UTF-8"?>

 

It contains the instructions for the XML parsers.

version

Defines the XML structure version.

encoding

Although XML files can be prepared using different encoding settings, the Application Studio will always create a new library element with encoding "UTF-8" to support all the characters existing in the world.

  <form name="SubmitForm">

    <rect>30,39,209,91</rect>

    <elements>

      ... 

    </elements>

 </form>

Form is a container element. In the XML definition, a form starts with

<form name="formname"> and ends with </form>

 

An element has attributes and properties.

name is an attribute of form. rect and elements are properties of form.

Although a form element has more properties, here we see only rect and elements properties; because the other properties were left to their defaults by the user.

rect property contains coordinates and size of the element in the order

left, top, width, height.

The child elements of an container are the properties of the container element and therefore they are enclosed with elements property tags.