On Tue, Aug 07, 2001 at 10:17:58AM +0200, Lars Gullik Bjønnes wrote:
> John Weiss <[EMAIL PROTECTED]> writes:
> 
> | Having recently done an XML seminar at work, I can offer the following
> | to the discussion:

[snip!]

> | 
> |   For "well-formed", think "lex".  For "valid", think "yacc".
> 
> And for this would would need a DTD right?

NoNoNo, you misunderstand.  When someone says, "Well-formed XML," they
mean the equivalent of, "It will lex (tokenize) error-free and follows
an absolutely primitive, lowest-common-denominator grammar."  When
they say, "valid XML," they mean, "It will yacc (follow a grammar)
error free for the particular application it was written for."

> So we will have a format that conform to the LyX parser... that is
> really only Well-Formed XML, right? 

Oh, no.  It follows a grammar:  the LyX grammar.  As long as a file
follows that grammar, error free, it's also valid XML.

> (We might create a DTD later, but in the beginning this will only
> create more work.)

The DTD/XSL comes in when you document that grammar.  Hey, you could
document the LyX file format's grammar in Danish if you wished, but
using SGML DTD or XSL will be more concise.  After all, SGML DTD and
XSL were designed to document grammars, and both can be used to
document XML grammars.

The only other "natural" format for documenting grammars is a (heavily
commented) yacc-file.  I'll take XSL over that, any day.

If your DTD happens to be in the format described in the XML standard
(or if you use XSL), then the LyX file format is instantly portable!
We can even use an XML engine to convert the LyX format into LaTeX.
(That's one of the plans for XML, BTW.)

> I do not agree that we should do this from the beginning... we will
> most likely need several iterations before we are satisfied with the
> xml format, and I think it will be a lot easier to create the DTD
> afterwards.

Of course we'll do several iterations.  What, you eat your steaks by
swallowing them whole?  You don't slice into bits and chew?

We can do both design and DTD simultaneously.  When we need a new cell
or block or attribute, we'll end up discussing it, won't we?  Well,
there are four ways to have that discussion:

- In English (the imprecise Lingua Franca of the developer's list)
- In yacc-format
- In an SGML-DTD-like format.
- In an XSL-like format.

The latter is really flexible; I could teach it to y'all quickly.
After the discussion settles down, and we agree upon a format for the
new feature, I can take the email thread and clean up the XSL-like
chat into real XSL.  Won't take long.  Then, voila! we have a grammar
specification that makes the LyX XML file format portable.

I think it's doable.  I think it's doable without any extra effort.
We just need to start out on the right foot.

-- 
John Weiss

"Not through coercion.  Not by force.  But by compassion.  By
affection.  And, a small fish."  -His Holiness, the 14th Dalai Lama 

Reply via email to