[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
RE: XML/SGML
Russ said:
.....
As i recall, SGML documents, as
defined by their respective DTD's, by themselves had no notion of
formatting,
but were more concerned about the structure of the document.
.....
Yes, that's right.
.....
Any
display/printing concerns were left to DISSYL (sp?) i believe.
.....
DSSSL.
.....
While i like the
notion of an ascii-based markup, i would think or i would want my
wordprocessor
to be able to have some control over the actual layout portions of my
document,
in a precise manner. That includes, but not limited to, font size, paper
size,
leading, precise graphic placement, etc.
.....
Right, you're exactly right. You *do* want to control the layout for the
document. What the designers of SGML noticed is that distinctions in
appearance between various elements of the document correlates very
closely with the structure of the document. For instance, headings look
different from titles which look different from body text, because they
are structurally different parts of the document. So, rather than having
the mark-up in the document itself reflect the *appearance* of the
elements, the mark-up would reflect the *function*. Form follows
function. As a result, if you want to change the appearance of every,
say, heading, you can do so knowing that you're not also affecting
unrelated elements.
In such a system, you gain control of the actual appearance of the
document in one of two ways: (1) you create a stylesheet which defines
the appearance for each structural element; and/or (2) you put attributes
into the structural tags to describe the appearance of that element. An
example of the first approach would be to define somewhere else (in the
stylesheet) that First-Level Heading
should be Optima Bold 14pt.
An example of the second approach would be like this: First-Level Heading
. The first approach
keeps the appearance information separate from the document, while the
second approach includes it but retains a structural approach to mark-up.
.....
The capabilities to do some of these
things in HTML is kind of kludgy IMO and suggests limited capabilites in
HTML
to display these attributes. As i've said, i haven't yet gotten into XML,
but,
i would want to be able to control these things in my
wordprocessor/publishing
system. If later, i could then output this to XML, for someone else's
benefit,
that would be fine.
.....
XyWrite styles can control these things to a limited extent. Let me give
you another example of how such a thing might work in a word processing
tool. I'm tinkering with a programming language called Tcl/Tk, which
includes a very good rich-text function (Tcl is the programming language,
Tk is the GUI ToolKit). The language has a tagging method very similar to
that used by, say, XML. For instance, if I want text to be tagged with a
"h1" tag, I issue a command something like the following:
.text tag add "h1" sel.first sel.last
"sel.first" is the beginning of the selection (func DB), and "sel.last"
is the end (func DE).
Then, I can issue a command like the following:
.text tag configure "h1" -font "Optima 14 Bold"
The point is this: the structural tagging of the document is kept
separate from the "configuration" (appearance) of the tags, but I can
certainly control the appearance of the tags. I can also program the
system to handle this information in either way described above: I can
have the tag configuration information saved separately in a stylesheet,
or I can have that information saved as attributes in the tags.
Furthermore, Tcl/Tk operates exactly in the way you described: when tags
are "stacked" on top of each other (for instance, a "bold" tag within a
"h1" tag), each tag is assigned a priority level, and the tag with the
higher priority modifies the configuration of the text, but only for the
attributes that it defines -- other attributes are left alone. For
instance, if I DEFINED (DF) part of the "h1" text above and issued the
following commands:
.text tag add "remove" sel.first sel.last
.text tag configure "remove" -strikethrough yes
The result would be that the selected text would have a line through it,
and would still be 14pt Optima Bold. And the surrounding text would be
unchanged, 14pt Optima Bold without a strikethrough. Tcl/Tk handles this
in a way that is completely analogous to ... -- the tag is
turned on, then turned off, without affecting other surrounding text and
its attributes.
.....
For whatever reason, when i tried to get Xywrite's styles to do this, i
couldn't get it to work that way. As i said earlier, this is more than
likely
pilot error on my part,
.....
Don't sell yourself short. XyWrite has inherent limitations in this area.
Rather than turning a tag "on" and then "off", it turns a style or a mode
"on" until another style or mode intervenes to replace it. So, for
instance, ≪USh1≫ will continue in effect until another style
intervenes, such as ≪USbody≫. There is no built-in XyWrite mechanism
for ≪endUSh1≫ or something like that, without starting another style.
(The command ≪PS≫ uses the "previous style", but this appears to mean
the previous style in the order listed on the stylesheet -- not the one
that was in effect before the current ≪US...≫ was invoked. The use of
≪NS≫ and ≪PS≫ depends on the order of elements in the stylesheet
rather the order in which elements are invoked. Bother! If only. . . .)
(You *can* get "modes" to function in a "on" and "off" way if you use,
i.e., ≪md+bo≫ ... ≪md-bo≫. I believe all of the MD commands in
XyWrite are capable of functioning in this way. But not the styles. It'd
be nice if you could ≪US+h1≫ ... ≪US-h1≫. That would do it! But
alas.)
S.H.
==========================
shawn_harrison@xxxxxxxx
==========================