On Thu, Oct 07, 2004 at 10:02:39PM -0400, John Weiss wrote:
> - If the LyX kernel treats something in a character-like fashion, go
>   with entities.
> 
>   Example:  Say that the LyX file "command" for a non-breaking space
>   is translated into a character, and that said character is then
>   translated to something else when the buffer exporter code
>   encounters that character.  Using the ' ' XML entity-reference
>   does this for you neatly.  And, it works with any special character.

AFAICS only 'real characters' fall into this category nowadays withing
LyX. At least they should. Everything else is an 'inset', i.e. a 'real'
C++ object.

> - If the LyX kernel treats a command as an atomic token, better to
>   define it as such using XML namespaces instead of attributes.
> 
>   Example:  Suppose a non-breaking space ... and all of the other
>   "special chars" ... is treated as a command, not a character.
>   Semantically, it makes no sense to have a "<special_char />" tag and
>   pass the name of the char as an attribute.  It's also harder to deal
>   with in the DOM.  Better to create a "special_char" namespace and
>   define one tag per char:  "<special_char:nonbreaking_space/>",
>   "<special_char:ellipses>", etc.  The XML parser will create a
>   separate token for each of these, which is what you're doing under
>   the hood, anyhow.  (Well, at least the way I've constructed the
>   example, that's what you're doing.)

i.e. this category if I understand you correctly.

> Note that these are just guidelines, not recommendations.  I say that
> we write the DTD first, figuring out what we need.  Then, above
> certain definitions, put comments labelled "REVIEW:" followed by
> "maybe use entities?" or "maybe put in namespace?" etc.  We can then
> review the completed DTD and figure out the cleanest format.

Can we get a template for such a DTD from somewhere? I surely wouldn't
know how to start even if I might have an idea in which of your
categories certain LyX objects fall...

Andre'

Reply via email to