RE: Single-sourcing, who's doing it?

Subject: RE: Single-sourcing, who's doing it?
From: "Mark Baker" <mbaker -at- ca -dot- stilo -dot- com>
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Wed, 22 Oct 2003 10:56:43 -0400


Goober Writer asked

> OK, so what's superior about SGML over XML, since XML
> can be structured and transformed however you choose? ;)

Structurally, SGML and XML are more or less identical. (I say more of less
because while each involves the creation of nested element structures, there
are some differences between the content models allowed by SGML and XML
DTDs, just as there are differences between the content models allowed by
different types of XML schema.)

Once you run the source document through the parser, SGML and XML are
indistinguishable. You get either a tree of element and data content nodes
or a stream of markup events and the processing techniques you use from that
point on are identical.

The difference lies in the markup itself. XML insists on fully normalized
markup at all times. Every single tag must be closed and you cannot do
markup minimization tricks such as letting common symbols stand for markup
in certain contexts. XML markup is explicit and verbose. SGML markup can be
made implicit and lean. This makes SGML harder for people who write parsers
and easier for people who write documents.

For instance, you can have a structure like this in XML:

<p>This is a paragraph.</p>
<p>This is another paragraph. Now we are going to have a list:
<ul>
<li>This is the first item.</li>
<li>This is the second item.</li>
</ul>
</p>
<p>This is a following paragraph.</p>

In SGML, you can minimize the markup so that the same structure is marked up
like this:

This is a paragraph.
This is another paragraph. Now we are going to have a list:

* This is the first item.
* This is the second item.

This is a following paragraph.

In the SGML version, the indent at the beginning of the line signals the
start of a paragraph. The start of a new paragraph signals the end of the
previous one. An asterisk at the start of a line signals a list item. The
existence of a list item signals the start of a list. The start of a new
list item signals the end of the previous list item. The start of a
paragraph signals the end of the last list item and therefore the end of the
list. All the same structure is there, but with markup that is much simpler
to type.

And there is another advantage. Note that in the XML version, a list is
considered part of a paragraph. This is an arbitrary decision. It could just
as easily be marked up so that the list is outside the paragraph that
precedes it:

<p>This is a paragraph.</p>
<p>This is another paragraph. Now we are going to have a list:</p>
<ul>
<li>This is the first item.</li>
<li>This is the second item.</li>
</ul>
<p>This is a following paragraph.</p>

In fact, the decision about whether or not to include the list in the
paragraph is really only of interest to the formatting routine, which may
want to implement rules about keeping lists with their preceding paragraph.
But with XML, the author has to know which it is. With SGML, this detail of
structure is hidden from the author. In fact, the processing application is
actually free to interpret it either way depending on its needs.

SGML lets you hide both markup and structure from the author. It does not
let you go 100% tag free, nor is that desirable, but it does let you create
markup that is far easier to use and is not prone to silly mistakes like
leaving off the end tags on lists and paragraphs.

Now some will argue that if you use an XML editor you don't have to deal
with tags anyway. But you do still have to deal with explicit structure. And
dealing with an XML editor can make some markup tasks quite laborious. The
fact of the matter is that doing XML markup is difficult enough that you
will probably need an XML editor to do it. A well designed SGML markup
language, on the other hand, can be easily used with a simple text editor,
and will be less expensive and more productive.

SGML was optimized for use by authors. XML was optimized for ease of
parsing. XML is fine for transmission and exchange or data (apart from its
high overhead, which is a genuine problem on busy networks). SGML is
superior for authoring documents.

So... Don't buy a pig in a poke.
---
Mark Baker
Stilo Corporation
1900 City Park Drive, Suite 504 , Ottawa, Ontario, Canada, K1J 1A3
Phone: 613-745-4242, Fax: 613-745-5560
Email mbaker -at- ca -dot- stilo -dot- com
Web: http://www.stilo.com

This message, including any attachments, is for the sole use of the
intended recipient and may contain confidential and privileged
information. Any unauthorized review, use, disclosure, copying, or
distribution is strictly prohibited. If you are not the intended
recipient please contact the sender by reply email and destroy
all copies of the original message and any attachments.





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ROBOHELP FOR FRAMEMAKER TRIAL NOW AVAILABLE!

RoboHelp for FrameMaker is a NEW online publishing tool for FrameMaker that
lets you easily single-source content to online Help, intranet, and Web.
The interface is designed for FrameMaker users, so there is little or no
learning curve and no macro language required! Call 800-718-4407 for
competitive pricing or download a trial at: http://www.ehelp.com/techwr-l4

---
You are currently subscribed to techwr-l as:
archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit
http://www.raycomm.com/techwhirl/ for more resources and info.



Follow-Ups:

References:
RE: Single-sourcing, who's doing it?: From: Goober Writer

Previous by Author: RE: Single-sourcing, who's doing it?
Next by Author: RE: Single-sourcing, who's doing it?
Previous by Thread: RE: Single-sourcing, who's doing it?
Next by Thread: RE: Single-sourcing, who's doing it?


What this post helpful? Share it with friends and colleagues:


Sponsored Ads