Re: CSS1 extension: container/noncontainer property

[Joel N. Weber II:]

| BTW, XML sounds like a good idea, but I learn better from examples
| than from legalistic specs like what we have for XML.  If someone
| could write a plain English version of the spec, that would make my
| life easier.

Only the "legalistic spec" (which is actually in pretty
straightforward English except for the EBNR, which not too many
lawyers use) will give you a complete description of the language, but
the basic idea isn't difficult:

1. Any structure is OK as long as it describes a single tree.  Or, if
you don't like that way of thinking about it, any structure is OK as
long as it can be graphically represented as a set of non-overlapping

2. No DTD is required, though you can provide one if you wish (to
enable the XML application to check structural integrity before
importing something into a database, for example).

3. You can use any tags you want, but every start tag must be matched
by a corresponding named end tag.  This makes the markup a little more
verbose, but it's dead simple to parse (or to process using one-off
perl scripts).

4. With the exception of a small number of reserved attribute names
beginning with "-XML-", you can use any attribute names you want, but
every attribute value must be quoted (same reason as number 3).

5. There are five predefined character entities: &, <, >,
', and ".  The trailing semicolon cannot be omitted (same
reason as number 3).  The standard doesn't attempt to predefine other
character entities because...

6. The character set is Unicode.  The default character encoding is
UTF-8, and in the absence of an optional encoding specification, any
other encoding is assumed to be UCS-2.

7. EMPTY tags (like the IMG and BR tags in HTML) use the special tag
close delimiter "/>".  Thus, if you want to use an EMPTY tag named FOO
in your document, you represent it as <FOO/> (plus any attributes, of
course).  This is how the parser distinguishes between what you called
"container" and "non-container" in your original post.

To get the rest of XML you will have to read the spec -- all 26 pages
-- but that's about 98 percent of it.

Below is a slightly demented but, I believe, legal XML document (with
one exception noted in the text).  Two publicly available XML parsers
have appeared in the last week, but I haven't had time to install
either one yet; so this example may contain some error that I've
missed, but it should give you the general idea.



<?XML version="1.0" ?>
<rootytoot author="bosak" origdate="1996.12.03" rev1="1997.01.15">
<!--* the root of the tree (in case you were wondering) *-->

<mtitle>This is the title of my beautiful document.</mtitle>

<hiddenpara>I made up this tag called "hiddenpara" because I intend to
hide the content of this element by making a stylesheet that says to
do that.</hiddenpara>

<para>This is going to be a regular paragraph because I'm going to
tell the stylesheet to make it one.</para>



<bodyhead>This is the head for my beautiful body.  I intend to tell
the stylesheet to make it 30 pt Bodoni Bold.  But I may change my mind

<fls-title>Just what you think it is.</fls-title>

<para>Here comes a special tag that some Java app will know what to do

<blort param1="schnikelfritz" param2="schnitzelbank">

And here's an empty element that I will instruct the stylesheet to treat as
a graphic:

<colorful-picture file="colorpic.gif" />

And now my paragraph ends.</para>

<second-level-section class="who_needs_a_title_anyway">
<para>There are still certain rules; this is illegal: <bold>Beginning
one element <italic>and then beginning another </bold>and then ending
the outer element before </italic>ending the inner one.</para>

</second-level-section> <!--* a foolish consistency is the *-->
</firstlevelsection>    <!--* hobgoblin of small minds     *-->

Received on Wednesday, 15 January 1997 23:34:34 UTC