Mac Chan
2007-03-20 00:00:35 UTC
Hi,
Another handy use of cl-who is to generate xml testing data, like so:
(with-html
(loop repeat 500 do
(htm
(:|Item|
(:|ASIN| (str (format nil "~D" (random 9999999999))))
(:|DetailPageURL| "http://www.amazon.com/")
(:|ItemAttributes|
(:|Author| (str (conc (random-word) " " (random-word))))
(:|Manufacturer| (str (random-word)))
(:|ProductGroup| (str (random-word)))
(:|Title| (str (conc (random-word) " " (random-word)" "
(random-word)))))))))
Attached is a simple patch to introduce a special var
cl-who:*downcase-tag* to control whether cl-who should downcase
tagname by default.
Originally I thought just using the (eql *html-mode* :xml) test should
be sufficient. But I see that a lot of people actually only use
lowercase xml tags for internal projects and requiring them to quote a
symbol with :|| is kind of inconvenient.
Cheers,
-- Mac
Another handy use of cl-who is to generate xml testing data, like so:
(with-html
(loop repeat 500 do
(htm
(:|Item|
(:|ASIN| (str (format nil "~D" (random 9999999999))))
(:|DetailPageURL| "http://www.amazon.com/")
(:|ItemAttributes|
(:|Author| (str (conc (random-word) " " (random-word))))
(:|Manufacturer| (str (random-word)))
(:|ProductGroup| (str (random-word)))
(:|Title| (str (conc (random-word) " " (random-word)" "
(random-word)))))))))
Attached is a simple patch to introduce a special var
cl-who:*downcase-tag* to control whether cl-who should downcase
tagname by default.
Originally I thought just using the (eql *html-mode* :xml) test should
be sufficient. But I see that a lot of people actually only use
lowercase xml tags for internal projects and requiring them to quote a
symbol with :|| is kind of inconvenient.
Cheers,
-- Mac