INTRO SPECS TUTORIALS RESOURCES TOOLS ABOUT US CONTACT US
 
 
 

Proposal to replace "name" attribute with "name" and "id"

Send comments to Tom Kuo (tom@harmonia.com)
revised 27 April 2001

Abstract

The attribute "name" in UIML tags can be ambiguous and may be misleading in its meaning. A more appropriate label for identifying a UIML element within a document is required, in order to provide a way to distinguish between a unique identifier and a reference to an element.

Motivation

The attribute "name" in UIML2 serves 2 purposes: to define a unique identifier and to reference a unique identifier. We propose to use "id" for the first definition, and "name" for the second.

Proposed Change to UIML DTD to include ID attribute

The proposed modification to the UIML DTD is the following according to the table below:

 

Element
ID
Name
Required/Implied
action
-
-
-
behavior
x
-
implied
by-default
-
-
-
call
-
x
implied
condition
-
-
-
constant
x
-
implied
content
x
-
implied
d-class
x
-
required
d-component
x
-
required
d-event
x
-
implied
d-method
x
-
required
d-param
x
-
implied
d-property
x
-
required
equal
-
-
-
event
-
x
implied
meta
-
x
required
interface
x
-
implied
logic
x
-
implied
head
-
-
-
op
-
x
required
param
-
x
implied
part
x
-
implied
peers
x
-
implied
presentation
x
-
implied
property
-
x
implied
reference
-
-
-
restructure
-
-
-
rule
x
-
implied
script
x
-
implied
structure
x
-
implied
style
x
-
implied
template
x
-
implied
uiml
-
-
-
when-false
-
-
-
when-true
-
-
-

A sample of the modifications is shown below (Yellow highlighted text denotes changes from UIML2_Of.dtd.) *

<!ELEMENT part (style?, content?, behavior?, part*)>

<!ATTList part			
          class  NMTOKEN                    #IMPLIED
	  id   CDATA                        #IMPLIED
          source CDATA                      #IMPLIED
          how    (append|cascade|replace)   "replace"
          export (hidden|optional|required) "optional">

Comments:

* It is legal to have 2 of the same type of elements with no id attribute. An example of this is below

    <part class="A">
    <part class="B">

* The places where the use of name still remains are the cases when elements are referencing an id of some other element.

Example of some element where the name attribute is retained. (Consult table above for a complete listing of which elements use the name and id attributes)

    <property part-name="Part1" .../>
    <call name="function1"/>
    <event name="event1"/>

Examples of Using ID

In order to refer to a unique element in the structure, the id of that element would be specified thereby giving that element a unique identifier throughout the UIML document.


<structure>
  <part class="H1" id="textbox1">
    <style>
    	<property part-name="textbox1" name="content">
    	Welcome to Bob's Homepage </property>
      ...
    </style>
  </part>
  ...
  <part class="H1" id="textbox2">
    <style>
    	<property part-name="textbox2" name="content">
    	Thanks for Visiting, Come Again Soon! </property>
      ...
    </style>
  </part>
</structure>

Notice the name attribute takes on an entire new definition as it no longer serves as the reference to the UIML element in the document. The new definition of name depends on the element it is associated with.

 

© 1999-2001 UIML.org (all rights reserved)