Sxml Example

The file "xml.txt" is a copy of the source for a wiki page that was used to produce this reference.

>> (import "lib/xml")
:: #f
>> (import "lib/file-port")
:: #f
>> (define a (open-input-file "xml.txt"))
:: #f
>> (define b (make-sxml a))
:: #f
>> (define html (get-sxml-item b 0))
:: #f
>>(get-sxml-attrs html)
:: ((xmlns . "http://www.w3.org/1999/xhtml") (xml:lang . "en"))
>> (has-sxml-attr? html 'xmlns "http://www.w3.org/1999/xhtml")
:: #t
>> (has-sxml-attr? html 'xmlns "http://www.w3.org/2000/xhtml")
:: #f
>> (get-sxml-attr html 'xmlns)
:: "http://www.w3.org/1999/xhtml"