November 14, 2019

Structured Documents

 

Here is a simple example of a structured document.

Memo


To: John McSweeney

CC: M150 jmc1234 TG

From: Derek Goldrei

Date: 1/04/04

Re: Your Contract


John,

Unfortunately we have had to terminate your contract.

Regards

Derek


 

Of concern here, apart from my need to find a new job, is the structural formatting, not the visual properties of the document (font type, colour, size etc).
Ignoring the lines and the Memo label, for all memos to adhere to this document structure they would require six fields, To:, CC:, From:, Date:, Re: and the body of the document for the message.
Consequently, a DTD (Document Type Definition) could be written that would enable all memos to be validated against the DTD. The DTD could constrain all memos to ensure that each has the structural elements mentioned above.

Once a document has been validated against a DTD and thus conforms to a set of rules, it can be processed or manipulated in some predetermined fashion. For example, a program could be written and executed on the receiver's machine, which simply outputs the name of the sender and the date it was sent. The receiver of this document can quickly view this information and decide whether or not to open it.

How can a program do this?

When the sender of a memo completes the document, the DTD will ensure that all memos have something written in the From: and Date: field. The memo, a representation of input data, cannot be sent until this is completed. The program on the receiver's machine can access, or process, the values (data) in these two fields for display. Consequently there is an output of data from which information can be gleaned. "OK, it's from Derek. He's my boss, I need to read this."

Next page » SGML

Previous page « Introduction to document markup

 

 

 

 

 

 

 

 

 

 

 

 

Up to top of page