On 09/06/10 04:27, Peter Kümmel wrote:
Am Dienstag, den 08.06.2010, 17:22 -0400 schrieb Richard Heck:
On 06/08/2010 03:49 PM, Peter Kümmel wrote:
Am Dienstag, den 08.06.2010, 20:52 +0200 schrieb Andre Poenitz:
On Tue, Jun 08, 2010 at 04:29:21PM +0200, Abdelrazak Younes wrote:
On 06/08/2010 03:27 PM, Vincent van Ravesteijn wrote:
What is the current status or thinking of the XML format for lyx 2?
Ideally, LyX 2 would have an XML file format. However, no-one is
actively working on the issue, so we postponed it.
As far as I know, we didn't really decide when and how to do the transition.
I worked recently with JSon format (www.json.org), cleaner to the
human, faster to parse and less verbose than XML, quite nice...
This might indeed be a good option.
http://gitorious.org/JsonQt/
http://gitorious.org/qjson
But the question remains what is the aim of the new format: is it for
us, or is it for other who wanna generate, manipulate, ... LyX files.
My understanding was that the point was to make the LyX format more
easily parsable by LyX and, in particular, to provide validation that a
file really is in the proper format. So, for us, but without breaking
the easy manipulability of LyX files via sed, awk, etc.
I would prefer a more readable format than XML like json, even I would
use Lua, because it is the future scripting languange in LaTeX, but
I assume we could never explain the rest of the world, why we we don't
use beloved XML. So let's use XML. And validating a XML with a DTD is
really an advantage.
This last point should not be underestimated by those who want to
transform Lyx documents using sed and awk. A DTD lets you know that you
did not break the document.
Because XSLT is such a convenient transforming tool, xml will make
conversion to and from other (xml-ish) documents much simpler than it is
for lyx at the moment.
XSLT is grep/sed/awk for xml. If you start with the default "identity"
transform you just then add patterns for the paths you want to
change/exclude. XSLT is sed for structured documents. (I've done some
nasty 4K long sed scripts that are state-machines for transforming
structured documents, and XSLT is much nicer).
However, I will admit there are rarely 1-liners for xslt; but I did
write a sed pattern for xslt that lets you make 1-lines, by passing the
xpath match pattern, and replace string on the command line.
JSON is an advantage where there is not an xml parser available, but are
there any systems that can't provide a DOM tree from a document these days?
lua has xml parsing extensions and will need them as the future
scripting language of latex, because it will be dealing with xml even if
not with an xml tex format. (And I prefer an xml tex format because
currently only tex can interpret tex because the syntax is extensible,
hence the difficulty that Lyx can have importing tex documents - it
can't even safely know how to ignore the bits it doesn't understand!).
--
*Sam's signature*