Next: , Previous: , Up: MIME   [Contents]

13.3 XML

In Scheme, XML is handled with SXML. Another way is to use strings appending method.

(get "/xml" #:mime 'xml
  (lambda (rc)
    (:mime rc '(*TOP* (WEIGHT (@ (unit "pound"))
                              (NET (@ (certified "certified")) "67")
                              (GROSS "95"))))))

The rendered result to the client will be:

<WEIGHT unit="pound">
 <NET certified="certified">67</NET>
 <GROSS>95</GROSS>
</WEIGHT>