Subject: Re: XML and lisp
From: Erik Naggum <erik@naggum.net>
Date: Fri, 24 Aug 2001 15:17:11 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3207655030850317@naggum.net>

* Tim Bradshaw <tfb@tfeb.org>
> I'm curious about your syntax though: If I want to go from Lisp to
> something (rather than from something to Lisp), it seems that the syntax
> you give is amiguous because of this (I cut the lines that don't seem
> relevent).
> 
> > XML                             Enamel (NML)            CL
> > <foo bar="zot"/>                <foo <bar|zot>>         (foo (bar "zot"))
> > <foo><bar>zot</bar></foo>       <foo|<bar|zot>>         (foo (bar "zot"))

  The key to this is the relationship between foo and bar.  Whether bar is
  an attribute or a sub-element of foo is irrelevant to processing them,
  but when you need to turn this back into SGML/XML/Enamel, you need to
  know which it is.  This is why I said:

    As for writing SGML/XML/HTML/whatever, I have a simple way to get rid
    of the annoying verbosity of these stupid languages while _retaining_
    that mistake between attribute values and elements, because it is quite
    hard to make simple regular expression-based conversions retain enough
    data about an element to decide what should be attribute and element.

  ... implying that I would normally have such information and use it when
  generating attribute/value or sub-element/contents.

///