[hunchentoot-devel] cl-who and case-sensitive XML generation

I'm trying to generate case-sensitive XML from cl-who. Here's a simple example of what I've tried that doesn't work: (asdf:oos 'asdf:load-op :cl-who) (let ((cl-who::*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar")))) This outputs: " <capitalized> <capitalizedcamel camelcase='foo'> bar </capitalizedcamel> </capitalized>" rather than: " <Capitalized> <CapitalizedCamel camelCase='foo'> bar </CapitalizedCamel> </Capitalized>" Can cl-who do what I need? If it can, can it also generate double- quoted strings ("foo" instead of 'foo')? I'm using Clozure and I don't control the XML schema, unfortunately. Thanks, Patrick

On Sat, Jun 6, 2009 at 8:04 PM, Patrick May<patrick.may@mac.com> wrote:
(let ((cl-who::*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar"))))
This outputs:
" <capitalized> <capitalizedcamel camelcase='foo'> bar </capitalizedcamel> </capitalized>"
Which version are you using? Works for me with the dev version: CL-USER 1 > (let ((cl-who:*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar")))) " <Capitalized> <CapitalizedCamel camelCase='foo'>bar </CapitalizedCamel> </Capitalized>" There's no need for the double colon, BTW.
If it can, can it also generate double- quoted strings ("foo" instead of 'foo')?
http://weitz.de/cl-who/#*attribute-quote-char* Cheers, Edi.

On 8 Jun 2009, at 01:57, Edi Weitz wrote:
On Sat, Jun 6, 2009 at 8:04 PM, Patrick May<patrick.may@mac.com> wrote:
(let ((cl-who::*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar"))))
This outputs:
" <capitalized> <capitalizedcamel camelcase='foo'> bar </capitalizedcamel> </capitalized>"
Which version are you using? Works for me with the dev version:
I'm using cl-who-0.11.1 and Clozure 1.3-r11936. Thanks, Patrick

Hi Edi, I'm running cl-who Version 1.0.0, 2009-0x-xx and sbcl 1.0.28. Setting *downcase-tokens-p* within a LET doesn't work as I expected, but using SETF does. Cheers, David (let ((cl-who::*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar")))) " <capitalized> <capitalizedcamel camelcase='foo'>bar </capitalizedcamel> </capitalized>" CL-USER> (setf cl-who::*downcase-tokens-p* nil) NIL CL-USER> (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar"))) " <Capitalized> <CapitalizedCamel camelCase='foo'>bar </CapitalizedCamel> </Capitalized>" On Mon, Jun 8, 2009 at 1:57 AM, Edi Weitz<edi@agharta.de> wrote:
On Sat, Jun 6, 2009 at 8:04 PM, Patrick May<patrick.may@mac.com> wrote:
(let ((cl-who::*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar"))))
This outputs:
" <capitalized> <capitalizedcamel camelcase='foo'> bar </capitalizedcamel> </capitalized>"
Which version are you using? Works for me with the dev version:
CL-USER 1 > (let ((cl-who:*downcase-tokens-p* nil)) (cl-who:with-html-output-to-string (*standard-output* nil :indent t) (:|Capitalized| (:|CapitalizedCamel| :|camelCase| "foo" "bar")))) " <Capitalized> <CapitalizedCamel camelCase='foo'>bar </CapitalizedCamel> </Capitalized>"
There's no need for the double colon, BTW.
If it can, can it also generate double- quoted strings ("foo" instead of 'foo')?
http://weitz.de/cl-who/#*attribute-quote-char*
Cheers, Edi.
_______________________________________________ tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel

David, On Tue, Jun 9, 2009 at 14:56, David Neu<david@davidneu.com> wrote:
I'm running cl-who Version 1.0.0, 2009-0x-xx and sbcl 1.0.28. Setting *downcase-tokens-p* within a LET doesn't work as I expected, but using SETF does.
CL-WHO:WITH-HTML-OUTPUT-TO-STRING is a macro, so binding the dynamic *DOWNCASE-TOKENS-P* variable at run time will not have the desired effect. You'll either want to set the variable in your compilation unit using SETF or bind it around your compiler invocation. -Hans

Thanks Hans! On Tue, Jun 9, 2009 at 3:38 PM, Hans Hübner<hans.huebner@gmail.com> wrote:
David,
On Tue, Jun 9, 2009 at 14:56, David Neu<david@davidneu.com> wrote:
I'm running cl-who Version 1.0.0, 2009-0x-xx and sbcl 1.0.28. Setting *downcase-tokens-p* within a LET doesn't work as I expected, but using SETF does.
CL-WHO:WITH-HTML-OUTPUT-TO-STRING is a macro, so binding the dynamic *DOWNCASE-TOKENS-P* variable at run time will not have the desired effect. You'll either want to set the variable in your compilation unit using SETF or bind it around your compiler invocation.
-Hans
_______________________________________________ tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
participants (4)
-
David Neu
-
Edi Weitz
-
Hans Hübner
-
Patrick May