Re: bobcat
- From: Torsten Bronger <bronger@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 18:52:30 +0100
Hallöchen!
William F Hammond writes:
Torsten Bronger <bronger@xxxxxxxxxxxxxxxxxxxxx> writes:
It's about the ugliness of tag syntax and its inflexibility. In
a specially tailored plain text format you can use more intuitive
syntax like
Section heading
===============
With a long section title string this type of underlining for markup
could become less convenient than \section{Section heading}.
Not really. I mean,
Section with a completely ridiculously
very long heading, just for testing it
======================================
v.
\section{Section with a completely ridiculously
very long heading, just for testing it}
is good enough in my opinion. YMMV.
[...]
Is it isomorphic to an xml document type?
Absolutely, yes. [...]
Questions.
1. Is it correct that the abstract syntax tree is the equivalent
xml?
Yes and no. An XML backend will be trivial: It just walks through
the tree and puts the current element's name as a tag before and
after its contents. But in no phase the source document is stored
as an XML.
2. Will there be a way in bobcat source to escape into named
markup?
I'm not sure what you mean ... there are two extension mechanisms,
namely "environments" (block level) and "roles" (inline level). See
<http://bobcat.origo.ethz.ch/wiki/Bobcat_sample_document>, section
8.2 and 8.3. They are delicate because the parser doesn't know
their meanings a priori. Only third-party backends will know them.
I addressed this problem by saying that they must not be nested, and
by forcing their syntax to be very simple. They still can be abused
of course; but if I don't add them, someone else will do.
3. Will the xml version only serve as a DOM or will it be possible to
save it and then operate on it independently, e.g., translate it
with xslt to another documenttype with well-developed
backends?
At the moment, I don't think about XML at all. I have a neatly
nested AST in memory, and a LaTeX backend. If all works well, I'll
ad an HTML backend. Well, as I said, an XML backend will be one
screen page long.
Bobcat's AST resembles XPath's DOM very much. There are elements,
children, and (terminal) text nodes. The backend modules share a
little bit with XSLT stylesheets, however, they are programmed in
Python. (Which is much for fun than XSLT if you have to do
algorithmic work.)
Comments.
A. If the xml is only dom-like and has only dom-like element
structure with many attributes, you may find that you are limited
by the fact that attributes cannot contain markup.
I have full-blown Python objects in memory. I can add to them what
I want, as long as I specify the document syntax and its markup
expectations clearly.
B. If the xml is only dom-like with relatively few elements, it's
not clear that validation will catch as many author errors as
would be the case with an author-level xml documenttype.
One project principle is that the document syntax must be
rock-solid. Some elements, for example, will test their parents.
For example, an "environment" element will scan for other
"environments" among its ancestors and trigger an error if it finds
one (nesting is forbidden, see above).
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: bronger@xxxxxxxxxx
(See http://ime.webhop.org for further contact info.)
.
- References:
- Re: The Problems of TeX
- From: Paul J Gans
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: Rowland McDonnell
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: Rowland McDonnell
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: Rowland McDonnell
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: Rowland McDonnell
- Re: The Problems of TeX
- From: William F Hammond
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: William F Hammond
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: William F Hammond
- Re: The Problems of TeX
- From: Torsten Bronger
- Re: The Problems of TeX
- From: William F Hammond
- Re: The Problems of TeX
- From: Torsten Bronger
- bobcat -- Was: The Problems of TeX
- From: William F Hammond
- Re: The Problems of TeX
- Prev by Date: Re: Spaces in included files
- Next by Date: \label and \ref with tex4ht an other problem
- Previous by thread: bobcat -- Was: The Problems of TeX
- Next by thread: Re: The Problems of TeX
- Index(es):
Relevant Pages
|