Data in a document are displayed according to a transformation stylesheet,
and the transformation stylesheet is automatically updated in response to
a document modification made using a graphical editor. Mapping between
the transformation stylesheet and the document is automated, so that user
modifications to the document or to the transformation stylesheet are
automatically incorporated in both. The transformation stylesheet is
automatically annotated to create the mapping, and the data are
transformed according to the annotated transformation stylesheet.
Annotations are carried over to the resulting document. The annotations
map nodes within the document to corresponding nodes in the
transformation stylesheet. Annotations affected by modifications to the
document are translated and replace corresponding nodes in the
transformation stylesheet. The updated transformation stylesheet is
re-annotated and the data are again transformed. Differences between the
updated document and the original document are merged into the original
document to maintain user selection information.