Section 2.1.  Formatting markup

Prev don't be afraid of buying books Next

2.1. Formatting markup

XML comes from a rich history of text processing systems. Markup actually predates the computer. Figure 2-1 shows a marked-up manuscript that might have been submitted to a human who would compose the type for printing.

Figure 2-1. A manuscript "marked up" by hand




The first wave of automated text processing was computer typesetting. An author would type a document and include style codes to describe how the document should be formatted. The computer would read the style codes and the rest of the text and print the document with the described formatting.

The file that contains the data of the document, plus the description of the desired format, is called a rendition. The style codes in the rendition file are called formatting markup.

The system interprets the formatting markup and converts the rendition into something physically perceivable by a human being – a presentation. The presentation medium was originally paper, but eventually electronic display was added.

This scenario isn't totally history. You and Word work with renditions today. It's just that Word gives you a nicer interface to manipulate them.

Word's user interface to the rendition (that is, to the .doc file with the style codes in it) is designed to look like the presentation (the finished paper product). The interface is called a What You See Is What You Get (WYSI-WYG) interface. Since a rendition describes a presentation, it is convenient to have the user interface reflect the end-product.

More than convenient. For Word it is essential, as we saw in 1.2.1, "Separating the document representation from the software", on page 9. Word's native binary .doc rendition file format is unfathomable to humans, and to virtually all non-Microsoft software.

For interchange (and virus avoidance) Word also offers a plain-text equivalent called Rich Text Format (RTF). While computers can handle it better than .doc, humans won't find it much of an improvement, as a glance at Example 2-1 will demonstrate.[1]

[1] Whitespace added for attempted readability. Prolog with font definitions, style definitions, etc. omitted for the same reason.

Example 2-1. Doug's article, represented in RTF (article.rtf)
 \pard\plain\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha \aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \pararsid13583126 \b\f1\fs32\lang1033\langfe1033\kerning32\cgrid \langnp1033\langfenp1033 {\insrsid13583126\par } \pard \s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum \faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid5243775 {\insrsid10036224 Sales Update\par } \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto \adjustright\rin0\lin0\itap0\pararsid10036224 \fs24\lang1033 \langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid16529125 Doug Jones} {\insrsid10036224\par February 3, 2004\par } {\insrsid10036224\charrsid10036224\par } \pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar \aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \pararsid12923755 \b\i\f1\fs28\lang1033\langfe1033\cgrid\langnp1033 \langfenp1033 {\insrsid10036224 A great month!} {\insrsid1358312\par } \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto \adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid \langnp1033\langfenp1033 {\insrsid10036224\par This month\rquote s figures are a } {\i\insrsid10036224\charrsid10036224 huge} {\insrsid10036224 improvement over this month last year. We } {\insrsid12923755 sold 1,342 widgets for a total revenue of $14,327.} {\insrsid10036224\par\par } \pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha \aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \pararsid12923755 \b\i\f1\fs28\lang1033\langfe1033\cgrid\langnp1033 \langfenp1033 {\insrsid10036224 More work to do\par } \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto \adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid \langnp1033\langfenp1033 {\insrsid10036224 Let\rquote s not rest on}{\insrsid12923755 our past success. Let\rquote s get out there and sell, sell, sell!} {\insrsid10036224\par }{\insrsid13583126\par } 

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net