On 01/22/2010 01:42 PM, José Matos wrote:
On Tuesday 19 January 2010 20:11:56 rgheck wrote:
While just beginning to think about xml, it occurred to me that probably
the first thing we have to do is modify the read and write routines so
that they write entities for&,<, and>, at which point we'll need
lyx2lyx to convert files, too.
Where is the best place to do the entity reading and writing? Maybe the
Lexer should learn about these entities?
For file writing, we may want a simple custom stream, similar to
XHTMLStream (itself modeled on MathStream).
Using this idea the first step should probably be to swap the meta-characters,
for the current lyx format we have the backslash and for xml we have the three
characters you mentioned.
This seems a reasonable first step to me:
\lyxformat -> <lyxformat>
\backslask -> \
<,>,& -> ...
Yes, I was thinking exactly the same thing.
I see how to do this for the write() routines, via a custom stream. It's
less obvious how to do it for the read routines, but I'll look into it
shortly. (We're about to start the semester, so it is time to get back
to real work.)
rh