A method and system are provided for using icons to show the validity of
markup language elements applicable to a computer-generated document. A
user of a computer-generated document such as a word processing document
attaches a schema to the document setting out the rules and procedures
with which the document may be annotated with markup language elements
for structuring portions of the document. According to one aspect of the
invention, the user attaches an Extensible Markup Language (XML) schema
to the document for setting the data types, data structures and XML
elements rules for the document so that the user may annotate the
document with XML structure. When the user begins to annotate the
document with a desired markup language structure, such as XML structure,
an application pane is displayed to the user to provide the user with
assistance in applying allowable XML elements at allowable locations and
in allowable order and number. A series of icons are presented alongside
the presented elements in the application pane to indicate the level of
validity of a given element based on the editing context and location in
the document.