Home > technical, uml > XML In UML


While learning XML, I concocted this UML class diagram of the conceptual structure of XML as a quick look refresher guide:

The diagram can be interpreted as:

  • A typical XML document is composed of  a “Document Element“, an optional “Prolog Element”, and many application specific “Element” classes.
  • Besides a base “Element” class, there are two subclass types: the “Document Element” and the “Prolog Element”.
  • In an XML file, the “Prolog Element” (if present) must precede the “Document Element”.
  • An element contains content and, optionally, 1 or more “Attributes”.
  • Each “Attribute” is comprised of a Name/Value pair.
  • An element can also contain other nested elements, providing support for structured data representation.

Here’s a simple concrete example XML file and the mapping from concrete to abstract. Note that the “comment” and “xml declaration” lines aren’t represented in the abstract class diagram model. I left out that second order level of detail to keep the class diagram simple.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: