4 ms·
http://okmij.org/ftp/Scheme/SXML.html http://okmij.org/ftp/Scheme/SXML.html
by brlewis 19y ago
http://okmij.org/ftp/Scheme/SXML.html http://okmij.org/ftp/Scheme/SXML.html
- olavk 19y agoCool! So bcts example <p>here is a <a href="http://example.com">link</a>.</p> would be: (p "here is a" (a (@ (href "http://example.com")) "link") ".")
- mojuba 19y agoSomething like that, yes, but attributes (a (@ (href /path))...) are ugly in particular. I think it shouldn't necessarily be parsable by Lisp. Attributes, for example, could be as simple as (a (href=/path) ...) Why '=' - because this character is not used in attribute names historically, so with this syntax you can move from XML to Sexp smoothly, automatically that is. Formally, the syntax I suggested is not Lisp, of course.
- omouse 19y agoSomething like that, yes, but attributes (a (@ (href /path))...) are ugly in particular. So use :named attributes instead? (a :href "/path" ...)
- mojuba 19y agoNice indeed, but how about attribute names that themselves contain colons, or maybe start with a colon? XML/HTML is less restrictive in this regard: all that matters basically is spaces and '=' inside a tag.
- omouse 19y agoReplace the colon with a dash in your attribute names. Easy solution.