On Tue, Jan 22, 2013 at 8:52 AM, Richard Heck <rgh...@lyx.org> wrote: > On 01/22/2013 02:38 AM, Nico Williams wrote: >> Hmm, the thought occurs that my lyx2xml script wouldn't be broken by any >> changes to.lyx, not if it was always chained with lyx2lyx so that it's input >> were always in a version supported by lyx2xml... > > It wouldn't be broken, but it wouldn't support new features that way, since > those are typically reverted to ERT. This was one of the main considerations > around the XHTML issue.
That's true. Although lyx2xml is so generic that you'd have to do something fairly radical to break it. For example, merely adding a new \begin_something wouldn't do it, but adding one that does not have a corresponding \end_something would. It has some things hard-coded, line that \index is a begin-like token, or that \color, \emph, ... are text styling tokens, and that \color appears in the header as not-a-text-style token, which means that anything that would have to be added to the sets of hard-coded tokens would indeed break lyx2xml, but it's trivial to add those. Perhaps you might like to review the script and see for yourself? If nothing else the script shows the few odd things in .lyx that tripped me up. (The script is still missing a post of the JavaScript LaTeX math -> MathML code, which I should do at some point. And it's only really working for the features I use or am aware of. There's probably other things missing besides math, though to be fair, the LaTeX math does get preserved in the XML output, but as the original LaTeX.) Nico --