On Wednesday 23 July 2008 15:58:56 Steve Litt wrote:
> Hi Pavel,
>
> Perhaps our best hope of continuing tweakability of native LyX is to create
> 1.5.x to XML and XML to 1.5.x converters. Then all the parsing/tweaking can
> continue to be done in the 1.5.x format.

I will advise against such practice. I hope to explain why in the paragraphs 
below.

> I'm presuming that the LyX developers will create the 1.5.x to XML
> converter so users can upgrade their old docs, and hopefully they would
> keep that converter updated for each new LyX version, so that you and I
> wouldn't need to worry about coding the 1.5.x to XML.

Note that the convertion to xml will only happen after 1.6. I know that your 
argument remains unchanged with this shift and just correct this before 
continuing.

With this said lyx2lyx will be able to convert from pre-xml to xml and vice-
versa.

Our previous experience suggest however that while the forward translation is 
complete the backwards translation results sometimes in the truncation or lots 
of ERT added to preserve the same structure.

For several reasons a transformation from X to X+1 and back again is not 
guaranteed to give the same document bit by bit. Note also that this is not an 
easy task in any way.

The next question is why do we need to manipulate lyx files with awk and 
friends? Is not there something that can should be done by lyx?

I have generated lyx files with scripts that have been used in my PhD thesis 
(almost 40 pages were generated like this) so I can recognize advantages in 
manipulating lyx files with scripts, but in that case there are better tools 
than awk and sed.

That is also the reason why lyx2lyx is nowadays mostly a python library 
(LyX.py) and the script lyx2lyx is just a wrapper around the library.

> The only thing you and I would have to do is the XML to 1.5.x converter.
> I'm pretty darned good with C, and if necessary I can do C++ (but with a C
> accent). If we pick an XML parser with full schema/dtd capability, that
> doesn't have many dependencies, then if you know how to write 1.5.x, I can
> feed you whatever data is needed to write the 1.5.x.
>
> There's another possibility that I think might be better. Using Ruby with
> REXML, I could convert the XML to YAML (http://en.wikipedia.org/wiki/Yaml)
> if you could help me just a little bit with the return trip (YAML to XML).
> I think this would be EVEN BETTER than 1.5.x, because YAML was made for
> exactly what you and I want to do -- parsing with awk/sed/perl/grep/cut. It
> would also remove our responsibility to support 1.5.x syntax in the 22nd
> century.
>
> Using YAML for tweaking, I think there may come a time when you and I would
> say "remember when we had to parse that nasty 1.5.x?"
>
> I can begin this project as soon as the developers give me an XML def and
> an XML file. That way, once they actually specify what they're going to do,
> we'll have the technology for the XML->YAML->XML round trip, and only the
> details will require coding.
>
> What do you think?
>
> StevET

You are welcome both to tell us your requirements around the future xml file 
format and to help us so that in the end we all have a better lyx. Really, all 
help is welcome.

> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US

-- 
José Abílio

Reply via email to