Hi!
I'm having trouble outputting case-sensitive XML using cl-who. The *downcase-tokens-p* variable claims to be the answer, but it only controls whether the output is all-upper-case or all-lower-case:
(setq *downcase-tokens-p* nil) (with-html-output-to-string (s) (:twoWords)) => "<TWOWORDS/>"
(setq *downcase-tokens-p* t) (with-html-output-to-string (s) (:twoWords)) => "<twowords/>"
I don't get how this is supposed to help with case-sensitive XML: keywords (like all symbols) are case-folded by the CL reader before cl-who sees them, no? :twoWords => :TWOWORDS. To support generation of XML with mixedCase tags or attributes, I would think that cl-who would need to allow strings where it allows only keywords now.
Or maybe I'm just completely missing something, because the question that prompted the creation of *downcase-tokens-p* was a camelCase attribute.
Can cl-who support mixedCase tags/attributes? Or if it's as simple as changing (keywordp x) to (or (keywordp x) (stringp x)), would such a patch be well-received?
thanks!
- Ken
On Sun, Nov 11, 2007 at 04:16:04PM -0800, Ken Harris wrote:
Hi!
I'm having trouble outputting case-sensitive XML using cl-who. The *downcase-tokens-p* variable claims to be the answer, but it only controls whether the output is all-upper-case or all-lower-case:
(setq *downcase-tokens-p* nil) (with-html-output-to-string (s) (:twoWords)) => "<TWOWORDS/>"
You must quote the symbol with |symBol|. ie
(setq *downcase-tokens-p* nil) (with-html-output-to-string (s) (:|twoWords|)) => "<twoWords/>"
OR
=> "<twoWords></twoWords>"
(setq *downcase-tokens-p* t) (with-html-output-to-string (s) (:twoWords)) => "<twowords/>"
I don't get how this is supposed to help with case-sensitive XML: keywords (like all symbols) are case-folded by the CL reader before cl-who sees them, no? :twoWords => :TWOWORDS. To support generation of XML with mixedCase tags or attributes, I would think that cl-who would need to allow strings where it allows only keywords now.
Or maybe I'm just completely missing something, because the question that prompted the creation of *downcase-tokens-p* was a camelCase attribute.
Can cl-who support mixedCase tags/attributes? Or if it's as simple as changing (keywordp x) to (or (keywordp x) (stringp x)), would such a patch be well-received?
thanks!
- Ken
cl-who-devel site list cl-who-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-who-devel
Hi Osei,
You must quote the symbol with |symBol|. ie
Ah! That will do it.
I guess that means I need to (setq *downcase-tokens-p* nil) and then ||-escape every tag, which seems unfortunate, but I don't think there's anything cl-who could do to make it nicer.
Thanks for the super-prompt response.
- Ken
On Sun, Nov 11, 2007 at 05:16:04PM -0800, Ken Harris wrote:
Hi Osei,
You must quote the symbol with |symBol|. ie
Ah! That will do it.
I guess that means I need to (setq *downcase-tokens-p* nil) and then ||-escape every tag, which seems unfortunate, but I don't think there's anything cl-who could do to make it nicer.
Maybe you could play with the reader case settings so that it doesn't upcase symbols by default.
look into READTABLE-CASE
http://www.lisp.org/HyperSpec/Body/acc_readtable-case.html
Thanks for the super-prompt response.
Glad to help :)
- Ken
cl-who-devel site list cl-who-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-who-devel