Two mechanisms, both part of the HTML 4.0 specification, are used
to identify elements (tags) for the creation of dynamic content. The
id
attribute, valid on most elements, is a document-unique
identifier of a particular element. Elements maybe grouped using the
the class
attribute. The class name can then be used to
find multiple elements on which to perform an operation. A given
element may belong to multiple classes by giving multiple
class
attributes. While both of these attribute are
defined in HTML 4.0, most HTML software ignores attributes that
are not understood and their use does not cause problems.
Examples of these attributes are:
<input type="text" name="username" id="username"> <tr class="deleteRow">
These identifiers serve as the formal interface between the designer of a document and the programmer writing code to generate dynamic content from that page. By the designer and programmer carefully working out the identifiers, both may proceed with full development in parallel.
The use of these the id
and class
attributes
does not conflict with other uses, such as access by JavaScript.
All an id does it give that element a unique name, it does
not define the usage, the same id can be accessed from both JavaScript
and with XMLC-generated objects. The class
attribute
is a white-space separated list of names, so it possible for an
element to belong to more than one class.
id
attribute are:
Element
object. but in a Text
node. To find the text, a
containing element is given a unique identifier.
<span>
tag with an id
attribute maybe
used to access a portion of text within a larger text block.
class
attribute are:
Since one goal of XMLC is to allow the HTML pages to remain a working
mockup, URLs must reference static HTML pages, rather than reference
dynamic content generators, like servlets. However, its is not necessary
to individual identify each element that has a URL that needs updated.
This can be done a XMLC compile-time using the
-urlmapping
,
-urlregexpmapping
, or
-urlsetting
option.