Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

SXML is widely used when combining Scheme and the web, so the DSL has already been made for you, and is actually pretty pleasant to use.

Example SXML template, that fills in data fields from a given namespace:

    (form
     (@ (method (%data form-method))
        (action (%data form-action)))
     (label "Username")
     (input (@ (type "text")
               (name (%data username-input-name))))
     (label "Password")
     (input (@ (type "password")
               (name (%data password-input-name))))
     (input (@ (type "submit"))))


I even do a minimal version of SXML in python, using python's lists, because it's much better than the DOM/builder way.

https://github.com/dgoffredo/dgoffredo.github.io/blob/372300...

You could do the exact same thing in javascript.


Does the new pattern match work with this? In guile there is (ice-9 sxml match) which matches attributes without order.

Incredibly useful.

And then there is the whole SXPATH and SXSLT stuff that makes sxml a lot nicer than HTML.


Not sure, but I ported Jim Bender's sxml-match to Racket so I could use it to pull apart some XSD: https://github.com/dgoffredo/stag/tree/master/src/stag/sxml-...

Hardly had to touch it, it's brilliant.


Nice. I will take a look at this. Thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: